libinfinity-0.5.5/0000755000175000017500000000000012264766271011057 500000000000000libinfinity-0.5.5/ltmain.sh0000644000175000017500000105204412264766060012621 00000000000000 # libtool (GNU libtool) 2.4.2 # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, # 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, # or obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Usage: $progname [OPTION]... [MODE-ARG]... # # Provide generalized library-building support services. # # --config show all configuration variables # --debug enable verbose shell tracing # -n, --dry-run display commands without modifying any files # --features display basic configuration information and exit # --mode=MODE use operation mode MODE # --preserve-dup-deps don't remove duplicate dependency libraries # --quiet, --silent don't print informational messages # --no-quiet, --no-silent # print informational messages (default) # --no-warn don't display warning messages # --tag=TAG use configuration variables from tag TAG # -v, --verbose print more informational messages than default # --no-verbose don't print the extra informational messages # --version print version information # -h, --help, --help-all print short, long, or detailed help message # # MODE must be one of the following: # # clean remove files from the build directory # compile compile a source file into a libtool object # execute automatically set library path, then run a program # finish complete the installation of libtool libraries # install install libraries or executables # link create a library or an executable # uninstall remove libraries from an installed directory # # MODE-ARGS vary depending on the MODE. When passed as first option, # `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. # Try `$progname --help --mode=MODE' for a more detailed description of MODE. # # When reporting a bug, please describe a test case to reproduce it and # include the following information: # # host-triplet: $host # shell: $SHELL # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) # $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.3ubuntu1 # automake: $automake_version # autoconf: $autoconf_version # # Report bugs to . # GNU libtool home page: . # General help using GNU software: . PROGRAM=libtool PACKAGE=libtool VERSION="2.4.2 Debian-2.4.2-1.3ubuntu1" TIMESTAMP="" package_revision=1.3337 # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # NLS nuisances: We save the old values to restore during execute mode. lt_user_locale= lt_safe_locale= for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${$lt_var+set}\" = set; then save_$lt_var=\$$lt_var $lt_var=C export $lt_var lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" fi" done LC_ALL=C LANGUAGE=C export LANGUAGE LC_ALL $lt_unset CDPATH # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" : ${CP="cp -f"} test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} : ${Xsed="$SED -e 1s/^X//"} # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. exit_status=$EXIT_SUCCESS # Make sure IFS has a sensible default lt_nl=' ' IFS=" $lt_nl" dirname="s,/[^/]*$,," basename="s,^.*/,," # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi } # func_dirname may be replaced by extended shell implementation # func_basename file func_basename () { func_basename_result=`$ECHO "${1}" | $SED "$basename"` } # func_basename may be replaced by extended shell implementation # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` } # func_dirname_and_basename may be replaced by extended shell implementation # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # func_strip_suffix prefix name func_stripname () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname may be replaced by extended shell implementation # These SED scripts presuppose an absolute path with a trailing slash. pathcar='s,^/\([^/]*\).*$,\1,' pathcdr='s,^/[^/]*,,' removedotparts=':dotsl s@/\./@/@g t dotsl s,/\.$,/,' collapseslashes='s@/\{1,\}@/@g' finalslash='s,/*$,/,' # func_normal_abspath PATH # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. # value returned in "$func_normal_abspath_result" func_normal_abspath () { # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` while :; do # Processed it all yet? if test "$func_normal_abspath_tpath" = / ; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result" ; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_relative_path SRCDIR DSTDIR # generates a relative path from SRCDIR to DSTDIR, with a trailing # slash if non-empty, suitable for immediately appending a filename # without needing to append a separator. # value returned in "$func_relative_path_result" func_relative_path () { func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=${func_dirname_result} if test "x$func_relative_path_tlibdir" = x ; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test "x$func_stripname_result" != x ; then func_relative_path_result=${func_relative_path_result}/${func_stripname_result} fi # Normalisation. If bindir is libdir, return empty string, # else relative path ending with a slash; either way, target # file name can be directly appended. if test ! -z "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result/" func_relative_path_result=$func_stripname_result fi } # The name of this program: func_dirname_and_basename "$progpath" progname=$func_basename_result # Make sure we have an absolute path for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=$func_dirname_result progdir=`cd "$progdir" && pwd` progpath="$progdir/$progname" ;; *) save_IFS="$IFS" IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS="$save_IFS" test -x "$progdir/$progname" && break done IFS="$save_IFS" test -n "$progdir" || progdir=`pwd` progpath="$progdir/$progname" ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed="${SED}"' -e 1s/^X//' sed_quote_subst='s/\([`"$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' # Sed substitution that converts a w32 file name or path # which contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-`\' parameter expansions in output of double_quote_subst that were # `\'-ed in input to the same. If an odd number of `\' preceded a '$' # in input to double_quote_subst, that '$' was protected from expansion. # Since each input `\' is now two `\'s, look for any number of runs of # four `\'s followed by two `\'s and then a '$'. `\' that '$'. bs='\\' bs2='\\\\' bs4='\\\\\\\\' dollar='\$' sed_double_backslash="\ s/$bs4/&\\ /g s/^$bs2$dollar/$bs&/ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g s/\n//g" # Standard options: opt_dry_run=false opt_help=false opt_quiet=false opt_verbose=false opt_warning=: # func_echo arg... # Echo program name prefixed message, along with the current mode # name if it has been set yet. func_echo () { $ECHO "$progname: ${opt_mode+$opt_mode: }$*" } # func_verbose arg... # Echo program name prefixed message in verbose mode only. func_verbose () { $opt_verbose && func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_error arg... # Echo program name prefixed message to standard error. func_error () { $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 } # func_warning arg... # Echo program name prefixed warning message to standard error. func_warning () { $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 # bash bug again: : } # func_fatal_error arg... # Echo program name prefixed message to standard error, and exit. func_fatal_error () { func_error ${1+"$@"} exit $EXIT_FAILURE } # func_fatal_help arg... # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { func_error ${1+"$@"} func_fatal_error "$help" } help="Try \`$progname --help' for more information." ## default # func_grep expression filename # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $GREP "$1" "$2" >/dev/null 2>&1 } # func_mkdir_p directory-path # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { my_directory_path="$1" my_dir_list= if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then # Protect directory names starting with `-' case $my_directory_path in -*) my_directory_path="./$my_directory_path" ;; esac # While some portion of DIR does not yet exist... while test ! -d "$my_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. my_dir_list="$my_directory_path:$my_dir_list" # If the last portion added has no slash in it, the list is done case $my_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` done my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` save_mkdir_p_IFS="$IFS"; IFS=':' for my_dir in $my_dir_list; do IFS="$save_mkdir_p_IFS" # mkdir can fail with a `File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$my_dir" 2>/dev/null || : done IFS="$save_mkdir_p_IFS" # Bail out if we (or some other process) failed to create a directory. test -d "$my_directory_path" || \ func_fatal_error "Failed to create \`$1'" fi } # func_mktempdir [string] # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, STRING is the basename for that directory. func_mktempdir () { my_template="${TMPDIR-/tmp}/${1-$progname}" if test "$opt_dry_run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else # If mktemp works, use that first and foremost my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race my_tmpdir="${my_template}-${RANDOM-0}$$" save_mktempdir_umask=`umask` umask 0077 $MKDIR "$my_tmpdir" umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$my_tmpdir" || \ func_fatal_error "cannot create temporary directory \`$my_tmpdir'" fi $ECHO "$my_tmpdir" } # func_quote_for_eval arg # Aesthetically quote ARG to be evaled later. # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT # is double-quoted, suitable for a subsequent eval, whereas # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters # which are still active within double quotes backslashified. func_quote_for_eval () { case $1 in *[\\\`\"\$]*) func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; *) func_quote_for_eval_unquoted_result="$1" ;; esac case $func_quote_for_eval_unquoted_result in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and and variable # expansion for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" ;; *) func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" esac } # func_quote_for_expand arg # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { case $1 in *[\\\`\"]*) my_arg=`$ECHO "$1" | $SED \ -e "$double_quote_subst" -e "$sed_double_backslash"` ;; *) my_arg="$1" ;; esac case $my_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") my_arg="\"$my_arg\"" ;; esac func_quote_for_expand_result="$my_arg" } # func_show_eval cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$my_cmd" my_status=$? if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_show_eval_locale cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$lt_user_locale $my_cmd" my_status=$? eval "$lt_safe_locale" if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_tr_sh # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_version # Echo version message to standard output and exit. func_version () { $opt_debug $SED -n '/(C)/!b go :more /\./!{ N s/\n# / / b more } :go /^# '$PROGRAM' (GNU /,/# warranty; / { s/^# // s/^# *$// s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ p }' < "$progpath" exit $? } # func_usage # Echo short help message to standard output and exit. func_usage () { $opt_debug $SED -n '/^# Usage:/,/^# *.*--help/ { s/^# // s/^# *$// s/\$progname/'$progname'/ p }' < "$progpath" echo $ECHO "run \`$progname --help | more' for full usage" exit $? } # func_help [NOEXIT] # Echo long help message to standard output and exit, # unless 'noexit' is passed as argument. func_help () { $opt_debug $SED -n '/^# Usage:/,/# Report bugs to/ { :print s/^# // s/^# *$// s*\$progname*'$progname'* s*\$host*'"$host"'* s*\$SHELL*'"$SHELL"'* s*\$LTCC*'"$LTCC"'* s*\$LTCFLAGS*'"$LTCFLAGS"'* s*\$LD*'"$LD"'* s/\$with_gnu_ld/'"$with_gnu_ld"'/ s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ p d } /^# .* home page:/b print /^# General help using/b print ' < "$progpath" ret=$? if test -z "$1"; then exit $ret fi } # func_missing_arg argname # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $opt_debug func_error "missing argument for $1." exit_cmd=exit } # func_split_short_opt shortopt # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. func_split_short_opt () { my_sed_short_opt='1s/^\(..\).*$/\1/;q' my_sed_short_rest='1s/^..\(.*\)$/\1/;q' func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` } # func_split_short_opt may be replaced by extended shell implementation # func_split_long_opt longopt # Set func_split_long_opt_name and func_split_long_opt_arg shell # variables after splitting LONGOPT at the `=' sign. func_split_long_opt () { my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' my_sed_long_arg='1s/^--[^=]*=//' func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` } # func_split_long_opt may be replaced by extended shell implementation exit_cmd=: magic="%%%MAGIC variable%%%" magic_exe="%%%MAGIC EXE variable%%%" # Global variables. nonopt= preserve_args= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "${1}=\$${1}\${2}" } # func_append may be replaced by extended shell implementation # func_append_quoted var value # Quote VALUE and append to the end of shell variable VAR, separated # by a space. func_append_quoted () { func_quote_for_eval "${2}" eval "${1}=\$${1}\\ \$func_quote_for_eval_result" } # func_append_quoted may be replaced by extended shell implementation # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "${@}"` } # func_arith may be replaced by extended shell implementation # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` } # func_len may be replaced by extended shell implementation # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` } # func_lo2o may be replaced by extended shell implementation # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` } # func_xform may be replaced by extended shell implementation # func_fatal_configuration arg... # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func_error ${1+"$@"} func_error "See the $PACKAGE documentation for more information." func_fatal_error "Fatal configuration error." } # func_config # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # Display the features supported by this script. func_features () { echo "host: $host" if test "$build_libtool_libs" = yes; then echo "enable shared libraries" else echo "disable shared libraries" fi if test "$build_old_libs" = yes; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag tagname # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname="$1" re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf="/$re_begincf/,/$re_endcf/p" # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # func_check_version_match # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Option defaults: opt_debug=: opt_dry_run=false opt_config=false opt_preserve_dup_deps=false opt_features=false opt_finish=false opt_help=false opt_help_all=false opt_silent=: opt_warning=: opt_verbose=: opt_silent=false opt_verbose=false # Parse options once, thoroughly. This comes as soon as possible in the # script to make things like `--version' happen as quickly as we can. { # this just eases exit handling while test $# -gt 0; do opt="$1" shift case $opt in --debug|-x) opt_debug='set -x' func_echo "enabling shell trace mode" $opt_debug ;; --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) opt_config=: func_config ;; --dlopen|-dlopen) optarg="$1" opt_dlopen="${opt_dlopen+$opt_dlopen }$optarg" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) opt_features=: func_features ;; --finish) opt_finish=: set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help_all=: opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_mode="$optarg" case $optarg in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_silent=false func_append preserve_args " $opt" ;; --no-warning|--no-warn) opt_warning=false func_append preserve_args " $opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $opt" ;; --silent|--quiet) opt_silent=: func_append preserve_args " $opt" opt_verbose=false ;; --verbose|-v) opt_verbose=: func_append preserve_args " $opt" opt_silent=false ;; --tag) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_tag="$optarg" func_append preserve_args " $opt $optarg" func_enable_tag "$optarg" shift ;; -\?|-h) func_usage ;; --help) func_help ;; --version) func_version ;; # Separate optargs to long options: --*=*) func_split_long_opt "$opt" set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-n*|-v*) func_split_short_opt "$opt" set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) break ;; -*) func_fatal_help "unrecognized option \`$opt'" ;; *) set dummy "$opt" ${1+"$@"}; shift; break ;; esac done # Validate options: # save first non-option argument if test "$#" -gt 0; then nonopt="$opt" shift fi # preserve --debug test "$opt_debug" = : || func_append preserve_args " --debug" case $host in *cygwin* | *mingw* | *pw32* | *cegcc*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then func_fatal_configuration "not configured to build any kind of library" fi # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test "$opt_mode" != execute; then func_error "unrecognized option \`-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$progname --help --mode=$opt_mode' for more information." } # Bail if the options were screwed $exit_cmd $EXIT_FAILURE } ## ----------- ## ## Main. ## ## ----------- ## # func_lalib_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null \ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_unsafe_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if `file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case "$lalib_p_line" in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test "$lalib_p" = yes } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { func_lalib_p "$1" } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $opt_debug save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$save_ifs eval cmd=\"$cmd\" func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. func_source () { $opt_debug case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case "$lt_sysroot:$1" in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result="=$func_stripname_result" ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $opt_debug if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with \`--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=${1} if test "$build_libtool_libs" = yes; then write_lobj=\'${2}\' else write_lobj=none fi if test "$build_old_libs" = yes; then write_oldobj=\'${3}\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$lt_sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly # configured wine environment available, with the winepath program in $build's # $PATH. Assumes ARG has no leading or trailing path separator characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $opt_debug # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result="" if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result" ; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $opt_debug if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $opt_debug # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $opt_debug if test -z "$2" && test -n "$1" ; then func_error "Could not determine host file name corresponding to" func_error " \`$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result="$1" fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $opt_debug if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " \`$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result="$3" fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $opt_debug case $4 in $1 ) func_to_host_path_result="$3$func_to_host_path_result" ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via `$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $opt_debug $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $opt_debug case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result="$1" } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result="$func_convert_core_msys_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via `$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $opt_debug if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd="func_convert_path_${func_stripname_result}" fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $opt_debug func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result="$1" } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_msys_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_mode_compile arg... func_mode_compile () { $opt_debug # Get the compilation command and the source file. base_compile= srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg="$arg" arg_mode=normal ;; target ) libobj="$arg" arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify \`-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" func_append_quoted lastarg "$arg" done IFS="$save_ifs" func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg="$srcfile" srcfile="$arg" ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with \`-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj="$func_basename_result" } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from \`$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name \`$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname="$func_basename_result" xdir="$func_dirname_result" lobj=${xdir}$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test "$suppress_opt" = yes; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test "$build_old_libs" = yes; then if test "$pic_mode" != yes; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test "$compiler_c_o" = yes; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test "$need_locks" != no; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test "$opt_mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a \`.o' file suitable for static linking -static only build a \`.o' file suitable for static linking -Wc,FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode \`$opt_mode'" ;; esac echo $ECHO "Try \`$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test "$opt_help" = :; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | sed -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | sed '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $opt_debug # The first argument is the command name. cmd="$nonopt" test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "\`$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "\`$file' was not linked with \`-export-dynamic'" continue fi func_dirname "$file" "" "." dir="$func_dirname_result" if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir="$func_dirname_result" ;; *) func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file="$progdir/$program" elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if test "X$opt_dry_run" = Xfalse; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS fi } test "$opt_mode" = execute && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $opt_debug libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "\`$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument \`$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and \`=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_silent && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the \`-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the \`$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the \`$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test "$opt_mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $opt_debug # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac; then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" func_append install_prog "$func_quote_for_eval_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test "x$prev" = x-m && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" func_append install_prog " $func_quote_for_eval_result" if test -n "$arg2"; then func_quote_for_eval "$arg2" fi func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the \`$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_for_eval "$install_override_mode" func_append install_shared_prog " -m $func_quote_for_eval_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else func_dirname_and_basename "$dest" "" "." destdir="$func_dirname_result" destname="$func_basename_result" # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "\`$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "\`$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir="$func_dirname_result" func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking \`$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname="$1" shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme="$stripme" case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme="" ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib="$destdir/$realname" func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name="$func_basename_result" instname="$dir/$name"i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest="$destfile" destfile= ;; *) func_fatal_help "cannot copy a libtool object to \`$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script \`$wrapper'" finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then func_warning "\`$lib' has not been installed in \`$libdir'" finalize=no fi done relink_command= func_source "$wrapper" outputname= if test "$fast_install" = no && test -n "$relink_command"; then $opt_dry_run || { if test "$finalize" = yes; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file="$func_basename_result" outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_silent || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink \`$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file="$outputname" else func_warning "cannot relink \`$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name="$func_basename_result" # Set up the ranlib parameters. oldlib="$destdir/$name" func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run \`$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test "$opt_mode" = install && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $opt_debug my_outputname="$1" my_originator="$2" my_pic_p="${3-no}" my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms="${my_outputname}S.c" else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${my_outputname}.nm" func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then func_verbose "generating symbol list for \`$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $opt_dry_run || { $RM $export_symbols eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from \`$dlprefile'" func_basename "$dlprefile" name="$func_basename_result" case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename="" if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname" ; then func_basename "$dlprefile_dlname" dlprefile_dlbasename="$func_basename_result" else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename" ; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[]; LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = {\ { \"$my_originator\", (void *) 0 }," case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) if test "X$my_pic_p" != Xno; then pic_flag_for_symtable=" $pic_flag" fi ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' # Transform the symbol file into the correct name. symfileobj="$output_objdir/${my_outputname}S.$objext" case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for \`$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $opt_debug win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s,.*,import, p q } }'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $opt_debug sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $opt_debug match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive which possess that section. Heuristic: eliminate # all those which have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $opt_debug if func_cygming_gnu_implib_p "$1" ; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1" ; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result="" fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $opt_debug f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" if test "$lock_old_archive_extraction" = yes; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test "$lock_old_archive_extraction" = yes; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $opt_debug my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib="$func_basename_result" my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir="$my_gentop/$my_xlib_u" func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`basename "$darwin_archive"` darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory in which it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=\"$qECHO\" fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ which is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options which match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { case \" \$* \" in *\\ --lt-*) for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done ;; esac func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include /* declarations of non-ANSI functions */ #if defined(__MINGW32__) # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #elif defined(__CYGWIN__) # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined (other platforms) ... */ #endif /* portability defines, excluding path handling macros */ #if defined(_MSC_VER) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC # ifndef _INTPTR_T_DEFINED # define _INTPTR_T_DEFINED # define intptr_t int # endif #elif defined(__MINGW32__) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined(__CYGWIN__) # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined (other platforms) ... */ #endif #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) #if defined(LT_DEBUGWRAPPER) static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; int tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (strcmp (str, pat) == 0) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else int len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { int orig_value_len = strlen (orig_value); int add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ int len = strlen (new_value); while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[len-1] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -n -e ' s/^\(.\{79\}\)\(..*\)/\1\ \2/ h s/\([\\"]\)/\\\1/g s/$/\\n/ s/\([^\n]*\).*/ fputs ("\1", f);/p g D' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $opt_debug case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_mode_link arg... func_mode_link () { $opt_debug case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=no prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module="${wl}-single_module" func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir="$arg" prev= continue ;; dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" test -f "$arg" \ || func_fatal_error "symbol file \`$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file \`$arg' does not exist" fi arg=$save_arg prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds="$arg" prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "\`-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between \`-L' and \`$1'" else func_fatal_error "need path for \`-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of \`$dir'" dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; -multi_module) single_module="${wl}-multi_module" continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "\`-no-install' is ignored for $host" func_warning "assuming \`-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; =*) func_stripname '=' '' "$dir" dir=$lt_sysroot$func_stripname_result ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $wl$func_quote_for_eval_result" func_append compiler_flags " $wl$func_quote_for_eval_result" func_append linker_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-flto*|-fwhopr*|-fuse-linker-plugin) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; *.$objext) # A standard object. func_append objs " $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test "$prev" = dlfiles; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the \`$prevarg' option requires an argument" if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname="$func_basename_result" libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" func_dirname "$output" "/" "" output_objdir="$func_dirname_result$objdir" func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_preserve_dup_deps ; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append libs " $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test "$linkmode,$pass" = "lib,link"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs="$tmp_deplibs" fi if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS%" test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" ;; esac fi if test "$linkmode,$pass" = "lib,dlpreopen"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs="$dlprefiles" fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then func_warning "\`-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test "$linkmode" = lib; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no func_dirname "$lib" "" "." ladir="$func_dirname_result" lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l *.ltframework) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "\`-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not use here." else echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi ;; esac continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" fi # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "\`$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir="$func_dirname_result" dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi continue fi # $pass = conv # Get the name of the library we link against. linklib= if test -n "$old_library" && { test "$prefer_static_libs" = yes || test "$prefer_static_libs,$installed" = "built,no"; }; then linklib=$old_library else for l in $old_library $library_names; do linklib="$l" done fi if test -z "$linklib"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then func_fatal_error "cannot -dlopen a convenience library: \`$lib'" fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. func_append dlprefiles " $lib $dependency_libs" else func_append newdlfiles " $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of \`$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir="$ladir" fi ;; esac func_basename "$lib" laname="$func_basename_result" # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library \`$lib' was moved." dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$lt_sysroot$libdir" absdir="$lt_sysroot$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later func_append notinst_path " $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir" && test "$linkmode" = prog; then func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" fi case "$host" in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present # (otherwise, the dlopen module name will be incorrect). We do # this by putting the import library name into $newdlprefiles. # We recover the dlopen module name by 'saving' the la file # name in a special purpose variable, and (later) extracting the # dlname from the la file. if test -n "$dlname"; then func_tr_sh "$dir/$linklib" eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" func_append newdlprefiles " $dir/$linklib" else func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" fi ;; * ) # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then func_append newdlprefiles " $dir/$dlname" else func_append newdlprefiles " $dir/$linklib" fi ;; esac fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { { test "$prefer_static_libs" = no || test "$prefer_static_libs,$installed" = "built,yes"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath:" in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test "$use_static_libs" = built && test "$installed" = yes; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test "$installed" = no; then func_append notinst_deplibs " $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule="" for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule="$dlpremoduletest" break fi done if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then echo if test "$linkmode" = prog; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname="$1" shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc*) func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" func_basename "$soroot" soname="$func_basename_result" func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from \`$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for \`$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$opt_mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we can not # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null ; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library" ; then echo echo "*** And there doesn't seem to be a static archive available" echo "*** The link will probably fail, sorry" else add="$dir/$old_library" fi elif test -n "$old_library"; then add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$absdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && test "$hardcode_minus_L" != yes && test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$opt_mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo $ECHO "*** Warning: This system can not link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs="$temp_deplibs" fi func_append newlib_search_path " $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi func_append tmp_libs " $func_resolve_sysroot_result" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path="$deplib" ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of \`$dir'" absdir="$dir" fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl" ; then depdepl="$absdir/$objdir/$depdepl" darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" path= fi fi ;; *) path="-L$absdir/$objdir" ;; esac else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "\`$deplib' seems to be moved" path="-L$absdir" fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test "$pass" = link; then if test "$linkmode" = "prog"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" fi if test "$linkmode" = prog || test "$linkmode" = lib; then dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "\`-R' is ignored for archives" test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "\`-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "\`-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" func_append objs "$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test "$module" = no && \ func_fatal_help "libtool library \`$output' must begin with \`lib'" if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" func_append libobjs " $objs" fi fi test "$dlself" != no && \ func_warning "\`-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test "$#" -gt 1 && \ func_warning "ignoring multiple \`-rpath's for a libtool library" install_libdir="$1" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "\`-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 shift IFS="$save_ifs" test -n "$7" && \ func_fatal_help "too many parameters to \`-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$1" number_minor="$2" number_revision="$3" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in # correct linux to gnu/linux during the next big refactor darwin|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|qnx|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_minor" lt_irix_increment=no ;; *) func_fatal_configuration "$modename: unknown library version type \`$version_type'" ;; esac ;; no) current="$1" revision="$2" age="$3" ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT \`$current' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION \`$revision' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE \`$age' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE \`$age' is greater than the current interface number \`$current'" func_fatal_error "\`$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current" ;; irix | nonstopux) if test "X$lt_irix_increment" = "Xno"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring:${iface}.0" done # Make executables depend on our current version. func_append verstring ":${current}.0" ;; qnx) major=".$current" versuffix=".$current" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; *) func_fatal_configuration "unknown library version type \`$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then func_warning "undefined symbols not allowed in $host shared libraries" build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi func_generate_dlsyms "$libname" "$libname" "yes" func_append libobjs " $symfileobj" test "X$libobjs" = "X " && libobjs= if test "$opt_mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) func_append dlfiles " $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) func_append dlprefiles " $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then func_append deplibs " -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test "X$deplibs_check_method" = "Xnone"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes ;; esac ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then # Remove ${wl} instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$opt_mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname="$1" shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" linknames= for link do func_append linknames " $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols="$output_objdir/$libname.uexp" func_append delfiles " $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile if test "x`$SED 1q $export_symbols`" != xEXPORTS; then # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols="$export_symbols" export_symbols= always_export_symbols=yes fi fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd1 in $cmds; do IFS="$save_ifs" # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) try_normal_branch=yes eval cmd=\"$cmd1\" func_len " $cmd" len=$func_len_result ;; *) try_normal_branch=no ;; esac if test "$try_normal_branch" = yes \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then func_show_eval "$cmd" 'exit $?' skipped_export=false elif test -n "$nm_file_list_spec"; then func_basename "$output" output_la=$func_basename_result save_libobjs=$libobjs save_output=$output output=${output_objdir}/${output_la}.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" func_verbose "creating $NM input file list: $output" for obj in $save_libobjs; do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > "$output" eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' output=$save_output libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS="$save_ifs" if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test "$compiler_needs_object" = yes && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $convenience func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output func_basename "$output" output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then output=${output_objdir}/${output_la}.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then output=${output_objdir}/${output_la}.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test "$compiler_needs_object" = yes; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done func_append delfiles " $output" func_to_tool_file "$output" output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-${k}.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test "X$objlist" = X || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-${k}.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ reload_objs="$objlist $last_robj" eval concat_cmds=\"\${concat_cmds}$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" fi func_append delfiles " $output" else output= fi if ${skipped_export-false}; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi fi test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi if ${skipped_export-false}; then if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi fi libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "\`-R' is ignored for objects" test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for objects" test -n "$release" && \ func_warning "\`-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object \`$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec and hope we can get by with # turning comma into space.. wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` else gentop="$output_objdir/${obj}x" func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # If we're not building shared, we need to use non_pic_objs test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" # Create the old-style object. reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for programs" test -n "$release" && \ func_warning "\`-release' is ignored for programs" test "$preload" = yes \ && test "$dlopen_support" = unknown \ && test "$dlopen_self" = unknown \ && test "$dlopen_self_static" = unknown && \ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test "$tagname" = CXX ; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " ${wl}-bind_at_load" func_append finalize_command " ${wl}-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs="$new_libs" func_append compile_command " $compile_deplibs" func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append finalize_perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" "no" # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=yes case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=no ;; *cygwin* | *mingw* ) if test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; *) if test "$need_relink" = no || test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; esac if test "$wrappers_required" = no; then # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Delete the generated files. if test -f "$output_objdir/${outputname}S.${objext}"; then func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' fi exit $exit_status fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" func_warning "this platform does not like uninstalled shared libraries" func_warning "\`$output' will be relinked during installation" else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output_objdir/$outputname" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource="$output_path/$objdir/lt-$output_name.c" cwrapper="$output_path/$output_name.exe" $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host" ; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save $symfileobj" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" if test "$preload" = yes && test -f "$symfileobj"; then func_append oldobjs " $symfileobj" fi fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase="$func_basename_result" case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds elif test -n "$archiver_list_spec"; then func_verbose "using command file archive linking..." for obj in $oldobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > $output_objdir/$libname.libcmd func_to_tool_file "$output_objdir/$libname.libcmd" oldobjs=" $archiver_list_spec$func_to_tool_file_result" cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name="$func_basename_result" func_resolve_sysroot "$deplib" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done dlprefiles="$newdlprefiles" fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test "x$bindir" != x ; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that can not go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } { test "$opt_mode" = link || test "$opt_mode" = relink; } && func_mode_link ${1+"$@"} # func_mode_uninstall arg... func_mode_uninstall () { $opt_debug RM="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) func_append RM " $arg"; rmforce=yes ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir="$func_dirname_result" if test "X$dir" = X.; then odir="$objdir" else odir="$dir/$objdir" fi func_basename "$file" name="$func_basename_result" test "$opt_mode" = uninstall && odir="$dir" # Remember odir for removal later, being careful to avoid duplicates if test "$opt_mode" = clean; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case "$opt_mode" in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test "$pic_object" != none; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test "$non_pic_object" != none; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test "$opt_mode" = clean ; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles func_append rmfiles " $odir/$name $odir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name" ; then func_append rmfiles " $odir/lt-${noexename}.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } { test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && func_mode_uninstall ${1+"$@"} test -z "$opt_mode" && { help="$generic_help" func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode \`$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: # vi:sw=2 libinfinity-0.5.5/libinftextgtk.pc.in0000644000175000017500000000066112264763732014610 00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ gtk_version=@gtk_version@ Name: libinftextgtk Description: Infinote text processing GTK+ UI functionality Requires: libinfinity-@LIBINFINITY_API_VERSION@ libinftext-@LIBINFINITY_API_VERSION@ @gtk_requirement@ Version: @VERSION@ Libs: -L${libdir} -linftextgtk-@LIBINFINITY_API_VERSION@ Cflags: -I${includedir}/libinftextgtk-@LIBINFINITY_API_VERSION@ libinfinity-0.5.5/depcomp0000755000175000017500000005064312202130664012343 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2012-03-27.16; # UTC # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010, # 2011, 2012 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # A tabulation character. tab=' ' # A newline character. nl=' ' 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 if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency informations. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -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 ' ' "$nl" < "$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. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -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 ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else # 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" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. 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" sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -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 anf tcc (Tiny C Compiler) understand '-MD -MF file'. # However on # $CC -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 ... \ # ... # tcc 0.9.26 (FIXME still under development at the moment of writing) # will emit a similar output, but also prepend the continuation lines # with horizontal tabulation characters. "$@" -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 -e "s/^[ $tab][ $tab]*/ /" -e "s,^[^:]*:,$object :," \ < "$tmpdepfile" > "$depfile" sed ' s/[ '"$tab"'][ '"$tab"']*/ /g s/^ *// s/ *\\*$// s/^[^:]*: *// /^$/d /:$/d s/$/ :/ ' < "$tmpdepfile" >> "$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" sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test "$stat" = 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed 's:^['"$tab"' ]*[^:'"$tab"' ][^:][^:]*\:['"$tab"' ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' "$nl" < "$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" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \ ## 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::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: libinfinity-0.5.5/config.sub0000755000175000017500000010532712202130661012746 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011, 2012 Free Software Foundation, Inc. timestamp='2012-04-18' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, 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. # Please send patches to . Submit a context # diff and a properly formatted GNU ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*178) os=-lynxos178 ;; -lynx*5) os=-lynxos5 ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | be32 | be64 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 \ | ns16k | ns32k \ | open8 \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze) basic_machine=microblaze-xilinx ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i386-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; hexagon-*) os=-elf ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: libinfinity-0.5.5/libinfgtk.pc.in0000644000175000017500000000056712264763732013710 00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ gtk_version=@gtk_version@ Name: libinfgtk Description: Common infinote GTK+ UI functionality Requires: libinfinity-@LIBINFINITY_API_VERSION@ @gtk_requirement@ Version: @VERSION@ Libs: -L${libdir} -linfgtk-@LIBINFINITY_API_VERSION@ Cflags: -I${includedir}/libinfgtk-@LIBINFINITY_API_VERSION@ libinfinity-0.5.5/infinoted/0000755000175000017500000000000012264766267013043 500000000000000libinfinity-0.5.5/infinoted/infinoted-creds.h0000644000175000017500000000430512264763732016205 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INFINOTED_CREDS_H__ #define __INFINOTED_CREDS_H__ #include #include #include G_BEGIN_DECLS gnutls_dh_params_t infinoted_creds_create_dh_params(GError** error); gnutls_dh_params_t infinoted_creds_read_dh_params(const gchar* dhparams_path, GError** error); gboolean infinoted_creds_write_dh_params(gnutls_dh_params_t params, const gchar* dhparams_path, GError** error); gnutls_x509_privkey_t infinoted_creds_create_key(GError** error); gnutls_x509_privkey_t infinoted_creds_read_key(const gchar* key_path, GError** error); gboolean infinoted_creds_write_key(gnutls_x509_privkey_t key, const gchar* key_path, GError** error); gnutls_x509_crt_t infinoted_creds_create_self_signed_certificate(gnutls_x509_privkey_t key, GError** error); InfCertificateCredentials* infinoted_creds_create_credentials(gnutls_x509_privkey_t key, gnutls_x509_crt_t* certs, guint n_certs, GError** error); G_END_DECLS #endif /* __INFINOTED_CREDS_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/infinoted/infinoted-record.c0000644000175000017500000001437212264763732016363 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include #include #include #include #include static InfAdoptedSessionRecord* infinoted_record_start_real(InfAdoptedSession* session, const gchar* filename, const gchar* title) { GError* error; InfAdoptedSessionRecord* record; record = inf_adopted_session_record_new(session); error = NULL; inf_adopted_session_record_start_recording(record, filename, &error); if(error != NULL) { g_warning(_("Error while writing record for session " "\"%s\" into \"%s\": %s"), title, filename, error->message); g_error_free(error); g_object_unref(record); return NULL; } else { return record; } } static InfAdoptedSessionRecord* infinoted_record_start(InfAdoptedSession* session, const gchar* title) { gchar* dirname; gchar* basename; gchar* filename; guint i; gsize pos; InfAdoptedSessionRecord* record; dirname = g_build_filename(g_get_home_dir(), ".infinoted-records", NULL); basename = g_build_filename(dirname, title, NULL); pos = strlen(basename) + 8; filename = g_strdup_printf("%s.record-00000.xml", basename); g_free(basename); i = 0; while(g_file_test(filename, G_FILE_TEST_EXISTS) && ++i < 100000) { g_snprintf(filename + pos, 10, "%05u.xml", i); } record = NULL; if(i >= 100000) { g_warning( _("Could not create record file for session \"%s\": Could not generate " "unused record file in directory \"%s\""), title, dirname ); } else { /* TODO: Use GetLastError() on Win32 */ if(g_mkdir_with_parents(dirname, 0700) == -1) { g_warning( _("Could not create record file directory \"%s\": %s"), strerror(errno) ); } else { record = infinoted_record_start_real(session, filename, title); } } g_free(filename); g_free(dirname); return record; } static void infinoted_record_directory_add_session_cb(InfdDirectory* directory, InfdDirectoryIter* iter, InfdSessionProxy* proxy, gpointer user_data) { InfinotedRecord* record; const gchar* title; InfAdoptedSessionRecord* rec; record = (InfinotedRecord*)user_data; if(INF_ADOPTED_IS_SESSION(infd_session_proxy_get_session(proxy))) { title = infd_directory_iter_get_name(directory, iter); rec = infinoted_record_start( INF_ADOPTED_SESSION(infd_session_proxy_get_session(proxy)), title ); if(rec) record->records = g_slist_prepend(record->records, rec); } } static void infinoted_record_directory_remove_session_cb(InfdDirectory* directory, InfdDirectoryIter* iter, InfdSessionProxy* proxy, gpointer user_data) { InfinotedRecord* record; InfSession* session; GSList* item; InfAdoptedSessionRecord* rec; InfSession* cur_session; session = infd_session_proxy_get_session(proxy); record = (InfinotedRecord*)user_data; for(item = record->records; item != NULL; item = item->next) { rec = INF_ADOPTED_SESSION_RECORD(item->data); g_object_get(G_OBJECT(rec), "session", &cur_session, NULL); if(session == cur_session) { record->records = g_slist_remove(record->records, rec); g_object_unref(cur_session); g_object_unref(rec); break; } else { g_object_unref(cur_session); } } } /** * infinoted_record_new: * @directory: The directory for whose sessions to create records. * * Crates records for all sessions of @directory. They are stored into * .infinoted-records/ in the home directory of the executing user. * * Returns: A new #InfinotedRecord. Free with infinoted_record_free() to stop * recording. */ InfinotedRecord* infinoted_record_new(InfdDirectory* directory) { InfinotedRecord* record; record = g_slice_new(InfinotedRecord); record->directory = directory; record->records = NULL; g_object_ref(directory); g_signal_connect( G_OBJECT(record->directory), "add-session", G_CALLBACK(infinoted_record_directory_add_session_cb), record ); g_signal_connect( G_OBJECT(record->directory), "remove-session", G_CALLBACK(infinoted_record_directory_remove_session_cb), record ); return record; } /** * infinoted_record_free: * @record: A #InfinotedRecord. * * Frees the given #InfinotedRecord. This stops all recordings currently in * progress, if any. */ void infinoted_record_free(InfinotedRecord* record) { GSList* item; InfAdoptedSessionRecord* rec; inf_signal_handlers_disconnect_by_func( record->directory, G_CALLBACK(infinoted_record_directory_add_session_cb), record ); inf_signal_handlers_disconnect_by_func( record->directory, G_CALLBACK(infinoted_record_directory_remove_session_cb), record ); for(item = record->records; item != NULL; item = item->next) { rec = INF_ADOPTED_SESSION_RECORD(item->data); g_object_unref(rec); } g_slist_free(record->records); g_object_unref(record->directory); g_slice_free(InfinotedRecord, record); } libinfinity-0.5.5/infinoted/infinoted-config-reload.h0000644000175000017500000000225012264763732017613 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INFINOTED_CONFIG_RELOAD_H__ #define __INFINOTED_CONFIG_RELOAD_H__ #include #include G_BEGIN_DECLS gboolean infinoted_config_reload(InfinotedRun* run, GError** error); G_END_DECLS #endif /* __INFINOTED_CONFIG_RELOAD_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/infinoted/infinoted-signal.c0000644000175000017500000001427512264763732016364 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include #include #ifdef LIBINFINITY_HAVE_LIBDAEMON #include #endif #ifdef G_OS_WIN32 # include # include #endif #ifdef LIBINFINITY_HAVE_LIBDAEMON static void infinoted_signal_sig_func(InfNativeSocket* fd, InfIoEvent event, gpointer user_data) { InfinotedSignal* sig; int occured; GError* error; sig = (InfinotedSignal*)user_data; if(event & INF_IO_ERROR) { inf_io_remove_watch(INF_IO(sig->run->io), sig->watch); daemon_signal_done(); sig->run = NULL; sig->signal_fd = 0; sig->watch = NULL; infinoted_util_log_error(_("Error on signal handler connection; signal " "handlers have been removed from now on")); } else if(event & INF_IO_INCOMING) { occured = daemon_signal_next(); if(occured == SIGINT || occured == SIGTERM || occured == SIGQUIT) { printf("\n"); inf_standalone_io_loop_quit(sig->run->io); } else if(occured == SIGHUP) { error = NULL; if(!infinoted_config_reload(sig->run, &error)) { infinoted_util_log_error(_("Config reload failed: %s"), error->message); g_error_free(error); } else { infinoted_util_log_info(_("Config reloaded")); } } } } #else static InfinotedRun* _infinoted_signal_server = NULL; static void infinoted_signal_terminate(void) { InfinotedRun* run; /* We do a hard exit here, not calling inf_standalone_io_loop_quit(), * because the signal handler could be called from anywhere in the code. */ if(_infinoted_signal_server != NULL) { run = _infinoted_signal_server; _infinoted_signal_server = NULL; infinoted_run_free(run); exit(0); } } static void infinoted_signal_sigint_handler(int sig) { printf("\n"); infinoted_signal_terminate(); } static void infinoted_signal_sigterm_handler(int sig) { printf("\n"); infinoted_signal_terminate(); } #ifndef G_OS_WIN32 static void infinoted_signal_sigquit_handler(int sig) { printf("\n"); infinoted_signal_terminate(); } static void infinoted_signal_sighup_handler(int sig) { /* We don't reload the config file here since the signal handler could be * called from anywhere in the code. */ infinoted_util_log_error(_("For config reloading to work libinfinity needs " "to be compiled with libdaemon support")); /* Make sure the signal handler is not reset */ signal(SIGHUP, infinoted_signal_sighup_handler); } #endif /* !G_OS_WIN32 */ #endif /* !LIBINFINITY_HAVE_LIBDAEMON */ #ifdef G_OS_WIN32 BOOL WINAPI infinoted_signal_console_handler(DWORD fdwCtrlType) { /* TODO: Don't terminate for CTRL_LOGOFF_EVENT? */ infinoted_signal_terminate(); /* Doesn't matter, we exit() anyway */ return TRUE; } #endif /** * infinoted_signal_register: * @run: A #InfinotedRun. * * Registers signal handlers for SIGINT and SIGTERM that terminate the given * infinote server. When you don't need the signal handlers anymore, you * must unregister them again using infinoted_signal_unregister(). * * Returns: A #InfinotedSignal to unregister the signal handlers again later. */ InfinotedSignal* infinoted_signal_register(InfinotedRun* run) { InfinotedSignal* sig; sig = g_slice_new(InfinotedSignal); #ifdef LIBINFINITY_HAVE_LIBDAEMON sig->run = run; /* TODO: Should we report when this fails? Should ideally happen before * actually forking then - are signal connections kept in fork()'s child? */ if(daemon_signal_init(SIGINT, SIGTERM, SIGQUIT, SIGHUP, 0) == 0) { sig->signal_fd = daemon_signal_fd(); sig->watch = inf_io_add_watch( INF_IO(run->io), &sig->signal_fd, INF_IO_INCOMING | INF_IO_ERROR, infinoted_signal_sig_func, sig, NULL ); } #else sig->previous_sigint_handler = signal(SIGINT, &infinoted_signal_sigint_handler); sig->previous_sigterm_handler = signal(SIGTERM, &infinoted_signal_sigterm_handler); sig->previous_sigquit_handler = #ifndef G_OS_WIN32 signal(SIGQUIT, &infinoted_signal_sigquit_handler); sig->previous_sighup_handler = signal(SIGHUP, &infinoted_signal_sighup_handler); #endif /* !G_OS_WIN32 */ _infinoted_signal_server = run; #endif /* !LIBINFINITY_HAVE_LIBDAEMON */ #ifdef G_OS_WIN32 SetConsoleCtrlHandler(infinoted_signal_console_handler, TRUE); #endif return sig; } /** * infinoted_signal_unregister: * @sig: A #InfinotedSignal. * * Unregisters signal handlers registered with infinoted_signal_register(). */ void infinoted_signal_unregister(InfinotedSignal* sig) { #ifdef G_OS_WIN32 SetConsoleCtrlHandler(infinoted_signal_console_handler, FALSE); #endif #ifdef LIBINFINITY_HAVE_LIBDAEMON if(sig->run) { inf_io_remove_watch(INF_IO(sig->run->io), sig->watch); sig->watch = NULL; daemon_signal_done(); } #else signal(SIGINT, sig->previous_sigint_handler); signal(SIGTERM, sig->previous_sigterm_handler); #ifndef G_OS_WIN32 signal(SIGQUIT, sig->previous_sigquit_handler); signal(SIGHUP, sig->previous_sighup_handler); #endif /* !G_OS_WIN32 */ _infinoted_signal_server = NULL; #endif /* !LIBINFINITY_HAVE_LIBDAEMON */ g_slice_free(InfinotedSignal, sig); } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/infinoted/infinoted-run.c0000644000175000017500000002462612264763732015714 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include static const guint8 INFINOTED_RUN_IPV6_ANY_ADDR[16] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; static gboolean infinoted_run_load_directory(InfinotedRun* run, InfinotedStartup* startup, GError** error) { /* TODO: Allow different storage plugins */ InfdFilesystemStorage* storage; InfCommunicationManager* communication_manager; #ifdef G_OS_WIN32 gchar* module_path; #endif gchar* plugin_path; storage = infd_filesystem_storage_new(startup->options->root_directory); communication_manager = inf_communication_manager_new(); run->io = inf_standalone_io_new(); run->directory = infd_directory_new( INF_IO(run->io), INFD_STORAGE(storage), communication_manager ); infd_directory_enable_chat(run->directory, TRUE); g_object_unref(storage); g_object_unref(communication_manager); #ifdef G_OS_WIN32 module_path = g_win32_get_package_installation_directory_of_module(NULL); plugin_path = g_build_filename(module_path, "lib", PLUGIN_BASEPATH, NULL); g_free(module_path); #else plugin_path = g_build_filename(PLUGIN_LIBPATH, PLUGIN_BASEPATH, NULL); #endif if(!infinoted_note_plugin_load_directory(plugin_path, run->directory)) { g_free(plugin_path); g_object_unref(run->directory); g_object_unref(run->io); run->directory = NULL; run->io = NULL; g_set_error( error, g_quark_from_static_string("INFINOTED_STARTUP_ERROR"), 0, "Failed to load note plugins" ); return FALSE; } g_free(plugin_path); return TRUE; } static InfdXmppServer* infinoted_run_create_server(InfinotedRun* run, InfinotedStartup* startup, InfIpAddress* address, GError** error) { InfdTcpServer* tcp; InfdXmppServer* xmpp; tcp = INFD_TCP_SERVER( g_object_new( INFD_TYPE_TCP_SERVER, "io", INF_IO(run->io), "local-address", address, "local-port", startup->options->port, NULL ) ); if(!infd_tcp_server_bind(tcp, error)) { g_object_unref(tcp); return NULL; } xmpp = infd_xmpp_server_new( tcp, startup->options->security_policy, startup->credentials, startup->sasl_context, startup->sasl_context ? "PLAIN" : NULL ); infd_server_pool_add_server(run->pool, INFD_XML_SERVER(xmpp)); #ifdef LIBINFINITY_HAVE_AVAHI infd_server_pool_add_local_publisher( run->pool, xmpp, INF_LOCAL_PUBLISHER(run->avahi) ); #endif g_object_unref(tcp); return xmpp; } /** * infinoted_run_new: * @startup: Startup parameters for the Infinote Server. * @error: Location to store error information, if any. * * Creates all necessary ressources for running an Infinote server. The * #InfinotedRun has taken ownership of @startup if this function returns * non-%NULL. * * Use infinoted_run_start() to start the server. * * Returns: A new #InfinotedRun, free with infinoted_run_free(). Or %NULL, * on error. */ InfinotedRun* infinoted_run_new(InfinotedStartup* startup, GError** error) { InfIpAddress* address; #ifdef LIBINFINITY_HAVE_AVAHI InfXmppManager* xmpp_manager; #endif InfinotedRun* run; GError* local_error; run = g_slice_new(InfinotedRun); run->startup = startup; run->dh_params = NULL; if(infinoted_run_load_directory(run, startup, error) == FALSE) { g_slice_free(InfinotedRun, run); return NULL; } run->pool = infd_server_pool_new(run->directory); #ifdef LIBINFINITY_HAVE_AVAHI xmpp_manager = inf_xmpp_manager_new(); run->avahi = inf_discovery_avahi_new( INF_IO(run->io), xmpp_manager, startup->credentials, NULL, NULL ); g_object_unref(xmpp_manager); #endif address = inf_ip_address_new_raw6(INFINOTED_RUN_IPV6_ANY_ADDR); run->xmpp6 = infinoted_run_create_server(run, startup, address, NULL); local_error = NULL; run->xmpp4 = infinoted_run_create_server(run, startup, NULL, &local_error); if(run->xmpp4 == NULL) { /* Ignore if we have an IPv6 server running */ if(run->xmpp6 != NULL) { g_error_free(local_error); } else { g_propagate_error(error, local_error); #ifdef LIBINFINITY_HAVE_AVAHI g_object_unref(run->avahi); #endif g_object_unref(run->pool); g_object_unref(run->directory); g_object_unref(run->io); g_slice_free(InfinotedRun, run); return NULL; } } inf_ip_address_free(address); run->record = infinoted_record_new(run->directory); if(startup->options->autosave_interval > 0) { run->autosave = infinoted_autosave_new( run->directory, startup->options->autosave_interval ); } else { run->autosave = NULL; } if(startup->options->sync_interval > 0 && startup->options->sync_directory != NULL) { run->dsync = infinoted_directory_sync_new( run->directory, startup->options->sync_directory, startup->options->sync_interval ); } else { run->dsync = NULL; } return run; } /** * infinoted_run_free: * @run: A #InfinotedRun. * * Frees the given #InfinotedRun, so that it can no longer be used. */ void infinoted_run_free(InfinotedRun* run) { InfdXmlServerStatus status; if(inf_standalone_io_loop_running(run->io)) inf_standalone_io_loop_quit(run->io); if(run->autosave != NULL) infinoted_autosave_free(run->autosave); if(run->dsync != NULL) infinoted_directory_sync_free(run->dsync); if(run->xmpp6 != NULL) { g_object_get(G_OBJECT(run->xmpp6), "status", &status, NULL); infd_server_pool_remove_server(run->pool, INFD_XML_SERVER(run->xmpp6)); if(status != INFD_XML_SERVER_CLOSED) infd_xml_server_close(INFD_XML_SERVER(run->xmpp6)); g_object_unref(run->xmpp6); } if(run->xmpp4 != NULL) { g_object_get(G_OBJECT(run->xmpp4), "status", &status, NULL); infd_server_pool_remove_server(run->pool, INFD_XML_SERVER(run->xmpp4)); if(status != INFD_XML_SERVER_CLOSED) infd_xml_server_close(INFD_XML_SERVER(run->xmpp4)); g_object_unref(run->xmpp4); } #ifdef LIBINFINITY_HAVE_AVAHI g_object_unref(run->avahi); #endif if(run->record != NULL) infinoted_record_free(run->record); g_object_unref(run->io); g_object_unref(run->directory); g_object_unref(run->pool); if(run->dh_params != NULL) gnutls_dh_params_deinit(run->dh_params); if(run->startup != NULL) infinoted_startup_free(run->startup); g_slice_free(InfinotedRun, run); } /** * infinoted_run_start: * @run: A #InfinotedRun. * * Starts the infinote server. This runs in a loop until infinoted_run_stop() * is called. This may fail in theory, but hardly does in practise. If it * fails, it prints an error message to stderr and returns. It may also block * before starting to generate DH parameters for key exchange. */ void infinoted_run_start(InfinotedRun* run) { GError* error; GError* error4; GError* error6; guint port; gboolean result; InfdTcpServer* tcp; error = NULL; error4 = NULL; error6 = NULL; /* Load DH parameters */ if(run->startup->credentials) { result = infinoted_dh_params_ensure( run->startup->credentials, &run->dh_params, &error); if(result == FALSE) { infinoted_util_log_error( _("Failed to generate Diffie-Hellman parameters: %s"), error->message); g_error_free(error); return; } } /* Open server sockets, accepting incoming connections... TODO: Prevent * code duplication here. */ if(run->xmpp6 != NULL) { g_object_get(G_OBJECT(run->xmpp6), "tcp-server", &tcp, NULL); if(infd_tcp_server_open(tcp, &error6) == TRUE) { g_object_get(G_OBJECT(tcp), "local-port", &port, NULL); infinoted_util_log_info(_("IPv6 Server running on port %u"), port); } else { g_object_unref(run->xmpp6); run->xmpp6 = NULL; infd_tcp_server_close(tcp); } g_object_unref(tcp); } if(run->xmpp4 != NULL) { g_object_get(G_OBJECT(run->xmpp4), "tcp-server", &tcp, NULL); if(infd_tcp_server_open(tcp, &error4) == TRUE) { g_object_get(G_OBJECT(tcp), "local-port", &port, NULL); infinoted_util_log_info(_("IPv4 Server running on port %u"), port); } else { g_object_unref(run->xmpp4); run->xmpp4 = NULL; infd_tcp_server_close(tcp); } g_object_unref(tcp); } if(run->xmpp4 == NULL && run->xmpp6 == NULL) { g_assert(error4 != NULL || error6 != NULL); error = error4 != NULL ? error4 : error6; infinoted_util_log_error( _("Failed to start server: %s"), error->message); } if(error4 != NULL) g_error_free(error4); if(error6 != NULL) g_error_free(error6); /* Make sure messages are shown. This explicit flush is for example * required when running in an MSYS shell on Windows. */ fflush(stderr); if(run->xmpp4 != NULL || run->xmpp6 != NULL) inf_standalone_io_loop(run->io); } /** * infinoted_run_stop: * @run: A #InfinotedRun. * * Stops a running infinote server. */ void infinoted_run_stop(InfinotedRun* run) { inf_standalone_io_loop_quit(run->io); } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/infinoted/Makefile.am0000644000175000017500000000273112264763732015014 00000000000000SUBDIRS = note-plugins # TODO: Find a way to have the version number set automatically. bin_PROGRAMS = infinoted-0.5 dist_man1_MANS = infinoted-0.5.man plugin_path = infinoted-$(LIBINFINITY_API_VERSION)/note-plugins infinoted_0_5_CPPFLAGS = \ -I${top_srcdir} \ $(infinoted_CFLAGS) \ $(infinity_CFLAGS) \ -DPLUGIN_LIBPATH=\"${libdir}\" \ -DPLUGIN_BASEPATH=\"${plugin_path}\" \ -DLOCALSTATEDIR=\"${localstatedir}\" \ -DLIBINFINITY_API_VERSION=\"$(LIBINFINITY_API_VERSION)\" infinoted_0_5_LDADD = \ ${top_builddir}/libinftext/libinftext-$(LIBINFINITY_API_VERSION).la \ ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ $(infinoted_LIBS) \ $(infinity_LIBS) \ $(libdaemon_LIBS) infinoted_0_5_SOURCES = \ infinoted-autosave.c \ infinoted-config-reload.c \ infinoted-creds.c \ infinoted-dh-params.c \ infinoted-directory-sync.c \ infinoted-main.c \ infinoted-note-plugin.c \ infinoted-options.c \ infinoted-pam.c \ infinoted-record.c \ infinoted-run.c \ infinoted-signal.c \ infinoted-startup.c \ infinoted-util.c noinst_HEADERS = \ infinoted-autosave.h \ infinoted-config-reload.h \ infinoted-creds.h \ infinoted-dh-params.h \ infinoted-directory-sync.h \ infinoted-note-plugin.h \ infinoted-options.h \ infinoted-pam.h \ infinoted-record.h \ infinoted-run.h \ infinoted-signal.h \ infinoted-startup.h \ infinoted-util.h # Create pid file directory pidfiledir = ${localstatedir}/run/infinoted-$(LIBINFINITY_API_VERSION) pidfile_DATA = libinfinity-0.5.5/infinoted/infinoted-directory-sync.c0000644000175000017500000003355312264763732020065 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include #include #include #include #include typedef struct _InfinotedDirectorySyncSession InfinotedDirectorySyncSession; struct _InfinotedDirectorySyncSession { InfinotedDirectorySync* dsync; InfdDirectoryIter iter; InfdSessionProxy* proxy; InfIoTimeout* timeout; gchar* path; }; #ifdef G_OS_WIN32 /* Currently only used on Windows, thus ifdef-out on Unix to avoid * a compiler warning. */ static GQuark infinoted_directory_sync_error_quark(void) { return g_quark_from_static_string("INFINOTED_DIRECTORY_SYNC_ERROR"); } #endif static InfinotedDirectorySyncSession* infinoted_directory_sync_find_session(InfinotedDirectorySync* dsync, InfdDirectoryIter* iter) { GSList* item; InfinotedDirectorySyncSession* session; for(item = dsync->sessions; item != NULL; item = g_slist_next(item)) { session = (InfinotedDirectorySyncSession*)item->data; /* TODO: Add a infd_directory_iter_compare() method in libinfinity */ if(session->iter.node == iter->node && session->iter.node_id == iter->node_id) { return session; } } return NULL; } /* Required by infinoted_directory_sync_session_start */ static void infinoted_directory_sync_session_timeout_cb(gpointer user_data); static void infinoted_directory_sync_session_start(InfinotedDirectorySync* dsync, InfinotedDirectorySyncSession* session) { InfIo* io; io = infd_directory_get_io(dsync->directory); g_assert(session->timeout == NULL); session->timeout = inf_io_add_timeout( io, dsync->sync_interval * 1000, infinoted_directory_sync_session_timeout_cb, session, NULL ); } static void infinoted_directory_sync_session_stop(InfinotedDirectorySync* dsync, InfinotedDirectorySyncSession* session) { InfIo* io; io = infd_directory_get_io(dsync->directory); g_assert(session->timeout != NULL); inf_io_remove_timeout(io, session->timeout); session->timeout = NULL; } static void infinoted_directory_sync_buffer_text_inserted_cb(InfTextBuffer* buffer, guint position, InfTextChunk* text, InfUser* user, gpointer user_data) { InfinotedDirectorySyncSession* session; session = (InfinotedDirectorySyncSession*)user_data; if(session->timeout == NULL) infinoted_directory_sync_session_start(session->dsync, session); } static void infinoted_directory_sync_buffer_text_erased_cb(InfTextBuffer* buffer, guint position, InfTextChunk* text, InfUser* user, gpointer user_data) { InfinotedDirectorySyncSession* session; session = (InfinotedDirectorySyncSession*)user_data; if(session->timeout == NULL) infinoted_directory_sync_session_start(session->dsync, session); } static void infinoted_directory_sync_session_save(InfinotedDirectorySync* dsync, InfinotedDirectorySyncSession* session) { InfdDirectoryIter* iter; GError* error; InfBuffer* buffer; InfTextChunk* chunk; gchar* content; gsize bytes; iter = &session->iter; error = NULL; if(session->timeout != NULL) { inf_io_remove_timeout( infd_directory_get_io(dsync->directory), session->timeout ); session->timeout = NULL; } buffer = inf_session_get_buffer( infd_session_proxy_get_session(session->proxy) ); error = NULL; if(!infinoted_util_create_dirname(session->path, &error)) { g_warning(_("Failed to create directory for path \"%s\": %s\n\n"), session->path, error->message); g_error_free(error); } else { /* TODO: Use the iterator API here, which should be less expensive */ chunk = inf_text_buffer_get_slice( INF_TEXT_BUFFER(buffer), 0, inf_text_buffer_get_length(INF_TEXT_BUFFER(buffer)) ); content = inf_text_chunk_get_text(chunk, &bytes); inf_text_chunk_free(chunk); if(!g_file_set_contents(session->path, content, bytes, &error)) { g_warning( _("Failed to write session for path \"%s\": %s\n\n" "Will retry in %u seconds."), session->path, error->message, dsync->sync_interval ); g_error_free(error); infinoted_directory_sync_session_start(session->dsync, session); } g_free(content); } } static void infinoted_directory_sync_session_timeout_cb(gpointer user_data) { InfinotedDirectorySyncSession* session; session = (InfinotedDirectorySyncSession*)user_data; session->timeout = NULL; infinoted_directory_sync_session_save(session->dsync, session); } static gboolean infinoted_directory_sync_add_session(InfinotedDirectorySync* dsync, InfdDirectoryIter* iter, GError** error) { InfinotedDirectorySyncSession* session; InfdSessionProxy* proxy; InfBuffer* buffer; gchar* iter_path; #ifdef G_OS_WIN32 gchar* pos; #endif gchar* full_path; gchar* converted; g_assert(infinoted_directory_sync_find_session(dsync, iter) == NULL); proxy = infd_directory_iter_peek_session(dsync->directory, iter); g_assert(proxy != NULL); /* Ignore if this is not a text session */ if(!INF_TEXT_IS_SESSION(infd_session_proxy_get_session(proxy))) return TRUE; iter_path = infd_directory_iter_get_path(dsync->directory, iter); #ifdef G_OS_WIN32 for(pos = iter_path; *pos != '\0'; ++pos) { if(*pos == '\\') { g_set_error( error, infinoted_directory_sync_error_quark(), INFINOTED_DIRECTORY_SYNC_ERROR_INVALID_PATH, _("Node \"%s\" contains invalid characters"), iter_path ); g_free(iter_path); return FALSE; } else if(*pos == '/') { *pos = '\\'; } } #endif full_path = g_build_filename(dsync->sync_directory, iter_path+1, NULL); g_free(iter_path); converted = g_filename_from_utf8(full_path, -1, NULL, NULL, error); g_free(full_path); if(!converted) return FALSE; session = g_slice_new(InfinotedDirectorySyncSession); session->dsync = dsync; session->iter = *iter; session->proxy = proxy; session->timeout = NULL; session->path = converted; dsync->sessions = g_slist_prepend(dsync->sessions, session); buffer = inf_session_get_buffer(infd_session_proxy_get_session(proxy)); g_signal_connect( G_OBJECT(buffer), "text-inserted", G_CALLBACK(infinoted_directory_sync_buffer_text_inserted_cb), session ); g_signal_connect( G_OBJECT(buffer), "text-erased", G_CALLBACK(infinoted_directory_sync_buffer_text_erased_cb), session ); infinoted_directory_sync_session_save(dsync, session); return TRUE; } static void infinoted_directory_sync_remove_session(InfinotedDirectorySync* dsync, InfinotedDirectorySyncSession* sess) { InfTextBuffer* buffer; if(sess->timeout != NULL) { infinoted_directory_sync_session_save(dsync, sess); if(sess->timeout != NULL) { /* should not happen as the timeout is reset by _save. Could still * be set in case _save fails though. */ infinoted_directory_sync_session_stop(dsync, sess); } } buffer = INF_TEXT_BUFFER( inf_session_get_buffer(infd_session_proxy_get_session(sess->proxy)) ); inf_signal_handlers_disconnect_by_func( G_OBJECT(buffer), G_CALLBACK(infinoted_directory_sync_buffer_text_inserted_cb), sess ); inf_signal_handlers_disconnect_by_func( G_OBJECT(buffer), G_CALLBACK(infinoted_directory_sync_buffer_text_erased_cb), sess ); dsync->sessions = g_slist_remove(dsync->sessions, sess); g_free(sess->path); g_slice_free(InfinotedDirectorySyncSession, sess); } static void infinoted_directory_sync_directory_add_session_cb(InfdDirectory* directory, InfdDirectoryIter* iter, InfdSessionProxy* proxy, gpointer user_data) { InfinotedDirectorySync* dsync; GError* error; gchar* path; dsync = (InfinotedDirectorySync*)user_data; error = NULL; if(!infinoted_directory_sync_add_session(dsync, iter, &error)) { path = infd_directory_iter_get_path(directory, iter); infinoted_util_log_warning( _("Failed to synchronize session \"%s\" to disk: %s"), path, error->message ); g_free(path); g_error_free(error); } } static void infinoted_directory_sync_directory_remove_session_cb(InfdDirectory* directory, InfdDirectoryIter* iter, InfdSessionProxy* proxy, gpointer user_data) { InfinotedDirectorySync* dsync; InfinotedDirectorySyncSession* session; /* Ignore if this is not a text session */ if(INF_TEXT_IS_SESSION(infd_session_proxy_get_session(proxy))) { dsync = (InfinotedDirectorySync*)user_data; session = infinoted_directory_sync_find_session(dsync, iter); g_assert(session != NULL && session->proxy == proxy); infinoted_directory_sync_remove_session(dsync, session); } } static void infinoted_directory_sync_walk_directory(InfinotedDirectorySync* dsync, InfdDirectoryIter* iter) { InfdDirectoryIter child; InfdSessionProxy* session; GError* error; gchar* path; if(infd_directory_iter_get_node_type(dsync->directory, iter) == INFD_STORAGE_NODE_SUBDIRECTORY) { if(infd_directory_iter_get_explored(dsync->directory, iter) == TRUE) { /* Errors can't happen as the directory is already explored */ child = *iter; if(infd_directory_iter_get_child(dsync->directory, &child, NULL)) { do { infinoted_directory_sync_walk_directory(dsync, &child); } while(infd_directory_iter_get_next(dsync->directory, &child)); } } } else { session = infd_directory_iter_peek_session(dsync->directory, iter); if(session != NULL) { error = NULL; if(!infinoted_directory_sync_add_session(dsync, iter, &error)) { path = infd_directory_iter_get_path(dsync->directory, iter); infinoted_util_log_warning( _("Failed to synchronize session \"%s\" to disk: %s"), path, error->message ); g_free(path); g_error_free(error); } } } } /** * infinoted_directory_sync_new: * @directory: A #InfdDirectory. * @sync_directory: The directory on the file system to sync documents to. * @sync_interval: The interval in which to save documents to @sync_directory, * in seconds. * * Creates a new #InfinotedDirectorySync object which will save all documents * in @directory every @sync_interval into the file system at @sync_directory. * If @sync_directory does not exist it will be created. * * Returns: A new #InfinotedDirectorySync. */ InfinotedDirectorySync* infinoted_directory_sync_new(InfdDirectory* directory, const gchar* sync_directory, unsigned int sync_interval) { InfinotedDirectorySync* dsync; InfdDirectoryIter iter; dsync = g_slice_new(InfinotedDirectorySync); dsync->directory = directory; dsync->sync_directory = g_strdup(sync_directory); dsync->sync_interval = sync_interval; dsync->sessions = NULL; g_object_ref(directory); g_signal_connect_after( G_OBJECT(directory), "add-session", G_CALLBACK(infinoted_directory_sync_directory_add_session_cb), dsync ); g_signal_connect_after( G_OBJECT(directory), "remove-session", G_CALLBACK(infinoted_directory_sync_directory_remove_session_cb), dsync ); infd_directory_iter_get_root(directory, &iter); infinoted_directory_sync_walk_directory(dsync, &iter); return dsync; } /** * infinoted_directory_sync_free: * @directory_sync: A #InfinotedDirectorySync. * * Frees the given #InfinotedDirectorySync. */ void infinoted_directory_sync_free(InfinotedDirectorySync* dsync) { inf_signal_handlers_disconnect_by_func( G_OBJECT(dsync->directory), G_CALLBACK(infinoted_directory_sync_directory_add_session_cb), dsync ); inf_signal_handlers_disconnect_by_func( G_OBJECT(dsync->directory), G_CALLBACK(infinoted_directory_sync_directory_remove_session_cb), dsync ); while(dsync->sessions != NULL) { infinoted_directory_sync_remove_session( dsync, (InfinotedDirectorySyncSession*)dsync->sessions->data ); } g_object_unref(dsync->directory); g_slice_free(InfinotedDirectorySync, dsync); } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/infinoted/infinoted-record.h0000644000175000017500000000246512264763732016370 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INFINOTED_RECORD_H__ #define __INFINOTED_RECORD_H__ #include #include G_BEGIN_DECLS typedef struct _InfinotedRecord InfinotedRecord; struct _InfinotedRecord { InfdDirectory* directory; GSList* records; }; InfinotedRecord* infinoted_record_new(InfdDirectory* directory); void infinoted_record_free(InfinotedRecord* record); G_END_DECLS #endif /* __INFINOTED_RECORD_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/infinoted/infinoted-run.h0000644000175000017500000000404512264763732015712 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INFINOTED_RUN_H__ #define __INFINOTED_RUN_H__ #include #include #include #include #include #include #include #include #include #include G_BEGIN_DECLS typedef struct _InfinotedRun InfinotedRun; struct _InfinotedRun { InfinotedStartup* startup; InfStandaloneIo* io; InfdDirectory* directory; InfdServerPool* pool; InfinotedAutosave* autosave; InfinotedDirectorySync* dsync; InfdXmppServer* xmpp4; InfdXmppServer* xmpp6; gnutls_dh_params_t dh_params; InfinotedRecord* record; #ifdef LIBINFINITY_HAVE_AVAHI InfDiscoveryAvahi* avahi; #endif }; InfinotedRun* infinoted_run_new(InfinotedStartup* startup, GError** error); void infinoted_run_free(InfinotedRun* run); void infinoted_run_start(InfinotedRun* run); void infinoted_run_stop(InfinotedRun* run); G_END_DECLS #endif /* __INFINOTED_RUN_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/infinoted/infinoted-startup.c0000644000175000017500000002723312264763732016607 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include static void infinoted_startup_free_certificate_array(gnutls_x509_crt_t* certificates, guint n_certificates) { guint i; for(i = 0; i < n_certificates; ++ i) gnutls_x509_crt_deinit(certificates[i]); g_free(certificates); } static gnutls_x509_privkey_t infinoted_startup_load_key(gboolean create_key, const gchar* key_file, GError** error) { gnutls_x509_privkey_t key; if(create_key == TRUE) { if(infinoted_util_create_dirname(key_file, error) == FALSE) return NULL; /* TODO: Open the key file beforehand */ infinoted_util_log_info(_("Generating 2048 bit RSA private key...")); key = infinoted_creds_create_key(error); if(key == NULL) return NULL; if(infinoted_creds_write_key(key, key_file, error) == FALSE) { gnutls_x509_privkey_deinit(key); return NULL; } } else { key = infinoted_creds_read_key(key_file, error); } return key; } static gnutls_x509_crt_t* infinoted_startup_load_certificate(gboolean create_self_signed_certificate, gnutls_x509_privkey_t key, const gchar* certificate_file, const gchar* certificate_chain_file, guint* n_certificates, GError** error) { gnutls_x509_crt_t* result; gnutls_x509_crt_t cert; GPtrArray* certs; GPtrArray* chain_certs; if(create_self_signed_certificate == TRUE) { if(infinoted_util_create_dirname(certificate_file, error) == FALSE) return NULL; infinoted_util_log_info(_("Generating self-signed certificate...")); cert = infinoted_creds_create_self_signed_certificate(key, error); if(cert == NULL) return NULL; if(inf_cert_util_save_file(&cert, 1, certificate_file, error) == FALSE) { gnutls_x509_crt_deinit(cert); return NULL; } else { result = g_malloc(sizeof(gnutls_x509_crt_t)); *result = cert; *n_certificates = 1; } } else { certs = inf_cert_util_load_file(certificate_file, NULL, error); if(certs == NULL) return NULL; if(certificate_chain_file != NULL) { chain_certs = inf_cert_util_load_file(certificate_chain_file, certs, error); if(chain_certs == NULL) { result = (gnutls_x509_crt_t*)g_ptr_array_free(certs, FALSE); infinoted_startup_free_certificate_array(result, *n_certificates); return NULL; } } *n_certificates = certs->len; result = (gnutls_x509_crt_t*)g_ptr_array_free(certs, FALSE); } return result; } static gboolean infinoted_startup_load_credentials(InfinotedStartup* startup, GError** error) { if(startup->options->security_policy != INF_XMPP_CONNECTION_SECURITY_ONLY_UNSECURED) { startup->private_key = infinoted_startup_load_key( startup->options->create_key, startup->options->key_file, error ); if(startup->private_key == NULL) return FALSE; startup->certificates = infinoted_startup_load_certificate( startup->options->create_certificate, startup->private_key, startup->options->certificate_file, startup->options->certificate_chain_file, &startup->n_certificates, error ); if(startup->certificates == NULL) return FALSE; startup->credentials = infinoted_creds_create_credentials( startup->private_key, startup->certificates, startup->n_certificates, error ); if(startup->credentials == NULL) return FALSE; } return TRUE; } static gboolean infinoted_startup_load_options(InfinotedStartup* startup, int* argc, char*** argv, GError** error) { const gchar* const* system_config_dirs; guint n_system_config_dirs; const gchar* user_config_dir; const gchar* const* dir; guint i; gchar** config_files; system_config_dirs = g_get_system_config_dirs(); user_config_dir = g_get_user_config_dir(); n_system_config_dirs = 0; if(system_config_dirs != NULL) { for(dir = system_config_dirs; *dir != NULL; ++ dir) ++ n_system_config_dirs; } config_files = g_malloc( (n_system_config_dirs + 2) * sizeof(gchar*)); config_files[n_system_config_dirs + 1] = NULL; config_files[n_system_config_dirs] = g_build_filename(user_config_dir, "infinoted.conf", NULL); for(i = 0; i < n_system_config_dirs; ++ i) { config_files[n_system_config_dirs - i - 1] = g_build_filename(system_config_dirs[i], "infinoted.conf", NULL); } startup->options = infinoted_options_new( (gchar const* const*) config_files, argc, argv, error); for(i = 0; i < n_system_config_dirs + 1; ++ i) g_free(config_files[i]); g_free(config_files); if(startup->options == NULL) return FALSE; return TRUE; } static void infinoted_startup_sasl_callback_set_error(InfXmppConnection* connection, InfAuthenticationDetailError code, const GError* error) { GError* own_error; own_error = NULL; if(!error) { own_error = g_error_new_literal( inf_authentication_detail_error_quark(), code, inf_authentication_detail_strerror(code) ); inf_xmpp_connection_set_sasl_error(connection, own_error); g_error_free(own_error); } else { inf_xmpp_connection_set_sasl_error(connection, error); } } static void infinoted_startup_sasl_callback(InfSaslContextSession* session, Gsasl_property prop, gpointer session_data, gpointer user_data) { InfinotedStartup* startup; const char* password; InfXmppConnection* xmpp; #ifdef LIBINFINITY_HAVE_PAM const char* username; const gchar* pam_service; GError* error; #endif xmpp = INF_XMPP_CONNECTION(session_data); switch(prop) { case GSASL_VALIDATE_SIMPLE: startup = (InfinotedStartup*)user_data; password = inf_sasl_context_session_get_property(session, GSASL_PASSWORD); #ifdef LIBINFINITY_HAVE_PAM username = inf_sasl_context_session_get_property(session, GSASL_AUTHID); pam_service = startup->options->pam_service; if(pam_service != NULL) { error = NULL; if(!infinoted_pam_authenticate(pam_service, username, password)) { infinoted_startup_sasl_callback_set_error( xmpp, INF_AUTHENTICATION_DETAIL_ERROR_AUTHENTICATION_FAILED, NULL ); inf_sasl_context_session_continue( session, GSASL_AUTHENTICATION_ERROR ); } else if(!infinoted_pam_user_is_allowed(startup->options, username, &error)) { infinoted_startup_sasl_callback_set_error( xmpp, INF_AUTHENTICATION_DETAIL_ERROR_USER_NOT_AUTHORIZED, error ); inf_sasl_context_session_continue( session, GSASL_AUTHENTICATION_ERROR ); } else { inf_sasl_context_session_continue(session, GSASL_OK); } } else #endif /* LIBINFINITY_HAVE_PAM */ { g_assert(startup->options->password != NULL); if(strcmp(startup->options->password, password) == 0) { inf_sasl_context_session_continue(session, GSASL_OK); } else { infinoted_startup_sasl_callback_set_error( xmpp, INF_AUTHENTICATION_DETAIL_ERROR_AUTHENTICATION_FAILED, NULL ); inf_sasl_context_session_continue( session, GSASL_AUTHENTICATION_ERROR ); } } break; default: inf_sasl_context_session_continue(session, GSASL_AUTHENTICATION_ERROR); break; } } static gboolean infinoted_startup_load(InfinotedStartup* startup, int* argc, char*** argv, GError** error) { gboolean requires_password; if(infinoted_startup_load_options(startup, argc, argv, error) == FALSE) return FALSE; if(infinoted_startup_load_credentials(startup, error) == FALSE) return FALSE; requires_password = startup->options->password != NULL; #ifdef LIBINFINITY_HAVE_PAM requires_password = requires_password || startup->options->pam_service != NULL; #endif /* LIBINFINITY_HAVE_PAM */ if(requires_password) { startup->sasl_context = inf_sasl_context_new(error); if(!startup->sasl_context) return FALSE; inf_sasl_context_set_callback( startup->sasl_context, infinoted_startup_sasl_callback, startup ); } return TRUE; } /** * infinoted_startup_new: * @error: Location to store error information, if any. * * Creates parameters for starting an infinote daemon. This involves option * parsing, reading config files, reading or creating data for TLS * (private key and certificate). * * Returns: A new #InfinotedStartup. Free with infinoted_startup_free(). */ InfinotedStartup* infinoted_startup_new(int* argc, char*** argv, GError** error) { InfinotedStartup* startup; if(!inf_init(error)) return NULL; startup = g_slice_new(InfinotedStartup); startup->options = NULL; startup->private_key = NULL; startup->certificates = NULL; startup->n_certificates = 0; startup->credentials = NULL; startup->sasl_context = NULL; if(infinoted_startup_load(startup, argc, argv, error) == FALSE) { infinoted_startup_free(startup); return NULL; } return startup; } /** * infinoted_startup_free: * @startup: A #InfinotedStartup. * * Frees all ressources allocated by @startup. */ void infinoted_startup_free(InfinotedStartup* startup) { if(startup->credentials != NULL) inf_certificate_credentials_unref(startup->credentials); if(startup->certificates != NULL) { infinoted_startup_free_certificate_array( startup->certificates, startup->n_certificates ); } if(startup->private_key != NULL) gnutls_x509_privkey_deinit(startup->private_key); if(startup->options != NULL) infinoted_options_free(startup->options); if(startup->sasl_context != NULL) inf_sasl_context_unref(startup->sasl_context); g_slice_free(InfinotedStartup, startup); inf_deinit(); } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/infinoted/infinoted-autosave.h0000644000175000017500000000275512264763732016743 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INFINOTED_AUTOSAVE_H__ #define __INFINOTED_AUTOSAVE_H__ #include #include G_BEGIN_DECLS typedef struct _InfinotedAutosave InfinotedAutosave; struct _InfinotedAutosave { InfdDirectory* directory; unsigned int autosave_interval; GSList* sessions; }; InfinotedAutosave* infinoted_autosave_new(InfdDirectory* directory, unsigned int autosave_interval); void infinoted_autosave_free(InfinotedAutosave* autosave); void infinoted_autosave_save_immediately(InfinotedAutosave* autosave); G_END_DECLS #endif /* __INFINOTED_AUTOSAVE_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/infinoted/Makefile.in0000644000175000017500000017341512264766065015037 00000000000000# Makefile.in generated by automake 1.13.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = infinoted-0.5$(EXEEXT) subdir = infinoted DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/mkinstalldirs $(top_srcdir)/depcomp \ $(dist_man1_MANS) $(noinst_HEADERS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/libinfinity/inf-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" \ "$(DESTDIR)$(pidfiledir)" PROGRAMS = $(bin_PROGRAMS) am_infinoted_0_5_OBJECTS = infinoted_0_5-infinoted-autosave.$(OBJEXT) \ infinoted_0_5-infinoted-config-reload.$(OBJEXT) \ infinoted_0_5-infinoted-creds.$(OBJEXT) \ infinoted_0_5-infinoted-dh-params.$(OBJEXT) \ infinoted_0_5-infinoted-directory-sync.$(OBJEXT) \ infinoted_0_5-infinoted-main.$(OBJEXT) \ infinoted_0_5-infinoted-note-plugin.$(OBJEXT) \ infinoted_0_5-infinoted-options.$(OBJEXT) \ infinoted_0_5-infinoted-pam.$(OBJEXT) \ infinoted_0_5-infinoted-record.$(OBJEXT) \ infinoted_0_5-infinoted-run.$(OBJEXT) \ infinoted_0_5-infinoted-signal.$(OBJEXT) \ infinoted_0_5-infinoted-startup.$(OBJEXT) \ infinoted_0_5-infinoted-util.$(OBJEXT) infinoted_0_5_OBJECTS = $(am_infinoted_0_5_OBJECTS) am__DEPENDENCIES_1 = infinoted_0_5_DEPENDENCIES = ${top_builddir}/libinftext/libinftext-$(LIBINFINITY_API_VERSION).la \ ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -I$(top_builddir)/libinfinity 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) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(infinoted_0_5_SOURCES) DIST_SOURCES = $(infinoted_0_5_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man1dir = $(mandir)/man1 NROFF = nroff MANS = $(dist_man1_MANS) DATA = $(pidfile_DATA) HEADERS = $(noinst_HEADERS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBINFINITY_API_VERSION = @LIBINFINITY_API_VERSION@ LIBINFINITY_LIBTOOL_VERSION = @LIBINFINITY_LIBTOOL_VERSION@ LIBINFINITY_VERSION = @LIBINFINITY_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ avahi_CFLAGS = @avahi_CFLAGS@ avahi_LIBS = @avahi_LIBS@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gtk_requirement = @gtk_requirement@ gtk_version = @gtk_version@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infgtk_CFLAGS = @infgtk_CFLAGS@ infgtk_LIBS = @infgtk_LIBS@ infinity_CFLAGS = @infinity_CFLAGS@ infinity_LIBS = @infinity_LIBS@ infinoted_CFLAGS = @infinoted_CFLAGS@ infinoted_LIBS = @infinoted_LIBS@ infodir = @infodir@ inftext_CFLAGS = @inftext_CFLAGS@ inftext_LIBS = @inftext_LIBS@ inftextgtk_CFLAGS = @inftextgtk_CFLAGS@ inftextgtk_LIBS = @inftextgtk_LIBS@ install_sh = @install_sh@ libdaemon_CFLAGS = @libdaemon_CFLAGS@ libdaemon_LIBS = @libdaemon_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = note-plugins dist_man1_MANS = infinoted-0.5.man plugin_path = infinoted-$(LIBINFINITY_API_VERSION)/note-plugins infinoted_0_5_CPPFLAGS = \ -I${top_srcdir} \ $(infinoted_CFLAGS) \ $(infinity_CFLAGS) \ -DPLUGIN_LIBPATH=\"${libdir}\" \ -DPLUGIN_BASEPATH=\"${plugin_path}\" \ -DLOCALSTATEDIR=\"${localstatedir}\" \ -DLIBINFINITY_API_VERSION=\"$(LIBINFINITY_API_VERSION)\" infinoted_0_5_LDADD = \ ${top_builddir}/libinftext/libinftext-$(LIBINFINITY_API_VERSION).la \ ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ $(infinoted_LIBS) \ $(infinity_LIBS) \ $(libdaemon_LIBS) infinoted_0_5_SOURCES = \ infinoted-autosave.c \ infinoted-config-reload.c \ infinoted-creds.c \ infinoted-dh-params.c \ infinoted-directory-sync.c \ infinoted-main.c \ infinoted-note-plugin.c \ infinoted-options.c \ infinoted-pam.c \ infinoted-record.c \ infinoted-run.c \ infinoted-signal.c \ infinoted-startup.c \ infinoted-util.c noinst_HEADERS = \ infinoted-autosave.h \ infinoted-config-reload.h \ infinoted-creds.h \ infinoted-dh-params.h \ infinoted-directory-sync.h \ infinoted-note-plugin.h \ infinoted-options.h \ infinoted-pam.h \ infinoted-record.h \ infinoted-run.h \ infinoted-signal.h \ infinoted-startup.h \ infinoted-util.h # Create pid file directory pidfiledir = ${localstatedir}/run/infinoted-$(LIBINFINITY_API_VERSION) pidfile_DATA = all: all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu infinoted/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu infinoted/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list infinoted-0.5$(EXEEXT): $(infinoted_0_5_OBJECTS) $(infinoted_0_5_DEPENDENCIES) $(EXTRA_infinoted_0_5_DEPENDENCIES) @rm -f infinoted-0.5$(EXEEXT) $(AM_V_CCLD)$(LINK) $(infinoted_0_5_OBJECTS) $(infinoted_0_5_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/infinoted_0_5-infinoted-autosave.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/infinoted_0_5-infinoted-config-reload.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/infinoted_0_5-infinoted-creds.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/infinoted_0_5-infinoted-dh-params.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/infinoted_0_5-infinoted-directory-sync.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/infinoted_0_5-infinoted-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/infinoted_0_5-infinoted-note-plugin.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/infinoted_0_5-infinoted-options.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/infinoted_0_5-infinoted-pam.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/infinoted_0_5-infinoted-record.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/infinoted_0_5-infinoted-run.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/infinoted_0_5-infinoted-signal.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/infinoted_0_5-infinoted-startup.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/infinoted_0_5-infinoted-util.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< infinoted_0_5-infinoted-autosave.o: infinoted-autosave.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(infinoted_0_5_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT infinoted_0_5-infinoted-autosave.o -MD -MP -MF $(DEPDIR)/infinoted_0_5-infinoted-autosave.Tpo -c -o infinoted_0_5-infinoted-autosave.o `test -f 'infinoted-autosave.c' || echo '$(srcdir)/'`infinoted-autosave.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/infinoted_0_5-infinoted-autosave.Tpo $(DEPDIR)/infinoted_0_5-infinoted-autosave.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='infinoted-autosave.c' object='infinoted_0_5-infinoted-autosave.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(infinoted_0_5_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o infinoted_0_5-infinoted-autosave.o `test -f 'infinoted-autosave.c' || echo '$(srcdir)/'`infinoted-autosave.c infinoted_0_5-infinoted-autosave.obj: infinoted-autosave.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(infinoted_0_5_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT infinoted_0_5-infinoted-autosave.obj -MD -MP -MF $(DEPDIR)/infinoted_0_5-infinoted-autosave.Tpo -c -o infinoted_0_5-infinoted-autosave.obj `if test -f 'infinoted-autosave.c'; then $(CYGPATH_W) 'infinoted-autosave.c'; else $(CYGPATH_W) '$(srcdir)/infinoted-autosave.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/infinoted_0_5-infinoted-autosave.Tpo $(DEPDIR)/infinoted_0_5-infinoted-autosave.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='infinoted-autosave.c' object='infinoted_0_5-infinoted-autosave.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(infinoted_0_5_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o infinoted_0_5-infinoted-autosave.obj `if test -f 'infinoted-autosave.c'; then $(CYGPATH_W) 'infinoted-autosave.c'; else $(CYGPATH_W) '$(srcdir)/infinoted-autosave.c'; fi` infinoted_0_5-infinoted-config-reload.o: infinoted-config-reload.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(infinoted_0_5_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT infinoted_0_5-infinoted-config-reload.o -MD -MP -MF $(DEPDIR)/infinoted_0_5-infinoted-config-reload.Tpo -c -o infinoted_0_5-infinoted-config-reload.o `test -f 'infinoted-config-reload.c' || echo '$(srcdir)/'`infinoted-config-reload.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/infinoted_0_5-infinoted-config-reload.Tpo $(DEPDIR)/infinoted_0_5-infinoted-config-reload.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='infinoted-config-reload.c' object='infinoted_0_5-infinoted-config-reload.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(infinoted_0_5_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o infinoted_0_5-infinoted-config-reload.o `test -f 'infinoted-config-reload.c' || echo '$(srcdir)/'`infinoted-config-reload.c infinoted_0_5-infinoted-config-reload.obj: infinoted-config-reload.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(infinoted_0_5_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT infinoted_0_5-infinoted-config-reload.obj -MD -MP -MF $(DEPDIR)/infinoted_0_5-infinoted-config-reload.Tpo -c -o infinoted_0_5-infinoted-config-reload.obj `if test -f 'infinoted-config-reload.c'; then $(CYGPATH_W) 'infinoted-config-reload.c'; else $(CYGPATH_W) '$(srcdir)/infinoted-config-reload.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/infinoted_0_5-infinoted-config-reload.Tpo $(DEPDIR)/infinoted_0_5-infinoted-config-reload.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='infinoted-config-reload.c' object='infinoted_0_5-infinoted-config-reload.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(infinoted_0_5_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o infinoted_0_5-infinoted-config-reload.obj `if test -f 'infinoted-config-reload.c'; then $(CYGPATH_W) 'infinoted-config-reload.c'; else $(CYGPATH_W) '$(srcdir)/infinoted-config-reload.c'; fi` infinoted_0_5-infinoted-creds.o: infinoted-creds.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(infinoted_0_5_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT infinoted_0_5-infinoted-creds.o -MD -MP -MF $(DEPDIR)/infinoted_0_5-infinoted-creds.Tpo -c -o infinoted_0_5-infinoted-creds.o `test -f 'infinoted-creds.c' || echo '$(srcdir)/'`infinoted-creds.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/infinoted_0_5-infinoted-creds.Tpo $(DEPDIR)/infinoted_0_5-infinoted-creds.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='infinoted-creds.c' object='infinoted_0_5-infinoted-creds.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(infinoted_0_5_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o infinoted_0_5-infinoted-creds.o `test -f 'infinoted-creds.c' || echo '$(srcdir)/'`infinoted-creds.c infinoted_0_5-infinoted-creds.obj: infinoted-creds.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(infinoted_0_5_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT infinoted_0_5-infinoted-creds.obj -MD -MP -MF $(DEPDIR)/infinoted_0_5-infinoted-creds.Tpo -c -o infinoted_0_5-infinoted-creds.obj `if test -f 'infinoted-creds.c'; then $(CYGPATH_W) 'infinoted-creds.c'; else $(CYGPATH_W) '$(srcdir)/infinoted-creds.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/infinoted_0_5-infinoted-creds.Tpo $(DEPDIR)/infinoted_0_5-infinoted-creds.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='infinoted-creds.c' object='infinoted_0_5-infinoted-creds.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(infinoted_0_5_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o infinoted_0_5-infinoted-creds.obj `if test -f 'infinoted-creds.c'; then $(CYGPATH_W) 'infinoted-creds.c'; else $(CYGPATH_W) '$(srcdir)/infinoted-creds.c'; fi` infinoted_0_5-infinoted-dh-params.o: infinoted-dh-params.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(infinoted_0_5_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT infinoted_0_5-infinoted-dh-params.o -MD -MP -MF $(DEPDIR)/infinoted_0_5-infinoted-dh-params.Tpo -c -o infinoted_0_5-infinoted-dh-params.o `test -f 'infinoted-dh-params.c' || echo '$(srcdir)/'`infinoted-dh-params.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/infinoted_0_5-infinoted-dh-params.Tpo $(DEPDIR)/infinoted_0_5-infinoted-dh-params.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='infinoted-dh-params.c' object='infinoted_0_5-infinoted-dh-params.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(infinoted_0_5_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o infinoted_0_5-infinoted-dh-params.o `test -f 'infinoted-dh-params.c' || echo '$(srcdir)/'`infinoted-dh-params.c infinoted_0_5-infinoted-dh-params.obj: infinoted-dh-params.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(infinoted_0_5_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT infinoted_0_5-infinoted-dh-params.obj -MD -MP -MF $(DEPDIR)/infinoted_0_5-infinoted-dh-params.Tpo -c -o infinoted_0_5-infinoted-dh-params.obj `if test -f 'infinoted-dh-params.c'; then $(CYGPATH_W) 'infinoted-dh-params.c'; else $(CYGPATH_W) '$(srcdir)/infinoted-dh-params.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/infinoted_0_5-infinoted-dh-params.Tpo $(DEPDIR)/infinoted_0_5-infinoted-dh-params.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='infinoted-dh-params.c' object='infinoted_0_5-infinoted-dh-params.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(infinoted_0_5_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o infinoted_0_5-infinoted-dh-params.obj `if test -f 'infinoted-dh-params.c'; then $(CYGPATH_W) 'infinoted-dh-params.c'; else $(CYGPATH_W) '$(srcdir)/infinoted-dh-params.c'; fi` infinoted_0_5-infinoted-directory-sync.o: infinoted-directory-sync.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(infinoted_0_5_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT infinoted_0_5-infinoted-directory-sync.o -MD -MP -MF $(DEPDIR)/infinoted_0_5-infinoted-directory-sync.Tpo -c -o infinoted_0_5-infinoted-directory-sync.o `test -f 'infinoted-directory-sync.c' || echo '$(srcdir)/'`infinoted-directory-sync.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/infinoted_0_5-infinoted-directory-sync.Tpo $(DEPDIR)/infinoted_0_5-infinoted-directory-sync.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='infinoted-directory-sync.c' object='infinoted_0_5-infinoted-directory-sync.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(infinoted_0_5_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o infinoted_0_5-infinoted-directory-sync.o `test -f 'infinoted-directory-sync.c' || echo '$(srcdir)/'`infinoted-directory-sync.c infinoted_0_5-infinoted-directory-sync.obj: infinoted-directory-sync.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(infinoted_0_5_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT infinoted_0_5-infinoted-directory-sync.obj -MD -MP -MF $(DEPDIR)/infinoted_0_5-infinoted-directory-sync.Tpo -c -o infinoted_0_5-infinoted-directory-sync.obj `if test -f 'infinoted-directory-sync.c'; then $(CYGPATH_W) 'infinoted-directory-sync.c'; else $(CYGPATH_W) '$(srcdir)/infinoted-directory-sync.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/infinoted_0_5-infinoted-directory-sync.Tpo $(DEPDIR)/infinoted_0_5-infinoted-directory-sync.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='infinoted-directory-sync.c' object='infinoted_0_5-infinoted-directory-sync.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(infinoted_0_5_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o infinoted_0_5-infinoted-directory-sync.obj `if test -f 'infinoted-directory-sync.c'; then $(CYGPATH_W) 'infinoted-directory-sync.c'; else $(CYGPATH_W) '$(srcdir)/infinoted-directory-sync.c'; fi` infinoted_0_5-infinoted-main.o: infinoted-main.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(infinoted_0_5_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT infinoted_0_5-infinoted-main.o -MD -MP -MF $(DEPDIR)/infinoted_0_5-infinoted-main.Tpo -c -o infinoted_0_5-infinoted-main.o `test -f 'infinoted-main.c' || echo '$(srcdir)/'`infinoted-main.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/infinoted_0_5-infinoted-main.Tpo $(DEPDIR)/infinoted_0_5-infinoted-main.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='infinoted-main.c' object='infinoted_0_5-infinoted-main.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(infinoted_0_5_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o infinoted_0_5-infinoted-main.o `test -f 'infinoted-main.c' || echo '$(srcdir)/'`infinoted-main.c infinoted_0_5-infinoted-main.obj: infinoted-main.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(infinoted_0_5_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT infinoted_0_5-infinoted-main.obj -MD -MP -MF $(DEPDIR)/infinoted_0_5-infinoted-main.Tpo -c -o infinoted_0_5-infinoted-main.obj `if test -f 'infinoted-main.c'; then $(CYGPATH_W) 'infinoted-main.c'; else $(CYGPATH_W) '$(srcdir)/infinoted-main.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/infinoted_0_5-infinoted-main.Tpo $(DEPDIR)/infinoted_0_5-infinoted-main.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='infinoted-main.c' object='infinoted_0_5-infinoted-main.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(infinoted_0_5_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o infinoted_0_5-infinoted-main.obj `if test -f 'infinoted-main.c'; then $(CYGPATH_W) 'infinoted-main.c'; else $(CYGPATH_W) '$(srcdir)/infinoted-main.c'; fi` infinoted_0_5-infinoted-note-plugin.o: infinoted-note-plugin.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(infinoted_0_5_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT infinoted_0_5-infinoted-note-plugin.o -MD -MP -MF $(DEPDIR)/infinoted_0_5-infinoted-note-plugin.Tpo -c -o infinoted_0_5-infinoted-note-plugin.o `test -f 'infinoted-note-plugin.c' || echo '$(srcdir)/'`infinoted-note-plugin.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/infinoted_0_5-infinoted-note-plugin.Tpo $(DEPDIR)/infinoted_0_5-infinoted-note-plugin.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='infinoted-note-plugin.c' object='infinoted_0_5-infinoted-note-plugin.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(infinoted_0_5_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o infinoted_0_5-infinoted-note-plugin.o `test -f 'infinoted-note-plugin.c' || echo '$(srcdir)/'`infinoted-note-plugin.c infinoted_0_5-infinoted-note-plugin.obj: infinoted-note-plugin.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(infinoted_0_5_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT infinoted_0_5-infinoted-note-plugin.obj -MD -MP -MF $(DEPDIR)/infinoted_0_5-infinoted-note-plugin.Tpo -c -o infinoted_0_5-infinoted-note-plugin.obj `if test -f 'infinoted-note-plugin.c'; then $(CYGPATH_W) 'infinoted-note-plugin.c'; else $(CYGPATH_W) '$(srcdir)/infinoted-note-plugin.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/infinoted_0_5-infinoted-note-plugin.Tpo $(DEPDIR)/infinoted_0_5-infinoted-note-plugin.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='infinoted-note-plugin.c' object='infinoted_0_5-infinoted-note-plugin.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(infinoted_0_5_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o infinoted_0_5-infinoted-note-plugin.obj `if test -f 'infinoted-note-plugin.c'; then $(CYGPATH_W) 'infinoted-note-plugin.c'; else $(CYGPATH_W) '$(srcdir)/infinoted-note-plugin.c'; fi` infinoted_0_5-infinoted-options.o: infinoted-options.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(infinoted_0_5_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT infinoted_0_5-infinoted-options.o -MD -MP -MF $(DEPDIR)/infinoted_0_5-infinoted-options.Tpo -c -o infinoted_0_5-infinoted-options.o `test -f 'infinoted-options.c' || echo '$(srcdir)/'`infinoted-options.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/infinoted_0_5-infinoted-options.Tpo $(DEPDIR)/infinoted_0_5-infinoted-options.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='infinoted-options.c' object='infinoted_0_5-infinoted-options.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(infinoted_0_5_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o infinoted_0_5-infinoted-options.o `test -f 'infinoted-options.c' || echo '$(srcdir)/'`infinoted-options.c infinoted_0_5-infinoted-options.obj: infinoted-options.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(infinoted_0_5_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT infinoted_0_5-infinoted-options.obj -MD -MP -MF $(DEPDIR)/infinoted_0_5-infinoted-options.Tpo -c -o infinoted_0_5-infinoted-options.obj `if test -f 'infinoted-options.c'; then $(CYGPATH_W) 'infinoted-options.c'; else $(CYGPATH_W) '$(srcdir)/infinoted-options.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/infinoted_0_5-infinoted-options.Tpo $(DEPDIR)/infinoted_0_5-infinoted-options.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='infinoted-options.c' object='infinoted_0_5-infinoted-options.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(infinoted_0_5_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o infinoted_0_5-infinoted-options.obj `if test -f 'infinoted-options.c'; then $(CYGPATH_W) 'infinoted-options.c'; else $(CYGPATH_W) '$(srcdir)/infinoted-options.c'; fi` infinoted_0_5-infinoted-pam.o: infinoted-pam.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(infinoted_0_5_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT infinoted_0_5-infinoted-pam.o -MD -MP -MF $(DEPDIR)/infinoted_0_5-infinoted-pam.Tpo -c -o infinoted_0_5-infinoted-pam.o `test -f 'infinoted-pam.c' || echo '$(srcdir)/'`infinoted-pam.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/infinoted_0_5-infinoted-pam.Tpo $(DEPDIR)/infinoted_0_5-infinoted-pam.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='infinoted-pam.c' object='infinoted_0_5-infinoted-pam.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(infinoted_0_5_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o infinoted_0_5-infinoted-pam.o `test -f 'infinoted-pam.c' || echo '$(srcdir)/'`infinoted-pam.c infinoted_0_5-infinoted-pam.obj: infinoted-pam.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(infinoted_0_5_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT infinoted_0_5-infinoted-pam.obj -MD -MP -MF $(DEPDIR)/infinoted_0_5-infinoted-pam.Tpo -c -o infinoted_0_5-infinoted-pam.obj `if test -f 'infinoted-pam.c'; then $(CYGPATH_W) 'infinoted-pam.c'; else $(CYGPATH_W) '$(srcdir)/infinoted-pam.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/infinoted_0_5-infinoted-pam.Tpo $(DEPDIR)/infinoted_0_5-infinoted-pam.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='infinoted-pam.c' object='infinoted_0_5-infinoted-pam.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(infinoted_0_5_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o infinoted_0_5-infinoted-pam.obj `if test -f 'infinoted-pam.c'; then $(CYGPATH_W) 'infinoted-pam.c'; else $(CYGPATH_W) '$(srcdir)/infinoted-pam.c'; fi` infinoted_0_5-infinoted-record.o: infinoted-record.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(infinoted_0_5_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT infinoted_0_5-infinoted-record.o -MD -MP -MF $(DEPDIR)/infinoted_0_5-infinoted-record.Tpo -c -o infinoted_0_5-infinoted-record.o `test -f 'infinoted-record.c' || echo '$(srcdir)/'`infinoted-record.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/infinoted_0_5-infinoted-record.Tpo $(DEPDIR)/infinoted_0_5-infinoted-record.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='infinoted-record.c' object='infinoted_0_5-infinoted-record.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(infinoted_0_5_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o infinoted_0_5-infinoted-record.o `test -f 'infinoted-record.c' || echo '$(srcdir)/'`infinoted-record.c infinoted_0_5-infinoted-record.obj: infinoted-record.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(infinoted_0_5_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT infinoted_0_5-infinoted-record.obj -MD -MP -MF $(DEPDIR)/infinoted_0_5-infinoted-record.Tpo -c -o infinoted_0_5-infinoted-record.obj `if test -f 'infinoted-record.c'; then $(CYGPATH_W) 'infinoted-record.c'; else $(CYGPATH_W) '$(srcdir)/infinoted-record.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/infinoted_0_5-infinoted-record.Tpo $(DEPDIR)/infinoted_0_5-infinoted-record.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='infinoted-record.c' object='infinoted_0_5-infinoted-record.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(infinoted_0_5_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o infinoted_0_5-infinoted-record.obj `if test -f 'infinoted-record.c'; then $(CYGPATH_W) 'infinoted-record.c'; else $(CYGPATH_W) '$(srcdir)/infinoted-record.c'; fi` infinoted_0_5-infinoted-run.o: infinoted-run.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(infinoted_0_5_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT infinoted_0_5-infinoted-run.o -MD -MP -MF $(DEPDIR)/infinoted_0_5-infinoted-run.Tpo -c -o infinoted_0_5-infinoted-run.o `test -f 'infinoted-run.c' || echo '$(srcdir)/'`infinoted-run.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/infinoted_0_5-infinoted-run.Tpo $(DEPDIR)/infinoted_0_5-infinoted-run.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='infinoted-run.c' object='infinoted_0_5-infinoted-run.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(infinoted_0_5_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o infinoted_0_5-infinoted-run.o `test -f 'infinoted-run.c' || echo '$(srcdir)/'`infinoted-run.c infinoted_0_5-infinoted-run.obj: infinoted-run.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(infinoted_0_5_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT infinoted_0_5-infinoted-run.obj -MD -MP -MF $(DEPDIR)/infinoted_0_5-infinoted-run.Tpo -c -o infinoted_0_5-infinoted-run.obj `if test -f 'infinoted-run.c'; then $(CYGPATH_W) 'infinoted-run.c'; else $(CYGPATH_W) '$(srcdir)/infinoted-run.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/infinoted_0_5-infinoted-run.Tpo $(DEPDIR)/infinoted_0_5-infinoted-run.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='infinoted-run.c' object='infinoted_0_5-infinoted-run.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(infinoted_0_5_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o infinoted_0_5-infinoted-run.obj `if test -f 'infinoted-run.c'; then $(CYGPATH_W) 'infinoted-run.c'; else $(CYGPATH_W) '$(srcdir)/infinoted-run.c'; fi` infinoted_0_5-infinoted-signal.o: infinoted-signal.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(infinoted_0_5_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT infinoted_0_5-infinoted-signal.o -MD -MP -MF $(DEPDIR)/infinoted_0_5-infinoted-signal.Tpo -c -o infinoted_0_5-infinoted-signal.o `test -f 'infinoted-signal.c' || echo '$(srcdir)/'`infinoted-signal.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/infinoted_0_5-infinoted-signal.Tpo $(DEPDIR)/infinoted_0_5-infinoted-signal.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='infinoted-signal.c' object='infinoted_0_5-infinoted-signal.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(infinoted_0_5_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o infinoted_0_5-infinoted-signal.o `test -f 'infinoted-signal.c' || echo '$(srcdir)/'`infinoted-signal.c infinoted_0_5-infinoted-signal.obj: infinoted-signal.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(infinoted_0_5_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT infinoted_0_5-infinoted-signal.obj -MD -MP -MF $(DEPDIR)/infinoted_0_5-infinoted-signal.Tpo -c -o infinoted_0_5-infinoted-signal.obj `if test -f 'infinoted-signal.c'; then $(CYGPATH_W) 'infinoted-signal.c'; else $(CYGPATH_W) '$(srcdir)/infinoted-signal.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/infinoted_0_5-infinoted-signal.Tpo $(DEPDIR)/infinoted_0_5-infinoted-signal.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='infinoted-signal.c' object='infinoted_0_5-infinoted-signal.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(infinoted_0_5_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o infinoted_0_5-infinoted-signal.obj `if test -f 'infinoted-signal.c'; then $(CYGPATH_W) 'infinoted-signal.c'; else $(CYGPATH_W) '$(srcdir)/infinoted-signal.c'; fi` infinoted_0_5-infinoted-startup.o: infinoted-startup.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(infinoted_0_5_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT infinoted_0_5-infinoted-startup.o -MD -MP -MF $(DEPDIR)/infinoted_0_5-infinoted-startup.Tpo -c -o infinoted_0_5-infinoted-startup.o `test -f 'infinoted-startup.c' || echo '$(srcdir)/'`infinoted-startup.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/infinoted_0_5-infinoted-startup.Tpo $(DEPDIR)/infinoted_0_5-infinoted-startup.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='infinoted-startup.c' object='infinoted_0_5-infinoted-startup.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(infinoted_0_5_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o infinoted_0_5-infinoted-startup.o `test -f 'infinoted-startup.c' || echo '$(srcdir)/'`infinoted-startup.c infinoted_0_5-infinoted-startup.obj: infinoted-startup.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(infinoted_0_5_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT infinoted_0_5-infinoted-startup.obj -MD -MP -MF $(DEPDIR)/infinoted_0_5-infinoted-startup.Tpo -c -o infinoted_0_5-infinoted-startup.obj `if test -f 'infinoted-startup.c'; then $(CYGPATH_W) 'infinoted-startup.c'; else $(CYGPATH_W) '$(srcdir)/infinoted-startup.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/infinoted_0_5-infinoted-startup.Tpo $(DEPDIR)/infinoted_0_5-infinoted-startup.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='infinoted-startup.c' object='infinoted_0_5-infinoted-startup.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(infinoted_0_5_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o infinoted_0_5-infinoted-startup.obj `if test -f 'infinoted-startup.c'; then $(CYGPATH_W) 'infinoted-startup.c'; else $(CYGPATH_W) '$(srcdir)/infinoted-startup.c'; fi` infinoted_0_5-infinoted-util.o: infinoted-util.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(infinoted_0_5_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT infinoted_0_5-infinoted-util.o -MD -MP -MF $(DEPDIR)/infinoted_0_5-infinoted-util.Tpo -c -o infinoted_0_5-infinoted-util.o `test -f 'infinoted-util.c' || echo '$(srcdir)/'`infinoted-util.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/infinoted_0_5-infinoted-util.Tpo $(DEPDIR)/infinoted_0_5-infinoted-util.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='infinoted-util.c' object='infinoted_0_5-infinoted-util.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(infinoted_0_5_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o infinoted_0_5-infinoted-util.o `test -f 'infinoted-util.c' || echo '$(srcdir)/'`infinoted-util.c infinoted_0_5-infinoted-util.obj: infinoted-util.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(infinoted_0_5_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT infinoted_0_5-infinoted-util.obj -MD -MP -MF $(DEPDIR)/infinoted_0_5-infinoted-util.Tpo -c -o infinoted_0_5-infinoted-util.obj `if test -f 'infinoted-util.c'; then $(CYGPATH_W) 'infinoted-util.c'; else $(CYGPATH_W) '$(srcdir)/infinoted-util.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/infinoted_0_5-infinoted-util.Tpo $(DEPDIR)/infinoted_0_5-infinoted-util.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='infinoted-util.c' object='infinoted_0_5-infinoted-util.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(infinoted_0_5_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o infinoted_0_5-infinoted-util.obj `if test -f 'infinoted-util.c'; then $(CYGPATH_W) 'infinoted-util.c'; else $(CYGPATH_W) '$(srcdir)/infinoted-util.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man1: $(dist_man1_MANS) @$(NORMAL_INSTALL) @list1='$(dist_man1_MANS)'; \ list2=''; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | 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='$(dist_man1_MANS)'; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) install-pidfileDATA: $(pidfile_DATA) @$(NORMAL_INSTALL) @list='$(pidfile_DATA)'; test -n "$(pidfiledir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pidfiledir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pidfiledir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pidfiledir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pidfiledir)" || exit $$?; \ done uninstall-pidfileDATA: @$(NORMAL_UNINSTALL) @list='$(pidfile_DATA)'; test -n "$(pidfiledir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pidfiledir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(PROGRAMS) $(MANS) $(DATA) $(HEADERS) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(pidfiledir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-man install-pidfileDATA install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-man1 install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-man \ uninstall-pidfileDATA uninstall-man: uninstall-man1 .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-binPROGRAMS clean-generic clean-libtool \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-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-pidfileDATA \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-binPROGRAMS \ uninstall-man uninstall-man1 uninstall-pidfileDATA # 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: libinfinity-0.5.5/infinoted/infinoted-startup.h0000644000175000017500000000311112264763732016601 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INFINOTED_STARTUP_H__ #define __INFINOTED_STARTUP_H__ #include #include #include G_BEGIN_DECLS typedef struct _InfinotedStartup InfinotedStartup; struct _InfinotedStartup { InfinotedOptions* options; gnutls_x509_privkey_t private_key; gnutls_x509_crt_t* certificates; guint n_certificates; InfCertificateCredentials* credentials; InfSaslContext* sasl_context; }; InfinotedStartup* infinoted_startup_new(int* argc, char*** argv, GError** error); void infinoted_startup_free(InfinotedStartup* startup); G_END_DECLS #endif /* __INFINOTED_STARTUP_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/infinoted/infinoted-dh-params.c0000644000175000017500000000572212264763732016760 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include #include #include #include /** * infinoted_dh_params_ensure: * @credentials: A #InfCertificateCredentials. * @dh_params: A pointer to a gnutils_dh_params_t structure. * @error: Location to store error information, if any. * * Ensures that DH parameters are set in the certificate credentials. If * *@dh_params is non-%NULL, then this simply sets *@dh_params in * @credentials. Otherwise it tries to read the server's cached DH params * from disk. If successful, it sets them in @credentials and stores them in * *@dh_params. If not, then it generates new DH params, writes them to the * disk cache and sets them into *@dh_params. If generation fails, the * function returns %FALSE and @error is set. * * Returns: %TRUE on success or %FALSE on error. */ gboolean infinoted_dh_params_ensure(InfCertificateCredentials* credentials, gnutls_dh_params_t* dh_params, GError** error) { gnutls_certificate_credentials_t creds; gchar* filename; struct stat st; creds = inf_certificate_credentials_get(credentials); if(*dh_params != NULL) { gnutls_certificate_set_dh_params(creds, *dh_params); return TRUE; } filename = g_build_filename(g_get_home_dir(), ".infinoted", "dh.pem", NULL); if(g_stat(filename, &st) == 0) { /* DH params expire every week */ /*if(st.st_mtime + 60 * 60 * 24 * 7 > time(NULL))*/ *dh_params = infinoted_creds_read_dh_params(filename, NULL); } if(*dh_params == NULL) { infinoted_util_create_dirname(filename, NULL); infinoted_util_log_info( _("Generating 2048 bit Diffie-Hellman parameters...")); *dh_params = infinoted_creds_create_dh_params(error); if(*dh_params == NULL) { g_free(filename); return FALSE; } infinoted_creds_write_dh_params(*dh_params, filename, NULL); } g_free(filename); gnutls_certificate_set_dh_params(creds, *dh_params); return TRUE; } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/infinoted/infinoted-util.h0000644000175000017500000000332212264763732016060 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INFINOTED_UTIL_H__ #define __INFINOTED_UTIL_H__ #include #include G_BEGIN_DECLS gboolean infinoted_util_create_dirname(const gchar* path, GError** error); /* TODO: Move this to infinoted-log.[hc] */ void infinoted_util_log_error(const char* fmt, ...); void infinoted_util_log_warning(const char* fmt, ...); void infinoted_util_log_info(const char* fmt, ...); void infinoted_util_set_errno_error(GError** error, int save_errno, const char* prefix); #ifdef LIBINFINITY_HAVE_LIBDAEMON void infinoted_util_daemon_set_global_pid_file_proc(void); void infinoted_util_daemon_set_local_pid_file_proc(void); int infinoted_util_daemon_pid_file_kill(int sig); #endif G_END_DECLS #endif /* __INFINOTED_UTIL_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/infinoted/infinoted-pam.h0000644000175000017500000000307712264763732015667 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INFINOTED_PAM_H__ #define __INFINOTED_PAM_H__ #include #ifdef LIBINFINITY_HAVE_PAM #include #include #include #include G_BEGIN_DECLS gboolean infinoted_pam_user_is_allowed(InfinotedOptions* options, const gchar* username, GError** error); gboolean infinoted_pam_authenticate(const char* service, const char* username, const char* password); G_END_DECLS #endif /* LIBINFINITY_HAVE_PAM */ #endif /* __INFINOTED_PAM_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/infinoted/infinoted-autosave.c0000644000175000017500000002626212264763732016735 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ /* TODO: Make a GObject out of this, and move it into libinfinity */ #include #include #include typedef struct _InfinotedAutosaveSession InfinotedAutosaveSession; struct _InfinotedAutosaveSession { InfinotedAutosave* autosave; InfdDirectoryIter iter; InfdSessionProxy* proxy; InfIoTimeout* timeout; }; static InfinotedAutosaveSession* infinoted_autosave_find_session(InfinotedAutosave* autosave, InfdDirectoryIter* iter) { GSList* item; InfinotedAutosaveSession* session; for(item = autosave->sessions; item != NULL; item = g_slist_next(item)) { session = (InfinotedAutosaveSession*)item->data; /* TODO: Add a infd_directory_iter_compare() method in libinfinity */ if(session->iter.node == iter->node && session->iter.node_id == iter->node_id) { return session; } } return NULL; } /* Required by infinoted_autosave_session_start */ static void infinoted_autosave_session_timeout_cb(gpointer user_data); static void infinoted_autosave_session_start(InfinotedAutosave* autosave, InfinotedAutosaveSession* session) { InfIo* io; io = infd_directory_get_io(autosave->directory); g_assert(session->timeout == NULL); session->timeout = inf_io_add_timeout( io, autosave->autosave_interval * 1000, infinoted_autosave_session_timeout_cb, session, NULL ); } static void infinoted_autosave_session_stop(InfinotedAutosave* autosave, InfinotedAutosaveSession* session) { InfIo* io; io = infd_directory_get_io(autosave->directory); g_assert(session->timeout != NULL); inf_io_remove_timeout(io, session->timeout); session->timeout = NULL; } static void infinoted_autosave_buffer_notify_modified_cb(GObject* object, GParamSpec* pspec, gpointer user_data) { InfinotedAutosaveSession* session; InfBuffer* buffer; session = (InfinotedAutosaveSession*)user_data; buffer = inf_session_get_buffer( infd_session_proxy_get_session(session->proxy) ); if(inf_buffer_get_modified(buffer) == TRUE) { if(session->timeout == NULL) infinoted_autosave_session_start(session->autosave, session); } else { if(session->timeout != NULL) infinoted_autosave_session_stop(session->autosave, session); } } static void infinoted_autosave_session_save(InfinotedAutosave* autosave, InfinotedAutosaveSession* session) { InfdDirectory* directory; InfdDirectoryIter* iter; GError* error; gchar* path; InfBuffer* buffer; directory = autosave->directory; iter = &session->iter; error = NULL; if(session->timeout != NULL) { inf_io_remove_timeout( infd_directory_get_io(directory), session->timeout ); session->timeout = NULL; } buffer = inf_session_get_buffer( infd_session_proxy_get_session(session->proxy) ); inf_signal_handlers_block_by_func( G_OBJECT(buffer), G_CALLBACK(infinoted_autosave_buffer_notify_modified_cb), session ); if(infd_directory_iter_save_session(directory, iter, &error) == FALSE) { path = infd_directory_iter_get_path(directory, iter); g_warning( _("Failed to auto-save session \"%s\": %s\n\n" "Will retry in %u seconds."), path, error->message, session->autosave->autosave_interval ); g_free(path); g_error_free(error); infinoted_autosave_session_start(session->autosave, session); } else { /* TODO: Remove this as soon as directory itself unsets modified flag * on session_write */ inf_buffer_set_modified(INF_BUFFER(buffer), FALSE); } inf_signal_handlers_unblock_by_func( G_OBJECT(buffer), G_CALLBACK(infinoted_autosave_buffer_notify_modified_cb), session ); } static void infinoted_autosave_session_timeout_cb(gpointer user_data) { InfinotedAutosaveSession* session; session = (InfinotedAutosaveSession*)user_data; session->timeout = NULL; infinoted_autosave_session_save(session->autosave, session); } static void infinoted_autosave_add_session(InfinotedAutosave* autosave, InfdDirectoryIter* iter) { InfinotedAutosaveSession* session; InfdSessionProxy* proxy; InfBuffer* buffer; g_assert(infinoted_autosave_find_session(autosave, iter) == NULL); session = g_slice_new(InfinotedAutosaveSession); session->autosave = autosave; session->iter = *iter; proxy = infd_directory_iter_peek_session(autosave->directory, iter); g_assert(proxy != NULL); session->proxy = proxy; session->timeout = NULL; autosave->sessions = g_slist_prepend(autosave->sessions, session); buffer = inf_session_get_buffer(infd_session_proxy_get_session(proxy)); g_signal_connect( G_OBJECT(buffer), "notify::modified", G_CALLBACK(infinoted_autosave_buffer_notify_modified_cb), session ); if(inf_buffer_get_modified(buffer) == TRUE) { infinoted_autosave_session_start(autosave, session); } } static void infinoted_autosave_remove_session(InfinotedAutosave* autosave, InfinotedAutosaveSession* session) { InfBuffer* buffer; /* Cancel autosave timeout even if session is modified. If the directory * removed the session, then it has already saved it anyway. */ if(session->timeout != NULL) infinoted_autosave_session_stop(autosave, session); buffer = inf_session_get_buffer(infd_session_proxy_get_session(session->proxy)); inf_signal_handlers_disconnect_by_func( G_OBJECT(buffer), G_CALLBACK(infinoted_autosave_buffer_notify_modified_cb), session ); autosave->sessions = g_slist_remove(autosave->sessions, session); g_slice_free(InfinotedAutosaveSession, session); } static void infinoted_autosave_directory_add_session_cb(InfdDirectory* directory, InfdDirectoryIter* iter, InfdSessionProxy* proxy, gpointer user_data) { InfinotedAutosave* autosave; autosave = (InfinotedAutosave*)user_data; infinoted_autosave_add_session(autosave, iter); } static void infinoted_autosave_directory_remove_session_cb(InfdDirectory* directory, InfdDirectoryIter* iter, InfdSessionProxy* proxy, gpointer user_data) { InfinotedAutosave* autosave; InfinotedAutosaveSession* session; autosave = (InfinotedAutosave*)user_data; session = infinoted_autosave_find_session(autosave, iter); g_assert(session != NULL && session->proxy == proxy); infinoted_autosave_remove_session(autosave, session); } static void infinoted_autosave_walk_directory(InfinotedAutosave* autosave, InfdDirectoryIter* iter) { InfdDirectoryIter child; InfdSessionProxy* session; if(infd_directory_iter_get_node_type(autosave->directory, iter) == INFD_STORAGE_NODE_SUBDIRECTORY) { if(infd_directory_iter_get_explored(autosave->directory, iter) == TRUE) { /* Errors can't happen as the directory is already explored */ child = *iter; if(infd_directory_iter_get_child(autosave->directory, &child, NULL)) { do { infinoted_autosave_walk_directory(autosave, &child); } while(infd_directory_iter_get_next(autosave->directory, &child)); } } } else { session = infd_directory_iter_peek_session(autosave->directory, iter); if(session != NULL) infinoted_autosave_add_session(autosave, iter); } } /** * infinoted_autosave_new: * @directory: A #InfdDirectory. * @autosave_interval: The interval in which to save documents in @directory, * in seconds. * * Creates a new #InfinotedAutosave object which will save all documents * in @directory every @autosave_interval seconds into the directory's * background storage. * * Returns: A new #InfinotedAutosave. */ InfinotedAutosave* infinoted_autosave_new(InfdDirectory* directory, unsigned int autosave_interval) { InfinotedAutosave* autosave; InfdDirectoryIter iter; autosave = g_slice_new(InfinotedAutosave); autosave->directory = directory; autosave->autosave_interval = autosave_interval; autosave->sessions = NULL; g_object_ref(directory); g_signal_connect_after( G_OBJECT(directory), "add-session", G_CALLBACK(infinoted_autosave_directory_add_session_cb), autosave ); g_signal_connect_after( G_OBJECT(directory), "remove-session", G_CALLBACK(infinoted_autosave_directory_remove_session_cb), autosave ); infd_directory_iter_get_root(directory, &iter); infinoted_autosave_walk_directory(autosave, &iter); return autosave; } /** * infinoted_autosave_free: * @autosave: A #InfinotedAutosave. * * Frees the given #InfinotedAutosave. This function does not save changes * that don't have been saved yet (the InfdDirectory will do so when it is * freed). Use infinoted_autosave_save_immediately() before freeing the * #InfinotedAutosave if you want it to save everything. */ void infinoted_autosave_free(InfinotedAutosave* autosave) { inf_signal_handlers_disconnect_by_func( G_OBJECT(autosave->directory), G_CALLBACK(infinoted_autosave_directory_add_session_cb), autosave ); inf_signal_handlers_disconnect_by_func( G_OBJECT(autosave->directory), G_CALLBACK(infinoted_autosave_directory_remove_session_cb), autosave ); while(autosave->sessions != NULL) { infinoted_autosave_remove_session( autosave, (InfinotedAutosaveSession*)autosave->sessions->data ); } g_object_unref(autosave->directory); g_slice_free(InfinotedAutosave, autosave); } /** * infinoted_autosave_save_immediately: * @autosave: A #InfinotedAutosave. * * Saves all changes in all documents immediately, instead of waiting until * the autosave interval has elapsed. */ void infinoted_autosave_save_immediately(InfinotedAutosave* autosave) { GSList* item; InfinotedAutosaveSession* session; for(item = autosave->sessions; item != NULL; item = g_slist_next(item)) { session = (InfinotedAutosaveSession*)item->data; if(session->timeout != NULL) infinoted_autosave_session_save(autosave, session); } } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/infinoted/infinoted-options.c0000644000175000017500000006262212264763732016601 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include "config.h" #include #include #include #include #ifdef LIBINFINITY_HAVE_LIBDAEMON # include #endif #include #include #include #include #include static const gchar INFINOTED_OPTIONS_GROUP[] = "infinoted"; /* TODO: Split the functionality to load key files as options into a separate * file. */ /* We abuse the flags of a GOptionEntry to decide whether the option * can be set in the config file in addition to the command line. This has to * be a macro so that we can initialise the GOptionEntries[] with it. */ #define G_OPTION_FLAG_NO_CONFIG_FILE (1 << 31) #if 0 static gchar* infinoted_options_policy_to_string(InfXmppConnectionSecurityPolicy policy) { switch(policy) { case INF_XMPP_CONNECTION_SECURITY_ONLY_UNSECURED: return g_strdup("no-tls"); case INF_XMPP_CONNECTION_SECURITY_ONLY_TLS: return g_strdup("require-tls"); case INF_XMPP_CONNECTION_SECURITY_BOTH_PREFER_UNSECURED: case INF_XMPP_CONNECTION_SECURITY_BOTH_PREFER_TLS: return g_strdup("allow-tls"); default: g_assert_not_reached(); return NULL; } } #endif static gboolean infinoted_options_policy_from_string(const gchar* string, InfXmppConnectionSecurityPolicy* pol, GError** error) { if(strcmp(string, "no-tls") == 0) { *pol = INF_XMPP_CONNECTION_SECURITY_ONLY_UNSECURED; return TRUE; } else if(strcmp(string, "allow-tls") == 0) { *pol = INF_XMPP_CONNECTION_SECURITY_BOTH_PREFER_TLS; return TRUE; } else if(strcmp(string, "require-tls") == 0) { *pol = INF_XMPP_CONNECTION_SECURITY_ONLY_TLS; return TRUE; } else { g_set_error( error, infinoted_options_error_quark(), INFINOTED_OPTIONS_ERROR_INVALID_SECURITY_POLICY, _("\"%s\" is not a valid security policy. Allowed values are " "\"no-tls\", \"allow-tls\" or \"require-tls\""), string ); return FALSE; } } /* TODO: Correct error handling? We only use this at one point where we know * the port is valid anyway. */ static gint infinoted_options_port_to_integer(guint port) { g_assert(port <= 65535); return port; } static gboolean infinoted_options_interval_from_integer(gint value, guint* result, GError** error) { if(value < 0) { g_set_error( error, infinoted_options_error_quark(), INFINOTED_OPTIONS_ERROR_INVALID_AUTOSAVE_INTERVAL, "%s", _("Interval must not be negative") ); return FALSE; } *result = value; return TRUE; } static gboolean infinoted_options_port_from_integer(gint value, guint* port, GError** error) { if(value <= 0 || value > 0xffff) { g_set_error( error, infinoted_options_error_quark(), INFINOTED_OPTIONS_ERROR_INVALID_PORT, _("\"%d\" is not a valid port number. Port numbers range from " "1 to 65535"), value ); return FALSE; } *port = value; return TRUE; } static gboolean infinoted_options_propagate_key_file_error(GError** error, GError* key_file_error) { /* No error, always good */ if(key_file_error == NULL) return TRUE; if(key_file_error->domain == G_KEY_FILE_ERROR && (key_file_error->code == G_KEY_FILE_ERROR_GROUP_NOT_FOUND || key_file_error->code == G_KEY_FILE_ERROR_KEY_NOT_FOUND)) { /* We ignore these errors but just use default values instead */ g_error_free(key_file_error); return TRUE; } else { g_propagate_error(error, key_file_error); return FALSE; } } static gboolean infinoted_options_key_file_get_string(GKeyFile* keyfile, const gchar* keyname, gchar** result, GError** error) { GError* local_error; gchar* ret; local_error = NULL; ret = g_key_file_get_string( keyfile, INFINOTED_OPTIONS_GROUP, keyname, &local_error ); if(local_error == NULL) { g_free(*result); *result = ret; } else { g_free(ret); } return infinoted_options_propagate_key_file_error(error, local_error); } static gboolean infinoted_options_key_file_get_string_list(GKeyFile* keyfile, const gchar* keyname, gchar*** result, GError** error) { GError* local_error; gchar** ret; local_error = NULL; ret = g_key_file_get_string_list( keyfile, INFINOTED_OPTIONS_GROUP, keyname, NULL, &local_error ); if(local_error == NULL) { g_strfreev(*result); *result = ret; } else { g_strfreev(ret); } return infinoted_options_propagate_key_file_error(error, local_error); } static gboolean infinoted_options_key_file_get_integer(GKeyFile* keyfile, const gchar* keyname, gint* result, GError** error) { GError* local_error; gint ret; local_error = NULL; ret = g_key_file_get_integer( keyfile, INFINOTED_OPTIONS_GROUP, keyname, &local_error ); if(local_error == NULL) *result = ret; return infinoted_options_propagate_key_file_error(error, local_error); } static gboolean infinoted_options_key_file_get_boolean(GKeyFile* keyfile, const gchar* keyname, gboolean* result, GError** error) { GError* local_error; gboolean ret; local_error = NULL; ret = g_key_file_get_boolean( keyfile, INFINOTED_OPTIONS_GROUP, keyname, &local_error ); if(local_error == NULL) *result = ret; return infinoted_options_propagate_key_file_error(error, local_error); } static gboolean infinoted_options_load_key_file(const GOptionEntry* entries, GKeyFile* key_file, GError** error) { const GOptionEntry* entry; gboolean result; gchar* string; gchar* filename; gchar** string_list; for(entry = entries; entry->long_name != NULL; ++ entry) { if( (entry->flags & G_OPTION_FLAG_NO_CONFIG_FILE) == 0) { switch(entry->arg) { case G_OPTION_ARG_NONE: result = infinoted_options_key_file_get_boolean( key_file, entry->long_name, entry->arg_data, error ); break; case G_OPTION_ARG_INT: result = infinoted_options_key_file_get_integer( key_file, entry->long_name, entry->arg_data, error ); break; case G_OPTION_ARG_STRING: string = NULL; result = infinoted_options_key_file_get_string( key_file, entry->long_name, &string, error ); if(result == TRUE) { /* Can return TRUE without having string set, for example in case * the key is not set at all, in which case we just don't overwrite * the existing value. */ if(entry->arg_data && string != NULL) { g_free(*(gchar**)entry->arg_data); *(gchar**)entry->arg_data = string; } else { g_free(string); } } break; case G_OPTION_ARG_STRING_ARRAY: string_list = NULL; result = infinoted_options_key_file_get_string_list( key_file, entry->long_name, &string_list, error ); if(result == TRUE) { /* Can return TRUE without having string list set, for example in * case the key is not set at all, in which case we just don't * overwrite the existing value. */ if(entry->arg_data && string_list != NULL) { g_strfreev(*(gchar***)entry->arg_data); *(gchar***)entry->arg_data = string_list; } else { g_strfreev(string_list); } } break; case G_OPTION_ARG_FILENAME: string = NULL; result = infinoted_options_key_file_get_string( key_file, entry->long_name, &string, error ); if(result == TRUE) { /* Can return TRUE without having string set, for example in case * the key is not set at all, in which case we just don't overwrite * the existing value. */ if(entry->arg_data != NULL && string != NULL) { filename = g_filename_from_utf8(string, -1, NULL, NULL, error); if(filename == NULL) { result = FALSE; } else { g_free(*(gchar**)entry->arg_data); *(gchar**)entry->arg_data = filename; } } g_free(string); } break; default: /* Other argtypes are not yet supported to be loaded via keyfiles */ g_assert_not_reached(); break; } if(!result) return FALSE; } } return TRUE; } static gboolean infinoted_options_load_file(const GOptionEntry* entries, const gchar* file, GError** error) { GKeyFile* key_file; GError* local_error; gboolean result; key_file = g_key_file_new(); local_error = NULL; g_key_file_load_from_file(key_file, file, G_KEY_FILE_NONE, &local_error); if(local_error != NULL) { g_key_file_free(key_file); if(local_error->domain == G_FILE_ERROR && local_error->code == G_FILE_ERROR_NOENT) { /* ignore */ g_error_free(local_error); return TRUE; } else { g_propagate_error(error, local_error); return FALSE; } } result = infinoted_options_load_key_file(entries, key_file, error); g_key_file_free(key_file); return result; } static gboolean infinoted_options_validate(InfinotedOptions* options, GError** error) { InfXmppConnectionSecurityPolicy security_policy; gboolean requires_password; security_policy = options->security_policy; #ifdef LIBINFINITY_HAVE_PAM if(options->password != NULL && options->pam_service != NULL) { g_set_error( error, infinoted_options_error_quark(), INFINOTED_OPTIONS_ERROR_INVALID_AUTHENTICATION_SETTINGS, "%s", _("Cannot use both server password and system authentication.") ); return FALSE; } if(options->pam_service == NULL && (options->pam_allowed_users != NULL || options->pam_allowed_groups != NULL)) { g_set_error( error, infinoted_options_error_quark(), INFINOTED_OPTIONS_ERROR_INVALID_AUTHENTICATION_SETTINGS, "%s", _("Need a pam service to authenticate users.") ); return FALSE; } #endif /* LIBINFINITY_HAVE_PAM */ requires_password = options->password != NULL; #ifdef LIBINFINITY_HAVE_PAM requires_password = requires_password || options->pam_service != NULL; #endif /* LIBINFINITY_HAVE_PAM */ if(requires_password && options->security_policy == INF_XMPP_CONNECTION_SECURITY_ONLY_UNSECURED) { infinoted_util_log_warning( _("Requiring password through unencrypted connection.")); } if(options->create_key == TRUE && options->create_certificate == FALSE) { g_set_error( error, infinoted_options_error_quark(), INFINOTED_OPTIONS_ERROR_INVALID_CREATE_OPTIONS, "%s", _("Creating a new private key also requires creating a new certificate " "signed with it.") ); return FALSE; } else if(security_policy != INF_XMPP_CONNECTION_SECURITY_ONLY_UNSECURED && options->key_file == NULL) { g_set_error( error, infinoted_options_error_quark(), INFINOTED_OPTIONS_ERROR_EMPTY_KEY_FILE, "%s", _("No private key file given. If you don't have a suitable key file, " "either create one using the --create-key command line argument, " "or disable TLS by setting the security policy to \"no-tls\".") ); return FALSE; } else if(security_policy != INF_XMPP_CONNECTION_SECURITY_ONLY_UNSECURED && options->certificate_file == NULL) { g_set_error( error, infinoted_options_error_quark(), INFINOTED_OPTIONS_ERROR_EMPTY_CERTIFICATE_FILE, "%s", _("No certificate file given. If you don't have a suitable certificate " "file, either create one using the --create-certificate command line " "agument, or disable TLS via by setting the security policy to " "\"no-tls\".") ); return FALSE; } else if( (options->sync_directory != NULL && options->sync_interval == 0)) { g_set_error( error, infinoted_options_error_quark(), INFINOTED_OPTIONS_ERROR_INVALID_SYNC_COMBINATION, "%s", _("A synchronization directory is given, but synchronization interval " "is not set. Please either set a nonzero synchronization interval " "or unset the synchronization directory using the --sync-directory " "and sync-interval command line or config file options.") ); return FALSE; } else if(options->sync_directory == NULL && options->sync_interval != 0) { g_set_error( error, infinoted_options_error_quark(), INFINOTED_OPTIONS_ERROR_INVALID_SYNC_COMBINATION, "%s", _("A synchronization interval is given, but the synchronization " "directory is not set. Please either set a valid synchronization " "directory, or set the synchronization interval to zero using " "--sync-directory and sync-interval command line or config file " "options.") ); return FALSE; } return TRUE; } static gboolean infinoted_options_load(InfinotedOptions* options, const gchar* const* config_files, int* argc, char*** argv, GError** error) { const gchar* const* file; gchar* security_policy; gint port_number; gboolean display_version; #ifdef LIBINFINITY_HAVE_LIBDAEMON gboolean kill_daemon; #endif gint autosave_interval; gint sync_interval; guint i; gboolean result; GOptionContext *context; gchar* desc; GOptionEntry entries[] = { { "key-file", 'k', 0, G_OPTION_ARG_FILENAME, NULL, N_("The server's private key"), N_("KEY-FILE") }, { "certificate-file", 'c', 0, G_OPTION_ARG_FILENAME, NULL, N_("The server's certificate"), N_("CERTIFICATE-FILE") }, { "certificate-chain", 0, 0, G_OPTION_ARG_FILENAME, NULL, N_("The certificates chain down to the root certificate"), NULL }, { "create-key", 0, G_OPTION_FLAG_NO_CONFIG_FILE, G_OPTION_ARG_NONE, NULL, N_("Creates a new random private key"), NULL }, { "create-certificate", 0, G_OPTION_FLAG_NO_CONFIG_FILE, G_OPTION_ARG_NONE, NULL, N_("Creates a new self-signed certificate using the given key"), NULL }, { "port-number", 'p', 0, G_OPTION_ARG_INT, NULL, N_("The port number to listen on"), N_("PORT") }, { "security-policy", 0, 0, G_OPTION_ARG_STRING, NULL, N_("How to decide whether to use TLS"), "no-tls|allow-tls|require-tls" }, { "root-directory", 'r', 0, G_OPTION_ARG_FILENAME, NULL, N_("The directory to store documents into"), N_("DIRECTORY") }, { "autosave-interval", 0, 0, G_OPTION_ARG_INT, NULL, N_("Interval within which to save documents, in seconds, or 0 to " "disable autosave"), N_("INTERVAL") }, { "password", 'P', 0, G_OPTION_ARG_STRING, NULL, N_("Require given password on connections"), N_("PASSWORD") }, #ifdef LIBINFINITY_HAVE_PAM { "pam-service", 0, 0, G_OPTION_ARG_STRING, NULL, N_("Authenticate clients against given pam service on connection"), N_("SERVICE") }, { "allow-user", 0, 0, G_OPTION_ARG_STRING_ARRAY, NULL, N_("User allowed to connect after pam authentication"), N_("USER") }, { "allow-group", 0, 0, G_OPTION_ARG_STRING_ARRAY, NULL, N_("Group allowed to connect after pam authentication"), N_("GROUP") }, #endif /* LIBINFINITY_HAVE_PAM */ { "sync-directory", 0, 0, G_OPTION_ARG_FILENAME, NULL, N_("A directory into which to periodically store a copy of the " "document tree"), N_("DIRECTORY") }, { "sync-interval", 0, 0, G_OPTION_ARG_INT, NULL, N_("Interval within which to store documents to the specified " "sync-directory, in seconds, or 0 to disable directory " "synchronization"), N_("INTERVAL") }, #ifdef LIBINFINITY_HAVE_LIBDAEMON { "daemonize", 'd', 0, G_OPTION_ARG_NONE, NULL, N_("Daemonize the server"), NULL }, { "kill-daemon", 'D', 0, G_OPTION_ARG_NONE, NULL, N_("Kill a running daemon"), NULL }, #endif { "version", 'v', G_OPTION_FLAG_NO_CONFIG_FILE, G_OPTION_ARG_NONE, NULL, N_("Display version information and exit"), NULL }, { NULL, 0, 0, G_OPTION_ARG_NONE, NULL, NULL, 0 } }; /* C90 does not allow non-compile-time-constant initializers for structs */ i = 0; entries[i++].arg_data = &options->key_file; entries[i++].arg_data = &options->certificate_file; entries[i++].arg_data = &options->certificate_chain_file; entries[i++].arg_data = &options->create_key; entries[i++].arg_data = &options->create_certificate; entries[i++].arg_data = &port_number; entries[i++].arg_data = &security_policy; entries[i++].arg_data = &options->root_directory; entries[i++].arg_data = &autosave_interval; entries[i++].arg_data = &options->password; #ifdef LIBINFINITY_HAVE_PAM entries[i++].arg_data = &options->pam_service; entries[i++].arg_data = &options->pam_allowed_users; entries[i++].arg_data = &options->pam_allowed_groups; #endif /* LIBINFINITY_HAVE_PAM */ entries[i++].arg_data = &options->sync_directory; entries[i++].arg_data = &sync_interval; #ifdef LIBINFINITY_HAVE_LIBDAEMON entries[i++].arg_data = &options->daemonize; entries[i++].arg_data = &kill_daemon; #endif entries[i++].arg_data = &display_version; display_version = FALSE; #ifdef LIBINFINITY_HAVE_LIBDAEMON kill_daemon = FALSE; #endif security_policy = NULL; port_number = infinoted_options_port_to_integer(options->port); autosave_interval = options->autosave_interval; sync_interval = options->sync_interval; if(config_files) { for(file = config_files; *file != NULL; ++ file) { if(infinoted_options_load_file(entries, *file, error) == FALSE) { g_prefix_error(error, "%s: ", *file); g_free(security_policy); return FALSE; } } } if(argc != NULL && argv != NULL) { desc = g_strdup_printf("- %s", _("infinote dedicated server")); context = g_option_context_new(desc); g_free(desc); g_option_context_add_main_entries(context, entries, GETTEXT_PACKAGE); if(g_option_context_parse(context, argc, argv, error) == FALSE) { g_option_context_free(context); g_free(security_policy); return FALSE; } if(display_version) { printf("infinoted %s\n", PACKAGE_VERSION); exit(0); } #ifdef LIBINFINITY_HAVE_LIBDAEMON if(kill_daemon) { g_free(security_policy); infinoted_util_daemon_set_global_pid_file_proc(); if(infinoted_util_daemon_pid_file_kill(SIGTERM) != 0) { infinoted_util_daemon_set_local_pid_file_proc(); if(infinoted_util_daemon_pid_file_kill(SIGTERM) != 0) { infinoted_util_set_errno_error(error, errno, _("Could not kill daemon")); return FALSE; } } exit(0); } #endif g_option_context_free(context); } if(security_policy != NULL) { result = infinoted_options_policy_from_string( security_policy, &options->security_policy, error ); g_free(security_policy); if(!result) return FALSE; } /* TODO: Do we leak security_policy at this point? */ result = infinoted_options_port_from_integer( port_number, &options->port, error ); if(!result) return FALSE; result = infinoted_options_interval_from_integer( autosave_interval, &options->autosave_interval, error ); if(!result) return FALSE; result = infinoted_options_interval_from_integer( sync_interval, &options->sync_interval, error ); if(!result) return FALSE; if(options->password != NULL && strcmp(options->password, "") == 0) { g_free(options->password); options->password = NULL; } #ifdef LIBINFINITY_HAVE_PAM if(options->pam_service != NULL && strcmp(options->pam_service, "") == 0) { g_free(options->pam_service); options->pam_service = NULL; } /* treat it as undefining the option if only one entry, which is empty, * is given */ if(options->pam_allowed_users != NULL && strcmp(options->pam_allowed_users[0], "") == 0 && options->pam_allowed_users[1] == NULL) { g_free(options->pam_allowed_users[0]); g_free(options->pam_allowed_users); } if(options->pam_allowed_groups != NULL && strcmp(options->pam_allowed_groups[0], "") == 0 && options->pam_allowed_groups[1] == NULL) { g_free(options->pam_allowed_groups[0]); g_free(options->pam_allowed_groups); } #endif /* LIBINFINITY_HAVE_PAM */ if(options->sync_directory != NULL && strcmp(options->sync_directory, "") == 0) { g_free(options->sync_directory); options->sync_directory = NULL; } return infinoted_options_validate(options, error); } /** * infinoted_options_new: * @config_files: A %NULL-terminated error of config filenames. * @argc: Pointer to command line argument count, or %NULL. * @argv: Pointer to command line argument vector, or %NULL. * @error: Location to store error information, if any. * * Creates a new #InfinotedOptions structure that contains options infinoted * is supposed to start with. Command line options always overwrite config * file options. * * The config files are loaded in order, which means that config files at the * back of the array overwrite options of config files in front of the array. * Config files are not required to exist. If a given config file does not * exist, it is simply ignored. * * Returns: A new #InfinotedOptions, or %NULL in case of error. * Free with infinoted_options_free(). */ InfinotedOptions* infinoted_options_new(const gchar* const* config_files, int* argc, char*** argv, GError** error) { InfinotedOptions* options; options = g_slice_new(InfinotedOptions); /* Default options */ options->key_file = NULL; options->certificate_file = NULL; options->certificate_chain_file = NULL; options->create_key = FALSE; options->create_certificate = FALSE; options->port = inf_protocol_get_default_port(); options->security_policy = INF_XMPP_CONNECTION_SECURITY_BOTH_PREFER_TLS; options->root_directory = g_build_filename(g_get_home_dir(), ".infinote", NULL); options->autosave_interval = 0; options->password = NULL; #ifdef LIBINFINITY_HAVE_PAM options->pam_service = NULL; options->pam_allowed_users = NULL; options->pam_allowed_groups = NULL; #endif /* LIBINFINITY_HAVE_PAM */ options->sync_directory = NULL; options->sync_interval = 0; #ifdef LIBINFINITY_HAVE_LIBDAEMON options->daemonize = FALSE; #endif if(!infinoted_options_load(options, config_files, argc, argv, error)) { infinoted_options_free(options); return NULL; } return options; } /** * infinoted_options_free: * @options: A #InfinotedOptions. * * Frees @options and clears up all memory allocated by it. */ void infinoted_options_free(InfinotedOptions* options) { g_free(options->key_file); g_free(options->certificate_file); g_free(options->certificate_chain_file); g_free(options->root_directory); g_free(options->password); #ifdef LIBINFINITY_HAVE_PAM g_free(options->pam_service); g_strfreev(options->pam_allowed_users); g_strfreev(options->pam_allowed_groups); #endif g_free(options->sync_directory); g_slice_free(InfinotedOptions, options); } /** * infinoted_options_error_quark: * * Returns the GQuark for errors from the InfinotedOptions module. * * Returns: The error domain for the InfinotedOptions module. */ GQuark infinoted_options_error_quark(void) { return g_quark_from_static_string("INFINOTED_OPTIONS_ERROR"); } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/infinoted/infinoted-0.5.man0000644000175000017500000000501612264763732015733 00000000000000.TH INFINOTED "1" "January 2011" "infinoted 0.5" "User Commands" .SH NAME infinoted \- dedicated server for the infinote protocol (e.g. Gobby) .SH SYNOPSIS .B infinoted\-0.5 .RI [ options ] .SH DESCRIPTION .B infinoted is a dedicated server which allows clients to edit plain text documents and source files collaboratively over a network. Changes to the documents are synchronised instantly to the other clients. .PP This server supports the infinote protocol as implemented by libinfinity. Example clients include Gobby 0.4.9x, Kobby and a special plugin for gedit. It is .B not compatible to the older libobby protocol. .SH OPTIONS .SS "Help Options:" .TP \fB\-h\fR, \fB\-\-help\fR Show help options .SS "Application Options:" .TP \fB\-k\fR, \fB\-\-key\-file\fR=\fIKEY\-FILE\fR The server's private key .TP \fB\-c\fR, \fB\-\-certificate\-file\fR=\fICERTIFICATE\-FILE\fR The server's certificate .TP \fB\-\-certificate\-chain\fR The certificates chain down to the root certificate .TP \fB\-\-create\-key\fR Creates a new random private key .TP \fB\-\-create\-certificate\fR Creates a new self\-signed certificate using the given key .TP \fB\-p\fR, \fB\-\-port\-number\fR=\fIPORT\fR The port number to listen on .TP \fB\-\-security\-policy\fR=\fIno\-tls\fR|allow\-tls|require\-tls How to decide whether to use TLS .TP \fB\-r\fR, \fB\-\-root\-directory\fR=\fIDIRECTORY\fR The directory to store documents into .TP \fB\-\-autosave\-interval\fR=\fIINTERVAL\fR Interval within which to save documents, in seconds, or 0 to disable autosave .TP \fB\-P\fR, \fB\-\-password\fR=\fIPASSWORD\fR Require given password on connections .TP \fB\-P\fR, \fB\-\-pam-service\fR=\fISERVICE\fR Authenticate clients against given pam service on connection .TP \fB\-P\fR, \fB\-\-allow-user\fR=\fIUSERS\fR Users allowed to connect after pam authentication. Separate entries with semicolons. .TP \fB\-P\fR, \fB\-\-allow-group\fR=\fIGROUPS\fR Group allowed to connect after pam authentication. Separate entries with semicolons. .TP \fB\-\-sync\-directory\fR=\fIDIRECTORY\fR A directory into which to periodically store a copy of the document tree .TP \fB\-\-sync\-interval\fR=\fIINTERVAL\fR Interval within which to store documents to the specified sync\-directory, in seconds, or 0 to disable directory synchronization .TP \fB\-d\fR, \fB\-\-daemonize\fR Daemonize the server .TP \fB\-D\fR, \fB\-\-kill\-daemon\fR Kill a running daemon .TP \fB\-v\fR, \fB\-\-version\fR Display version information and exit .SH AUTHOR .B infinoted and .B libinfinity were written by Armin Burgmeier . libinfinity-0.5.5/infinoted/infinoted-signal.h0000644000175000017500000000330312264763732016357 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INFINOTED_SIGNAL_H__ #define __INFINOTED_SIGNAL_H__ #include #include #include #include G_BEGIN_DECLS /* sighandler_t seems not to be defined for some reason */ typedef void(*InfinotedSignalFunc)(int); typedef struct _InfinotedSignal InfinotedSignal; struct _InfinotedSignal { #ifdef LIBINFINITY_HAVE_LIBDAEMON InfinotedRun* run; int signal_fd; InfIoWatch* watch; #else InfinotedSignalFunc previous_sigint_handler; InfinotedSignalFunc previous_sigterm_handler; InfinotedSignalFunc previous_sigquit_handler; InfinotedSignalFunc previous_sighup_handler; #endif }; InfinotedSignal* infinoted_signal_register(InfinotedRun* run); void infinoted_signal_unregister(InfinotedSignal* sig); G_END_DECLS #endif /* __INFINOTED_SIGNAL_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/infinoted/note-plugins/0000755000175000017500000000000012264766267015467 500000000000000libinfinity-0.5.5/infinoted/note-plugins/Makefile.am0000644000175000017500000000001712264763732017433 00000000000000SUBDIRS = text libinfinity-0.5.5/infinoted/note-plugins/text/0000755000175000017500000000000012264766267016453 500000000000000libinfinity-0.5.5/infinoted/note-plugins/text/Makefile.am0000644000175000017500000000121311204026376020403 00000000000000plugin_LTLIBRARIES = libinfd-note-plugin-text.la plugindir = ${libdir}/infinoted-$(LIBINFINITY_API_VERSION)/note-plugins libinfd_note_plugin_text_la_CPPFLAGS = \ -I$(top_srcdir) \ $(infinoted_CFLAGS) \ $(inftext_CFLAGS) \ $(infinity_CFLAGS) libinfd_note_plugin_text_la_LDFLAGS = \ -avoid-version -module -no-undefined libinfd_note_plugin_text_la_LIBADD = \ ${top_builddir}/libinftext/libinftext-$(LIBINFINITY_API_VERSION).la \ ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ $(infinoted_LIBS) \ $(inftext_LIBS) \ $(infinity_LIBS) libinfd_note_plugin_text_la_SOURCES = \ infd-note-plugin-text.c noinst_HEADERS = libinfinity-0.5.5/infinoted/note-plugins/text/Makefile.in0000644000175000017500000005712312264766065020444 00000000000000# Makefile.in generated by automake 1.13.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = infinoted/note-plugins/text DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/mkinstalldirs $(top_srcdir)/depcomp \ $(noinst_HEADERS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/libinfinity/inf-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(plugindir)" LTLIBRARIES = $(plugin_LTLIBRARIES) am__DEPENDENCIES_1 = libinfd_note_plugin_text_la_DEPENDENCIES = ${top_builddir}/libinftext/libinftext-$(LIBINFINITY_API_VERSION).la \ ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) am_libinfd_note_plugin_text_la_OBJECTS = \ libinfd_note_plugin_text_la-infd-note-plugin-text.lo libinfd_note_plugin_text_la_OBJECTS = \ $(am_libinfd_note_plugin_text_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libinfd_note_plugin_text_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(libinfd_note_plugin_text_la_LDFLAGS) \ $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -I$(top_builddir)/libinfinity 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) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libinfd_note_plugin_text_la_SOURCES) DIST_SOURCES = $(libinfd_note_plugin_text_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBINFINITY_API_VERSION = @LIBINFINITY_API_VERSION@ LIBINFINITY_LIBTOOL_VERSION = @LIBINFINITY_LIBTOOL_VERSION@ LIBINFINITY_VERSION = @LIBINFINITY_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ avahi_CFLAGS = @avahi_CFLAGS@ avahi_LIBS = @avahi_LIBS@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gtk_requirement = @gtk_requirement@ gtk_version = @gtk_version@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infgtk_CFLAGS = @infgtk_CFLAGS@ infgtk_LIBS = @infgtk_LIBS@ infinity_CFLAGS = @infinity_CFLAGS@ infinity_LIBS = @infinity_LIBS@ infinoted_CFLAGS = @infinoted_CFLAGS@ infinoted_LIBS = @infinoted_LIBS@ infodir = @infodir@ inftext_CFLAGS = @inftext_CFLAGS@ inftext_LIBS = @inftext_LIBS@ inftextgtk_CFLAGS = @inftextgtk_CFLAGS@ inftextgtk_LIBS = @inftextgtk_LIBS@ install_sh = @install_sh@ libdaemon_CFLAGS = @libdaemon_CFLAGS@ libdaemon_LIBS = @libdaemon_LIBS@ 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@ plugin_LTLIBRARIES = libinfd-note-plugin-text.la plugindir = ${libdir}/infinoted-$(LIBINFINITY_API_VERSION)/note-plugins libinfd_note_plugin_text_la_CPPFLAGS = \ -I$(top_srcdir) \ $(infinoted_CFLAGS) \ $(inftext_CFLAGS) \ $(infinity_CFLAGS) libinfd_note_plugin_text_la_LDFLAGS = \ -avoid-version -module -no-undefined libinfd_note_plugin_text_la_LIBADD = \ ${top_builddir}/libinftext/libinftext-$(LIBINFINITY_API_VERSION).la \ ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ $(infinoted_LIBS) \ $(inftext_LIBS) \ $(infinity_LIBS) libinfd_note_plugin_text_la_SOURCES = \ infd-note-plugin-text.c noinst_HEADERS = all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu infinoted/note-plugins/text/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu infinoted/note-plugins/text/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-pluginLTLIBRARIES: $(plugin_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(plugin_LTLIBRARIES)'; test -n "$(plugindir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(plugindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(plugindir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(plugindir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(plugindir)"; \ } uninstall-pluginLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(plugin_LTLIBRARIES)'; test -n "$(plugindir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(plugindir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(plugindir)/$$f"; \ done clean-pluginLTLIBRARIES: -test -z "$(plugin_LTLIBRARIES)" || rm -f $(plugin_LTLIBRARIES) @list='$(plugin_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libinfd-note-plugin-text.la: $(libinfd_note_plugin_text_la_OBJECTS) $(libinfd_note_plugin_text_la_DEPENDENCIES) $(EXTRA_libinfd_note_plugin_text_la_DEPENDENCIES) $(AM_V_CCLD)$(libinfd_note_plugin_text_la_LINK) -rpath $(plugindir) $(libinfd_note_plugin_text_la_OBJECTS) $(libinfd_note_plugin_text_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfd_note_plugin_text_la-infd-note-plugin-text.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< libinfd_note_plugin_text_la-infd-note-plugin-text.lo: infd-note-plugin-text.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfd_note_plugin_text_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfd_note_plugin_text_la-infd-note-plugin-text.lo -MD -MP -MF $(DEPDIR)/libinfd_note_plugin_text_la-infd-note-plugin-text.Tpo -c -o libinfd_note_plugin_text_la-infd-note-plugin-text.lo `test -f 'infd-note-plugin-text.c' || echo '$(srcdir)/'`infd-note-plugin-text.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfd_note_plugin_text_la-infd-note-plugin-text.Tpo $(DEPDIR)/libinfd_note_plugin_text_la-infd-note-plugin-text.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='infd-note-plugin-text.c' object='libinfd_note_plugin_text_la-infd-note-plugin-text.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfd_note_plugin_text_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfd_note_plugin_text_la-infd-note-plugin-text.lo `test -f 'infd-note-plugin-text.c' || echo '$(srcdir)/'`infd-note-plugin-text.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(plugindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-pluginLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-pluginLTLIBRARIES install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pluginLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-pluginLTLIBRARIES cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-pluginLTLIBRARIES install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ uninstall-pluginLTLIBRARIES # 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: libinfinity-0.5.5/infinoted/note-plugins/text/infd-note-plugin-text.c0000644000175000017500000003134312264763732022676 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include /* TODO: Expose them to the client library? */ typedef enum InfdNotePluginTextError { INFD_NOTE_PLUGIN_TEXT_ERROR_NOT_A_TEXT_SESSION, INFD_NOTE_PLUGIN_TEXT_ERROR_USER_EXISTS, INFD_NOTE_PLUGIN_TEXT_ERROR_NO_SUCH_USER, INFD_NOTE_PLUGIN_TEXT_ERROR_UNEXPECTED_NODE } InfdNotePluginTextError; static InfSession* infd_note_plugin_text_session_new(InfIo* io, InfCommunicationManager* manager, InfSessionStatus status, InfCommunicationHostedGroup* sync_group, InfXmlConnection* sync_connection, gpointer user_data) { InfTextSession* session; session = inf_text_session_new( manager, INF_TEXT_BUFFER(inf_text_default_buffer_new("UTF-8")), io, status, INF_COMMUNICATION_GROUP(sync_group), sync_connection ); return INF_SESSION(session); } static int infd_note_plugin_text_session_read_read_func(void* context, char* buffer, int len) { int res; res = fread(buffer, 1, len, (FILE*)context); if(ferror((FILE*)context)) return -1; return res; } static int infd_note_plugin_text_sesison_read_close_func(void* context) { return fclose((FILE*)context); } static gboolean infd_note_plugin_text_session_unexpected_node(xmlNodePtr node, GError** error) { g_set_error( error, g_quark_from_static_string("INF_NOTE_PLUGIN_TEXT_ERROR"), INFD_NOTE_PLUGIN_TEXT_ERROR_UNEXPECTED_NODE, "Node `%s' unexpected", (const gchar*)node->name ); return FALSE; } static gboolean infd_note_plugin_text_read_user(InfUserTable* user_table, xmlNodePtr node, GError** error) { guint id; gdouble hue; xmlChar* name; gboolean result; InfUser* user; if(!inf_xml_util_get_attribute_uint_required(node, "id", &id, error)) return FALSE; if(!inf_xml_util_get_attribute_double_required(node, "hue", &hue, error)) return FALSE; name = inf_xml_util_get_attribute_required(node, "name", error); if(name == NULL) return FALSE; if(inf_user_table_lookup_user_by_id(user_table, id) != NULL) { g_set_error( error, g_quark_from_static_string("INF_NOTE_PLUGIN_TEXT_ERROR"), INFD_NOTE_PLUGIN_TEXT_ERROR_USER_EXISTS, "User with ID %u exists already", id ); result = FALSE; } else { if(inf_user_table_lookup_user_by_name(user_table, (const gchar*)name)) { g_set_error( error, g_quark_from_static_string("INF_NOTE_PLUGIN_TEXT_ERROR"), INFD_NOTE_PLUGIN_TEXT_ERROR_USER_EXISTS, "User with name `%s' exists already", (const gchar*)name ); result = FALSE; } else { user = INF_USER( g_object_new( INF_TEXT_TYPE_USER, "id", id, "name", name, "hue", hue, NULL ) ); inf_user_table_add_user(user_table, user); g_object_unref(user); result = TRUE; } } xmlFree(name); return result; } static gboolean infd_note_plugin_text_read_buffer(InfTextBuffer* buffer, InfUserTable* user_table, xmlNodePtr node, GError** error) { xmlNodePtr child; guint author; gchar* content; gboolean result; gboolean res; InfUser* user; gsize bytes; guint chars; g_assert(inf_text_buffer_get_length(buffer) == 0); for(child = node->children; child != NULL; child = child->next) { if(child->type != XML_ELEMENT_NODE) continue; if(strcmp((const gchar*)child->name, "segment") == 0) { res = inf_xml_util_get_attribute_uint_required( child, "author", &author, error ); if(res == FALSE) { result = FALSE; break; } if(author != 0) { user = inf_user_table_lookup_user_by_id(user_table, author); if(user == NULL) { g_set_error( error, g_quark_from_static_string("INF_NOTE_PLUGIN_TEXT_ERROR"), INFD_NOTE_PLUGIN_TEXT_ERROR_NO_SUCH_USER, "User with ID %u does not exist", author ); result = FALSE; break; } } else { user = NULL; } content = inf_xml_util_get_child_text(child, &bytes, &chars, error); if(!content) { result = FALSE; break; } if(*content != '\0') { /* TODO: Use inf_text_buffer_append when we have it */ inf_text_buffer_insert_text( buffer, inf_text_buffer_get_length(buffer), content, bytes, chars, user ); } g_free(content); } else { infd_note_plugin_text_session_unexpected_node(child, error); result = FALSE; break; } } if(child == NULL) result = TRUE; return result; } static InfSession* infd_note_plugin_text_session_read(InfdStorage* storage, InfIo* io, InfCommunicationManager* manager, const gchar* path, gpointer user_data, GError** error) { InfUserTable* user_table; InfTextBuffer* buffer; InfTextSession* session; FILE* stream; xmlDocPtr doc; xmlErrorPtr xmlerror; xmlNodePtr root; xmlNodePtr child; gboolean result; g_assert(INFD_IS_FILESYSTEM_STORAGE(storage)); user_table = inf_user_table_new(); buffer = INF_TEXT_BUFFER(inf_text_default_buffer_new("UTF-8")); /* TODO: Use a SAX parser for better performance */ stream = infd_filesystem_storage_open( INFD_FILESYSTEM_STORAGE(storage), "InfText", path, "r", error ); if(stream == NULL) return FALSE; doc = xmlReadIO( infd_note_plugin_text_session_read_read_func, infd_note_plugin_text_sesison_read_close_func, stream, path, /* TODO: Get some "infinote-filesystem-storage://" URL? */ "UTF-8", XML_PARSE_NOWARNING | XML_PARSE_NOERROR ); if(doc == NULL) { xmlerror = xmlGetLastError(); g_set_error( error, g_quark_from_static_string("LIBXML2_PARSER_ERROR"), xmlerror->code, "Error parsing XML in file '%s': [%d]: %s", path, xmlerror->line, xmlerror->message ); result = FALSE; } else { root = xmlDocGetRootElement(doc); if(strcmp((const char*)root->name, "inf-text-session") != 0) { g_set_error( error, g_quark_from_static_string("INF_NOTE_PLUGIN_TEXT_ERROR"), INFD_NOTE_PLUGIN_TEXT_ERROR_NOT_A_TEXT_SESSION, "Error processing file '%s': %s", path, "The document is not a text session" ); result = FALSE; } else { for(child = root->children; child != NULL; child = child->next) { if(child->type != XML_ELEMENT_NODE) continue; if(strcmp((const char*)child->name, "user") == 0) { if(!infd_note_plugin_text_read_user(user_table, child, error)) { g_prefix_error(error, "Error processing file '%s': ", path); result = FALSE; break; } } else if(strcmp((const char*)child->name, "buffer") == 0) { if(!infd_note_plugin_text_read_buffer(buffer, user_table, child, error)) { g_prefix_error(error, "Error processing file '%s': ", path); result = FALSE; break; } } else { infd_note_plugin_text_session_unexpected_node(child, error); g_prefix_error(error, "Error processing file '%s': ", path); result = FALSE; break; } } if(child == NULL) result = TRUE; } xmlFreeDoc(doc); } if(result == FALSE) return NULL; session = inf_text_session_new_with_user_table( manager, buffer, io, user_table, INF_SESSION_RUNNING, NULL, NULL ); return INF_SESSION(session); } static void infd_note_plugin_text_session_write_foreach_user_func(InfUser* user, gpointer user_data) { xmlNodePtr parent; xmlNodePtr node; parent = (xmlNodePtr)user_data; node = xmlNewChild(parent, NULL, (const xmlChar*)"user", NULL); inf_xml_util_set_attribute_uint(node, "id", inf_user_get_id(user)); inf_xml_util_set_attribute(node, "name", inf_user_get_name(user)); inf_xml_util_set_attribute_double( node, "hue", inf_text_user_get_hue(INF_TEXT_USER(user)) ); } static gboolean infd_note_plugin_text_session_write(InfdStorage* storage, InfSession* session, const gchar* path, gpointer user_data, GError** error) { InfUserTable* table; InfTextBuffer* buffer; InfTextBufferIter* iter; xmlNodePtr root; xmlNodePtr buffer_node; xmlNodePtr segment_node; guint author; gchar* content; gsize bytes; FILE* stream; xmlDocPtr doc; xmlErrorPtr xmlerror; g_assert(INFD_IS_FILESYSTEM_STORAGE(storage)); g_assert(INF_TEXT_IS_SESSION(session)); /* Open stream before exporting buffer to XML so possible errors are * catched earlier. */ stream = infd_filesystem_storage_open( INFD_FILESYSTEM_STORAGE(storage), "InfText", path, "w", error ); if(stream == NULL) return FALSE; root = xmlNewNode(NULL, (const xmlChar*)"inf-text-session"); buffer = INF_TEXT_BUFFER(inf_session_get_buffer(session)); table = inf_session_get_user_table(session); inf_user_table_foreach_user( table, infd_note_plugin_text_session_write_foreach_user_func, root ); buffer_node = xmlNewChild(root, NULL, (const xmlChar*)"buffer", NULL); iter = inf_text_buffer_create_iter(buffer); if(iter != NULL) { do { author = inf_text_buffer_iter_get_author(buffer, iter); content = inf_text_buffer_iter_get_text(buffer, iter); bytes = inf_text_buffer_iter_get_bytes(buffer, iter); segment_node = xmlNewChild( buffer_node, NULL, (const xmlChar*)"segment", NULL ); inf_xml_util_set_attribute_uint(segment_node, "author", author); inf_xml_util_add_child_text(segment_node, content, bytes); g_free(content); } while(inf_text_buffer_iter_next(buffer, iter)); inf_text_buffer_destroy_iter(buffer, iter); } doc = xmlNewDoc((const xmlChar*)"1.0"); xmlDocSetRootElement(doc, root); if(xmlDocFormatDump(stream, doc, 1) == -1) { xmlerror = xmlGetLastError(); fclose(stream); xmlFreeDoc(doc); g_set_error( error, g_quark_from_static_string("LIBXML2_OUTPUT_ERROR"), xmlerror->code, "%s", xmlerror->message ); return FALSE; } fclose(stream); xmlFreeDoc(doc); return TRUE; } const InfdNotePlugin INFD_NOTE_PLUGIN = { NULL, "InfdFilesystemStorage", "InfText", infd_note_plugin_text_session_new, infd_note_plugin_text_session_read, infd_note_plugin_text_session_write }; /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/infinoted/note-plugins/Makefile.in0000644000175000017500000004641012264766065017455 00000000000000# Makefile.in generated by automake 1.13.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = infinoted/note-plugins DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/mkinstalldirs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/libinfinity/inf-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBINFINITY_API_VERSION = @LIBINFINITY_API_VERSION@ LIBINFINITY_LIBTOOL_VERSION = @LIBINFINITY_LIBTOOL_VERSION@ LIBINFINITY_VERSION = @LIBINFINITY_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ avahi_CFLAGS = @avahi_CFLAGS@ avahi_LIBS = @avahi_LIBS@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gtk_requirement = @gtk_requirement@ gtk_version = @gtk_version@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infgtk_CFLAGS = @infgtk_CFLAGS@ infgtk_LIBS = @infgtk_LIBS@ infinity_CFLAGS = @infinity_CFLAGS@ infinity_LIBS = @infinity_LIBS@ infinoted_CFLAGS = @infinoted_CFLAGS@ infinoted_LIBS = @infinoted_LIBS@ infodir = @infodir@ inftext_CFLAGS = @inftext_CFLAGS@ inftext_LIBS = @inftext_LIBS@ inftextgtk_CFLAGS = @inftextgtk_CFLAGS@ inftextgtk_LIBS = @inftextgtk_LIBS@ install_sh = @install_sh@ libdaemon_CFLAGS = @libdaemon_CFLAGS@ libdaemon_LIBS = @libdaemon_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = text all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu infinoted/note-plugins/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu infinoted/note-plugins/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am # 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: libinfinity-0.5.5/infinoted/infinoted-note-plugin.c0000644000175000017500000001165712264763732017351 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include #include #include /** * infinoted_note_plugin_load: * @plugin_path: Path to a note plugin. * @error: Location to store error information, if any. * * Tries to load the plugin at @plugin_path. Such a plugin must be a shared * object that exports a symbol called "INFD_NOTE_PLUGIN" of type * #InfdNotePlugin. If the plugin could not be load, the function returns * %NULL and @error is set, otherwise it returns the loaded #InfdNotePlugin. * * Return Value: A #InfdNotePlugin, or %NULL. **/ const InfdNotePlugin* infinoted_note_plugin_load(const gchar* plugin_path, GError** error) { GModule* module; InfdNotePlugin* plugin; module = g_module_open(plugin_path, G_MODULE_BIND_LOCAL); if(module == NULL) { g_set_error( error, g_quark_from_static_string("INFINOTED_NOTE_PLUGIN_ERROR"), INFINOTED_NOTE_PLUGIN_ERROR_OPEN_FAILED, "%s", g_module_error() ); return NULL; } if(g_module_symbol(module, "INFD_NOTE_PLUGIN", (gpointer*)&plugin) == FALSE) { g_set_error( error, g_quark_from_static_string("INFINOTED_NOTE_PLUGIN_ERROR"), INFINOTED_NOTE_PLUGIN_ERROR_NO_ENTRY_POINT, "%s", g_module_error() ); g_module_close(module); return NULL; } g_module_make_resident(module); g_module_close(module); /* TODO: Don't necessary? */ return plugin; } /** * infinoted_note_plugin_load_directory: * Loads a directory that contains note plugins and adds them to the given * @directory. The directory should only contain valid plugins. A warning for * each plugin that could not be load is issued. **/ gboolean infinoted_note_plugin_load_directory(const gchar* path, InfdDirectory* directory) { GDir* dir; GError* error; InfdStorage* storage; const gchar* storage_type; const gchar* filename; const InfdNotePlugin* plugin; gchar* plugin_path; gboolean has_plugins; error = NULL; dir = g_dir_open(path, 0, &error); if(dir == NULL) { g_warning("%s", error->message); g_error_free(error); return FALSE; } else { storage = infd_directory_get_storage(directory); storage_type = g_type_name(G_TYPE_FROM_INSTANCE(storage)); has_plugins = FALSE; while((filename = g_dir_read_name(dir)) != NULL) { /* Ignore libtool ".la" files and other uninteresting stuff */ if(!g_str_has_suffix(filename, G_MODULE_SUFFIX)) continue; plugin_path = g_build_filename(path, filename, NULL); plugin = infinoted_note_plugin_load(plugin_path, &error); if(plugin == NULL) { g_warning( "%s", error->message ); g_error_free(error); } else { if(infd_directory_lookup_plugin(directory, plugin->note_type) != NULL) { g_warning( _("Failed to load plugin \"%s\": Note type \"%s\" is " "already handled by another plugin"), plugin_path, plugin->note_type ); } else { if(strcmp(storage_type, plugin->storage_type) != 0) { g_warning( _("Failed to load plugin \"%s\": " "Storage type \"%s\" does not match"), plugin_path, plugin->storage_type ); } else { infinoted_util_log_info( _("Loaded plugin \"%s\" (%s)"), plugin_path, plugin->note_type ); infd_directory_add_plugin(directory, plugin); has_plugins = TRUE; } } /* TODO: We should unload the plugin here since we don't need it */ } g_free(plugin_path); } g_dir_close(dir); if(has_plugins == FALSE) { g_warning(_("Path \"%s\" does not contain any note plugins"), path); return FALSE; } else { return TRUE; } } } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/infinoted/infinoted-main.c0000644000175000017500000001212012264763732016016 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include #include #include #include #ifdef LIBINFINITY_HAVE_LIBDAEMON #include #include #include #include #include #endif #include #include #include /* Takes ownership of startup */ static gboolean infinoted_main_run(InfinotedStartup* startup, GError** error) { InfinotedRun* run; InfinotedSignal* sig; #ifdef LIBINFINITY_HAVE_LIBDAEMON pid_t pid; int saved_errno; #endif /* infinoted_run_new() takes ownership of startup */ run = infinoted_run_new(startup, error); if(run == NULL) { infinoted_startup_free(startup); return FALSE; } #ifdef LIBINFINITY_HAVE_LIBDAEMON if(startup->options->daemonize) { if(daemon_retval_init() == -1) { infinoted_run_free(run); return FALSE; /* libdaemon already wrote an error message */ } pid = daemon_fork(); if(pid < 0) { /* Translators: fork as in "fork into the background" */ infinoted_util_set_errno_error(error, errno, _("Failed to fork")); infinoted_run_free(run); daemon_retval_done(); return FALSE; } else if(pid > 0) { infinoted_run_free(run); saved_errno = daemon_retval_wait(5); if(saved_errno == 0) { return TRUE; } if(saved_errno == -1) { infinoted_util_set_errno_error(error, errno, _("Failed to wait for daemonized child's return value")); return FALSE; } else { /* on -1, the child process would have subtracted one from * errno before passing it back to us. */ if(saved_errno < 0) ++saved_errno; infinoted_util_set_errno_error( error, saved_errno, _("Failed to create PID file")); return FALSE; } } else { infinoted_util_daemon_set_global_pid_file_proc(); if(daemon_pid_file_create() != 0) { infinoted_util_daemon_set_local_pid_file_proc(); if(daemon_pid_file_create() != 0) { if(daemon_pid_file_create() != 0) { saved_errno = errno; infinoted_util_set_errno_error( error, saved_errno, _("Failed to create PID file") ); if(saved_errno < 0) --saved_errno; daemon_retval_send(saved_errno); infinoted_run_free(run); return FALSE; } } } daemon_retval_send(0); } /* libdaemon < 0.14 sets our umask to 0777, preventing the file storage * backend from working correctly. 0.14 uses 0077, but the documentation * still says 0777, and, anyway, 0.14 does not seem widespread enough * right now. */ umask(0077); } #endif sig = infinoted_signal_register(run); /* Now start the server. It can later be stopped by signals. */ infinoted_run_start(run); infinoted_signal_unregister(sig); #ifdef LIBINFINITY_HAVE_LIBDAEMON /* startup might be invalid at this point in case a config reload happened, * so use run->startup instead (which is revalidated by config reload). */ if(run->startup->options->daemonize) daemon_pid_file_remove(); #endif infinoted_run_free(run); return TRUE; } static gboolean infinoted_main(int argc, char* argv[], GError** error) { InfinotedStartup* startup; gboolean result; startup = infinoted_startup_new(&argc, &argv, error); if(startup == NULL) return FALSE; #ifdef LIBINFINITY_HAVE_LIBDAEMON if(startup->options->daemonize) { daemon_pid_file_ident = daemon_ident_from_argv0(argv[0]); daemon_log_ident = daemon_pid_file_ident; } #endif result = infinoted_main_run(startup, error); return result; } int main(int argc, char* argv[]) { GError* error; setlocale(LC_ALL, ""); error = NULL; if(infinoted_main(argc, argv, &error) == FALSE) { if(error) { infinoted_util_log_error("%s", error->message); g_error_free(error); } return -1; } return 0; } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/infinoted/infinoted-config-reload.c0000644000175000017500000002545112264763732017616 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include #include #include #include static const guint8 INFINOTED_CONFIG_RELOAD_IPV6_ANY_ADDR[16] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; static void infinoted_config_reload_update_connection_sasl_context(InfXmlConnection* xml, gpointer userdata) { if(!INF_IS_XMPP_CONNECTION(xml)) return; inf_xmpp_connection_reset_sasl_authentication( INF_XMPP_CONNECTION(xml), (InfSaslContext*) userdata, userdata ? "PLAIN" : NULL ); } /** * infinoted_config_reload: * @run: A #InfinotedRun. * @error: Location to store error information, if any. * * Reloads the server's config file(s) at runtime. If there is a problem * loading them the server is untouched, the function returns %FALSE and * @error is set. * * Returns: %TRUE on success or %FALSE if an error occured. */ gboolean infinoted_config_reload(InfinotedRun* run, GError** error) { InfinotedStartup* startup; gnutls_dh_params_t dh_params; InfdTcpServer* tcp6; InfdTcpServer* tcp4; guint port; InfIpAddress* addr; GError* local_error; InfdStorage* storage; InfdFilesystemStorage* filesystem_storage; gchar* root_directory; startup = infinoted_startup_new(NULL, NULL, error); if(!startup) return FALSE; /* Acquire DH params if necessary (if security policy changed from * no-tls to one of allow-tls or require-tls). */ dh_params = run->dh_params; if(startup->credentials) { if(!infinoted_dh_params_ensure(startup->credentials, &dh_params, error)) { infinoted_startup_free(startup); return FALSE; } } /* Find out the port we are currently running on */ tcp4 = tcp6 = NULL; if(run->xmpp6) g_object_get(G_OBJECT(run->xmpp6), "tcp-server", &tcp6, NULL); if(run->xmpp4) g_object_get(G_OBJECT(run->xmpp4), "tcp-server", &tcp4, NULL); g_assert(tcp4 != NULL || tcp6 != NULL); if(tcp6) g_object_get(G_OBJECT(tcp6), "local-port", &port, NULL); else g_object_get(G_OBJECT(tcp4), "local-port", &port, NULL); if(tcp4) g_object_unref(tcp4); if(tcp6) g_object_unref(tcp6); tcp4 = tcp6 = NULL; /* If the port changes, then create new servers */ if(startup->options->port != port) { /* TODO: This is the same logic as in infinoted_run_new()... should * probably go into an extra function. */ addr = inf_ip_address_new_raw6(INFINOTED_CONFIG_RELOAD_IPV6_ANY_ADDR); tcp6 = g_object_new( INFD_TYPE_TCP_SERVER, "io", run->io, "local-address", addr, "local-port", startup->options->port, NULL ); inf_ip_address_free(addr); if(!infd_tcp_server_bind(tcp6, NULL)) { g_object_unref(tcp6); tcp6 = NULL; } tcp4 = g_object_new( INFD_TYPE_TCP_SERVER, "io", run->io, "local-address", NULL, "local-port", startup->options->port, NULL ); local_error = NULL; if(!infd_tcp_server_bind(tcp4, &local_error)) { g_object_unref(tcp4); tcp4 = NULL; if(tcp6 != NULL) { g_error_free(local_error); } else { g_propagate_error(error, local_error); infinoted_startup_free(startup); return FALSE; } } } /* Beyond this point, tcp4 or tcp6 are non-null if the port was changed and * the new server sockets could be bound successfully. */ g_object_get(G_OBJECT(run->directory), "storage", &storage, NULL); g_assert(INFD_IS_FILESYSTEM_STORAGE(storage)); filesystem_storage = INFD_FILESYSTEM_STORAGE(storage); g_object_get( G_OBJECT(filesystem_storage), "root-directory", &root_directory, NULL ); g_object_unref(storage); filesystem_storage = NULL; if(strcmp(root_directory, startup->options->root_directory) != 0) { /* Root directory changes. I don't think this is actually useful, but * all code is there, so let's support it. */ filesystem_storage = infd_filesystem_storage_new(startup->options->root_directory); } /* This should be the last thing that may fail which we do, because we * allow connection on the new port after this. */ if(tcp4 != NULL || tcp6 != NULL) { local_error = NULL; if(tcp6 != NULL) { local_error = NULL; if(!infd_tcp_server_open(tcp6, &local_error)) { g_object_unref(tcp6); tcp6 = NULL; } } if(tcp4) { if(!infd_tcp_server_open(tcp4, (local_error != NULL) ? NULL : &local_error)) { g_object_unref(tcp4); tcp4 = NULL; } } if(tcp4 == NULL && tcp6 == NULL) { g_propagate_error(error, local_error); if(filesystem_storage) g_object_unref(filesystem_storage); infinoted_startup_free(startup); return FALSE; } /* One of the server startups might have failed - that's not a problem if * we could start the other one. */ if(local_error) g_error_free(local_error); } /* OK, so beyond this point there is nothing that can fail anymore. */ if(tcp4 != NULL || tcp6 != NULL) { /* We have new servers, close old ones */ if(run->xmpp6 != NULL) { infd_server_pool_remove_server(run->pool, INFD_XML_SERVER(run->xmpp6)); infd_xml_server_close(INFD_XML_SERVER(run->xmpp6)); g_object_unref(run->xmpp6); run->xmpp6 = NULL; } if(run->xmpp4 != NULL) { infd_server_pool_remove_server(run->pool, INFD_XML_SERVER(run->xmpp4)); infd_xml_server_close(INFD_XML_SERVER(run->xmpp4)); g_object_unref(run->xmpp4); run->xmpp4 = NULL; } if(tcp6 != NULL) { run->xmpp6 = infd_xmpp_server_new( tcp6, startup->options->security_policy, startup->credentials, NULL, NULL ); g_object_unref(tcp6); infd_server_pool_add_server(run->pool, INFD_XML_SERVER(run->xmpp6)); #ifdef LIBINFINITY_HAVE_AVAHI infd_server_pool_add_local_publisher( run->pool, run->xmpp6, INF_LOCAL_PUBLISHER(run->avahi) ); #endif } if(tcp4 != NULL) { run->xmpp4 = infd_xmpp_server_new( tcp4, startup->options->security_policy, startup->credentials, NULL, NULL ); g_object_unref(tcp4); infd_server_pool_add_server(run->pool, INFD_XML_SERVER(run->xmpp4)); #ifdef LIBINFINITY_HAVE_AVAHI infd_server_pool_add_local_publisher( run->pool, run->xmpp4, INF_LOCAL_PUBLISHER(run->avahi) ); #endif } } else { /* No new servers, so just set new certificate settings * for existing ones. */ if(run->xmpp6 != NULL) { /* Make sure to set credentials before security-policy */ g_object_set( G_OBJECT(run->xmpp6), "credentials", startup->credentials, "security-policy", startup->options->security_policy, NULL ); } if(run->xmpp4 != NULL) { g_object_set( G_OBJECT(run->xmpp4), "credentials", startup->credentials, "security-policy", startup->options->security_policy, NULL ); } } if(filesystem_storage != NULL) { g_object_set( G_OBJECT(run->directory), "storage", filesystem_storage, NULL ); g_object_unref(filesystem_storage); } if( (run->autosave == NULL && startup->options->autosave_interval > 0) || (run->autosave != NULL && startup->options->autosave_interval != run->autosave->autosave_interval)) { if(run->autosave != NULL) { infinoted_autosave_free(run->autosave); run->autosave = NULL; } if(startup->options->autosave_interval > 0) { run->autosave = infinoted_autosave_new( run->directory, startup->options->autosave_interval ); } } if( (run->dsync == NULL && startup->options->sync_interval > 0 && startup->options->sync_directory != NULL) || (run->dsync != NULL && (startup->options->sync_interval != run->dsync->sync_interval || startup->options->sync_directory == NULL || strcmp( startup->options->sync_directory, run->dsync->sync_directory) != 0))) { if(run->dsync != NULL) { infinoted_directory_sync_free(run->dsync); run->dsync = NULL; } if(startup->options->sync_interval > 0 && startup->options->sync_directory != NULL) { run->dsync = infinoted_directory_sync_new( run->directory, startup->options->sync_directory, startup->options->sync_interval ); } } #ifdef LIBINFINITY_HAVE_LIBDAEMON /* Remember whether we have been daemonized; this is not a config file * option, so not properly set in our newly created startup. */ startup->options->daemonize = run->startup->options->daemonize; #endif if(run->xmpp4 != NULL) { g_object_set( G_OBJECT(run->xmpp4), "sasl-context", startup->sasl_context, "sasl-mechanisms", startup->sasl_context ? "PLAIN" : NULL, NULL ); } if(run->xmpp6 != NULL) { g_object_set( G_OBJECT(run->xmpp6), "sasl-context", startup->sasl_context, "sasl-mechanisms", startup->sasl_context ? "PLAIN" : NULL, NULL ); } /* Give each connection the new sasl context. This is necessary even if the * connection already had a sasl context since that holds on to the old * startup object. This aborts authentications in progress and otherwise * has no effect, really. */ infd_directory_foreach_connection( run->directory, infinoted_config_reload_update_connection_sasl_context, startup->sasl_context ); infinoted_startup_free(run->startup); run->startup = startup; return TRUE; } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/infinoted/infinoted-directory-sync.h0000644000175000017500000000356612264763732020073 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INFINOTED_DIRECTORY_SYNC_H__ #define __INFINOTED_DIRECTORY_SYNC_H__ #include #include G_BEGIN_DECLS /* TODO: This is (currently) the only part of infinoted which requires * libinftext, apart from the note plugin. I'd therefore prefer to move this * code to the note plugin, to keep infinoted generic. */ typedef struct _InfinotedDirectorySync InfinotedDirectorySync; struct _InfinotedDirectorySync { InfdDirectory* directory; gchar* sync_directory; unsigned int sync_interval; GSList* sessions; }; typedef enum _InfinotedDirectorySyncError { INFINOTED_DIRECTORY_SYNC_ERROR_INVALID_PATH } InfinotedDirectorySyncError; InfinotedDirectorySync* infinoted_directory_sync_new(InfdDirectory* directory, const gchar* sync_directory, unsigned int sync_interval); void infinoted_directory_sync_free(InfinotedDirectorySync* autosave); G_END_DECLS #endif /* __INFINOTED_DIRECTORY_SYNC_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/infinoted/infinoted-note-plugin.h0000644000175000017500000000306712264763732017352 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INFINOTED_NOTE_PLUGIN_H__ #define __INFINOTED_NOTE_PLUGIN_H__ #include G_BEGIN_DECLS typedef enum _InfinotedNotePluginError { INFINOTED_NOTE_PLUGIN_ERROR_OPEN_FAILED, INFINOTED_NOTE_PLUGIN_ERROR_NO_ENTRY_POINT, INFINOTED_NOTE_PLUGIN_ERROR_STORAGE_MISMATCH, INFINOTED_NOTE_PLUGIN_ERROR_DUPLICATE_NOTE_TYPE } InfinotedNotePluginError; const InfdNotePlugin* infinoted_note_plugin_load(const gchar* plugin_path, GError** error); gboolean infinoted_note_plugin_load_directory(const gchar* path, InfdDirectory* directory); G_END_DECLS #endif /* __INFINOTED_NOTE_PLUGINS_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/infinoted/infinoted-creds.c0000644000175000017500000002524412264763732016205 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include #include #include #include static const unsigned int DAYS = 24 * 60 * 60; static void infinoted_creds_gnutls_error(int gnutls_error_code, GError** error) { g_set_error( error, g_quark_from_static_string("GNUTLS_ERROR"), gnutls_error_code, "%s", gnutls_strerror(gnutls_error_code) ); } static int infinoted_creds_create_self_signed_certificate_impl(gnutls_x509_crt_t cert, gnutls_x509_privkey_t key) { gint32 default_serial; char buffer[20]; const gchar* hostname; int res; res = gnutls_x509_crt_set_key(cert, key); if(res != 0) return res; default_serial = (gint32)time(NULL); buffer[4] = (default_serial ) & 0xff; buffer[3] = (default_serial >> 8) & 0xff; buffer[2] = (default_serial >> 16) & 0xff; buffer[1] = (default_serial >> 24) & 0xff; buffer[0] = 0; res = gnutls_x509_crt_set_serial(cert, buffer, 5); if(res != 0) return res; res = gnutls_x509_crt_set_activation_time(cert, time(NULL)); if(res != 0) return res; res = gnutls_x509_crt_set_expiration_time(cert, time(NULL) + 365 * DAYS); if(res != 0) return res; res = gnutls_x509_crt_set_basic_constraints(cert, 0, -1); if(res != 0) return res; res = gnutls_x509_crt_set_key_usage(cert, GNUTLS_KEY_DIGITAL_SIGNATURE); if(res != 0) return res; res = gnutls_x509_crt_set_version(cert, 3); if(res != 0) return res; hostname = g_get_host_name(); res = gnutls_x509_crt_set_dn_by_oid( cert, GNUTLS_OID_X520_COMMON_NAME, 0, hostname, strlen(hostname) ); if(res != 0) return res; #if 0 /* TODO: We set the alternative name always to hostname.local, because this * is what avahi yields when resolving that host. However, we rather should * find out the real DNS name, perhaps by doing a reverse DNS resolve * for 127.0.0.1? */ dnsname = g_strdup_printf("%s.local", hostname); res = gnutls_x509_crt_set_subject_alternative_name( cert, GNUTLS_SAN_DNSNAME, dnsname ); g_free(dnsname); if(res != 0) return res; #else res = gnutls_x509_crt_set_subject_alternative_name( cert, GNUTLS_SAN_DNSNAME, g_get_host_name() ); if(res != 0) return res; #endif res = gnutls_x509_crt_sign2(cert, cert, key, GNUTLS_DIG_SHA1, 0); if(res != 0) return res; return 0; } #define READ_FUNC_IMPL(type, path, init_func, deinit_func, import_func) \ type obj; \ gnutls_datum_t datum; \ gchar* data; \ gsize size; \ int res; \ \ obj = NULL; \ data = NULL; \ \ if(g_file_get_contents(path, &data, &size, error) == FALSE) \ return NULL; \ \ res = init_func(&obj); \ if(res != 0) goto error; \ \ datum.data = (unsigned char*)data; \ datum.size = (unsigned int)size; \ res = import_func(obj, &datum, GNUTLS_X509_FMT_PEM); \ if(res != 0) goto error; \ \ g_free(data); \ return obj; \ error: \ if(obj != NULL) deinit_func(obj); \ g_free(data); \ infinoted_creds_gnutls_error(res, error); \ return NULL; #define WRITE_FUNC_IMPL(obj, path, export_func) \ unsigned char* data; \ size_t size; \ int res; \ gboolean bres; \ \ size = 0; \ data = NULL; \ \ res = export_func(obj, GNUTLS_X509_FMT_PEM, NULL, &size); \ g_assert(res != 0); /* cannot succeed */ \ if(res != GNUTLS_E_SHORT_MEMORY_BUFFER) \ goto error; /* real error */ \ \ data = g_malloc(size); \ res = export_func(obj, GNUTLS_X509_FMT_PEM, data, &size); \ if(res != 0) goto error; \ \ bres = g_file_set_contents(path, (gchar*)data, size, error); \ g_free(data); \ \ return bres; \ error: \ if(data != NULL) g_free(data); \ infinoted_creds_gnutls_error(res, error); \ return FALSE; /** * infinoted_creds_create_dh_params: * @error: Loctation to store error information, if any. * * Creates new, random Diffie-Hellman parameters. * * Returns: New dhparams to be freed with gnutls_dh_params_deinit(), * or %NULL in case of error. **/ gnutls_dh_params_t infinoted_creds_create_dh_params(GError** error) { gnutls_dh_params_t params; int res; params = NULL; res = gnutls_dh_params_init(¶ms); if(res != 0) { infinoted_creds_gnutls_error(res, error); return NULL; } res = gnutls_dh_params_generate2(params, 2048); if(res != 0) { gnutls_dh_params_deinit(params); infinoted_creds_gnutls_error(res, error); return NULL; } return params; } /** * infinoted_creds_read_dh_params: * @dhparams_path: A path to a DH parameters file. * @error: Location to store error information, if any. * * Reads the Diffie-Hellman parameters located at @dhparams_path into a * gnutls_dh_params_t structure. * * Returns: New dhparams to be freed with gnutls_dh_params_deinit(), * or %NULL in case of error. **/ gnutls_dh_params_t infinoted_creds_read_dh_params(const gchar* dhparams_path, GError** error) { READ_FUNC_IMPL( gnutls_dh_params_t, dhparams_path, gnutls_dh_params_init, gnutls_dh_params_deinit, gnutls_dh_params_import_pkcs3 ) } /** * infinoted_creds_write_dh_params: * @params: An initialized #gnutls_dh_params_t structure. * @dhparams_path: The path at which so store @params. * @error: Location to store error information, if any. * * Writes the given Diffie-Hellman parameters to the given path on the * filesystem. If an error occurs, @error is set and %FALSE is returned. * * Returns: %TRUE on success, %FALSE otherwise. **/ gboolean infinoted_creds_write_dh_params(gnutls_dh_params_t params, const gchar* dhparams_path, GError** error) { WRITE_FUNC_IMPL( params, dhparams_path, gnutls_dh_params_export_pkcs3 ) } /** * infinoted_creds_create_key: * @error: Location to store error information, if any. * * Generates a new, random X.509 private key. * * Returns: A new key to be freed with gnutls_x509_privkey_deinit(), * or %NULL if an error occured. **/ gnutls_x509_privkey_t infinoted_creds_create_key(GError** error) { gnutls_x509_privkey_t key; int res; res = gnutls_x509_privkey_init(&key); if(res != 0) { infinoted_creds_gnutls_error(res, error); return NULL; } res = gnutls_x509_privkey_generate(key, GNUTLS_PK_RSA, 2048, 0); if(res != 0) { infinoted_creds_gnutls_error(res, error); gnutls_x509_privkey_deinit(key); return NULL; } return key; } /** * infinoted_creds_read_key: * @key_path: A path to a X.509 private key file * @error: Location for error information, if any. * * Reads the key located at @key_path into a gnutls_x509_privkey_t * structure. * * Returns: A private key. Free with gnutls_x509_privkey_deinit(). **/ gnutls_x509_privkey_t infinoted_creds_read_key(const gchar* key_path, GError** error) { READ_FUNC_IMPL( gnutls_x509_privkey_t, key_path, gnutls_x509_privkey_init, gnutls_x509_privkey_deinit, gnutls_x509_privkey_import ) } /** * infinoted_creds_write_key: * @key: An initialized #gnutls_x509_privkey_t structure. * @key_path: The path at which so store the key. * @error: Location to store error information, if any. * * Writes @key to the location specified by @key_path on the filesystem. * If an error occurs, the function returns %FALSE and @error is set. * * Returns: %TRUE on success, %FALSE otherwise. **/ gboolean infinoted_creds_write_key(gnutls_x509_privkey_t key, const gchar* key_path, GError** error) { WRITE_FUNC_IMPL( key, key_path, gnutls_x509_privkey_export ) } /** * infinoted_creds_create_self_signed_certificate: * @key: The key with which to sign the certificate. * @error: Location to store error information, if any. * * Creates an new self-signed X.509 certificate signed with @key. * * Returns: A certificate to be freed with gnutls_x509_crt_deinit(), * or %NULL on error. **/ gnutls_x509_crt_t infinoted_creds_create_self_signed_certificate(gnutls_x509_privkey_t key, GError** error) { gnutls_x509_crt_t cert; int res; res = gnutls_x509_crt_init(&cert); if(res != 0) { infinoted_creds_gnutls_error(res, error); return NULL; } res = infinoted_creds_create_self_signed_certificate_impl(cert, key); if(res != 0) { gnutls_x509_crt_deinit(cert); infinoted_creds_gnutls_error(res, error); return NULL; } return cert; } /** * infinoted_creds_create_credentials: * @key: The X.509 private key to use. * @certs: An array of X.509 certificates to use. The first certificate is the * server's certificate, the second the issuer's, the third the issuer's * issuer's, etc. * @n_certs: Number of certificates in @certs. * @error: Location to store error information, if any. * * Creates a new #InfCertificateCredentials struture suitable for * TLS. You still need to set the DH params to be used for key exchange via * gnutls_certificate_set_dh_params(). * * Return Value: A #InfCertificateCredentials, to be freed * with inf_certificate_credentials_unref(). **/ InfCertificateCredentials* infinoted_creds_create_credentials(gnutls_x509_privkey_t key, gnutls_x509_crt_t* certs, guint n_certs, GError** error) { InfCertificateCredentials* credentials; gnutls_certificate_credentials_t creds; int res; credentials = inf_certificate_credentials_new(); creds = inf_certificate_credentials_get(credentials); res = gnutls_certificate_set_x509_key(creds, certs, n_certs, key); if(res != 0) { gnutls_certificate_free_credentials(creds); infinoted_creds_gnutls_error(res, error); return NULL; } /*gnutls_certificate_set_dh_params(creds, dh_params);*/ return credentials; } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/infinoted/infinoted-dh-params.h0000644000175000017500000000243512264763732016763 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INFINOTED_DH_PARAMS_H__ #define __INFINOTED_DH_PARAMS_H__ #include #include #include G_BEGIN_DECLS gboolean infinoted_dh_params_ensure(InfCertificateCredentials* creds, gnutls_dh_params_t* dh_params, GError** error); G_END_DECLS #endif /* __INFINOTED_DH_PARAMS_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/infinoted/infinoted-options.h0000644000175000017500000000466312264763732016607 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INFINOTED_OPTIONS_H__ #define __INFINOTED_OPTIONS_H__ #include #include #include G_BEGIN_DECLS typedef struct _InfinotedOptions InfinotedOptions; struct _InfinotedOptions { gchar* key_file; gchar* certificate_file; gchar* certificate_chain_file; gboolean create_key; gboolean create_certificate; guint port; InfXmppConnectionSecurityPolicy security_policy; gchar* root_directory; guint autosave_interval; gchar* password; #ifdef LIBINFINITY_HAVE_PAM gchar* pam_service; gchar** pam_allowed_users; gchar** pam_allowed_groups; #endif /* LIBINFINITY_HAVE_PAM */ gchar* sync_directory; guint sync_interval; #ifdef LIBINFINITY_HAVE_LIBDAEMON gboolean daemonize; #endif }; typedef enum _InfinotedOptionsError { INFINOTED_OPTIONS_ERROR_INVALID_SECURITY_POLICY, INFINOTED_OPTIONS_ERROR_INVALID_PORT, INFINOTED_OPTIONS_ERROR_INVALID_AUTOSAVE_INTERVAL, INFINOTED_OPTIONS_ERROR_INVALID_CREATE_OPTIONS, INFINOTED_OPTIONS_ERROR_EMPTY_KEY_FILE, INFINOTED_OPTIONS_ERROR_EMPTY_CERTIFICATE_FILE, INFINOTED_OPTIONS_ERROR_INVALID_SYNC_COMBINATION, INFINOTED_OPTIONS_ERROR_INVALID_AUTHENTICATION_SETTINGS } InfinotedOptionsError; InfinotedOptions* infinoted_options_new(const gchar* const* config_files, int* argc, char*** argv, GError** error); void infinoted_options_free(InfinotedOptions* options); GQuark infinoted_options_error_quark(void); G_END_DECLS #endif /* __INFINOTED_OPTIONS_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/infinoted/infinoted-util.c0000644000175000017500000001500712264763732016056 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include #ifdef LIBINFINITY_HAVE_LIBDAEMON #include #include #include /* for access(2) */ #define INFINOTED_PID_FILE_DIRECTORY \ LOCALSTATEDIR "/run/infinoted-" LIBINFINITY_API_VERSION #endif #include #include #include #include #include #ifdef G_OS_WIN32 /* Arbitrary; they are not used currently anyway */ # define LOG_ERR 0 # define LOG_WARNING 1 # define LOG_INFO 2 # include #else # include #endif static void infinoted_util_logv(int prio, const char* fmt, va_list ap) { #ifdef LIBINFINITY_HAVE_LIBDAEMON daemon_logv(prio, fmt, ap); #else #ifdef G_OS_WIN32 /* On Windows, convert to the character set of the console */ gchar* out; gchar* codeset; gchar* converted; out = g_strdup_vprintf(fmt, ap); codeset = g_strdup_printf("CP%u", (guint)GetConsoleOutputCP()); converted = g_convert(out, -1, codeset, "UTF-8", NULL, NULL, NULL); g_free(out); g_free(codeset); fprintf(stderr, "%s\n", converted); g_free(converted); #else vfprintf(stderr, fmt, ap); fputc('\n', stderr); #endif /* !G_OS_WIN32 */ #endif /* !LIBINFINITY_HAVE_LIBDAEMON */ } #ifdef LIBINFINITY_HAVE_LIBDAEMON static const gchar* infinoted_util_get_pidfile_path_user(void) { static gchar* path = NULL; if(path) return path; path = g_strdup_printf( "%s/.infinoted/infinoted-" LIBINFINITY_API_VERSION ".pid", g_get_home_dir()); infinoted_util_create_dirname(path, NULL); return path; } static const gchar* infinoted_util_get_pidfile_path_system(void) { return INFINOTED_PID_FILE_DIRECTORY "/infinoted-" LIBINFINITY_API_VERSION ".pid"; } #endif /** * infinoted_util_create_dirname: * @path: The filename to create a path to. * @error: Location to store error information, if any. * * Creates directories leading to the given path. Does not create a directory * for the last component of the path, assuming that it is a filename that * you are going to write into that directory later. * * Returns: %TRUE on success, or %FALSE on error in which case @error is set. */ gboolean infinoted_util_create_dirname(const gchar* path, GError** error) { gchar* dirname; int save_errno; dirname = g_path_get_dirname(path); if(g_mkdir_with_parents(dirname, 0700) != 0) { save_errno = errno; g_set_error( error, g_quark_from_static_string("ERRNO_ERROR"), save_errno, _("Could not create directory \"%s\": %s"), dirname, strerror(save_errno) ); g_free(dirname); return FALSE; } g_free(dirname); return TRUE; } /** * infinoted_util_log_error: * @fmt: A printf-style format string. * ...: Format arguments. * * Logs an error message. If the server is daemonized, log to syslog, * otherwise log to stderr. */ void infinoted_util_log_error(const char* fmt, ...) { va_list ap; va_start(ap, fmt); infinoted_util_logv(LOG_ERR, fmt, ap); va_end(ap); } /** * infinoted_util_log_warning: * @fmt: A printf-style format string. * ...: Format arguments. * * Logs a warning message. If the server is daemonized, log to syslog, * otherwise log to stderr. */ void infinoted_util_log_warning(const char* fmt, ...) { va_list ap; va_start(ap, fmt); infinoted_util_logv(LOG_WARNING, fmt, ap); va_end(ap); } /** * infinoted_util_log_info: * @fmt: A printf-style format string. * ...: Format arguments. * * Logs an info message. If the server is daemonized, log to syslog, * otherwise log to stderr. */ void infinoted_util_log_info(const char* fmt, ...) { va_list ap; va_start(ap, fmt); infinoted_util_logv(LOG_INFO, fmt, ap); va_end(ap); } /** * infinoted_util_set_errno_error: * @error: A pointer to a #GError pointer, or %NULL. * @save_errno: An errno variable. * @prefix: A prefix string, or %NULL. * * Sets @error to @save_errno with domain ERRNO_ERROR. If @prefix is * non-%NULL, @prefix is prefixed to @error's message, obtained by strerror(). */ void infinoted_util_set_errno_error(GError** error, int save_errno, const char* prefix) { if(prefix != NULL) { g_set_error( error, g_quark_from_static_string("ERRNO_ERROR"), save_errno, "%s: %s", prefix, strerror(save_errno) ); } else { g_set_error( error, g_quark_from_static_string("ERRNO_ERROR"), save_errno, "%s", strerror(save_errno) ); } } #ifdef LIBINFINITY_HAVE_LIBDAEMON /** * infinoted_util_daemon_set_global_pid_file_proc: * * When attempting to read or write the PID file use the global file. */ void infinoted_util_daemon_set_global_pid_file_proc(void) { daemon_pid_file_proc = infinoted_util_get_pidfile_path_system; } /** * infinoted_util_daemon_set_global_pid_file_proc: * * When attempting to read or write the PID file use the local file which is * in the owner's home directory. */ void infinoted_util_daemon_set_local_pid_file_proc(void) { daemon_pid_file_proc = infinoted_util_get_pidfile_path_user; } /** * infinoted_util_daemon_pid_file_kill: * @sig: The signal to send to the daemon process. * * This is a thin wrapper for daemon_pid_file_kill() which uses * daemon_pid_file_kill_wait() if available with a timeout of 5 seconds. * * Returns: 0 if the signal was sent or nonzero otherwise. */ int infinoted_util_daemon_pid_file_kill(int sig) { #ifdef DAEMON_PID_FILE_KILL_WAIT_AVAILABLE return daemon_pid_file_kill_wait(sig, 5); #else return daemon_pid_file_kill(sig); #endif } #endif /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/infinoted/infinoted-pam.c0000644000175000017500000001633712264763732015665 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include "config.h" #include #include #include #ifdef LIBINFINITY_HAVE_PAM #include #ifdef __APPLE__ #include #else #include #endif #include #include #include #include #include /* cannot use g_strdup because that requires its return value to be free'd * with g_free(), but pam is not aware of that. */ static char* infinoted_pam_strdup(const char* str) { size_t size; char* new_str; size = strlen(str) + 1; new_str = malloc(size); memcpy(new_str, str, size); return new_str; } static int infinoted_pam_conv_func(int num_msg, const struct pam_message** msgs, struct pam_response** resps, void* appdata_ptr) { int i; const struct pam_message* msg; struct pam_response* resp; *resps = malloc(sizeof(struct pam_response) * num_msg); for(i = 0; i < num_msg; ++i) { msg = msgs[i]; resp = &(*resps)[i]; resp->resp_retcode = 0; if(msg->msg_style == PAM_PROMPT_ECHO_OFF) /* looks like password prompt */ resp->resp = infinoted_pam_strdup(appdata_ptr); else resp->resp = NULL; } return PAM_SUCCESS; } #ifdef HAVE_PAM_FAIL_DELAY static void infinoted_pam_delay_func(int retval, unsigned usec_delay, void *appdata_ptr) { /* do not delay */ /* TODO: figure out how to randomly delay a bit without blocking the entire * server. */ } #endif /* HAVE_PAM_FAIL_DELAY */ static void infinoted_pam_log_error(const char* username, const char* detail, int error_code, GError** error) { const char* msg; if(error_code == 0) msg = _("Entry not found"); else msg = strerror(error_code); infinoted_util_log_error( _("Error while checking groups of user \"%s\", %s: %s."), username, detail, msg ); /* TODO: use g_set_error_literal in glib 2.18 */ g_set_error( error, inf_authentication_detail_error_quark(), INF_AUTHENTICATION_DETAIL_ERROR_SERVER_ERROR, "%s", inf_authentication_detail_strerror(INF_AUTHENTICATION_DETAIL_ERROR_SERVER_ERROR) ); } static gboolean infinoted_pam_user_is_in_group(const gchar* username, gchar* required_group, gchar* buf, size_t buf_size, GError** error) { struct passwd user_entry, *user_pointer; struct group group_entry, *group_pointer; char** iter; char msgbuf[128]; int status; gid_t gid; /* first check against the user's primary group */ status = getpwnam_r(username, &user_entry, buf, buf_size, &user_pointer); if(user_pointer == NULL) { infinoted_pam_log_error( username, _("looking up user information"), status, error); return FALSE; } gid = user_entry.pw_gid; status = getgrgid_r(gid, &group_entry, buf, buf_size, &group_pointer); if(group_pointer == NULL) { g_snprintf(msgbuf, sizeof msgbuf, _("looking up group %ld"), (long) gid); infinoted_pam_log_error(username, msgbuf, status, error); return FALSE; } if(strcmp(group_entry.gr_name, required_group) == 0) return TRUE; /* now go through all users listed for the required group */ status = getgrnam_r(required_group, &group_entry, buf, buf_size, &group_pointer); if(group_pointer == NULL) { g_snprintf(msgbuf, sizeof msgbuf, _("looking up group \"%s\""), required_group); infinoted_pam_log_error(username, msgbuf, status, error); return FALSE; } for(iter = group_entry.gr_mem; *iter; ++iter) { if(strcmp(*iter, username) == 0) return TRUE; } /* Nothing worked. No success, but no error either. */ return FALSE; } gboolean infinoted_pam_user_is_allowed(InfinotedOptions* options, const gchar* username, GError** error) { char* buf; long buf_size_gr, buf_size_pw, buf_size; gboolean status; GError* local_error; gchar** iter; if(options->pam_allowed_users == NULL && options->pam_allowed_groups == NULL) { return TRUE; } else { if(options->pam_allowed_users != NULL) { for(iter = options->pam_allowed_users; *iter; ++iter) { if(strcmp(*iter, username) == 0) return TRUE; } } if(options->pam_allowed_groups != NULL) { /* avoid reallocating this buffer over and over */ buf_size_pw = sysconf(_SC_GETPW_R_SIZE_MAX); buf_size_gr = sysconf(_SC_GETGR_R_SIZE_MAX); buf_size = MAX(buf_size_pw, buf_size_gr); buf = g_malloc(buf_size); status = FALSE; local_error = NULL; for(iter = options->pam_allowed_groups; *iter; ++iter) { if(infinoted_pam_user_is_in_group( username, *iter, buf, buf_size, &local_error)) { status = TRUE; break; } /* do not try to check all other groups on an actual error */ if(local_error) { g_propagate_error(error, local_error); break; } } g_free(buf); return status; } else { return FALSE; } } } gboolean infinoted_pam_authenticate(const char* service, const char* username, const char* password) { pam_handle_t* pamh; struct pam_conv conv; int status; #ifdef HAVE_PAM_FAIL_DELAY void (*delay_fp)(int, unsigned, void*); void* delay_void_ptr; #endif conv.conv = infinoted_pam_conv_func; conv.appdata_ptr = *(void**) (void*) &password; if(pam_start(service, username, &conv, &pamh) != PAM_SUCCESS) return FALSE; status = PAM_SUCCESS; #ifdef HAVE_PAM_FAIL_DELAY delay_fp = infinoted_pam_delay_func; /* avoid warnings for casting func-ptrs to object pointers * and for type-punning pointers */ delay_void_ptr = *(void**) (void*) (char*) &delay_fp; status = pam_set_item(pamh, PAM_FAIL_DELAY, delay_void_ptr); if(status == PAM_SUCCESS) status = pam_authenticate(pamh, 0); #endif /* TODO: consider pam_acct_mgmt */ pam_end(pamh, status); return status == PAM_SUCCESS; } #endif /* LIBINFINITY_HAVE_PAM */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinftext.pc.in0000644000175000017500000000051011204026376014060 00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: libinftext Description: Infinote text processing library Requires: libinfinity-@LIBINFINITY_API_VERSION@ Version: @VERSION@ Libs: -L${libdir} -linftext-@LIBINFINITY_API_VERSION@ Cflags: -I${includedir}/libinftext-@LIBINFINITY_API_VERSION@ libinfinity-0.5.5/m4/0000755000175000017500000000000012264766266011403 500000000000000libinfinity-0.5.5/m4/ltoptions.m40000644000175000017500000003007312264766060013613 00000000000000# Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, # Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 7 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option `$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl `shared' nor `disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) ]) ])# _LT_SET_OPTIONS ## --------------------------------- ## ## Macros to handle LT_INIT options. ## ## --------------------------------- ## # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the `shared' and # `disable-shared' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the `static' and # `disable-static' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the `fast-install' # and `disable-fast-install' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the `pic-only' and `no-pic' # LT_INIT options. # MODE is either `yes' or `no'. If omitted, it defaults to `both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS="$lt_save_ifs" ;; esac], [pic_mode=default]) test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) ## ----------------- ## ## LTDL_INIT Options ## ## ----------------- ## m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) libinfinity-0.5.5/m4/gtk-doc.m40000644000175000017500000000477212264766060013117 00000000000000dnl -*- mode: autoconf -*- # serial 1 dnl Usage: dnl GTK_DOC_CHECK([minimum-gtk-doc-version]) AC_DEFUN([GTK_DOC_CHECK], [ AC_REQUIRE([PKG_PROG_PKG_CONFIG]) AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first dnl check for tools we added during development AC_PATH_PROG([GTKDOC_CHECK],[gtkdoc-check]) AC_PATH_PROGS([GTKDOC_REBASE],[gtkdoc-rebase],[true]) AC_PATH_PROG([GTKDOC_MKPDF],[gtkdoc-mkpdf]) dnl for overriding the documentation installation directory AC_ARG_WITH([html-dir], AS_HELP_STRING([--with-html-dir=PATH], [path to installed docs]),, [with_html_dir='${datadir}/gtk-doc/html']) HTML_DIR="$with_html_dir" AC_SUBST([HTML_DIR]) dnl enable/disable documentation building AC_ARG_ENABLE([gtk-doc], AS_HELP_STRING([--enable-gtk-doc], [use gtk-doc to build documentation [[default=no]]]),, [enable_gtk_doc=no]) if test x$enable_gtk_doc = xyes; then ifelse([$1],[], [PKG_CHECK_EXISTS([gtk-doc],, AC_MSG_ERROR([gtk-doc not installed and --enable-gtk-doc requested]))], [PKG_CHECK_EXISTS([gtk-doc >= $1],, AC_MSG_ERROR([You need to have gtk-doc >= $1 installed to build $PACKAGE_NAME]))]) dnl don't check for glib if we build glib if test "x$PACKAGE_NAME" != "xglib"; then dnl don't fail if someone does not have glib PKG_CHECK_MODULES(GTKDOC_DEPS, glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0,,[:]) fi fi AC_MSG_CHECKING([whether to build gtk-doc documentation]) AC_MSG_RESULT($enable_gtk_doc) dnl enable/disable output formats AC_ARG_ENABLE([gtk-doc-html], AS_HELP_STRING([--enable-gtk-doc-html], [build documentation in html format [[default=yes]]]),, [enable_gtk_doc_html=yes]) AC_ARG_ENABLE([gtk-doc-pdf], AS_HELP_STRING([--enable-gtk-doc-pdf], [build documentation in pdf format [[default=no]]]),, [enable_gtk_doc_pdf=no]) if test -z "$GTKDOC_MKPDF"; then enable_gtk_doc_pdf=no fi if test -z "$AM_DEFAULT_VERBOSITY"; then AM_DEFAULT_VERBOSITY=1 fi AC_SUBST([AM_DEFAULT_VERBOSITY]) AM_CONDITIONAL([ENABLE_GTK_DOC], [test x$enable_gtk_doc = xyes]) AM_CONDITIONAL([GTK_DOC_BUILD_HTML], [test x$enable_gtk_doc_html = xyes]) AM_CONDITIONAL([GTK_DOC_BUILD_PDF], [test x$enable_gtk_doc_pdf = xyes]) AM_CONDITIONAL([GTK_DOC_USE_LIBTOOL], [test -n "$LIBTOOL"]) AM_CONDITIONAL([GTK_DOC_USE_REBASE], [test -n "$GTKDOC_REBASE"]) ]) libinfinity-0.5.5/m4/libtool.m40000644000175000017500000106000712264766060013225 00000000000000# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ]) # serial 57 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. m4_defun([_LT_CC_BASENAME], [for cc_temp in $1""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ]) # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from `configure', and `config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # `config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain="$ac_aux_dir/ltmain.sh" ])# _LT_PROG_LTMAIN ## ------------------------------------- ## ## Accumulate code for creating libtool. ## ## ------------------------------------- ## # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the `libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) ## ------------------------ ## ## FIXME: Eliminate VARNAME ## ## ------------------------ ## # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to `config.status' so that its # declaration there will have the same value as in `configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags="_LT_TAGS"dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the `libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into `config.status', and then the shell code to quote escape them in # for loops in `config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$[]1 _LTECHO_EOF' } # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # `#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test $lt_write_fail = 0 && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ \`$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test $[#] != 0 do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try \`$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try \`$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test "$silent" = yes && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # _LT_COPYING _LT_LIBTOOL_TAGS # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) _LT_PROG_REPLACE_SHELLFNS mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG m4_ifndef([AC_PROG_GO], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_GO. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_GO], [AC_LANG_PUSH(Go)dnl AC_ARG_VAR([GOC], [Go compiler command])dnl AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl AC_CHECK_TOOL(GOC, gccgo) if test -z "$GOC"; then if test -n "$ac_tool_prefix"; then AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) fi fi if test -z "$GOC"; then AC_CHECK_PROG(GOC, gccgo, gccgo, false) fi ])#m4_defun ])#m4_ifndef # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([AC_PROG_GO], [LT_LANG(GO)], [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[[012]]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES([TAG]) # --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test "$lt_cv_ld_force_load" = "yes"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" m4_if([$1], [CXX], [ if test "$lt_cv_apple_cc_single_mod" != "yes"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX([TAGNAME]) # ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script which will find a shell with a builtin # printf (which we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $[]1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } case "$ECHO" in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [ --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified).], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([${with_sysroot}]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and in which our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD="${LD-ld}_sol2" fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" ])# _LT_ENABLE_LOCK # _LT_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} : ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) _LT_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test x"[$]$2" = xyes; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links="nottested" if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", [Define to the sub-directory in which libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existent directories. if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[[4-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([], [sys_lib_dlsearch_path_spec], [2], [Run-time system search path for libraries]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program which can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program which can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method = "file_magic"]) _LT_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi]) if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # _LT_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], [lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then nm_file_list_spec='@' fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; *Sun\ F* | *Sun*Fortran*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Intel*\ [[CF]]*Compiler*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *Portland\ Group*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global defined # symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] ;; esac ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi _LT_TAGVAR(link_all_deplibs, $1)=no else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS="$save_LDFLAGS"]) if test "$lt_cv_irix_exported_symbol" = yes; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting ${shlibpath_var} if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report which library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC="$lt_save_CC" ])# _LT_LANG_C_CONFIG # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GXX" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared # libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ func_to_tool_file "$lt_outputfile"~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd2*) # C++ shared libraries are fairly broken _LT_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(GCC, $1)="$GXX" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test "$_lt_caught_CXX_error" != yes AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF package foo func foo() { } _LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case ${prev}${p} in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" || test $p = "-R"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test "$pre_test_object_deps_done" = no; then case ${prev} in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)="${prev}${p}" else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)="$p" else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)="$p" else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) if test -z "$F77" || test "X$F77" = "Xno"; then _lt_disable_F77=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_F77" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$G77" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC="$lt_save_CC" CFLAGS="$lt_save_CFLAGS" fi # test "$_lt_disable_F77" != yes AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) if test -z "$FC" || test "X$FC" = "Xno"; then _lt_disable_FC=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_FC" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test "$_lt_disable_FC" != yes AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_GO_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE # Source file extension for Go test sources. ac_ext=go # Object file extension for compiled Go test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="package main; func main() { }" # Code to be used in simple link tests lt_simple_link_test_code='package main; func main() { }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GOC-"gccgo"} CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # Go did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GO_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_GO # ---------- AC_DEFUN([LT_PROG_GO], [AC_CHECK_TOOL(GOC, gccgo,) ]) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [AC_MSG_CHECKING([whether the shell understands some XSI constructs]) # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes AC_MSG_RESULT([$xsi_shell]) _LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) AC_MSG_CHECKING([whether the shell understands "+="]) lt_shell_append=no ( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes AC_MSG_RESULT([$lt_shell_append]) _LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) # ------------------------------------------------------ # In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and # '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. m4_defun([_LT_PROG_FUNCTION_REPLACE], [dnl { sed -e '/^$1 ()$/,/^} # $1 /c\ $1 ()\ {\ m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) } # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: ]) # _LT_PROG_REPLACE_SHELLFNS # ------------------------- # Replace existing portable implementations of several shell functions with # equivalent extended shell implementations where those features are available.. m4_defun([_LT_PROG_REPLACE_SHELLFNS], [if test x"$xsi_shell" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary parameter first. func_stripname_result=${3} func_stripname_result=${func_stripname_result#"${1}"} func_stripname_result=${func_stripname_result%"${2}"}]) _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl func_split_long_opt_name=${1%%=*} func_split_long_opt_arg=${1#*=}]) _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) fi if test x"$lt_shell_append" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl func_quote_for_eval "${2}" dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) fi ]) # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine which file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS libinfinity-0.5.5/m4/ltversion.m40000644000175000017500000000126212264766060013603 00000000000000# ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # @configure_input@ # serial 3337 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.2]) m4_define([LT_PACKAGE_REVISION], [1.3337]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.2' macro_revision='1.3337' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) libinfinity-0.5.5/m4/lt~obsolete.m40000644000175000017500000001375612264766060014143 00000000000000# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) libinfinity-0.5.5/m4/ltsugar.m40000644000175000017500000001042412264766060013237 00000000000000# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59 which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) libinfinity-0.5.5/TODO0000644000175000017500000000644212264763732011474 00000000000000This is a more or less incomplete list of more or less independant tasks that would be nice to have done for the first stable release. Performance (Some ideas to improve performance, profile to verify!): * callgrind suggests g_object_new requires much time, especially for objects that are often instantianted, such as InfAdoptedRequest, InfTextDefaultInsertOperation and InfTextDefaultDeleteOperation. Maybe we can improve this by not initializing the member variables by properties, but by setting them after the g_object_new() call. * Move state vector helper functions in algorithm to InfAdoptedStateVector, with a better O(n) implementation. * Cache request.vector[request.user] in every request, this seems to be used pretty often. * Optionally compile with - G_DISABLE_CAST_CHECKS - G_DISABLE_ASSERT - G_DISABLE_CHECKS defined. Others: * Split InfXmppConnection (XMPP) - InfXmppConnection: XMPP core implementation - InfJabberConnection: Connection to jabber server, managing roster, presence, etc. Derives from InfXmppConnection, not used on server side - InfRawXmppConnection: InfXmlConnection implementation by sending raw messages to XMPP server (Derive from InfXmppConnection, make XMPP server create these connections (unsure: rather add a vfunc and subclass InfXmppServer?)) - InfJabberUserConnection: Implements InfXmlConnection by sending stuff to a particular Jabber user (owns InfJabberConnection) - InfJabberDiscovery (owns InfJabberConnection) * Make InfTextChunk reference-counted, or implement copy-on-write semantics. It is currently copied way too often. (InfText) * Implement inf_text_chunk_insert_substring, and make use in InfTextDeleteOperation (InfText) * Add a set_caret paramater to insert_text and erase_text of InfTextBuffer and derive a InfTextRequest with a "set-caret" flag. * InfTextEncoding boxed type * Create a pseudo XML connection implementation, re-enable INF_IS_XML_CONNECTION check in inf_net_object_received * Add accessor API in InfGtkBrowserModel, so InfGtkBrowserView does not need to call gtk_tree_model_get all the time (which unnecssarily dups/refs) * Add append() and clear() virtual methods to InfTextBuffer. These may not have to be implemented since a default implementation can be used if no special one is provided, but it could help to speed up special operations. Make use in infd_note_plugin_text. * Make InfcExploreRequest derive from InfcNodeRequest. This saves some code duplication in InfcBrowser. * Change the storage interface to be asynchronous * Replace the various begin-foo signals in InfcBrowser by a begin-operation with iter and request as parameters, detailed on the operation type (add-node, remove-node, subscribe-session etc.). Similar with the infc_browser_iter_get_foo_request functions (replace by a generic infc_browser_iter_get_pending_request function). * Make InfLocalPublisher take a InfdXmlServer instead of a port number. Maybe even rename to InfPublisher, with InfDiscoveryAvahi assuming an InfdXmppServer. Or, consider simply removing the interface, and require people to use InfDiscoveryAvahi directly (check how well that works with InfdServerPool). * Assert in infc_explore_request_progress/_finish instead of setting error, check error condition in InfcBrowser. libinfinity-0.5.5/ChangeLog0000644000175000017500000101221312264763732012550 000000000000002012-11-26 Armin Burgmeier * libinfinity/common/inf-xmpp-connection.c (inf_xmpp_connection_send_xml): Don't crash when the connection is deleted during the sent callback. 2012-11-26 Armin Burgmeier * libinftextgtk/inf-text-gtk-view.c: Fix assertion fail at drawing selection of not yet fully synchronized document. 2012-10-21 Armin Burgmeier * configure.ac: Post-release bump to 0.5.4. 2012-10-21 Armin Burgmeier * === Released 0.5.3 === * NEWS: Update for release. 2012-10-21 Armin Burgmeier * libinfinity/common/inf-xmpp-connection.c: Fix a crash that could occur when it is noticed at send time that a connection is down. * test/inf-test-mass-join.c: * test/Makefile.am: Add a test which connects 128 users simultaneously to an infinote server. Disconnecting all these users at once is a way to reproduce the crash the above change fixes. 2012-06-02 Philipp Kern * test/Makefile.am: Add non-interactive tests to `make check'. (Except for text-replay, which takes a long time to complete and needs additional CLI parameters.) 2012-06-02 Philipp Kern * configure.ac: Check for libm for libinftextgtk (uses atan2, floor and sin/cos). 2012-05-30 Colomban Wendling * libinfgtk/inf-gtk-browser-model.c: * libinfinity/client/infc-browser.c: * libinfinity/common/inf-xml-connection.c: InfXmlConnectionStatus, InfcBrowserStatus and InfGtkBrowserModelStatus GType registration code missed an array sentinel leading to GType reading invalid memory paste the end of the array. 2012-03-25 Armin Burgmeier * configure.ac: Post-release bump to 0.5.3. 2012-03-25 Armin Burgmeier * === Released 0.5.2 === * NEWS: Update for release. 2012-03-17 Philipp Kern * INSTALL: Boilerplate content updated. 2012-02-07 Armin Burgmeier * libinfgtk/inf-gtk-certificate-manager.c (inf_gtk_certificate_manager_certificate_func): Fix a crash when the certificate has no hostname set. 2012-01-09 Dominique Leuenberger * infinoted/infinoted-creds.h: * infinoted/infinoted-util.h: * libinfinity/common/inf-xml-util.h: Fix compilation with glib 2.31. 2011-10-13 Philipp Kern * infinoted/infinoted-0.5.man: * infinoted/infinoted-options.c: State that sync interval is in seconds. 2011-08-28 Philipp Kern * infinoted/infinoted-0.5.man: Update whatis entry to be actually useful. 2011-08-09 Armin Burgmeier * libinfinity/common/inf-xmpp-connection.c: Fix a crash when the initial message contains invalid UTF-8. 2011-08-01 Armin Burgmeier * configure.ac: Post-release bump to 0.5.2. 2011-08-01 Armin Burgmeier * === Released 0.5.1 === * NEWS: Update for release. 2011-08-01 Armin Burgmeier * infinoted/infinoted-config-reload.c (infinoted_config_reload): Update directory sync on config reload. 2011-08-01 Armin Burgmeier * infinoted/infinoted-directory-sync.c (infinoted_directory_sync_remove_session): Do not run into an assertion failue if the removed session had a timeout running. 2011-08-01 Armin Burgmeier * libinfinity/common/inf-standalone-io.c (inf_standalone_io_iteration_impl): Wait for the earliest timeout, not for the latest one. 2011-07-17 Armin Burgmeier * infinoted/infinoted-pam.c: Fix pam_appl.h include on MacOS X (#563, nairboon). 2011-06-23 Philipp Kern * configure.ac: Print if PAM support is enabled or not. 2011-06-19 Benjamin Herr * libinfinity/server/infd-directory.c (infd_directory_node_is_name_available): Disallow node names containing non-printable or only space characters. 2011-06-19 Armin Burgmeier * libinfinity/server/infd-directory.c (infd_directory_node_is_name_available): Enable localization of two error messages. 2011-06-02 Armin Burgmeier * libinfinity/server/infd-directory.c (infd_directory_add_note): Do not leak a reference on the subscription group. 2011-05-10 Armin Burgmeier * libinfinity/server/infd-directory.c (infd_directory_node_get_and_link_session): Only call infd_directory_node_link_session() if the session is not yet linked, otherwise an assertion fails. This could happen if the infd_directory_iter_get_session() public API function was called when the session existed already. 2011-03-27 Armin Burgmeier * === Released 0.5.0 === * NEWS: Update for release. * infinoted/Makefile.am: Distribute the manpage since it is not generated. * docs/reference/Makefile.am: * docs/reference/libinfgtk/Makefile.am: * docs/reference/libinfinity/Makefile.am; * docs/reference/libinftext/Makefile.am: * docs/reference/libinftextgtk/Makefile.am: Fix make distcheck with recent gtk-doc. 2011-02-23 Armin Burgmeier * libinfinity/client/infc-note-plugin.h: * libinfinity/server/infd-note-plugin.h: Add typedefs for the function pointers used to be more friendly to binding generators. 2011-02-21 Armin Burgmeier * libinfinity/adopted/inf-adopted-undo-grouping.c (inf_adopted_undo_grouping_class_init): Fix struct offset of the group_requests signal. 2011-01-30 Armin Burgmeier * libinftext/inf-text-session.c (inf_text_session_get_xml_user_props): If the "selection" attribute is not set, default to zero. Otherwise an invalid selection might arise if the selection-length of a rejoined user is kept but caret-position is set to another value. 2011-01-30 Armin Burgmeier * libinftextgtk/inf-text-gtk-view.c (inf_text_gtk_view_expose_event_after_cb): Add a few assertions to make sure our internal state is OK. 2011-01-30 Armin Burgmeier * libinftextgtk/inf-text-gtk-viewport.c (inf_text_gtk_viewport_remove_user): Remove remote cursor position indicator when the corresponding client leaves. 2011-01-30 Armin Burgmeier * libinftextgtk/inf-text-gtk-viewport.c: Adapt remote cursor position indicator when the scrollbar's adjustment changes. This happens for example when GtkTextView lazily computes the height of the text. 2011-01-29 Armin Burgmeier * libinftextgtk/inf-text-gtk-viewport.c: Fix display of remote cursor position in scrollbar with GTK+ 3, and make the marker a bit nicer. 2011-01-29 Armin Burgmeier * libinftextgtk/inf-text-gtk-view.c (inf_text_gtk_view_expose_event_after_cb): With GTK+ 3, fix remote cursors not being drawn if remote selections are not activated to be drawn. 2011-01-23 Armin Burgmeier * all source files: Add 2011 to copyright years. 2011-01-23 Armin Burgmeier * configure.ac: * libinfgtk.pc.in: * libinftextgtk.pc.in: Add a gtk_version variable for pkg-config and request the correct GTK+ version in the pkg-config file. 2011-01-17 Armin Burgmeier * libinfinity/communication/inf-communication-group-private.h: * libinfinity/communication/inf-communication-group.c: Add a private _inf_communication_group_foreach_method() function. * libinfinity/communication/inf-communication-method.h: * libinfinity/communication/inf-communication-method.c: * libinfinity/communication/inf-communication-central-method.c: Change the return type of the _received vfunc to InfCommunicationScope, returning the scope given by the InfCommunicationObject target. * libinfinity/communication/inf-communication-registry.c (inf_communication_registry_received_cb): Relay any received messages with INF_COMMUNICATION_SCOPE_GROUP to connections in other networks of the same group. 2011-01-17 Armin Burgmeier * libinftext/inf-text-undo-grouping.c: Fix two typos in comments. 2011-01-17 Armin Burgmeier * README: Add new gthread-2.0 dependency to the README file. 2011-01-14 Philipp Kern * infinoted/Makefile.am: * infinoted/infinoted-0.5.man: add a manpage for infinoted 2011-01-01 Elliot Kroo * libinfinity/server/infd-filesystem-storage.c (infd_filesystem_storage_remove_rec): If g_unlink fails with EPERM then this can also mean that the file being unlinked is a directory, so also try to recurse in this case. This fixes node removal on Mac OS X. 2010-12-25 Armin Burgmeier * libinfinity/common/inf-standalone-io.c: Don't confuse dispatch list with timeout list on dispatch invocation. * libinfinity/common/inf-sasl-context.h: * libinfinity/common/inf-sasl-context.c: * libinfinity/common/Makefile.am: Add InfSaslContext, which provides a wrapper for Gsasl. It provides an asynchronous callback mechanism, implemented via an extra thread for each authentication session. * libinfinity/common/inf-discovery-avahi.h: * libinfinity/common/inf-discovery-avahi.c: * libinfinity/common/inf-xmpp-connection.h: * libinfinity/common/inf-xmpp-connection.c: * libinfinity/server/infd-xmpp-server.h: * libinfinity/server/infd-xmpp-server.c: * infinoted/infinoted-startup.h: * infinoted/infinoted-startup.c: * infinoted/infinoted-run.h: * infinoted/infinoted-run.c: * infinoted/infinoted-pam.h: * infinoted/infinoted-config-reload.c: Replace Gsasl usage by InfSaslContext and adapt to API changes. 2010-12-25 Armin Burgmeier * libinfinity/common/inf-xmpp-connection.c (inf_xmpp_connection_terminate): If sending an authentication abort, then free the corresponding XML node afterwards. * libinfinity/server/infd-directory.c (infd_directory_dispose): Free the connections hash table. * libinfinity/server/infd-filesystem-storage.c (infd_filesystem_storage_storage_read_subdirectory): Close the DIR* returned by fdopendir(). * infinoted/infinoted-run.c (infinoted_run_start): If the IPv6 server could start but the IPv4 server couldn't (or vice versa), then still free the error from the failing server. 2010-12-25 Armin Burgmeier * libinfgtk/inf-gtk-io.c: Fix a possible race condition. 2010-12-25 Armin Burgmeier * libinfgtk/inf-gtk-browser-view.c (inf_gtk_browser_view_browser_added): Remove two unused variables. 2010-12-25 Armin Burgmeier * libinfinity/common/inf-standalone-io.c (inf_standalone_io_wakeup): Make this actually work by writing to the writing end of the pipe, not to the reading end. 2010-12-14 Felix Kaser * libinftextgtk/inf-text-gtk-hue-chooser.c: Use get_preferred_width and get_preferred_height instead of size_request when building against recent enough GTK+ 3, fixing the build. 2010-11-27 Armin Burgmeier * libinfgtk/inf-gtk-io.c (inf_gtk_io_dispatch_func): Fix a crash when a dispatch handler is supposed to be called (Felix Kaser). 2010-11-27 Armin Burgmeier * libinfinity/common/inf-simulated-connection.h: * libinfinity/common/inf-simulated-connection.c: Add INF_SIMULATED_CONNECTION_IO_CONTROLLED mode. 2010-11-27 Armin Burgmeier * libinfinity/common/inf-simulated-connection.c (inf_simulated_connection_connect): Improve the docs to make it clear that the function needs only to be called once for both connections to be connected to each other. 2010-11-24 Armin Burgmeier * libinfgtk/inf-gtk-browser-view.c (inf_gtk_browser_view_browser_added): Check for browser status to be connected instead of connection status before doing initial root exploration. Otherwise it can happen that the browser is not yet ready for exploration in case it is still waiting for the server's welcome message (Felix Kaser). 2010-11-21 Armin Burgmeier * libinfinity/common/inf-certificate-chain.h: * libinfinity/common/inf-chat-session.c: * libinfinity/common/inf-error.h: * libinfinity/common/inf-io.h: * libinfinity/common/inf-io.c: * libinfinity/common/inf-local-publisher.h: * libinfinity/common/inf-protocol.c: * libinfinity/common/inf-session.h: * libinfinity/common/inf-session.c: * libinfinity/common/inf-xmpp-manager.c: * libinfinity/communication/inf-communication-factory.h: * libinfinity/communication/inf-communication-object.h: * libinfinity/client/infc-browser.h: * libinfinity/client/infc-browser.c: * libinfinity/client/infc-explore-request.h: * libinfinity/client/infc-explore-request.c: * libinfinity/server/infd-directory.c: * libinfinity/server/infd-session-proxy.c: * libinfinity/adopted/inf-adopted-algorithm.c: * libinfinity/adopted/inf-adopted-session.c: * libinfinity/adopted/inf-adopted-state-vector.c: * libinfinity/adopted/inf-adopted-undo-grouping.c: Some documentation fixes. 2010-11-01 Armin Burgmeier * libinfinity/common/inf-xmpp-connection.c (inf_xmpp_connection_sasl_error): Don't assert that sasl session is set since it can happen that it isn't in case the SASL session cannot be initiated. 2010-11-01 Armin Burgmeier * libinfinity.pc.in: * configure.ac: Require and link against gthread-2.0. 2010-10-31 Armin Burgmeier * infinoted/infinoted-record.c (infinoted_record_new): Initialize the record->records list to NULL. 2010-10-31 Armin Burgmeier * libinfinity/common/inf-io.h: * libinfinity/common/inf-io.c: Change the watch interface slightly, add inf_io_add_dispatch() and inf_io_remove_dispatch() and require implementations to be thread-safe. * libinfinity/common/inf-standalone-io.c: * libinfgtk/inf-gtk-io.c: Adapt, and provide thread-safety. * libinfinity/common/inf-init.c: Call g_thread_init as a part of the libinfinity startup procedure. * libinfinity/common/inf-discovery-avahi.c: * libinfinity/common/inf-tcp-connection.c: * libinfinity/adopted/inf-adopted-session.c: * libinfinity/client/infc-browser.c: * libinfinity/server/infd-directory.c: * libinfinity/server/infd-tcp-server.c: * libinftext/inf-text-session.c: * libinftextgtk/inf-text-gtk-view.c: * infinoted/infinoted-signal.h: * infinoted/infinoted-signal.c: * infinoted/infinoted-autosave.c: * infinoted/infinoted-directory-sync.c: * test/inf-test-browser.c: * test/inf-test-chat.c: * test/inf-test-tcp-connection.c: Adapt to the API changes. 2010-10-09 Armin Burgmeier * libinfinity/client/infc-browser.c (infc_browser_disconnected): Discard the browser's chat session on disconnection. 2010-10-09 Armin Burgmeier * test/inf-test-gtk-browser.c: Add a missing include. 2010-10-06 Armin Burgmeier * libinfinity/common/inf-xmpp-connection.c (inf_xmpp_connection_sax_end_element): Fix an assertion so that the ending top-level tag is allowed not to be stream:stream if the connection is going to be terminated. This can happen if the opening and closing XML tag is sent in one go so that both are processed by the parser. The XML handler for the start element will then terminate the connection. Bug #546. 2010-10-03 Armin Burgmeier * libinfinity/communication/inf-communication-central-method.c (inf_communication_central_method_send_all): Make the code aware of the send callback modifying the connection list. 2010-10-03 Armin Burgmeier * libinftext/inf-text-remote-delete-operation.c (inf_text_remote_delete_operation_transform_split): When a remote delete operation is splitted, make sure to keep the recon order in the splitted operations. Also fix recon position index in the second operation. * test/session/test-53.xml: * test/replay/replay-11.record.xml: Add a test and a record which make libinfinity run into a failed assertion when reconstructing the delete operation without this being fixed. 2010-10-02 Armin Burgmeier * test/inf-test-gtk-browser.c (main): Allow to open connections via their IP address when given as commandline arguments. 2010-10-02 Jesse van den Kieboom * libinfgtk/inf-gtk-browser-view.c: * libinftextgtk/inf-text-gtk-hue-chooser.c: * libinftextgtk/inf-text-gtk-view.c: * libinftextgtk/inf-text-gtk-viewport.c: Adapt for latest GTK+3. 2010-09-21 Armin Burgmeier * libinftextgtk/inf-text-gtk-view.h: * libinftextgtk/inf-text-gtk-view.c: Add inf_text_gtk_view_set_show_remote_cursors(), inf_text_gtk_view_set_show_remote_selections() and inf_text_gtk_view_set_show_remote_current_lines(). * libinftextgtk/inf-text-gtk-viewport.h: * libinftextgtk/inf-text-gtk-viewport.c: Add inf_text_gtk_viewport_set_show_user_markers(). 2010-09-19 Armin Burgmeier * libinfgtk/inf-gtk-browser-view.c: * libinfgtk/inf-gtk-certificate-dialog.c: * libinfgtk/inf-gtk-certificate-manager.c: * libinfgtk/inf-gtk-chat.c: * libinftextgtk/inf-text-gtk-hue-chooser.c: Fix the GTK+2 build (#545). 2010-09-19 Armin Burgmeier * infinoted/infinoted-main.c: Include and , so that umask() is available (fixes the build on Ubuntu). 2010-09-19 Armin Burgmeier * libinfinity/server/infd-tcp-server.c (infd_tcp_server_io): Fix a compiler warning. 2010-09-17 Armin Burgmeier * libinfgtk/inf-gtk-browser-view.c: * libinfgtk/inf-gtk-certificate-dialog.c: * libinfgtk/inf-gtk-certificate-manager.c: * libinfgtk/inf-gtk-chat.c: * libinftextgtk/inf-text-gtk-hue-chooser.c: Adapt to recent changes in GTK+ 3. 2010-08-22 Jesse van den Kieboom * libinfinity/common/inf-protocol.h: * libinfinity/common/inf-protocol.c: Add inf_protocol_get_default_port(). * infinoted/infinoted-options.c: * test/inf-test-browser.c: * test/inf-test-chat.c: * test/inf-test-daemon.c: Make use of the new function instead of hardcoding the port value. 2010-08-22 Jesse van den Kieboom * libinftextgtk/inf-text-gtk-hue-chooser.c (inf_text_gtk_hue_chooser_realize): Set correct user_data for correct window, fixing the behavior of the hue chooser. 2010-08-15 Armin Burgmeier * configure.ac: Added a --with-gtk3 switch which makes libinfgtk and libinftexgtk build against GTK+ 3. * libinfgtk/inf-gtk-browser-model-filter.h: * libinfgtk/inf-gtk-browser-model-sort.h: * libinfgtk/inf-gtk-browser-model.h: * libinfgtk/inf-gtk-browser-store.h: * libinfgtk/inf-gtk-browser-store.c: * libinfgtk/inf-gtk-browser-view.h: * libinfgtk/inf-gtk-browser-view.c: * libinfgtk/inf-gtk-certificate-dialog.c: * libinfgtk/inf-gtk-certificate-manager.c: * libinfgtk/inf-gtk-certificate-view.c: * libinfgtk/inf-gtk-chat.c: * libinftextgtk/inf-text-gtk-buffer.h: * libinftextgtk/inf-text-gtk-hue-chooser.h: * libinftextgtk/inf-text-gtk-hue-chooser.c: * libinftextgtk/inf-text-gtk-view.h: * libinftextgtk/inf-text-gtk-view.c: * libinftextgtk/inf-text-gtk-viewport.h: * libinftextgtk/inf-text-gtk-viewport.c: Make libinfgtk and libinftextgtk compile with GTK+ 3. This involves adhering to the single include policy and replacing some sealed struct member accesses with their corresponding accessor functions. 2010-08-15 Armin Burgmeier * libinfinity/common/inf-chat-session.c (inf_chat_session_user_join, inf_chat_session_user_part): Set correct flags for userjoin and userpart messages. 2010-08-15 Armin Burgmeier * libinfinity/common/inf-chat-session.c (inf_chat_session_to_xml_sync): Fix sending chat backlog to clients which was broken since 2010-03-12. 2010-08-15 Armin Burgmeier * test/inf-test-gtk-browser.c: Fixed a crash when closing the chat or session window while joining. Also do not attempt to rejoin with the same user name all the time if the user name is in use already. 2010-08-08 Armin Burgmeier * libinfinity/server/infd-tcp-server.c: Add debugging code to observe badly-behaving accept(). There was a case where accept() returned a valid but non-connected socket which brought down the infinoted server due to getpeername failing. I want to find out more about when exactly this happens and how this can be catched instead of just fixing the symptoms. 2010-06-25 Armin Burgmeier * libinftextgtk/inf-text-gtk-buffer.h: * libinftextgtk/inf-text-gtk-buffer.c: Added inf_text_gtk_buffer_get_user_for_tag(). 2010-06-05 Armin Burgmeier * libinftext/inf-text-move-operation.c (inf_text_move_operation_transform_insert, inf_text_move_operation_transform_delete): Make the delete transformation work correctly when deleting characters from within the selection, make the insert transformation not expand the selection when inserting at the selection bounds. 2010-06-05 Armin Burgmeier * libinftextgtk/inf-text-gtk-view.c: * libinftextgtk/inf-text-gtk-viewport.c: Avoid use of symbols not available in GTK+ 2.12. 2010-06-04 Armin Burgmeier * libinfinity/inf-marshal.in: Remove the VOID:UINT,UINT,OBJECT marshaller. * libinftext/inf-text-buffer.h: * libinftext/inf-text-buffer.c: Rename the insert-text and erase-text signals to text-inserted and text-erased, and make them RUN_FIRST signals. This does not require the signal to be emitted to insert or remove text, but if a modification to the buffer happens externally then the signal can (and should!) still be emitted afterwards. Also, turn the lengeth parameter of the text-erased signal to a InfTextChunk* chunk parameter, so that it is still possible to find out what text was deleted afterwards. * libinftextgtk/inf-text-gtk-buffer.c: Do not stop emission of GtkTextBuffer's insert-text and delete-range signals in our signal handlers. This allows other signal handlers to rely on proper signal emission and makes us handle recursive emissions correctly. * libinftext/inf-text-default-buffer.c: * libinftext/inf-text-session.c: * infinoted/infinoted-directory-sync.c: Adapt for the API change. 2010-05-21 Armin Burgmeier * infinoted/infinoted-util.h: * infinoted/infinoted-util.c: Replaced infinoted_util_set_daemon_pid_file_proc() by infinoted_util_daemon_set_global_pid_file_proc(), infinoted_util_daemon_set_local_pid_file_proc(). Also add infinoted_util_daemon_pid_file_kill(). * infinoted-main.c: * infinoted-options.c: Instead of setting the PID file directory directly, first try the global one and if that fails use the local one. This avoids a race condition which resulted from the previous use of access() to check whether the PID file directory is writable. These changes also fix a bug which prevented infinoted to launch in daemonized mode when the global PID file directory did not exist. 2010-05-08 Armin Burgmeier * infinoted/infinoted-options.c: Include signal.h to fix the build on Debian Lenny (#537). 2010-03-12 Armin Burgmeier * libinfinity/common/inf-chat-buffer.h: * libinfinity/common/inf-chat-buffer.c: Added a flags field to InfGtkChatBufferMessage indicating whether a message is a backlog message or not. * libinfgtk/inf-gtk-chat.c: Show backlog messages also if chat session is attached to widget after synchronization. * libinfinity/common/inf-chat-session.c: * test/inf-test-chat.c: Adapt for API changes. 2010-03-12 Armin Burgmeier * libinfgtk/inf-gtk-chat.c (inf_gtk_chat_init): Fix a typo in a comment. 2010-03-12 Armin Burgmeier * libinfinity/comon/inf-chat-buffer.c (inf_chat_buffer_get_message): Reversed the order in which messages are returned, so that the function does what the docs say. * libinfinity/common/inf-chat-session.c (inf_chat_session_to_xml_sync): Adapt to the API change. 2010-03-05 Benjamin Herr * infinoted/infinoted-main.c: Call umask(077) explicitly after forking since libdaemon < 0.14 sets the mask to 0777. 2010-03-02 Eike Siewertsen * autogen.sh: Check for glibtoolize from OSX in addition to libtoolize * libinfinity/server/infd-filesystem-storage.c: use fdopendir work-around on Apple systems, too 2010-02-27 Armin Burgmeier , Benjamin Herr * libinftextgtk/inf-text-gtk-view.c: Fix rendering multi-selections far down a document, slightly increased minimum value of selection colors. 2010-02-26 Armin Burgmeier * test/inf-test-reduce-replay.c: Make this compile on Windows (but not work yet). 2010-02-26 Armin Burgmeier * libinftextgtk/inf-text-gtk-viewport.c: Fix redraw bugs. 2010-02-25 Armin Burgmeier * libinftextgtk/Makefile.am: * libinftextgtk/inf-text-gtk-viewport.h: * libinftextgtk/inf-text-gtk-viewport.c: Added InfTextGtkViewport, showing remote users' cursor positions in the scrollbar. * test/inf-test-gtk-browser.c: Show the functionality in inf-test-gtk-browser. 2010-02-21 Armin Burgmeier * libinftextgtk/inf-text-gtk-view.c: Highlight current line of remote users. 2010-02-21 Armin Burgmeier * libinfinity/client/infc-session-proxy.c: Improved docs for infc_session_proxy_join_user(). 2010-02-19 Armin Burgmeier * libinftextgtk/inf-text-gtk-view.c: Take TextView's left and right margin into account when drawing remote selections. 2010-02-19 Armin Burgmeier * test/inf-test-text-replay.c: Don't play the first argument N times but every argument once. 2010-02-18 Armin Burgmeier * libinftextgtk/inf-text-gtk-view.c: Show remote selections. 2010-02-17 Armin Burgmeier * libinfinity/inf-marshal.in: * libinftext/inf-text-user.h: * libinftext/inf-text-user.c: Added a by_request parameter to the selection-changed signal. * libinftext/inf-text-move-operation.c: * libinftext/inf-text-session.c: * libinftextgtk/inf-text-gtk-buffer.c: * libinftextgtk/inf-text-gtk-view.c: Adapt for the API change. 2010-02-15 Armin Burgmeier * libinftextgtk/inf-text-gtk-view.c (inf_text_gtk_view_user_invalidate_cursor_rect): Convert to window coordinates before invalidating. 2010-02-15 Armin Burgmeier * libinftextgtk/inf-text-gtk-view.c (inf_text_gtk_view_set_active_user): Readd previously active user correctly to list of users to track. 2010-02-14 Armin Burgmeier * libinfinity/common/inf-xmpp-connection.h: * libinfinity/common/inf-xmpp-connection.c: Added inf_xmpp_connection_get_tls_enabled() and the "tls-enabled" property. 2010-02-14 Armin Burgmeier * libinftextgtk/inf-text-gtk-buffer.h: * libinftextgtk/inf-text-gtk-buffer.c: Added inf_text_gtk_buffer_is_author_toggle(), inf_text_gtk_buffer_forward_to_author_toggle() and inf_text_gtk_buffer_backward_to_tag_toggle(). 2010-02-14 Armin Burgmeier * libinftextgtk/inf-text-gtk-buffer.h: * libinftextgtk/inf-text-gtk-buffer.c: Added the "show-user-colors" property and accessor functions. 2010-02-14 Armin Burgmeier * libinfinity/client/infc-session-proxy.c (infc_session_proxy_unsubscribe_connection): Only send the "session-unsubscribe" message if the connection is still open. We might get to this point with a closed connection if a status::notify signal handler closes the session explicitely before our own signal handler ran (Jesse van den Kieboom). 2010-02-13 Armin Burgmeier * libinftext/inf-text-session.c (inf_text_session_validate_user_props): Fix error domain for the "'caret' attribute is missing" error. 2010-02-13 Armin Burgmeier * libinftextgtk/inf-text-gtk-view.h: * libinftextgtk/inf-text-gtk-view.c: * libinftextgtk/Makefile.am: Added InfTextGtkView, a class which draws remote cursors in a GtkTextView. * test/inf-test-gtk-browser.c: Make this show remote cursors. 2010-02-13 Armin Burgmeier * libinfgtk/inf-gtk-browser-store.c: When emitting "has_child_toggled" after the last node has been removed from a directory make sure that gtk_tree_model_iter_has_child() returns FALSE, and also that the other tree model functions skip the node to be removed. 2010-02-13 Jesse van den Kieboom * libinfgtk/inf-gtk-browser-store.c: * libinfgtk/inf-gtk-browser-store.h: Added inf_gtk_browser_store_set_connection_name() and inf_gtk_browser_store_clear_connection_error(). 2010-02-13 Jesse van den Kieboom * libinfgtk/inf-gtk-browser-store.c: * libinfgtk/inf-gtk-browser-store.h: Added inf_gtk_browser_store_remove_connection(). 2010-02-13 Armin Burgmeier * libinfinity/server/infd-directory.c: * infinoted/infinoted-pam.c: Fixed compiler warnings. 2010-02-12 Armin Burgmeier * all source files: Added 2010 to copyright years. 2010-02-09 Armin Burgmeier * libinfinity/server/infd-directory.h: * libinfinity/server/infd-directory.c: Added infd_directory_foreach_connection(). * libinfinity/common/inf-error.h: * libinfinity/common/inf-error.c: Added INF_AUTHENTICATION_DETAIL_ERROR_TRY_AGAIN. * libinfinity/common/inf-xmpp-connection.h: * libinfinity/common/inf-xmpp-connection.c: Added inf_xmpp_connection_reset_sasl_authentication(), implement gracefully abort of authentication. * infinoted/infinoted-config-reload.c: Set new SASL context and mechanisms for existing connections. 2010-02-11 Armin Burgmeier * configure.ac: Use AC_USE_SYSTEM_EXTENSIONS, bump autoconf requirement to 2.60 to be able to make use of it. Check whether dirent.d_type and PAM_FAIL_DELAY exist. * libinfinity/server/infd-directory.c: Include config.h instead of defining _GNU_SOURCE manually, do lstat if d_type does not exist. * infinoted/infinoted-pam.c: Only set fail delay if HAVE_PAM_FAIL_DELAY is set. 2010-02-11 Armin Burgmeier * libinfgtk/inf-gtk-browser-view.c (inf_gtk_browser_view_status_icon_data_func, inf_gtk_browser_view_status_data_func): Handle INF_GTK_BROWSER_MODEL_DISCONNECTED in switch, to avoid a crash when adding disconnected connections to the browser (Jesse van den Kieboom). 2010-02-10 Benjamin Herr , Armin Burgmeier * configure.ac: Check for SO_REUSEADDR. * libinfinity/server/infd-tcp-server.c: Set SO_REUSEADDR before calling bind() on server sockets. Also do not call infd_tcp_server_close() on error in infd_tcp_server_open() if the socket was bound already. * infinoted/infinoted-run.c: Only log errors on server startup if neither ipv4 nor ipv6 servers could be started. This is because SO_REUSEADDR apparently makes bind() work for both variants on the same port even though a later listen() call will definitely fail. 2010-02-09 Benjamin Herr * infinoted/infinoted-options.c: * infinoted/infinoted-startup.c: Fix stupid compilation errors without LIBINFINITY_HAVE_PAM. 2010-02-09 Benjamin Herr * infinoted/infinoted-options.h: * infinoted/infinoted-options.c: Properly set GError in for invalid authentication-related options in infinoted_options_validate() so that for example config-reloading knows what is up. 2010-02-09 Benjamin Herr * infinoted/infinoted-config-reload.c: Properly require authentication mechanism specified from newly loaded configuration. 2010-02-09 Armin Burgmeier * infinoted/infinoted-startup.c: Changed sasl callback to provide proper authentication error detail for server password authentication. 2010-02-07 Armin Burgmeier * libinfinity/common/inf-error.h: * libinfinity/common/inf-error.c: Added INF_DIRECTORY_ERROR_NO_STORAGE. * libinfinity/server/infd-directory.c: Allow to pass NULL storage to directory in which case all nodes are kept in memory. 2010-02-07 Armin Burgmeier * test/inf-test-text-replay.c (inf_test_text_replay_apply_operation_to_string): Handle the operation being a split operation, and apply both parts of it to the string in that case. * test/replay/replay-10.record.xml: Added a replay which requires this functionality. 2010-02-07 Armin Burgmeier * libinfinity/adopted/inf-adopted-operation.c (inf_adopted_operation_get_concurrency_id): If the second operation is a split operation, then call the function on it, and reverse the result. This prevents every subclass to have to take that case into account. * libinfinity/adopted/inf-adopted-split-operation.c (inf_adopted_split_operation_get_concurrency_id): If both parts of the split operation agree, then return that. If one is none and the other has a decision, then return that decision. Only error out if the two IDs are contradictory. * test/replay/replay-08.record.xml: * test/replay/replay-09.record.xml: Added two records where get_concurrency_id for InfAdoptedSplitOperation is required (08 is a cut-down version of 09). 2009-12-28 Armin Burgmeier * test/inf-test-reduce-replay.c: * test/Makefile.am: Added a tool to reduce a erroneous replay to a minimal testcase. 2009-12-27 Armin Burgmeier * test/inf-test-text-replay.c: Reimplement using InfAdoptedSessionReplay. 2009-12-26 Armin Burgmeier * libinfinity/adopted/inf-adopted-session-replay.h: * libinfinity/adopted/inf-adopted-session-replay.c: * libinfinity/adopted/Makefile.am: Added the InfAdoptedSessionReplay class, which can be used to replay a session recorded with InfAdoptedSessionRecord. * libinfinity/adopted/inf-adopted-session-record.c: Add a reference to InfAdoptedSessionReplay in the docs. 2010-01-31 Benjamin Herr , Armin Burgmeier * libinfinity/common/inf-error.h: * libinfinity/common/inf-error.c: Rename InfPostAuthenticationError to InfAuthenticationDetailError, added INF_AUTHENTICATION_DETAIL_ERROR_AUTHENTICATION_FAILED. * libinfinity/common/inf-xmpp-connection.h: * libinfinity/common/inf-xmpp-connection.c: * libinfinity/server/infd-xmpp-server.h: * libinfinity/server/infd-xmpp-server.c: Removed user-authenticated signals. Instead, allow the gsasl callback to use the new function inf_xmpp_connection_set_sasl_error() to provide further information regarding the failed authentication, which is sent to the clientside and can be queried, for example in error callbacks, on either side with inf_xmpp_connection_get_sasl_error(). The callback now needs to explicitly use inf_xmpp_connection_retry_sasl_authentication() to restart the authentication process. To make that possible, the client will now remember what sasl mechanisms are supported by the server. * infinoted/infinoted-config-reload.c: * infinoted/infinoted-pam.h: * infinoted/infinoted-pam.c: * infinoted/infinoted-run.c: * infinoted/infinoted-startup.c: Adapt to the above API changes. 2010-01-29 Benjamin Herr * infinoted/infinoted-pam.c: Abort checking all groups early when an error happens even if the caller does not care, also localise strings properly and use proper quotation marks. 2010-01-29 Benjamin Herr * libinfinity/common/inf-error.h: * libinfinity/common/inf-error.c: * infinoted/infinoted-pam.c: When an error happens while checking on a user after authentication, log it and also let the user know that something went wrong. 2010-01-28 Benjamin Herr * libinfinity/server/infd-xmpp-server.c: Properly disconnect the post-auth signal handler when the server goes away before the connection either goes away or is done authenticating. 2010-01-27 Benjamin Herr * libinfinity/common/inf-xmpp-connection.c: Handle post-auth error separately from auth error and emit it instead of generic auth error. 2010-01-27 Benjamin Herr * infinoted/Makefile.am: * infinoted/infinoted-startup.c: * infinoted/infinoted-pam.h: * infinoted/infinoted-pam.c: Shuffled pam functions into their own header and translation unit. * infinoted/infinoted-config-reload.c: * infinoted/infinoted-run.c: Connect the pam postauthentication callback to each new InfdXmppServer so that it might disallow clients that have been authenticated. 2010-01-27 Benjamin Herr * libinfinity/inf-marshal.in: * libinfinity/common/inf-xmpp-connection.h: * libinfinity/common/inf-xmpp-connection.c: Added user-authenticated signal that is emitted right before sasl authentication is finished successfully to give a last chance to interrupt it. * libinfinity/server/infd-xmpp-server.h: * libinfinity/server/infd-xmpp-server.c: Added connection-user-authenticated signal that is emitted whenever the above signal is emitted for any connection to this server. * libinfinity/common/inf-error.h: * libinfinity/common/inf-error.c: Added PostAuthentication error domain for authentication failures that happen during the above signals. 2010-01-23 Benjamin Herr * infinoted/infinoted-options.h: * infinoted/infinoted-options.c: * infinoted/infinoted-startup.c: Added support for specifying a limited set of system users or groups that will be accepted after pam authentication. * libinfinity/common/inf-xmpp-connection.c: Added a todo comment that should probably be taken care of for the above changes not to suck. 2010-01-20 Benjamin Herr * infinoted/infinoted-config-reload.c: * infinoted/infinoted-startup.c: * infinoted/infinoted-options.h: * infinoted/infinoted-options.c: --pam is now --pam-service and requires an argument instead of using a gentoo-specific default; added the password pam options to config reloading. 2010-01-20 Benjamin Herr * configure.ac: * libinfinity/inf-config.h.in: * infinoted/infinoted-options.h: * infinoted/infinoted-options.c: * infinoted/infinoted-startup.c: Add option to use pam to check passwords instead of providing a server-wide one. No support for only allowing certain users yet. 2010-01-27 Benjamin Herr * libinfinity/common/inf-xml-util.h: * libinfinity/common/inf-xml-util.c: Added inf_xml_util_new_{error,node}_from_{node,error}() functions for [de]serializing GErrors to xml. * libinfinity/common/inf-session.c: * libinfinity/server/infd-directory.c: * libinfinity/server/infd-session-proxy.c: Partially replaced manual [de]serializing of GErrors to xml with the above functions. 2010-01-22 Armin Burgmeier * infinoted/infinoted-run.c (infinoted_run_free): Avoid a runtime warning when freeing the InfinotedRun without having started it. 2010-01-11 Armin Burgmeier * test/inf-test-browser.c: * test/inf-test-chat.c: Check the result of fgets(). Bug #523 (Philipp Kern). 2010-01-11 Armin Burgmeier * libinfinity/client/infc-browser.h: * libinfinity/client/infc-browser.c: Added infc_browser_iter_is_valid(). Initial patch by Simon Veith. 2010-01-02 Armin Burgmeier * libinftext/inf-text-user.h: * libinftext/inf-text-user.c: Added inf_text_user_new(), to ease language bindings. 2009-12-25 Armin Burgmeier * libinfinity/adopted/inf-adopted-undo-grouping.c (inf_adopted_undo_grouping_execute_request_cb): Also do cleanup if the request does not affect the buffer, but it was issued by the undo grouping's user. In that case that user's vector time increases, which might cause requests being dropped from its request log. * test/replay/replay-07.record.xml: Added a replay in which this caused a problem. 2009-12-24 Armin Burgmeier * libinfinity/adopted/inf-adopted-undo-grouping.c (inf_adopted_undo_grouping_cleanup): Don't throw away requests prematurely, which might result in a failed assertion later when they are needed. This happened when undoing a large number of requests. * test/replay/replay-06.record.xml: Added a replay in which this scenario occurs. 2009-12-22 Armin Burgmeier * libinfinity/common/inf-cert-util.h: * libinfinity/common/inf-certificate-chain.h: * libinfinity/common/inf-certificate-credentials.h: * libinfinity/common/inf-error.c: * libinfinity/common/inf-init.c: * libinfinity/common/inf-ip-address.c: * libinfinity/common/inf-xmpp-connection.h: * libinfinity/common/inf-xmpp-connection.c: * libinfinity/server/infd-xmpp-server.h: * libinfgtk/inf-gtk-certificate-view.h: Include before including , to make sure the definition of ssize_t is available also when compiling with MSVC. * libinfinity/common/inf-tcp-connection.c: * libinfinity/server/infd-tcp-server.c: * libinfinity/server/infd-filesystem-storage.c: #ifdef-out some variables not needed on Windows. * win32/libinfinity/libinfinity.def: * win32/libinftext/libinftext.def: * win32/libinfgtk/libinfgtk.def: * win32/libinftextgtk/libinftextgtk.def: Added module definition files to create proper import libraries with MSVC. * win32/libinfinity/inf-config.h: * win32/libinfinity/inf-marshal.h: * win32/libinfinity/inf-marshal.c: * win32/config.h: Add static versions of files that would otherwise be generated at the configure step, in order to be able to build libinfinity with MSVC. * win32/unistd.h: Added fake unistd.h, declaring ssize_t. * win32/libinfinity/libinfinity.vcproj: * win32/libinftext/libinftext.vcproj: * win32/libinfgtk/libinfgtk.vcproj: * win32/libinftextgtk/libinftextgtk.vcproj: Added MSVC project files for libinfinity. * win32/inf-test-browser/inf-test-browser.vcproj: * win32/inf-test-chat/inf-test-chat.vcproj: * win32/inf-test-chunk/inf-test-chunk.vcproj: * win32/inf-test-daemon/inf-test-daemon.vcproj: * win32/inf-test-gtk-browser/inf-test-gtk-browser.vcproj: * win32/inf-test-state-vector/inf-test-state-vector.vcproj: * win32/inf-test-tcp-connection/inf-test-tcp-connection.vcproj: * win32/inf-test-tcp-server/inf-test-tcp-server.vcproj: * win32/inf-test-text-cleanup/inf-test-text-cleanup.vcproj: * win32/inf-test-text-operations/inf-test-text-operations.vcproj: * win32/inf-test-text-replay/inf-test-text-replay.vcproj: * win32/inf-test-text-session/inf-test-text-session.vcproj: * win32/inf-test-xmpp-connection/inf-test-xmpp-connection.vcproj: * win32/inf-test-xmpp-server/inf-test-xmpp-server.vcproj: Added MSVC project files for its tests. * win32/libinfinity.sln: Added a MSVC solution file containing all the project files mentioned above. 2009-12-22 Armin Burgmeier * test/Makefile.am: Added inf-test-xmpp-server to build. * test/inf-test-xmpp-server.c: Adapt to latest libinfinity API. 2009-12-20 Armin Burgmeier * test/inf-test-text-replay.c: Set connection for users that joined later in the replay, to avoid the request being rejected. 2009-12-19 Armin Burgmeier * configure.ac: Post-release bump to 0.5.0. * docs/reference/libinfinity/libinfinity-0.5-docs.sgml: * docs/reference/libinfinity/libinfinity-0.5-overrides.txt: * docs/reference/libinfinity/libinfinity-0.5-sections.txt: * docs/reference/libinftext/libinftext-0.5-docs.sgml: * docs/reference/libinftext/libinftext-0.5-overrides.txt: * docs/reference/libinftext/libinftext-0.5-sections.txt: * docs/reference/libinfgtk/libinfgtk-0.5-docs.sgml: * docs/reference/libinfgtk/libinfgtk-0.5-overrides.txt: * docs/reference/libinfgtk/libinfgtk-0.5-sections.txt: * docs/reference/libinftextgtk/libinftextgtk-0.5-docs.sgml: * docs/reference/libinftextgtk/libinftextgtk-0.5-overrides.txt: * docs/reference/libinftextgtk/libinftextgtk-0.5-sections.txt: * infinoted/Makefile.am: * libinfgtk/Makefile.am: * libinfinity/Makefile.am: * libinftext/Makefile.am: * libinftextgtk/Makefile.am: Bump API version to 0.5. 2009-12-19 Armin Burgmeier * === Released 0.4.0 === * NEWS: Update for release. 2009-12-19 Armin Burgmeier * libinfinity/common/inf-xmpp-connection.c: Track used SASL mechanism, instead of using gsasl_mechanism_name(), since the latter is only available since gsasl 0.2.28. 2009-12-19 Armin Burgmeier * infinoted/infinoted-util.c (infinoted_util_logv): On Windows, convert the output from UTF-8 to the character set of the console. 2009-12-19 Armin Burgmeier * infinoted/infinoted-directory-sync.c (infinoted_directory_sync_add_session): Fix the build on Windows. 2009-12-19 Armin Burgmeier * libinfinity/common/inf-chat-session.c (inf_chat_session_receive_message): Accept messages not issued from the corresponding's user's connection on synchronization. 2009-12-19 Armin Burgmeier * libinfgtk/inf-gtk-certificate-manager.c: Change the wording of the check button in the certificate dialog, to make clear that it only affects whether to trust the certificate. 2009-12-19 Armin Burgmeier * libinfinity/common/inf-chat-session.c: * libinfinity/adopted/inf-adopted-session.c: Deny operation if the user has not joined from the connection from which the request is received. 2009-12-19 Armin Burgmeier * libinfinity/adopted/inf-adopted-algorithm.c: Added a TODO comment about not considering translation against inactive users. 2009-12-18 Armin Burgmeier * libinfinity/server/infd-filesystem-storage.c (infd_filesystem_storage_open): Specify O_CREAT when opening the file in writing mode. 2009-12-18 Armin Burgmeier * infinoted/infinoted-directory-sync.h: * infinoted/infinoted-directory-sync.c: * infinoted/Makefile.am: Added a new object which synchronizes the document tree to disk. * infinoted/infinoted-options.h: * infinoted/infinoted-options.c: Added the --sync-directory and --sync-interval command line and config file options. * infinoted/infinoted-run.h: * infinoted/infinoted-run.c: Create a InfinotedDirectorySync in case the corresponding options were provided. Bug #428. 2009-12-18 Armin Burgmeier * libinftext/inf-text-buffer.c (inf_text_buffer_create_iter): Fixed a typo in a documentation string. 2009-12-18 Armin Burgmeier * libinftextgtk/inf-text-gtk-buffer.h: * libinftextgtk/inf-text-gtk-buffer.c: Added inf_text_gtk_buffer_show_user_colors(). 2009-12-18 Armin Burgmeier * libinfinity/server/infd-filesystem-storage.c (infd_filesystem_storage_storage_read_subdirectory): If readdir_r does not report the type of the enumerated file, then find it out via lstat(). 2009-12-18 Armin Burgmeier * infinoted/infinoted-signal.c: Replace C++ style comments by C style comments. * infinoted/infinoted-option.c: Fix #ifdef check, to avoid a warning. 2009-12-16 Armin Burgmeier * libinfinity/client/infc-browser.c: * libinfinity/server/infd-xmpp-server.c: #undef ERROR on Windows. Some crazy Windows header defines it, but we want to use it as an identifier. * infinoted/infinoted-options.c: * infinoted/infinoted-signal.c: * infinoted/infinoted-util.c: Fix the build on Windows. 2009-12-16 Benjamin Herr * libinfinity/server/infd-filesystem-storage.c: Try to ignore symlinks when reading directories or opening files. 2009-12-15 Benjamin Herr * ChangeLog: * infinoted/infinoted-config-reload.c: * infinoted/infinoted-options.h: * infinoted/infinoted-options.c: * infinoted/infinoted-run.h: * infinoted/infinoted-run.c: * infinoted/infinoted-startup.h: * infinoted/infinoted-startup.c: Enable requiring authentication via SASL PLAIN, giving a server-wide password via startup options. * libinfinity/common/inf-xmpp-connection.c: Perform multiple authentication attempts. 2009-12-14 Armin Burgmeier * libinfinity/common/inf-xmpp-connection.c (inf_xmpp_connection_notify_status_cb): Reset priv->position when the TCP connection was closed. (inf_xmpp_connection_clear): Reset priv->pull_data and priv->pull_len. 2009-12-14 Armin Burgmeier * infinoted/Makefile.am: Create PID file directory via an empty _DATA variable, for make distcheck to pass. 2009-12-14 Armin Burgmeier * libinfinity/client/infc-browser.c: Reset exploration flag for root node. * libinfinity/common/inf-xmpp-manager.h: * libinfinity/common/inf-xmpp-manager.c: Keep closed connections, handle changing addresses or ports. * libinfinity/common/inf-xml-connection.h: * libinfinity/common/inf-xml-connection.c: Added inf_xml_connection_open(), and a corresponding vfunc. * libinfinity/common/inf-xmpp-connection.c: Implement inf_xml_connection_open(). * libinfinity/common/inf-discovery-avahi.c: Reopen existing connections, if any, instead of opening new connections. * libinfgtk/inf-gtk-browser-view.c: Reconnect when double-clicking an item with a disconnected browser. * libinfgtk/inf-gtk-browser-store.c: Keep undiscovered items if they have browser or error set. 2009-12-14 Armin Burgmeier * libinfgtk/inf-gtk-certificate-manager.c: Don't complain about a certificate having changed if the new certificate was issued by a CA. 2009-12-12 Benjamin Herr * configure.ac: Added AM_SILENT_RULES, defaulting to off. * docs/reference/libinfinity/Makefile.am: * infinoted/infinoted-autosave.c: * infinoted/infinoted-note-plugin.c: * infinoted/infinoted-options.c: * infinoted/infinoted-record.c: * infinoted/infinoted-startup.c: * infinoted/note-plugins/text/infd-note-plugin-text.c: * libinfgtk/inf-gtk-browser-model-filter.c: * libinfgtk/inf-gtk-browser-model-sort.c: * libinfgtk/inf-gtk-browser-store.c: * libinfgtk/inf-gtk-browser-view.c: * libinfgtk/inf-gtk-certificate-dialog.c: * libinfgtk/inf-gtk-certificate-manager.c: * libinfgtk/inf-gtk-chat.c: * libinfinity/Makefile.am: * libinfinity/adopted/inf-adopted-algorithm.c: * libinfinity/adopted/inf-adopted-request-log.c: * libinfinity/adopted/inf-adopted-session-record.c: * libinfinity/adopted/inf-adopted-session.c: * libinfinity/adopted/inf-adopted-split-operation.c: * libinfinity/adopted/inf-adopted-state-vector.c: * libinfinity/adopted/inf-adopted-undo-grouping.c: * libinfinity/client/infc-browser.c: * libinfinity/client/infc-request-manager.c: * libinfinity/client/infc-session-proxy.c: * libinfinity/common/Makefile.am: * libinfinity/common/inf-chat-buffer.c: * libinfinity/common/inf-chat-session.c: * libinfinity/common/inf-session.c: * libinfinity/common/inf-tcp-connection-private.h: * libinfinity/common/inf-tcp-connection.c: * libinfinity/common/inf-user-table.c: * libinfinity/common/inf-user.h: * libinfinity/common/inf-user.c: * libinfinity/common/inf-xml-util.c: * libinfinity/common/inf-xmpp-connection.c: * libinfinity/common/inf-xmpp-manager.c: * libinfinity/inf-communication-central-method.c: * libinfinity/communication/inf-communication-group.c: * libinfinity/communication/inf-communication-joined-group.c: * libinfinity/communication/inf-communication-manager.c: * libinfinity/communication/inf-communication-registry.c: * libinfinity/inf-i18n.c: * libinfinity/inf-signals.h: * libinfinity/inf-signals.c: * libinfinity/server/infd-directory.c: * libinfinity/server/infd-filesystem-storage.c: * libinfinity/server/infd-server-pool.c: * libinfinity/server/infd-session-proxy.c: * libinfinity/server/infd-tcp-server.c: * libinfinity/server/infd-xmpp-server.c: * libinftext/inf-text-chunk.c: * libinftext/inf-text-default-buffer.c: * libinftext/inf-text-default-delete-operation.c: * libinftext/inf-text-default-insert-operation.c: * libinftext/inf-text-move-operation.c: * libinftext/inf-text-remote-delete-operation.c: * libinftext/inf-text-session.c: * libinftext/inf-text-undo-grouping.c: * libinftextgtk/inf-text-gtk-buffer.c: * libinftextgtk/inf-text-gtk-hue-chooser.c: * test/inf-test-browser.c: * test/inf-test-chat.c: * test/inf-test-gtk-browser.c: * test/inf-test-tcp-connection.c: * test/inf-test-xmpp-connection.c: * test/util/inf-test-util.c: Fixed warnings. To that effect, introduced wrappers for glib functions with funny types and did a lot of casting-const-away or casting between object pointers and function pointers with more indirection, so that gcc would not notice it, and a few other minor changes. Also some whitespace. Everything appears to build with -Werror now for at least the following CFLAGS: -pedantic -ansi -Wall -Wextra -Wwrite-strings -Wpointer-arith -Wcast-qual -Wno-missing-field-initializers -Wdeclaration-after-statement -Wbad-function-cast -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Waggregate-return -Wno-unused-parameter. 2009-12-12 Armin Burgmeier * libinfinity/communication/inf-communication-method.h: * libinfinity/communication/inf-communication-method.c: * libinfinity/communication/inf-communication-group.h: * libinfinity/communication/inf-communication-group.c: Removed the except parameter for sending a message to the whole group. * libinfinity/communication/inf-communication-central-method.c: Adapt. * libinfinity/common/inf-session.h: * libinfinity/common/inf-session.c: Removed the except parameter for inf_session_send_to_subscriptions(). * libinfinity/common/inf-chat-session.c: * libinfinity/adopted/inf-adopted-session.c: * libinfinity/server/infd-session-proxy.c: * libinftext/inf-text-session.c: * test/inf-test-text-replay.c: Adapt. 2009-12-11 Armin Burgmeier * libinfinity/inf-marshal.in: Added VOID:OBJECT,UINT marshaller. * libinfinity/server/infd-session-proxy.h: * libinfinity/server/infd-session-proxy.c: * libinfinity/server/infd-directory.c: Send seqs in the form "seq-id/seq-num". This allows to send the same message to the whole group, not requiring an extra message for the host which issued the request. Added the seq_id parameter to InfdSessionProxy's add-subscription signal. * libinfinity/client/infc-request-manager.h: * libinfinity/client/infc-request-manager.c: * libinfinity/client/infc-session-proxy.h: * libinfinity/client/infc-session-proxy.c: * libinfinity/client/infc-browser.c: Correctly deal with this kind of seqs; pass sequence-id from welcome message to request manager and session proxy and added the sequence-id property for InfcRequestManager. 2009-12-10 Armin Burgmeier * libinfinity/common/inf-error.h: * libinfinity/common/inf-error.c: Added INF_DIRECTORY_ERROR_NO_WELCOME_MESSAGE and INF_DIRECTORY_ERROR_VERSION_MISMATCH error codes. * libinfinity/common/inf-protocol.h: * libinfinity/common/inf-protocol.c: * libinfinity/common/Makefile.am: Added this new file containing common protocol properties used by both client and server. Currently contains a function returning the Infinote protocol version implemented by libinfinity, and a function to split the version string. * libinfinity/server/infd-directory.c: Send a welcome message to the client, telling it the protocol version the server uses and a sequence identifier. * libinfinity/client/infc-browser.c: Only activate itself after the welcome message was received, produce an error if it did not arrive after 5 seconds. Remember the sequence identifier which will be used in a followup patch. 2009-12-10 Benjamin Herr * libinfinity/common/inf-error.c: Include gsasl.h so that gsasl_strerror() is not assumed to return int and consequently works on non-32bit platforms, fixing a crash. 2009-12-10 Benjamin Herr * infinoted/infinoted-config-reload.c: * infinoted/infinoted-options.h: * infinoted/infinoted-options.c: * infinoted/infinoted-run.h: * infinoted/infinoted-run.c: * infinoted/infinoted-startup.h: * infinoted/infinoted-startup.c: Added --password/-P option to require a password from clients via GNU SASL 'PLAIN' authentication. 2009-12-10 Benjamin Herr * libinfinity/common/inf-error.h: * libinfinity/common/inf-error.c: Add public inf_gsasl_error_quark(), inf_gsasl_set_error() for error codes returned from GNU GSASL functions. * libinfinity/common/inf-xmpp-connection.c: Use inf_gsasl_error_set_error() instead of manually setting errors for gsasl error codes. 2009-12-10 Benjamin Herr * libinfinity/common/inf-tcp-connection.h: * libinfinity/common/inf-tcp-connection.c: Add functions to create new connections: inf_tcp_connection_new(), inf_tcp_connection_new_and_open(). * libinfinity/common/inf-discovery-avahi.c: * test/inf-test-browser.c: * test/inf-test-chat.c: * test/inf-test-tcp-connection.c: * test/inf-test-xmpp-connection.c: * libinfinity/common/inf-tcp-connection.c: Use inf_tcp_connection_new(), inf_tcp_connection_new_and_open() instead of manually creating new InfTcpConnection objects. 2009-12-08 Armin Burgmeier * libinftext/inf-text-session.c (inf_text_session_remove_local_user): Fix a crash a user's selection changes after it becomes non-local. 2009-12-08 Armin Burgmeier * libinftextgtk/inf-text-gtk-buffer.c (inf_text_gtk_buffer_set_modified): Notify the "modified" property. 2009-12-07 Armin Burgmeier * libinfinity/client/infc-browser.c: Move root node destruction to finalize. 2009-12-07 Armin Burgmeier * libinfinity/client/infc-browser.h: * libinfinity/client/infc-browser.c: Added the "status" property, infc_browser_get_status() and the "error" signal. Keep connection around if it is closed, to allow easy reconnections. * libinfgtk/inf-gtk-browser-model.h: Added INF_GTK_BROWSER_MODEL_DISCONNECTED status. * libinfgtk/inf-gtk-browser-store.c: Drop connection bookkeeping, keep browser alive when it reaches INFC_BROWSER_DISCONNECTED status. * test/inf-test-browser.c: * test/inf-test-gtk-browser.c: Simplify the code by making use of the new API. * libinfinity/communication/inf-communication-manager.c: Added a TODO comment questioning whether we should continue to allow joining groups with connections with status INF_XML_CONNECTION_OPENING. 2009-12-07 Armin Burgmeier * test/inf-test-text-replay.c: Added an Undo Grouping for each user in the replay, to test that undo grouping can at least handle all cases. * libinfinity/adopted/inf-adopted-undo-grouping.c: Fixed some bugs which showed up when replaying test/replays/. 2009-12-07 Armin Burgmeier * test/inf-test-text-replay.c: Allow UTF-8 input files. 2009-12-05 Armin Burgmeier * libinfinity/inf-marshal.in: Added a BOOL:OBJECT,OBJECT marshaller. * libinfinity/adopted/inf-adopted-undo-grouping.h: * libinfinity/adopted/inf-adopted-undo-grouping.c: * libinfinity/adopted/Makefile.am: Added the #InfAdoptedUndoGrouping class. It allows to group requests to be undone at the same time. * libinftext/inf-text-undo-grouping.h: * libinftext/inf-text-undo-grouping.c: * libinftext/Makefile.am: Added a specialization of that class for text operations. 2009-12-05 Armin Burgmeier * libinftext/inf-text-session.h: Removed INF_TEXT_TYPE_SESSION_STATUS define as it's not used. * libinftext/inf-text-chunk.c: Removed commented-out code to serialize a chunk to/from XML. * libinfinity/adopted/inf-adopted-algorithm.c (inf_adopted_algorithm_class_init): Fixed a typo in the signal documentation. 2009-12-02 Armin Burgmeier * libinftextgtk/inf-text-gtk-buffer.c (inf_text_gtk_buffer_active_user_notify_status_cb): Added a TODO comment about unsetting active-user when it gets unavailable. 2009-12-02 Armin Burgmeier * libinfinity/adopted/inf-adopted-request-log.h: * libinfinity/adopted/inf-adopted-request-log.c: Added the "add-request" signal. 2009-12-02 Armin Burgmeier * libinfinity/adopted/inf-adopted-algorithm.h: * libinfinity/adopted/inf-adopted-algorithm.c: Made inf_adopted_algorithm_translate_request() public. 2009-12-02 Armin Burgmeier * libinfinity/adopted/inf-adopted-session.h: * libinfinity/adopted/inf-adopted-session.c: Allow repetitive requests by sending a num="n" attribute in the message. Add a guint parameter to inf_adopted_session_undo() and inf_adopted_session_redo() to undo or redo multiple requests at once. * test/inf-test-gtk-browser.c: Adapt to the API change. 2009-12-01 Benjamin Herr * infinoted/infinoted-config-reload.c: Properly wrap reference to startup->options->daemonize in #ifdef LIBINFINITY_HAVE_LIBDAEMON. 2009-11-30 Armin Burgmeier * libinfinity/server/infd-directory.c: Immediately write an empty session to disk on sync-in, and refuse sync-in if that fails. 2009-11-30 Armin Burgmeier * libinfinity/common/inf-session.h: * libinfinity/common/inf-session.c: Added INF_SESSION_PRESYNC status, and the inf_session_synchronize_from() function. Require setting status at construction. * libinfinity/common/inf-chat-session.h: * libinfinity/common/inf-chat-session.c (inf_chat_session_new): Added status parameter. * libinfinity/server/infd-note-plugin.h: * libinfinity/client/infc-note-plugin.h: Added a status parameter to the session_new function. * libinftext/inf-text-session.h: * libinftext/inf-text-session.c: Added a status parameter to inf_text_session_new() and inf_text_session_new_with_user_table(). * libinfinity/adopted/inf-adopted-session.c: * libinfinity/server/infd-directory.c: * libinfinity/client/infc-browser.c: * libinftext/inf-text-session.c: * test/inf-test-gtk-browser.c: * test/inf-test-text-replay.c: * test/inf-test-text-session.c: Adapt to the API change. 2009-11-30 Armin Burgmeier * infinoted/infinoted-autosave.c (infinoted_autosave_remove_session): Disconnect from the notify::modified signal handler, preventing a crash when the autosaver is disabled at runtime. 2009-11-29 Armin Burgmeier * infinoted/infinoted-config-reload.h: * infinoted/infinoted-config-reload.c: * infinoted/Makefile.am: Added a new file which handles reloading infinoted's configuration at runtime. * infinoted/infinoted-signal.c: Call it on SIGHUP (#509). * infinoted/infinoted-main.c (infinoted_main_run): After InfinotedRun terminates, check run->startup->options->daemonize, not startup->options->daemonize, since config reload might have invalidated the latter. 2009-11-29 Armin Burgmeier * infinoted/infinoted-autosave.c (infinoted_autosave_walk_directory): Make this actually work, by initializing child before using it. This is used only when adding an autosaver at runtime. 2009-11-29 Armin Burgmeier * libinfinity/server/infd-server-pool.h: * libinfinity/server/infd-server-pool.c: Added infd_server_pool_remove_server() and infd_server_pool_foreach_server(). Changed semantics so that when a server is closed it is no longer removed automatically from the pool. * infinoted/infinoted-run.h: * infinoted/infinoted-run.c: Adapt to that, and remove a server from the pool if infd_tcp_server_open() failed (which it normally does not since we have bound it already, but just to be sure). 2009-11-29 Armin Burgmeier * libinfinity/common/inf-discovery-avahi.c: * libinfinity/server/infd-xmpp-server.c: Allow changing credentials, SASL context and SASL mechanisms at runtime. * libinfinity/server/infd-directory.c: Allow setting a new storage backend at runtime. 2009-11-29 Armin Burgmeier * infinoted/infinoted-creds.c (READ_FUNC_IMPL): Fixed a memory leak: Don't leak the data variable. 2009-11-29 Armin Burgmeier * libinfinity/common/inf-certificate-credentials.h: * libinfinity/common/inf-certificate-credentials.c: * libinfinity/common/Makefile.am: Added a wrapper for gnutls_certificate_credentials_t which does reference counting. * libinfinity/common/inf-xmpp-connection.h: * libinfinity/common/inf-xmpp-connection.c: * libinfinity/common/inf-discovery-avahi.h: * libinfinity/common/inf-discovery-avahi.c: * libinfinity/server/infd-xmpp-server.h: * libinfinity/server/infd-xmpp-server.c: Use InfCertificateCredentials instead of gnutls_certificate_credentials_t. * infinoted/infinoted-creds.h: * infinoted/infinoted-creds.c: * infinoted/infinoted-dh-params.h: * infinoted/infinoted-dh-params.c: * infinoted/infinoted-startup.h: * infinoted/infinoted-startup.c: Adapt to the changed API. 2009-11-29 Armin Burgmeier * infinoted/infinoted-util.h: Added a TODO comment about moving the logging functions to an extra file. * infinoted/infinoted-dh-params.h: * infinoted/infinoted-dh-params.c: * infinoted/Makefile.am: Renamed infinoted_run_ensure_dh_params() to infinoted_dh_params_ensure() and moved this to an extra file. * infinoted/infinoted-run.h: * infinoted/infinoted-run.c: Adapt. 2009-11-28 Armin Burgmeier * infinoted/infinoted-util.h: * infinoted/infinoted-util.c: Added infinoted_util_set_errno_error() and infinoted_util_set_daemon_pid_file_proc(). * infinoted/infinoted-options.c: Added the -D option to kill a daemonized process. * infinoted/infinoted-main.c: Use infinoted_util_set_daemon_pid_file_proc(). 2009-11-28 Armin Burgmeier * infinoted/infinoted-main.c: Tell parent process whether PID file creation failed or not. 2009-11-28 Armin Burgmeier * infinoted/infinoted-main.c: Change the location of the PID file to localstatedir/run, append libinfinity API version to PID file name. * infinoted/Makefile.am: Create directory for PID file on install. 2009-11-28 Armin Burgmeier * infinoted/infinoted-util.c (infinoted_util_logv): Put an extra newline after the log message. * infinoted/infinoted-note-plugin.c: * infinoted/infinoted-run.c: * infinoted/infinoted-signal.c: * infinoted/infinoted-startup.c: * infinoted/infinoted-main.c: Remove newline from calls to infinoted_util_log_*() to prevent it from appearing in the syslog. 2009-11-28 Benjamin Herr * infinoted-util.h: * infinoted-util.c: Added infinoted_util_log_{error,warning,info} that delegate to either fprintf(stderr, ...), or daemon_log with the proper priority when building with libdaemon. * infinoted-main.c: * infinoted-note-plugin.c: * infinoted-signal.c: * infinoted-startup.c: Use infinoted_util_log_{error,warning,info} instead of fprintf(stderr, ...). 2009-11-28 Armin Burgmeier * infinoted/infinoted-signal.c (infinoted_signal_terminate): Fixed indentation. 2009-11-28 Armin Burgmeier * infinoted/infinoted-run.h: * infinoted/infinoted-run.c: Added infinoted_run_ensure_dh_params(), take ownership of startup. * infinoted/infinoted-startup.c (infinoted_startup_load): Fixed documentation comment stating that this takes care about generating DH params. It does not anymore, the code has moved to InfinotedRun. * infinoted/infinoted-main.c: Adapt to startup ownership change in InfinotedRun. 2009-11-28 Benjamin Herr * infinoted/infinoted-main.c: When daemonizing, write the pid file to $HOME/.infinoted/infinote.pid if the default location is not writable. 2009-11-28 Armin Burgmeier * infinoted/infinoted-options.c: Allow passing NULL argc and argv in which case options are only read from config file. 2009-11-28 Armin Burgmeier * infinoted/infinoted-signal.h: * infinoted/infinoted-signal.c: Implemented serial signal handling via libdaemon, handle SIGQUIT and SIGHUP signals. Bug #507 (Yarek "Fx3" Tyshchenko). 2009-11-28 Armin Burgmeier * libinfinity/common/inf-discovery-avahi.c (inf_discovery_avahi_create_client): Pass the error variable to the avahi_client_new() call, not NULL. 2009-11-25 Armin Burgmeier * configure.ac: Check for libdaemon presence. * libinfinity/inf-config.h.in: Add a LIBINFINITY_HAVE_LIBDAEMON entry. * infinoted/infinoted-options.h: * infinoted/infinoted-options.c: Added a daemonize option. * infinoted/infinoted-main.c: Fork and create a PID file if the daemonize option is given, and libdaemon support is present. Bug #507 (Yarek "Fx3" Tyshchenko). * infinoted/Makefile.am: Link against libdaemon. * docs/reference/libinfinity/compiling.sgml: * README: Mention libdaemon as an optional dependency for the package. 2009-11-25 Armin Burgmeier * infinoted/infinoted-note-plugin.c: Fixed the build, broken by my last commit. 2009-11-24 Armin Burgmeier * infinoted/infinoted-note-plugin.c: Fixed some strings. 2009-11-23 Armin Burgmeier * infinoted/infinoted-record.h: * infinoted/infinoted-record.c: * infinoted/Makefile.am: Moved the session recording code to this new source file. * infinoted/infinoted-run.h: * infinoted/infinoted-run.c: Use the new file, removed the equivalent code from this file. 2009-11-23 Armin Burgmeier * infinoted/infinoted-util.h: * infinoted/infinoted-util.c: * infinoted/Makefile.am: Added this new source file, containing infinoted_util_create_dirname(), moved from infinoted-startup. * infinoted/infinoted-creds.h: * infinoted/infinoted-creds.c (infinoted_creds_create_credentials): Don't set DH params. * infinoted/infinoted-startup.h: * infinoted/infinoted-startup.c: Don't load DH params in startup. * infinoted/infinoted-run.h: * infinoted/infinoted-run.c: Load DH params in run instead, and set them for the credentials after loading. Also bind the server sockets in _new() before starting the server. Create DH params just before starting it. This prepares for the upcoming daemonizing; the server should do all non-blocking work that might fail before fork()ing (so that an error message can be reported), and potentially blocking work (DH params generation) after fork()ing (so that it does not the block boot process). * infinoted-main.c: Adapt to infinoted_run_start() not taking an error argument anymore. 2009-11-23 Armin Burgmeier * libinfinity/server/infd-tcp-server.h: * libinfinity/server/infd-tcp-server.c: Added infd_tcp_server_bind(), and a INFD_TCP_SERVER_BOUND state. * libinfinity/server/infd-xmpp-server.c: Treat INFD_TCP_SERVER_BOUND the same as INFD_TCP_SERVER_CLOSED. 2009-11-23 Armin Burgmeier * test/session/test-52.xml: * test/session/Makefile.am: Added one more test which requires recon in remote delete operations. 2009-11-22 Benjamin Herr * libinfinity/common/inf-chat-buffer.c (inf_chat_buffer_reserve_message): Properly set offset into allocated messages when prepending a new message. 2009-11-22 Armin Burgmeier * libinfinity/common/inf-chat-buffer.c (inf_chat_buffer_reserve_message): Return the new message in case we wrap around, not another one. 2009-11-21 Armin Burgmeier * libinfinity/common/inf-user.h: * libinfinity/common/inf-user.c: Added the set-status signal which allows to access the previous user status. * libinfinity/common/inf-chat-session.c: Don't emit a new message userjoin message for each active->inactive and inactive->active user status change. 2009-11-21 Armin Burgmeier * libinfinity/adopted/inf-adopted-session.c: * libinftext/inf-text-session.c: Made some clarifying comments about implicit user activation and flushing pending requests. 2009-11-18 Armin Burgmeier * libinfgtk/inf-gtk-chat.c (inf_gtk_chat_commit_message): Fixed parantheses so that an emote message is only triggered when there is /me at the beginning, not when the fourth character is whitespace. 2009-11-17 Armin Burgmeier * libinfgtk/inf-gtk-chat.c (inf_gtk_chat_commit_message): Send messages beginning with /me as emote messages. (inf_gtk_chat_init): Fix a compiler warning. 2009-11-15 Armin Burgmeier * libinfinity/server/infd-filesystem-storage.h: * libinfinity/server/infd-filesystem-storage.c: Fixed directory deletion on Windows. Bug #501. 2009-11-13 Armin Burgmeier * libinfinity/server/infd-directory.c (infd_directory_node_name_equal): Don't always return TRUE. (infd_directory_handle_subscribe_ack): Use existing session and session proxy to notify client about cancellation in case the parent node was removed, instead of creating a new proxy. 2009-11-13 Armin Burgmeier * libinfinity/common/inf-error.h: * libinfinity/common/inf-error.c: Added INF_DIRECTORY_ERROR_INVALID_NAME error code. * libinfinity/server/infd-directory.c (infd_directory_node_name_equal): Use Unicode-aware case-insensitive comparison. (infd_directory_node_is_name_available): Don't allow nodes with '/' in the name. * libinfinity/server/infd-filesystem-storage.c: Don't allow empty path components. 2009-11-11 Armin Burgmeier * libinfinity/common/inf-xml-util.c: Added documentation comments. 2009-11-11 Armin Burgmeier * libinfinity/client/infc-browser.c: Check for non-NULL iter in infc_browser_return_if_iter_fail() and infc_browser_return_val_if_iter_fail(). 2009-11-11 Armin Burgmeier * libinfgtk/inf-gtk-chat.c: Avoid the use of gtk_entry_get_text_length() because this is only available since GTK+ 2.14. 2009-11-11 Armin Burgmeier * libinftextgtk/inf-text-gtk-buffer.h: * libinftextgtk/inf-text-gtk-buffer.c: Added the "saturation" and "value" properties, and the inf_text_gtk_buffer_set_saturation_value(), inf_text_gtk_buffer_get_saturation(), inf_text_gtk_buffer_get_value(). 2009-11-10 Armin Burgmeier * libinfinity/common/inf-chat-buffer.c (inf_chat_buffer_finalize): Take into account that we may have preallocated space at the beginning of the buffer, so don't try to free the text of all entries from the beginning, avoiding a crash. 2009-11-10 Armin Burgmeier * libinfgtk/inf-gtk-chat.c (inf_gtk_chat_init): Set indentation of wrapped lines to 12 pixels. 2009-11-10 Armin Burgmeier * libinfgtk/inf-gtk-chat.c (inf_gtk_chat_init): Wrap text in the chat widget. 2009-11-10 Armin Burgmeier * libinfinity/server/infd-directory.c (infd_directory_handle_subscribe_ack): Fix a crash in the ADD_NODE case introduced by my last change. 2009-11-10 Armin Burgmeier * libinfinity/server/infd-directory.c: Fix crash when session could not initially be saved in response to an add-node request with initial-subscribe set. This fixes a crash on creating documents with names '.', '..'. Still not handled properly for sync-in. 2009-11-09 Armin Burgmeier * libinfinity/common/inf-chat-buffer.c: Added missing paranthesis to constructs like (priv->first_message + n) % priv->size, fixing a crash when the buffer starts to wrap around. 2009-11-08 Armin Burgmeier * libinfgtk/inf-gtk-chat.c: Make sure to scroll to bottom initially, and keep bottom row in viewport visible on size change, instead of top row. 2009-11-08 Benjamin Herr * libinfinity/common/inf-chat-session.c (inf_chat_session_message_from_xml): Fixed bytes/chars mixup. 2009-11-08 Armin Burgmeier * infinoted/infinoted-run.c: Enable chat. 2009-11-07 Armin Burgmeier * libinfgtk/inf-gtk-chat.h: * libinfgtk/inf-gtk-chat.c: Added inf_gtk_chat_get_active_user() as a complement to inf_gtk_chat_set_active_user(). 2009-11-07 Armin Burgmeier * libinfinity/common/inf-tcp-connection.c (inf_tcp_connection_open): Fix the condition for closing an existing socket. Spotted by Gabríel A. Pétursson. 2009-11-07 Armin Burgmeier * libinfgtk/inf-gtk-browser-store.c (inf_gtk_browser_store_tree_model_get_column_type): Handle the case when index is INF_GTK_BROWSER_MODEL_COL_NAME. 2009-11-07 Armin Burgmeier * docs/reference/libinfinity/compiling.sgml: Added a chapter about compiling libinfinity. * docs/reference/libinfinity/libinfinity-0.4-docs.sgml: Added it to the documentation. * docs/reference/libinfinity/Makefile.am: Added it to the build. 2009-11-07 Armin Burgmeier * configure.ac: Removed the --enable-traffic-output option. * libinfinity/common/inf-xmpp-connection.c: Add a global boolean variable called INF_XMPP_CONNECTION_PRINT_TRAFFIC instead of a #define with the same name. * libinfinity/common/inf-init.c: Set that variable in inf_init() based on the presence of the environment variable LIBINFINITY_DEBUG_PRINT_TRAFFIC. Bug #502. 2009-11-07 Armin Burgmeier * libinfinity/common/inf-xmpp-connection.c (inf_xmpp_connection_initiate): Removed commented-out try to allow non-printable characters via XML entities. 2009-11-07 Armin Burgmeier * libinfinity/common/inf-tcp-connection (inf_tcp_connection_error): Fix a typo in a comment. 2009-11-07 Armin Burgmeier * libinfinity/common/inf-xmpp-connection.c: Don't crash if the underlying TCP connection goes down in an XML parser callback. This also involved simplifying the code a bit by introducing an additional state variable that tracks whether we are currently in an XML parser callback or not. 2009-11-07 Armin Burgmeier * libinfinity/server/infd-session-proxy.c (infd_session_proxy_set_property): When connecting to the "close" signal of a new session, connect before the default signal handler, not after, so that our signal handler can still figure out the synchronization status of the subscribed connections, to avoid sending "session-close" if the sync is/was in progress. Bug #499. 2009-11-06 Benjamin Herr * libinfinity/common/inf-xml-util.c: In inf_xml_util_add_child_text, only escape the characters which are actually forbidden by XML, not newlines and friends. 2009-11-06 Benjamin Herr * libinfinity/common/inf-xml-util.h: * libinfinity/common/inf-xml-util.c: * docs/reference/libinfinity/libinfinity-0.4-sections.txt: Added inf_xml_util_add_child_text and inf_xml_util_get_child_text which get the text content of an xml element while encoding or decoding unprintable characters as child elements. * infinoted/note-plugins/text/infd-note-plugin-text.c: * libinfinity/common/inf-chat-session.c: * libinftext/inf-text-chunk.c: * libinftext/inf-text-session.c: * test/util/inf-test-util.c: Use inf_xml_util_add_child_text and inf_xml_util_get_child_text instead of using the libxml2 calls directly. Bug #499. 2009-10-26 Armin Burgmeier * libinfgtk/inf-gtk-certificate-manager.c (inf_gtk_certificate_manager_certificate_func): Don't crash if a certificate of a known host does not have a hostname set. Ignore the certificate instead, because we can't identify it with a host properly. Bug #484. 2009-10-22 Armin Burgmeier * libinfinity/common/inf-standalone-io.c (inf_standalone_io_io_watch): Update event pointers after realloc. This fixes sporadic disconnections when there are more than two clients on a Windows infinoted. 2009-10-12 Armin Burgmeier * libinfgtk/inf-gtk-chat.h: * libinfgtk/inf-gtk-chat.c: Added the InfGtkChat class, a widget to show the conversation of an InfChatSession and to write messages if a local user has joined the session. * libinfgtk/Makefile.am: Added the new files to the build. * test/inf-test-gtk-browser.c: When connecting to a host, subscribe to its chat and open a window showing a InfGtkChat to make use of it. 2009-10-10 Armin Burgmeier * libinfinity/common/inf-user.c: * libinfinity/server/infd-session-proxy.c: * libinfgtk/inf-gtk-io.c: Minor documentation fixes. 2009-10-09 Armin Burgmeier * test/inf-test-chat.c: Added simple command-line based chat client as a test for InfChatSession. * test/inf-test-daemon.c: Enable the chat on the server. * test/Makefile.am: Added the file to the build. 2009-10-09 Armin Burgmeier * libinfinity/common/inf-chat-buffer.c (inf_chat_buffer_reserve_message): Fixed logic for first inserted message and fixed return value when the first message is reordered in memory. * libinfinity/common/inf-chat-session.c (inf_chat_session_message_from_xml): Don't require the "type" attribute being set but default to INF_CHAT_BUFFER_MESSAGE_NORMAL if it isn't. This is compatible to the way the inverse function, inf_chat_session_message_to_xml(), generates XML messages. * libinfinity/client/infc-browser.c (infc_browser_communication_object_sent): Handle correctly the case when the outgoing message has no ID set (chat subscription). 2009-10-08 Armin Burgmeier * libinfinity/common/inf-chat-buffer.c (inf_chat_buffer_get_size): Added a formal description of the return type in the documentation comment. 2009-10-08 Armin Burgmeier * libinfinity/common/inf-chat-session.c: Make InfChatSession's description appear in the documentation. 2009-10-08 Armin Burgmeier * libinfinity/client/infc-browser.h: * libinfinity/client/infc-browser.c: Added infc_browser_subscribe_chat(), infc_browser_get_subscribe_chat_request() and infc_browser_get_chat_session(). This handles the client-side part of subscribing to a server's global chat. * libinfgtk/inf-gtk-browser-store.c: * libinfgtk/inf-gtk-browser-view.c: Ignore chat subscriptions in begin-subscribe and subscribe-session signal handlers. 2009-10-07 Armin Burgmeier * libinfinity/common/inf-error.h: * libinfinity/common/inf-error.c: Added the INFD_DIRECTORY_ERROR_CHAT_DISABLED error code which is generated when a client tries to subscribe to a chat that is disabled on the server. * libinfinity/server/infd-directory.h: * libinfinity/server/infd-directory.c: Added infd_directory_enable_chat(), infd_directory_get_chat_session() and handle requests from clients. 2009-10-07 Armin Burgmeier * libinfinity/common/inf-chat-buffer.h: * libinfinity/common/inf-chat-buffer.c: Added the InfChatBuffer class. This is an InfBuffer-implementing class that holds chat messages in a ring-like structure (new messages replace old ones when a certain message size has been exceeded). * libinfinity/common/inf-chat-session.h: * libinfinity/common/inf-chat-session.c: Added the InfChatSession class which is a session allowing joined users to exchange messages. * libinfinity/common/Makefile.am: Added the new files to the build. 2009-10-08 Armin Burgmeier * libinfinity/communication/inf-communication-manager.c: Fixed a typo in a comment. 2009-10-08 Armin Burgmeier * libinfinity/client/infc-browser.c: Declared the iter member in the InfcBrowserIterGetSyncInRequestsForeachData, InfcBrowserIterGetNodeRequestForeachData and InfcBrowserIterGetExploreRequestForeachData structs as const to avoid compiler warnings. 2009-10-08 Armin Burgmeier * autogen.sh: Updated autogen.sh from gnome-common. Bug #476. 2009-10-07 Armin Burgmeier * libinfinity/server/infd-session-proxy.c: Fixed the documentation comment of the infd_session_proxy_get_session() function. 2009-10-07 Armin Burgmeier * libinfinity/server/infd-directory.c (infd_directory_handle_remove_node): Fixed the error domain of the error generated when attempting to remove the root node. 2009-10-07 Armin Burgmeier * libinfinity/communication/inf-communication-manager.c: * libinfinity/common/inf-init.c: * libinfinity/common/inf-standalone-io.c: * libinfinity/common/inf-xmpp-manager.c: * libinfinity/adopted/inf-adopted-state-vector.c: * libinfinity/client/infc-browser.c: * libinfinity/client/infc-explore-request.c: * libinfinity/server/infd-directory.c: * libinfinity/server/infd-filesystem-storage.c: * libinfinity/server/infd-tcp-server.c: Fixed a few documentation comments. 2009-06-03 Armin Burgmeier * libinftext/inf-text-session.c (inf_text_session_request_to_xml): For delete operations, don't assert that at least one segment exists. This avoids a crash when synchronizing a zero-length delete operation. 2009-05-13 Armin Burgmeier * libinftextgtk.pc.in: Fixed "Name:" field. This is libinftextgtk, not libinftext. 2009-05-11 Armin Burgmeier * libinfinity/client/infc-browser.h: * libinfinity/client/infc-browser.c: Made several InfcBrowserIter arguments const. 2009-05-02 Armin Burgmeier * libinfgtk/inf-gtk-browser-store.c: Fixed a typo in a comment. 2009-05-02 Armin Burgmeier * test/inf-test-browser.c: Connect after the default handler on the connection's notify::status, to give the communication method a chance to register the connection with the registry before we try to send stuff through it. 2009-05-02 Armin Burgmeier * libinfinity/common/inf-error.h: * libinfinity/common/inf-error.c: Added INF_DIRECTORY_ERROR_ROOT_NODE_REMOVE_ATTEMPT error. * libinfinity/server/infd-directory.c (infd_directory_handle_remove_node): Produce the newly introduced error if a client attempts to remove the root node. This fixes bug #442 (Gregory Haynes). (infd_directory_remove_node): Added a g_return_val_if_fail() if a the root node is attempted to be removed. * libinfinity/client/infc-browser.c (infc_browser_remove_node): Added a g_return_val_if_fail() if the root node is attempted to be removed. 2009-04-26 Armin Burgmeier * README: Added some notes about development of libinfinity. 2009-04-26 Armin Burgmeier * configure.ac: Post-release bump to 0.4.0. * docs/reference/libinfinity/libinfinity-0.4-docs.sgml: * docs/reference/libinfinity/libinfinity-0.4-overrides.txt: * docs/reference/libinfinity/libinfinity-0.4-sections.txt: * docs/reference/libinftext/libinftext-0.4-docs.sgml: * docs/reference/libinftext/libinftext-0.4-overrides.txt: * docs/reference/libinftext/libinftext-0.4-sections.txt: * docs/reference/libinfgtk/libinfgtk-0.4-docs.sgml: * docs/reference/libinfgtk/libinfgtk-0.4-overrides.txt: * docs/reference/libinfgtk/libinfgtk-0.4-sections.txt: * docs/reference/libinftextgtk/libinftextgtk-0.4-docs.sgml: * docs/reference/libinftextgtk/libinftextgtk-0.4-overrides.txt: * docs/reference/libinftextgtk/libinftextgtk-0.4-sections.txt: * infinoted/Makefile.am: * libinfgtk/Makefile.am: * libinfinity/Makefile.am: * libinftext/Makefile.am: * libinftextgtk/Makefile.am: Bump API version to 0.4. * docs/reference/libinfgtk/Makefile.am: * docs/reference/libinftext/Makefile.am: * docs/reference/libinftextgtk/Makefile.am: Clear .types file correctly on distclean. 2009-04-24 Armin Burgmeier * === Released 0.3.0 === * NEWS: Update for release. 2009-04-24 Armin Burgmeier * libinfinity/inf-i18n.c: Change gettext directory from lib/locale to share/locale on Windows. 2009-04-24 Armin Burgmeier * libinfinity/client/infc-browser.c: * libinfinity/server/infd-directory.c: Updated a few comments. 2009-04-24 Armin Burgmeier * docs/reference/api_version.xml.in.in: Moved from api_version.xml.in. * docs/reference/version.xml.in.in: Moved from version.xml.in. * docs/reference/Makefile.am: Generate (api_)version.xml from (api_)version.xml.in by removing the trailing newline. This is to prevent that newline from appearing in the docbook XML when substituting the external entities. * configure.ac: Generate docs/reference/(api_)version.xml.in. 2009-04-22 Armin Burgmeier * docs/reference/libinftext/libinftext-0.3-docs.sgml: * docs/reference/libinftext/libinftext-0.3-overrides.txt: * docs/reference/libinftext/libinftext-0.3-sections.txt: * docs/reference/libinfgtk/libinfgtk-0.3-docs.sgml: * docs/reference/libinfgtk/libinfgtk-0.3-overrides.txt: * docs/reference/libinfgtk/libinfgtk-0.3-sections.txt: * docs/reference/libinftextgtk/libinftextgtk-0.3-docs.sgml: * docs/reference/libinftextgtk/libinftextgtk-0.3-overrides.txt: * docs/reference/libinftextgtk/libinftextgtk-0.3-sections.txt: Moved from the unversioned files. * docs/reference/libinftext/Makefile.am: * docs/reference/libinfgtk/Makefile.am: * docs/reference/libinftextgtk/Makefile.am: Adapted DOC_MODULE accordingly. 2009-04-21 Armin Burgmeier * docs/reference/api_version.xml.in: Added another external entity for the API version. There is still one newline too much at the end in the generated file, but I have currently no idea how to get rid of it. * configure.ac: Generate docs/reference/api_version.xml. * libinfinity/Makefile.am: Added inf-marshal.in to EXTRA_DIST instead of dist_pkgdata_DATA, so that it is not installed. * libinfinity/common/inf-discovery.h: Fixed a typo in a parameter name. * docs/reference/libinfinity/libinfinity-0.3-docs.sgml: * docs/reference/libinfinity/libinfinity-0.3-overrides.txt: * docs/reference/libinfinity/libinfinity-0.3-sections.txt: Moved from the non-versioned files for parallel installation of the documentation. This requires renaming these files with every API version bump. The other libraries (libinftext, libinfgtk, libinftextgtk) will follow soon. * docs/reference/libinfinity/Makefile.am: Changed DOC_MODULE to libinfinity-0.3 for parallel installation. * docs/reference/libinftext/libinftext-docs.sgml: * docs/reference/libinfgtk/libinfgtk-docs.sgml: * docs/reference/libinftextgtk/libinftextgtk-docs.sgml: Include the new external entity, and name the API version in the book title. 2009-04-21 Armin Burgmeier * libinfinity/adopted/inf-adopted-operation.h: Removed commented-out documentation as this causes a warning when building the documentation. 2009-04-21 Armin Burgmeier * libinfinity/adopted/inf-adopted-session-record.c (inf_adopted_session_record_stop_recording): Fixed two compiler warnings about incompatible pointer types by properly casting them. 2009-04-21 Armin Burgmeier * libinfgtk/Makefile.am: * libinftext/Makefile.am: Removed -release from LDFLAGS to not duplicate the API version number in the .so filename. 2009-04-21 Philipp Kern * test/util/Makefile.am: correct hardcoded *-1.0.la import. 2009-04-20 Armin Burgmeier * libinfgtk.pc.in: * libinfinity.pc.in: * libinftext.pc.in: * libinftextgtk.pc.in: Moved from *-1.0.pc.in, respectively. The API version of the generated .pc file is not determined by the configure script. * infinoted/Makefile.am: * infinoted/note-plugins/text/Makefile.am: * libinfinity/Makefile.am: * libinfinity/common/Makefile.am: * libinfinity/communication/Makefile.am: * libinfinity/adopted/Makefile.am: * libinfinity/client/Makefile.am: * libinfinity/server/Makefile.am: * libinfgtk/Makefile.am: * libinftext/Makefile.am: * libinftextgtk/Makefile.am: * test/Makefile.am: * docs/reference/libinfinity/Makefile.am: * docs/reference/libinftext/Makefile.am: * docs/reference/libinfgtk/Makefile.am: * docs/reference/libinftextgtk/Makefile.am: * configure.ac: * Makefile.am: Introduce libtool versioning, make libinfinity parallel-installable with future versions. The pkg-config files are now prefixed with the corresponding libinfinity API version, such as libinfinity-0.3.pc. 2009-04-20 Armin Burgmeier * libinfinity/communication/inf-communication-hosted-group.c: Fixed the length of a documentation comment. 2009-02-28 Armin Burgmeier * libinfinity/common/inf-error.h: * libinfinity/common/inf-error.c: Added INF_DIRECTORY_ERROR_NO_SUCH_SUBSCRIPTION_REQUEST, and some documentation fixes. * libinfinity/common/inf-session.c: Added a TODO item. * libinfinity/client/infc-browser.c: Send or after subscriptions, actually perform the subscription when the message has been sent. This is used to tell the server whether a subscription was successful or not. The subscription can fail if the client does not support the communication method used, or if it does not know the note type. * libinfinity/server/infd-directory.h: Made the InfdNotePlugin parameter const in infd_directory_add_note(). * libinfinity/server/infd-directory.c: Don't immediately subscribe the client in or requests, but wait for instead. Don't add the node in the latter case if the client replies with , so that operations are atomic. 2009-02-28 Armin Burgmeier * libinfinity/communication/inf-communication-group.c: Documentation fix for inf_communication_group_get_method_for_network(): Mention that conn does not need to be a member of the group. 2009-02-26 Armin Burgmeier * libinfinity/common/inf-discovery-avahi.c: Added include to allow compilation on FreeBSD. Bug #430. Patch by Romain Tartière. 2009-02-15 Armin Burgmeier * libinfgtk/inf-gtk-certificate-dialog.c: * libinfgtk/inf-gtk-certificate-manager.c: Added TODO comments about how to improve certificate handling: For trusted hosts, we shouldn't show the hijack warning, and we should remember trusted hosts in the known hosts file. 2009-02-15 Armin Burgmeier * libinfinity/common/inf-xml-util.h: * libinfinity/common/inf-xml-util.c: Added xml property setter and getter functions for long and unsigned long values. 2009-02-14 Armin Burgmeier * libinfinity/common/inf-tcp-connection.c (inf_tcp_connection_io_incoming): Make sure we don't try to read again when the connection has been closed in a signal handler. 2009-02-14 Armin Burgmeier * libinfgtk/inf-gtk-certificate-manager.c (inf_gtk_certificate_manager_certificate_func): Added GNUTLS_VERIFY_ALLOW_X509_V1_CA_CRT flag. 2009-02-14 Armin Burgmeier * libinfinity/common/inf-cert-util.h: * libinfinity/common/inf-cert-util.c: Added a "current" GPtrArray parameter to inf_cert_util_load_file(), to which newly read certificates will be added, if non-NULL. * libinfgtk/inf-gtk-certificate-manager.c: Adapt to the API change. * infinoted/infinoted-options.h: * infinoted/infinoted-options.c: Added a certificate-chain command-line and configuration option, so that other certificates belonging to the certificate chain can be read from a separate file. * infinoted/infinoted-startup.c: Load more certificates from the certificate-chain-file, if given. 2009-01-15 Armin Burgmeier * all source files: Added 2009 to copyright years. 2009-01-04 Armin Burgmeier * configure.ac: Post-release bump to 0.3.0. 2009-01-04 Armin Burgmeier * === Released 0.2.0 === * NEWS: Update for release. 2009-01-04 Armin Burgmeier * libinfinity/common/inf-tcp-connection.c (inf_tcp_connection_get_property): Compare priv->socket against INVALID_SOCKET instead of NULL in assertion for PROP_LOCAL_ADDRESS and PROP_LOCAL_PORT. 2009-01-04 Armin Burgmeier * infinoted/infinoted-run.c (infinoted_run_load_directory): Fixed a warning about an unused variable. 2009-01-04 Armin Burgmeier * infinoted/infinoted-startup.h: * infinoted/infinoted-startup.c: * infinoted/infinoted-run.c: Moved directory creation from InfinotedStartup to InfinotedRun. * infinoted/infinoted-signal.c: Terminate directly on signal handler, without relying on the mainloop being exited properly. Also set a ConsoleCtrlHandler on Windows, to save the documents when the server's console window is closed. 2009-01-04 Armin Burgmeier * infinoted/Makefile.am: Replace PLUGIN_PATH define by PLUGIN_LIBPATH and PLUGIN_BASEPATH. * infinoted/infinoted-startup.c (infinoted_startup_load_directory): Lookup the module path relative to the application's executable. 2009-01-04 Armin Burgmeier * libinftextgtk/inf-text-gtk-buffer.h: * libinftextgtk/inf-text-gtk-buffer.c: Added inf_text_gtk_buffer_get_author(). 2009-01-04 Armin Burgmeier * libinfinity/communication/inf-communication-registry.c (inf_communication_registry_is_registered): Don't leak the publisher ID, and use g_return_val_if_reached instead of g_return_if_reached to avoid a warning. (inf_communication_registry_unregister): Fixed another compiler warning. 2008-12-30 Armin Burgmeier * libinfinity/server/infd-xmpp-server.h: * libinfinity/server/infd-xmpp-server.c: Made "security-policy" a construct property, don't allow passing NULL credentials for a non-only-unsecured security policy. * libinfinity/client/inf-xmpp-connections.c: Enable built-in credentials only for client connections, require valid credentials including certificate for server connections in case security policy is not only-unsecured. * infinoted/infinoted-run.c: * test/inf-test-daemon.c: Adapt to API change. 2008-12-30 Armin Burgmeier * libinfinity/common/inf-standalone-io.c: Some code cleanup, gather some common platform-specific stuff at the top. 2008-12-30 Armin Burgmeier * infinoted/infinoted-run.h: * infinoted/infinoted-run.c: Delay server opening to infinoted_run_start(), create both IPv6 and IPv4 server when possible. * infinoted/infinoted-main.c: Handle errors from infinoted_run_start(). 2008-12-30 Armin Burgmeier * libinfinity/communication/inf-communication-registry.h: * libinfinity/communication/inf-communication-registry.c: Added inf_communication_registry_is_registered(). * libinfinity/communication/inf-communication-central-method.c: Make sure we don't try to unregister a connection we never registered. 2008-12-30 Armin Burgmeier * libinfinity/common/inf-xmpp-connection.c (inf_xmpp_connection_received_cb): Make sure we read the whole gnutls buffer, so that we don't stall when gnutls buffers some data. 2008-12-29 Armin Burgmeier * libinfinity/common/inf-tcp-connection.c: Allow retrieving local remote and port on closed connections by keeping the native socket alive until disposal. * libinfinity/communication/inf-communication-method.h: * libinfinity/communication/inf-communication-method.c: Removed the unregistered method. * libinfinity/communication/inf-communication-registry.c: Support and require closed connections to be unregistered. * libinfinity/communication/inf-communication-central-method.c: Unregister the connection even if it has been closed already. 2008-12-29 Armin Burgmeier * libinfinity/common/inf-standalone-io.c: Added Win32 implementation using Winsock2's WSAWaitForMultipleEvents(). 2008-12-29 Armin Burgmeier * libinfinity/communication/inf-communication-central-method.c: Remember whether a connection has been open, so we do remove it from its group if it has not already been registered. 2008-12-29 Armin Burgmeier * libinfinity/communication/inf-communication-central-method.c: Do not unregister unregistered connection when in _CONNECTION_OPENING status in inf_communication_central_method_remove_member() 2008-12-29 Armin Burgmeier * libinfinity/server/infd-directory.c: Negated wrongly negated assertion in infd_directory_node_register_reply_subscription(). 2008-12-29 Armin Burgmeier * libinfinity/common/inf-xmpp-connection.c: Make sure inf_xml_connection_sent() is not called twice for the same message, and that it is not omitted for others. 2008-12-28 Armin Burgmeier * libinfinity/common/inf-session.c (inf_session_send_sync_error): Send synchronization error to synchronization client instead of whole group except client. 2008-12-28 Armin Burgmeier * libinfinity/communication/inf-communication-registry.c (inf_communication_registry_register): Fixed reactivation of previously unregistered connection which still has final messages scheduled. 2008-12-28 Armin Burgmeier * libinfinity/adopted/inf-adopted-session-record.c (inf_adopted_session_record_stop_recording): Avoid another warning. 2008-12-28 Armin Burgmeier * libinfinity/adopted/inf-adopted-session-record.c (inf_adopted_session_record_stop_recording): Avoid runtime warnings when the recorded session is still in INF_SESSION_SYNCHRONIZING status. 2008-12-28 Armin Burgmeier * libinfinity/server/infd-session-proxy.c (infd_session_proxy_set_property): Connect after the default handler for the close signal, so that the session has a chance to cancel any synchronizations before we remove group membership of all subscribed connections. * libinfinity/communication/inf-communication-registry.c: Make flushing final messages on group unref for unregistered connections work. 2008-12-28 Armin Burgmeier * libinfinity/communication/inf-communication-manager.h: * libinfinity/communication/inf-communication-manager.c: * libinfinity/communication/inf-communication-group-private.h: * libinfinity/communication/inf-communication-group.h: * libinfinity/communication/inf-communication-group.c: * libinfinity/communication/inf-communication-method.h: * libinfinity/communication/inf-communication-method.c: * libinfinity/communication/inf-communication-factory.h: * libinfinity/communication/inf-communication-factory.c: * libinfinity/communication/inf-communication-object.h: * libinfinity/communication/inf-communication-object.c: * libinfinity/communication/inf-communication-joined-group.h: * libinfinity/communication/inf-communication-joined-group.c: * libinfinity/communication/inf-communication-hosted-group.h: * libinfinity/communication/inf-communication-hosted-group.c: * libinfinity/communication/inf-communication-registry.h: * libinfinity/communication/inf-communication-registry.c: * libinfinity/communication/inf-communication-central-method.h: * libinfinity/communication/inf-communication-central-method.c: * libinfinity/communication/inf-communication-central-factory.h: * libinfinity/communication/inf-communication-central-factory.c: * libinfinity/communication/Makefile.am: Added new "communication" API replacing the connection manager system. This allows multiple connections to the same host, and gets rid of the requirement for UUIDs. * libinfinity/common/inf-net-object.h: * libinfinity/common/inf-net-object.c: * libinfinity/common/inf-method-manager.h: * libinfinity/common/inf-method-manager.c: * libinfinity/common/inf-connection-manager.h: * libinfinity/common/inf-connection-manager.c: * libinfinity/common/inf-central-method.h: * libinfinity/common/inf-central-method.c: * libinfinity/methods/local-central/inf-method-local-central.c: * libinfinity/methods/local-central/Makefile.am: * libinfinity/methods/Makefile.am: Removed. These files are obsoleted by the communication API. * libinfinity/common/Makefile.am: Removed the above files from the build. * libinfinity/Makefile.am: Decend into communication subdirectory, link against libinfinity_communication. * configure.ac: Removed dependency on libuuid, don't link against rpcrt4 on Windows. * libinfinity/common/inf-simulated-connection.c: Small documentation fix. * libinfinity/common/inf-xmpp-connection.c: Renamed network from "local" to "tcp/ip". * libinfinity/common/inf-session.h: * libinfinity/common/inf-session.c: * libinfinity/adopted/inf-adopted-session.c: * libinfinity/client/infc-note-plugin.h: * libinfinity/client/infc-browser.h: * libinfinity/client/infc-browser.c: * libinfinity/client/infc-session-proxy.h: * libinfinity/client/infc-session-proxy.c: * libinfinity/server/infd-note-plugin.h: * libinfinity/server/infd-filesystem-storage.h: * libinfinity/server/infd-session-proxy.h: * libinfinity/server/infd-session-proxy.c: * libinfinity/server/infd-directory.h: * libinfinity/server/infd-directory.c: * libinftext/inf-text-session.h: * libinftext/inf-text-session.c: * libinfgtk/inf-gtk-browser-store.h: * libinfgtk/inf-gtk-browser-store.c: * infinoted/note-plugins/text/infd-note-plugin-text.c: * infinoted/infinoted-startup.c: * test/inf-test-browser.c: * test/inf-test-daemon.c: * test/inf-test-gtk-browser.c: * test/inf-test-text-cleanup.c: * test/inf-test-text-replay.c: * test/inf-test-text-session.c: Adapt to API change. 2008-12-28 Armin Burgmeier * libinfinity/configure.ac: Added an --enable-traffic-output configure option, defining INF_XMPP_CONNECTION_PRINT_TRAFFIC. * libinfinity/common/inf-xmpp-connection.c: Include config.h, so that we see when INF_XMPP_CONNECTION_PRINT_TRAFFIC is defined. 2008-12-28 Armin Burgmeier * libinfinity-1.0.pc.in: * libinfgtk-1.0.pc.in: * libinftextgtk-1.0.pc.in: Fixed dependencies in pkg-config files. 2008-12-27 Armin Burgmeier * libinfinity/server/infd-server-pool.c (infd_server_pool_entry_free): Free the InfdServerPoolPublisher struct for each publisher. * libinfinity/server/infd-directory.c (infd_directory_node_explore): Don't leak the path variable. * libinfinity/common/inf-xmpp-connection.c (inf_xmpp_connection_process_authentication): Free the result of xmlNodeGetContent() as we are supposed to. * libinfinity/adopted/inf-adopted-algorithm.c (inf_adopted_algorithm_dispose): Don't leak the buffer_modified_time. 2008-12-27 Armin Burgmeier * infinoted/infinoted-options.c (infinoted_options_load): Don't leak default security_policy if overwritten by command line. * infinoted/infinoted-startup.c (infinoted_startup_free): Don't leak options and the startup struct. 2008-12-27 Armin Burgmeier * libinfinity/common/inf-xmpp-connection.c: Improved error message when the remote site seems not to be an XMPP server. 2008-12-23 Armin Burgmeier * libinfinity/common/inf-certificate-chain.h: * libinfinity/common/inf-certificate-chain.c: Made inf_certificate_chain_ref return the passed chain, so the function fulfills the requirements for a GBoxedCopyFunc. This lead to a crash with optimization enabled. 2008-12-23 Armin Burgmeier * libinfgtk/inf-gtk-certificate-dialog.c (inf_gtk_certificate_dialog_init): Free the icon_info so that we don't leak it. 2008-12-23 Armin Burgmeier * libinfgtk/inf-gtk-browser-view.c (inf_gtk_browser_view_progress_data_func): Free browser_iter to avoid a memory leak. 2008-12-22 Armin Burgmeier * libinfinity/common/inf-io.c (inf_io_event_get_type): Null-terminate the list of flags values. 2008-12-21 Armin Burgmeier * libinfgtk/inf-gtk-browser-view.c (inf_gtk_browser_view_row_changed_cb): Removed two unused variables. * libinftextgtk/inf-text-gtk-buffer.c (inf_text_gtk_buffer_buffer_init): Connect the get_modified and set_modified buffer implementations to the InfBufferIface. * libinftextgtk/inf-text-gtk-hue-chooser.c: (inf_text_gtk_hue_chooser_class_init): Install the dispose and finalize handlers. * infinoted/infinoted-creds.c (infinoted_creds_create_self_signed_certificate_impl): Removed an unused variable. * infinoted/infinoted-main.c (infinoted_main): Removed an unused variable. 2008-12-21 Armin Burgmeier * libinfinity/common/inf-cert-util.c: Include inf-error.h to avoid a warning. * libinfinity/adopted/inf-adopted-request-log.c (inf_adopted_request_log_is_empty): Use g_return_val_if_reached instead of g_return_if_reached, to avoid a warning. (inf_adopted_request_log_add_request): Cast the log to GObject before calling g_object_notify_freeze, to avoid a warning. 2008-12-21 Armin Burgmeier * libinfinity/common/inf-xmpp-connection.c (inf_xmpp_connection_send_chars): Fix a warning caused by += being used on a void pointer. (inf_xmpp_connection_process_features): Cast a xmlChar* to const char* before passing to strcmp(), to avoid a warning. 2008-12-21 Armin Burgmeier * libinfinity/common/inf-xmpp-connection.c: Added ctype.h inclusion. 2008-12-13 Armin Burgmeier * test/inf-test-text-replay.c: Allow multiple record files to be passed. 2008-12-07 Armin Burgmeier * infinoted/infinoted-run.c: Record sessions into ~/.infinoted-records. 2008-12-02 Armin Burgmeier * libinfinity/common/inf-buffer.h: * libinfinity/common/inf-buffer.c: Added a "modified" property, and get_modified/set_modified accessors. * libinftext/inf-text-default-buffer.c: Implement the property of the InfBuffer interface. * libinftextgtk/inf-text-gtk-buffer.c: Implement the "modified" property, keep it synchronized with the GtkTextBuffer's "modified" property. * libinfinity/server/infd-directory.h: * libinfinity/server/infd-directory.c: Added infd_directory_iter_peek_session(), infd_directory_iter_get_name() and infd_directory_iter_get_path(). * libinfinity/adopted/inf-adopted-algorithm.c: Track modification status of the buffer. If the buffer is considered not modified in a certain state, then set it modified if the buffer changes, but set it non-modified again when all users undid their changes since the last time when the buffer was considered non-modified. * infinoted/infinoted-autosave.h: * infinoted/infinoted-autosave.c: * infinoted/Makefile.am: Added an autosaver for infinoted. * infinoted/infinoted-options.h: * infinoted/infinoted-options.c: Added an autosave-interval option. * infinoted/infinoted-run.h: * infinoted/infinoted-run.c: Instantiate the autosaver when the autosave-interval is nonzero. * infinoted/infinoted-main.c: Added vim modelines. 2008-11-27 Armin Burgmeier * libinfinity/server/infd-directory.h: * libinfinity/server/infd-directory.c: Added infd_directory_iter_save_session(), and the "add-session" and "remove-session" signals. 2008-11-14 Armin Burgmeier * libinftextgtk/inf-text-gtk-hue-chooser.c: Don't use cairo_format_stride_for_width, so we don't need cairo 1.6 (Bug #393). 2008-11-08 Armin Burgmeier * libinfinity/adopted/inf-adopted-request-log.h: * libinfinity/adopted/inf-adopted-request-log.c: Added inf_adopted_request_log_set_begin() and inf_adopted_request_log_is_empty(). * libinfinity/adopted/inf-adopted-algorithm.c (inf_adopted_algorithm_is_component_reachable): Added an assertion that the request is either contained in the user's request log, or is to be added. * libinfinity/adopted/inf-adopted-session.c: Upon successful synchronization, set begin index of empty request logs to the corresponding user's time of the current state vector (#389, Matthias Prinz). * test/replay/replay-05.record.xml: Added a test for this. 2008-11-08 Armin Burgmeier * libinfinity/common/inf-user-table.c: Fixed a typo that prevented inf_user_table_foreach_user to appear in the documentation. 2008-11-08 Benjamin Herr * libinfinity/inf-xmpp-connection.c: Properly advance data pointer on partial writes (fixed bug #387). 2008-11-05 Armin Burgmeier * libinftext/inf-text-move-operation.h: * libinftext/inf-text-move-operation.c: Added a left_gravity parameter to inf_text_move_operation_transform_insert(). Always set it to TRUE in inf_text_move_operation_transform(), assuming a remote operation. * libinftext/inf-text-session.c: Interpret all requests as non-caret versions by default. Use right gravity when adjusting the author's cursor on an insert operation. * libinftextgtk/inf-text-gtk-buffer.c: Block selection-changed signal handler of active user in inf_text_gtk_buffer_insert_text_cb() and inf_text_gtk_buffer_delete_range_cb() since GtkTextBuffer already takes care of adjusting the buffer marks in response to index changes on insert or delete operations. These changes fix pasting text over selected text (#390, Georg Kapeller). 2008-11-02 Armin Burgmeier * libinfinity/common/inf-discovery-avahi.c: Added a documentation note that this class is only available when LIBINFINITY_HAVE_AVAHI is defined. 2008-11-02 Armin Burgmeier * configure.ac: Add LIBINFINITY_HAVI_AVAHI as an AM_CONDITIONAL. * docs/reference/libinfinity/Makefile.am: Add inf-discovery-avahi.h to the header files to ignore, and pass --rebuild-types to gtkdoc-scan. This way, inf_discovery_avahi_get_type is not listed in the .types file when avahi support is not enabled (#386, Gregory Haynes). * docs/reference/libinftext/Makefile.am: * docs/reference/libinfgtk/Makefile.am: * docs/reference/libinftextgtk/Makefile.am: Also added --rebuild-types to gtkdoc-scan. * docs/reference/libinfinity/libinfinity.types: * docs/reference/libinftext/libinftext.types: * docs/reference/libinfgtk/libinfgtk.types: * docs/reference/libinftextgtk/libinftextgtk.types: Removed, since these are now autogenerated. 2008-11-02 Armin Burgmeier * infinoted/note-plugins/text/Makefile.am: * libinfinity/methods/local-central/Makefile.am: Changed module installation path to be versioned. * infinoted/Makefile.am: * libinfinity/common/Makefile.am: Adapt module lookup path accordingly. 2008-10-30 Armin Burgmeier * libinfgtk/inf-gtk-browser-store.c (inf_gtk_browser_store_tree_model_iter_children): Make sure parent is not dereferenced for an assertion check if it is NULL, preventing a crash when this function was called with NULL parent and assertions enabled (#388). 2008-10-25 Philipp Kern * configure.ac: check for MSG_NOSIGNAL * libinfinity/common/inf-tcp-connection.c: conditionally define INF_TCP_CONNECTION_SENDRECV_FLAGS 2008-10-19 Armin Burgmeier * libinfinity/common/inf-connection-manager.c: Added #InfMethodManager to @see_also in section documentation. * libinfinity/common/inf-discovery-avahi.c: Added #InfLocalPublisher to @see_also in section documentation. * libinfinity/common/inf-discovery.h: Make virtual functions of the InfDiscoveryIface struct appear in the documentation. * libinfinity/server/infd-directory.c (infd_directory_set_method_manager): Added a clarifying comment. * libinfinity/common/inf-io.h: * libinfinity/common/inf-io.c: * libinfinity/common/inf-ip-address.h: * libinfinity/common/inf-ip-address.c: * libinfinity/common/inf-local-publisher.h: * libinfinity/common/inf-local-publisher.c: * libinfinity/common/inf-method-manager.h: * libinfinity/common/inf-method-manager.c: * libinfinity/common/inf-net-object.h: * libinfinity/common/inf-net-object.c: * libinfinity/common/inf-session.h: * libinfinity/common/inf-session.c: Added class and section documentation. 2008-10-19 Armin Burgmeier * libinfinity/common/inf-connection-manager.c: * libinfinity/common/inf-connection-manager.h: Removed some obsolete commented-out code. * libinfinity/common/inf-certificate-chain.h: Document the InfCertificateChain symbol. * libinfinity/common/inf-discovery-avahi.h: * libinfinity/common/inf-discovery-avahi.c: * libinfinity/common/inf-discovery.h: * libinfinity/common/inf-discovery.c: * libinfinity/common/inf-error.h: * libinfinity/common/inf-error.c: Added class and section documentation. 2008-10-18 Armin Burgmeier * libinfinity/inf-i18n.c: Set localedir relative to libinfinity DLL on Windows, so i18n is properly relocatable. 2008-10-18 Armin Burgmeier * configure.ac: Post-release bump to 0.2.0. 2008-10-18 Armin Burgmeier * === Released 0.1.0 === 2008-10-18 Armin Burgmeier * infinoted/infinoted-creds.c: Don't set the SAN to $hostname.local since the common name is no longer checked when a SAN is present. * infinoted/infinoted-startup.c (infinoted_startup_load_certificate): Error out if a self-signed certificate could not be created. 2008-10-17 Armin Burgmeier * libinfinity/common/inf-connection-manager.c (inf_connection_manager_send_ctrl): Fixed an assignment in an assertion that should be a comparison. (inf_connection_manager_group_real_send): Removed an unused variable. * libinfinity/common/inf-discovery-avahi.c (inf_discovery_avahi_client_callback): Removed an unused variable. 2008-10-17 Armin Burgmeier * configure.ac: Don't require avahi-glib for avahi support, as we don't use it. 2008-10-17 Armin Burgmeier * docs/reference/libinftext/Makefile.am: * docs/reference/libinfgtk/Makefile.am: * docs/reference/libinftextgtk/Makefile.am: Added underlying libraries as --extra-dir to FIXXREF_ARGS. * docs/reference/libinfinity/libinfinity-docs.sgml: * docs/reference/libinftext/libinftext-docs.sgml: * docs/reference/libinfgtk/libinfgtk-docs.sgml: * docs/reference/libinftextgtk/libinftextgtk-docs.sgml: Adjust online location. 2008-10-17 Armin Burgmeier * libinfinity/client/infc-browser.c: Add sync-in before emitting the NODE_ADDED signal, so that the signal handler can access the sync-in via infc_browser_iter_get_sync_in(). This allows InfGtkBrowserView to show progress for sync-ins. * libinfgtk/inf-gtk-browser-view: Removed a TODO comment about showing progress for sync-ins. 2008-10-17 Armin Burgmeier * infinoted/infinoted-options.c: Don't crash when reading options from config files. 2008-10-17 Armin Burgmeier * libinfinity/common/inf-connection-manager.c (inf_connection_manager_group_real_send): Removed debug logs. 2008-10-16 Armin Burgmeier * libinfinity/common/inf-tcp-connection.c: Consider INF_IO_ERROR with no error code as an ordinary disconnection. This is currently the way to be notified about disconnection on Windows, because InfGtkIo maps G_IO_HUP to INF_IO_ERROR. * libinfgtk/inf-gtk-io.c: Also watch for G_IO_HUP in addition to G_IO_ERR when INF_IO_ERROR is requested. 2008-10-16 Armin Burgmeier * libinfinity/common/inf-connection-manager.c (inf_connection_manager_group_real_send): Make sure all queued messages are sent, even if the callback for the last item adds new messages to the queue. 2008-10-16 Armin Burgmeier * libinfinity/common/inf-session.c (inf_session_close): Make sure the session's status is not already closed via a g_return_if_fail(), to prevent a failing assertion in the default handler. 2008-10-16 Armin Burgmeier * libinfinity/common/inf-connection-manager.c (inf_connection_manager_handle_message): Make sure a group's object is only finalized after we have unrefed the group, to prevent warnings when a received handler releases the NetObject. 2008-10-16 Armin Burgmeier * libinfinity/common/inf-tcp-connection.c (inf_tcp_connection_send): Always queue data we could not sent immediately. There was a bug that data wasn't queued if more than the half of it has been sent already. 2008-10-16 Armin Burgmeier * libinfinity/common/inf-xmpp-connection.c (inf_xmpp_connection_received_cb): Don't call gnutls_record_recv with a NULL session when a TLS error occured. 2008-10-16 Armin Burgmeier * infinoted/infinoted-note-plugin.c (infinoted_note_plugin_load_directory): Added missing return value in success case. 2008-10-16 Armin Burgmeier * libinftextgtk/inf-text-gtk-buffer.c: Fixed a stupid type error in the setter for the wake-on-cursor-movement property. 2008-10-16 Armin Burgmeier * libinfinity/Makefile.am: * libinfinity/common/Makefile.am: * libinfinity/adopted/Makefile.am: * libinfinity/client/Makefile.am: * libinfinity/server/Makefile.am: * libinfinity/methods/local-central/Makefile.am: * libinftext/Makefile.am: * libinfgtk/Makefile.am: * libinftextgtk/Makefile.am: * infinoted/Makefile.am: * infinoted/note-plugins/text/Makefile.am: * test/Makefile.am: Moved -I$(top_srcdir) from AM_CPPFLAGS to $lib_CPPFLAGS, because the former is not used when the latter is present. This is required for `make distcheck'. * docs/reference/Makefile.am: Added version.xml.in to EXTRA_DIST. * docs/reference/libinfinity/Makefile.am: * docs/reference/libinftext/Makefile.am: * docs/reference/libinfgtk/Makefile.am: * docs/reference/libinftextgtk/Makefile.am: Added ../version.xml to content_files, to fix `make distcheck'. * docs/reference/libinfinity/libinfinity-docs.sgml: Reordered documentation sections. 2008-10-16 Armin Burgmeier * libinfinity/common/inf-tcp-connection.c: Make sure that calling inf_tcp_connection_send() in a SENT callback does send things in a different order, or even breaks consistency of the queue. * libinfinity/common/inf-connection-manager.c (inf_connection_manager_group_real_send): Fixed a memory corruption problem. 2008-10-16 Armin Burgmeier * infinoted/infinoted-note-plugin.h: * infinoted/infinoted-note-plugin.c: Print a warning when no note plugins could be loaded. * infinoted/infinoted-startup.c: Don't start the server if there are no note plugins available. 2008-10-16 Armin Burgmeier * NEWS: Update for initial release. 2008-10-16 Armin Burgmeier * libinfinity/common/inf-xmpp-connection.c: Removed network traffic output. 2008-10-16 Armin Burgmeier * all source files: Fixed copyright period in GPL header, and changed the package description. 2008-10-15 Armin Burgmeier * configure.ac: Changed some occurences of infinote to libinfinity where the implementation rather than the protocol is meant. This changes the INFINOTE_HAVE_AVAHI define to LIBINFINITY_HAVE_AVAHI. * libinfinity/inf-config.h.in: * libinfinity/common/inf-discovery-avahi.h: * libinfinity/common/inf-discovery-avahi.c: * infinoted/infinoted-run.c: * test/inf-test-daemon.c: * test/inf-test-gtk-browser.c: * doc/reference/version.xml.in: Adapt to the changes. 2008-10-15 Armin Burgmeier * libinfinity/inf-dll.h: * libinfinity/inf-dll.c: * libinfinity/Makefile.am: Added new files that implement DllMain() on Windows, to save the DLL Handle. This can be used with g_win32_get_package_installation_directory_of_module(). * libinfinity/common/Makefile.am: Split the METHODS_PATH define in METHODS_LIBDIR and METHODS_BASEDIR, where METHODS_BASEDIR is the application-specific part of the path. * libinfinity/common/inf-method-manager.c: On Windows, locate the methods relative to the libinfinity DLL instead of using a hardcoded path. * libinfinity/methods/local-central/Makefile.am: Added a comment about renaming renaming the directory into which the methods are stored. However, this doesn't work yet because of some evil libtool weirdness. 2008-10-15 Armin Burgmeier * libinfinity/inf-i18n.h: Fixed a misleading comment in the first line, originating from a copy+paste from inf-config.h. 2008-10-15 Armin Burgmeier * libinfinity/client/infc-browser.c: Make sure signals are emitted before data any is sent out for various operations. 2008-10-15 Armin Burgmeier * libinfinity/common/inf-tcp-connection.c: Only queue new data if it can't be sent directly. This allows a call to inf_tcp_connection_send() to emit the "sent" signal directly. * libinfinity/common/inf-xmpp-connection.c: * libinfinity/common/inf-connection-manager.c: Fixes to honor this. 2008-10-14 Armin Burgmeier * libinfinity/common/inf-tcp-connection.c: Changed INF_TCP_CONNECTION_EINPROGRESS to be WSAEWOULDBLOCK on Windows because this is what connect() yields for non-blocking sockets. 2008-10-14 Armin Burgmeier * libinfinity/common/inf-connection-manager.c: * libinfinity/common/inf-error.c: * libinfinity/common/inf-init.c: * libinfinity/common/inf-io.h: * libinfinity/common/inf-ip-address.c: * libinfinity/common/inf-standalone-io.c: * libinfinity/common/inf-tcp-connection.c: * libinfinity/server/infd-tcp-server.c: Fixed the build on Windows. InfStandaloneIo only has a stub implementation for now. GtkIo does not work correctly with glib 2.18, though I believe that's a regression in glib because it works with glib 2.16. Let's see whether I can track that down. * configure.ac: Don't require libuuid on Windows since we use native Windows API there. 2008-10-14 Armin Burgmeier * libinfinity/common/inf-init.h: Include only for G_BEGIN_DECLS and G_END_DECLS, removed inculdes that we don't need in inf-init.h. 2008-10-14 Armin Burgmeier * libinfinity/Makefile.am: * libinftext/Makefile.am: * libinfgtk/Makefile.am: * libinftextgtk/Makefile.am: * infinoted/Makefile.am: * libinftextgtk/Makefile.am: Fixed linking order so that libraries that depend on others appear first in the command line. 2008-10-14 Armin Burgmeier * libinfinity/methods/local-central/Makefile.am: * infinoted/note-plugins/text/Makefile.am: Added -avoid-version, -module and -no-undefined LDFLAGS. Also fixed the linking order. 2008-10-14 Armin Burgmeier * infinoted/infinoted-options.c: * infinoted/infinoted-startup.c: Fixed a few warnings. 2008-10-14 Armin Burgmeier * po/LINGUAS: Added a file that lists all languages, as required by `make dist'. * configure.ac: Use that file to set ALL_LINGUAS. 2008-10-14 Armin Burgmeier * libinfinity/common/inf-init.h: * libinfinity/common/inf-init.c * libinfinity/common/Makefile.am: New file that contains a function to initialize the library. * infinoted/infinoted-main.c: Don't call g_type_init() anymore in main(). * infinoted/infinoted-startup.c: Instead, call inf_init() which does g_type_init in startup. * libinfinity/inf-i18n.h: * libinfinity/inf-i18n.c: Rely on gettext being initialized all the time. This means inf_init() needs to have been called before. 2008-10-14 Armin Burgmeier * libinftextgtk/inf-text-gtk-buffer.h: * libinftextgtk/inf-text-gtk-buffer.c: Added inf_text_gtk_buffer_get_wake_on_cursor_movement() and inf_text_gtk_buffer_set_wake_on_cursor_movement(). This setting specifies whether to make inactive users active when the cursor position of the underlying TextBuffer changes, or to resync when the user is explicitely set to be active. 2008-10-13 Armin Burgmeier * libinftextgtk/inf-text-gtk-buffer.c: Make sure only one author tag can be applied to a range of text. Applying multiple tags could still occur when copying and pasting text from the same buffer. 2008-10-13 Armin Burgmeier * libinfinity/common/inf-connection-manager.c (inf_connection_manager_handle_message): Keep a reference on the group that is currently processed, and unref at the end. This prevents a crash when net_object_received() does a final unref on the group. 2008-10-12 Armin Burgmeier * libinfinity/common/inf-connection-manager.c (inf_connection_manager_group_unref): Allow final unref of groups not in the tree (because of duplicate IDs). This is a temporary workaround until the handling of such groups has been fixed. 2008-10-12 Armin Burgmeier * libinfgtk/inf-gtk-browser-store.c: Removed an unnecessary gtk_tree_model_row_changed() call. * libinfgtk/inf-gtk-browser-view.c: Fixed automatic expansion of root node when multiple views show the same model. 2008-10-11 Armin Burgmeier * libinfinity/adopted/inf-adopted-session.c (inf_adopted_session_process_xml_sync): Don't leak the processed request. * inf_adopted_split_operation_revert (inf_adopted_split_operation_revert): Don't leak the two reverted child operations. * libinfinity/common/inf-connection-manager.c (inf_connection_manager_group_free): Don't leak the InfConnectionManagerMethodInstance instance. (inf_connection_manager_handle_message): Don't leak scope_attr. * libinfinity/common/inf-session.c (inf_session_get_xml_user_props_impl): Don't leak status. * libinftext/inf-text-session.c (inf_text_session_process_xml_sync): Don't leak the GIconv conversion descriptor. (inf_text_session_process_xml_sync): Don't leak text. 2008-10-09 Armin Burgmeier * libinfinity/common/inf-discovery-avahi.c: Don't assert when the avahi client could not be created. Even though we pass AVAHI_CLIENT_NO_FAIL, sometimes the client still can't be created it seems. 2008-10-09 Armin Burgmeier * libinfinity/adopted/inf-adopted-state-vector.c (inf_adopted_state_vector_vdiff): Changed an assertion that effectively checks an input parameter to a g_return_val_if_fail. * libinftext/inf-text-chunk.c: Disable chunk integrity check by default. * libinftext/inf-text-default-delete-operation.c: Disable text match check by default. 2008-10-09 Armin Burgmeier * libinfinity/adopted/inf-adopted-algorithm.c: Don't let unavailable users prevent cleanup. 2008-10-09 Armin Burgmeier * libinftext/inf-text-session.c: Send undo-caret and redo-caret. We still don't make a difference internally, but let's be gentle to implementations which do. * libinftextgtk/inf-text-gtk-buffer.c: Update "insert" and "selection-bound" markers when the active user's selection changes. 2008-10-09 Armin Burgmeier * infinoted/infinoted-run.h: * infinoted/infinoted-run.c: Moved server running code from infinoted-main.c to a new file. * infinoted/infinoted-signal.h: * infinoted/infinoted-signal.c: New files to handle SIGINT and SIGTERM properly by saving the directory and then shutting down. * infinoted/infinoted-main.c: Register the signals, call into infinoted-run. * infinoted/Makefile.am: Add the new files to the build. * libinfinity/common/inf-standalone-io.c (inf_standalone_io_iteration_impl): Return if poll returned EINTR, to allow shutting down the server in a signal handler. * libinfinity/server/infd-server-pool.c (infd_server_pool_entry_unpublish_with): Fixed unwanted fallthrough in a switch statement. * libinfinity/common/inf-discovery-avahi.c (inf_discovery_avahi_unpublish): Fixed an assertion. * libinfinity/adopted/inf-adopted-split-operation.c: Fixed a typo in a comment. 2008-10-08 Armin Burgmeier * libinfinity/common/inf-user.h: * libinfinity/adopted/inf-adopted-user.h: * libinfinity/adopted/inf-adopted-request.h: * libinfinity/adopted/inf-adopted-request-log.h: * libinfinity/adopted/inf-adopted-algorithm.h: * libinfinity/common/inf-user.c: * libinfinity/adopted/inf-adopted-user.c: * libinfinity/adopted/inf-adopted-request.c: * libinfinity/adopted/inf-adopted-request-log.c: * libinfinity/adopted/inf-adopted-algorithm.c: Added a priv pointer to the instance struct, initialize it in instance_init and use this instead of calling g_type_instance_get_private all the time. This gets us a performance gain of about 9%. 2008-10-08 Armin Burgmeier * infinoted/infinoted-creds.c: Set the subject alternatime name to hostname.local for newly created self-signed certificates, because this is what avahi discovers in a local network. 2008-10-08 Armin Burgmeier * libinfgtk/inf-gtk-certificate-dialog.c: Fixed messages when the certificate has changed. The normal message and the one shown when the old certificate has expired were swapped. 2008-10-08 Armin Burgmeier * libinfgtk/inf-gtk-certificate-manager.c: Don't crash when no certificate warnings are shown, but just go on without showing a dialog. 2008-10-08 Armin Burgmeier * libinfinity/common/inf-discovery-avahi.c: Emit undiscovered signals on correct discovery infos. 2008-10-08 Armin Burgmeier * libinfinity/common/inf-xmpp-connection.h: * libinfinity/common/inf-xmpp-connection.c: Added a sasl-mechanisms property that specifies what mechanisms to accept or offer, respectively, for authentication. * libinfinity/server/infd-xmpp-server.h: * libinfinity/server/infd-xmpp-server.c: * libinfinity/common/inf-discovery-avahi.h: * libinfinity/common/inf-discovery-avahi.c: Added the same property, and forward to created connections. * infinoted/infinoted-main.c: * test/inf-test-browser.c: * test/inf-test-daemon.c: * test/inf-test-gtk-browser.c: * test/inf-test-xmpp-connection.c: Adapt to API changes. * libinfinity/client/infc-browser.c: Don't unref the default method manager. 2008-10-07 Armin Burgmeier * libinfinity/adopted/inf-adopted-state-vector.h: * libinfinity/adopted/inf-adopted-state-vector.c: Added inf_adopted_state_vector_vdiff(). * libinfinity/adopted/inf-adopted-algorithm.c: Use that function to calculate required vdiffs, instead of a slower, own implementation. 2008-10-07 Armin Burgmeier * libinfinity/adopted/inf-adopted-state-vector.h: * libinfinity/adopted/inf-adopted-state-vector.c: Added inf_adopted_state_vector_causally_before_inc(). * libinfinity/adopted/inf-adopted-algorithm.c: Use this new function, to save some copies. * test/inf-test-state-vector.c: Verify that inf_adopted_state_vector_causally_before_inc(, , 1) yields FALSE. 2008-10-07 Armin Burgmeier * libinfinity/adopted/inf-adopted-state-vector.c: Fixed an assertion in inf_adopted_state_vector_add(). * libinfinity/adopted/inf-adopted-algorithm.c: Cleaned up the code in inf_adopted_translate_request(), don't make a copy of the 'to' parameter anymore. 2008-10-07 Armin Burgmeier * libinfinity/adopted/inf-adopted-algorithm.c (inf_adopted_algorithm_translate_request): Don't leak v when a cached request is returned. (inf_adopted_algorithm_execute_request): Don't leak log_request when the request must be made reversible. * libinfinity/adopted/inf-adopted-request.c (inf_adopted_request_transform), (inf_adopted_request_mirror): Don't leak the newly created operations. * libinftext/inf-text-session.c (inf_text_session_xml_to_request): Don't leak the parsed operation. * test/inf-test-chunk.c: Don't leak the two chunks. * test/inf-test-text-operations.c: Don't leak the users array. * test/util/inf-test-util.c: Don't leak the XML content of nodes for buffers. 2008-10-07 Armin Burgmeier * libinfinity/adopted/inf-adopted-algorithm.c: Removed the ugly can_cache paramatere for inf_adopted_algorithm_translate_request() and inf_adopted_algorithm_transform_request(). Instead, translate_request checks itself whether a request is cachable or not. 2008-10-07 Armin Burgmeier * libinfinity/adopted/inf-adopted-request.h: * libinfinity/adopted/inf-adopted-request.c: Made InfAdoptedRequest immutable, which means that the request cannot be altered anymore once created. The functions inf_adopted_request_transform(), inf_adopted_request_mirror() and inf_adopted_request_fold() now return new requests instead of modifying the given one. * libinfinity/adopted/inf-adopted-algorithm.c: Adapt to that change. Given that requests are now immutable, we can save a few copies. This speeds up inf-test-text-session about 11%. 2008-10-07 Armin Burgmeier * test/util/inf-test-util.c (inf_test_dir_util_foreach): Iterate alphabetically through the file names. * test/inf-test-text-session.c: Actually make setting a random seed work, added time measurement. 2008-10-06 Armin Burgmeier * libinfinity/adopted/inf-adopted-session-record.c: Fixed a few warnings. * configure.ac: Added check-news to AM_INIT_AUTOMAKE. * NEWS: Removed the dummy entry, so I don't forget to create a real one for the release. 2008-10-06 Armin Burgmeier * libinfinity/adopted/inf-adopted-operation.h: * libinfinity/adopted/inf-adopted-operation.c: Added two new virtual functions, need_concurrency_id() and get_concurrency_id(). These are used to correctly handle situations when two requests insert text at the same position concurrently. * libinfinity/adopted/inf-adopted-request.h: * libinfinity/adopted/inf-adopted-request.c: Added inf_adopted_request_need_concurrency_id() and inf_adopted_request_get_concurrency_id() which are simple wrapper functions for the underlying operation functions. * libinfinity/adopted/inf-adopted-algorithm.c: If a concurrency ID is needed during transformation, then acquire one from the same requests in a previous state. * libinfinity/adopted/inf-adopted-no-operation.c: * libinfinity/adopted/inf-adopted-split-operation.c: Implement the two new virtual functions. * libinftext/inf-text-pword.h: * libinftext/inf-text-pword.c: Removed, since pwords are no longer used. These did not handle the situation described above well enough, since the algorithm did not pass one of the tests in test/session since the request cache has been introduced (see my change from 2008-02-22). The test in question is now test #28. Also, the adOPTed algorithm relies on the fact that it must not matter on which path a request has been transformed to reach a certain state. The pword concept did not fulfill this requirement. * libinftext/Makefile.am: Removed the files from the build. * libinftext/inf-text-insert-operation.h: * libinftext/inf-text-insert-operation.c: Added inf_text_insert_operation_need_concurrency_id() and inf_text_insert_operation_get_concurrency_id(), and replaced the get_pword() virtual function by get_position(). * libinftext/inf-text-delete-operation.h: * libinftext/inf-text-delete-operation.c: Added inf_text_delete_operation_need_concurrency_id() and inf_text_delete_operation_get_concurrency_id(). * libinftext/inf-text-default-insert-operation.c: * libinftext/inf-text-default-delete-operation.c: * libinftext/inf-text-remote-delete-operation.c: * libinftext/inf-text-move-operation.c: Implement the two new virtual functions from InfAdoptedOperation, and adapt to the get_pword() -> get_position() change in InfTextDefaultInsertOperation. * test/inf-test-text-operations.c: Correctly supply concurrency IDs for the C2 tests to pass. * test/inf-test-text-session.c: Always show the random seed used, also if given. * test/session/*.xml: Regenerated tests. * test/session/Makefile.am: Added the new files to the distribution. 2008-10-06 Armin Burgmeier * libinfinity/inf-i18n.h: * libinfinity/inf-i18n.c: Added vim modelines. * libinfinity/adopted/inf-adopted-concurrency-warning.h: * libinfinity/adopted/inf-adopted-concurrency-warning.c: Helper files that contain a function to print a warning used in the upcoming modification of the algorithm when a concurrency ID is requested for types that don't support it yet. * libinfinity/adopted/Makefile.am: Add the files to the build. 2008-10-03 Armin Burgmeier * libinfinity/adopted/inf-adopted-algorithm.c (inf_adopted_algorithm_translate_request): Simplified the code a bit. 2008-10-01 Armin Burgmeier * libinfinity/inf-i18n.h: * libinfinity/inf-i18n.c: Added _inf_gettext_init() in case somebody needs the infinote gettext translation domain being set without having called _inf_gettext() before. * infinoted/infinoted-creds.h: * infinoted/infinoted-creds.c: Fixed a typo. * infinoted/infinoted-options.h: * infinoted/infinoted-startup.h: * infinoted/infinoted-options.c: * infinoted/infinoted-startup.c: New files, containing some functionality from infinoted-main.c, due to code refactorings. * infinoted/infinoted-main.c: Adapt. * infinoted/Makefile.am: Build the new files. * README: * configure.ac: Require at least glib 2.16. 2008-09-29 Armin Burgmeier * libinfinity/common/inf-cert-util.c (inf_cert_util_save_file): Fixed storage of more than one certificate. 2008-09-25 Armin Burgmeier * libinftext/inf-text-chunk.c: Fixed another problem when a chunk was inserted into another chunk between two segments when the last part could be merged. * test/replay/replay-03.record.xml: * test/replay/replay-04.record.xml: Added two new records, to test the the InfTextChunk. 2008-09-23 Armin Burgmeier * libinftext/inf-text-chunk.c: Fixed a problem when a chunk was inserted into another chunk between two segments, and the last part could not be merged. * test/inf-test-text-replay.c: Cleaned up the code a bit. 2008-09-22 Armin Burgmeier * libinftext/inf-text-chunk.c (inf_text_chunk_erase): Fixed a problem that the erase operation did not produce a correct result when both the first and the last segment of the erasure bounds were in different segments of the same author. * test/inf-test-text-replay.c: Added code to set a breakpoint just before the algorithm applies a request, to be able to debug the InfTextChunk internals. 2008-09-22 Armin Burgmeier * test/inf-test-text-replay.c: Added functionality to check for InfTextChunk errors by performing all the buffer operations on an (ascii-only) GString and comparing the result with the buffer. * libinfinity/adopted/inf-adopted-algorithm.c: Documented a missing parameter in InfAdoptedAlgorithm::execute-request. * test/replay/replay-01.record.xml: * test/replay/replay-02.record.xml: Added two records that currently fail to replay correctly. 2008-09-22 Armin Burgmeier * libinftext/inf-text-session.h: * libinftext/inf-text-session.c: Reorganized the code a bit, added inf_text_session_flush_requests_for_user(). 2008-09-21 Armin Burgmeier * libinftextgtk/inf-text-gtk-buffer.h: * libinftextgtk/inf-text-gtk-buffer.c: Added inf_text_gtk_buffer_ensure_author_tags_priority(). 2008-09-21 Armin Burgmeier * libinfgtk/inf-gtk-certificate-manager.c: Fixed a crash when setting a new trust file. 2008-09-21 Armin Burgmeier * libinfgtk/inf-gtk-browser-store.c: * libinfgtk/inf-gtk-browser-view.c: Allow activating an item with error status and discovery set in which case another connection attempt is made. 2008-09-21 Armin Burgmeier * libinfinity/common/inf-discovery-avahi.c: Fixed usage of alternative service name on collision. 2008-09-21 Armin Burgmeier * libinfinity/server/infd-directory.c: Save new and synced-in sessions initially to storage, to prevent later data loss and to avoid a failure when a user deletes a newly added document (It has not yet been saved to storage, so the deletion of it caused an error). 2008-09-19 Armin Burgmeier * libinfgtk/inf-gtk-browser-store.c: Fixed a crash when the network interface used goes suddenly down. * libinfgtk/inf-gtk-browser-view.c: Fixed a reference counting problem. 2008-09-19 Armin Burgmeier * libinfgtk/inf-gtk-certificate-view.c: Fixed a crash when instantiating InfGtkCertificateView. 2008-09-18 Armin Burgmeier * update-potfiles: Added a small script to generate the po/POTFILES.in. It is simple, but enough for our needs. 2008-09-18 Armin Burgmeier * libinfinity/common/inf-connection-manager.c: * libinfinity/common/inf-discovery-avahi.c: * libinfinity/common/inf-method-manager.c: * libinfinity/common/inf-tcp-connection.c: * libinfinity/common/inf-xmpp-connection.c: * libinfinity/client/infc-browser.c: * libinfinity/server/infd-directory.c: * libinfinity/server/infd-filesystem-storage.c: * libinfinity/adopted/inf-adopted-session-record.c: * libinfgtk/inf-gtk-certificate-manager.c: Marked a few more strings for translation. 2008-09-18 Armin Burgmeier * infinoted/infinoted-main.c: Added --require-tls and --no-tls command line options. 2008-09-18 Armin Burgmeier * libinfinity/server/infd-directory.c infd_directory_node_explore(): Prevent a crash when exploring an unknown note type from the storage. 2008-09-18 Armin Burgmeier * libinfinity/common/inf-xmpp-connection.h: * libinfinity/common/inf-xmpp-connection.c: Added a security-policy property that specifies how to decide whether to use TLS or not. This allows not to use TLS for specific purposes. * libinfinity/server/infd-xmpp-server.h: * libinfinity/server/infd-xmpp-server.c: * libinfinity/common/inf-discovery-avahi.h: * libinfinity/common/inf-discovery-avahi.c: Added the same property that is delegated to created XMPP connections. * test/inf-test-browser.c: * test/inf-test-xmpp-connection.c: Adapted to API change. 2008-09-17 Armin Burgmeier * configure.ac: * Makefile.am: Added gettext support. * libinfinity/inf-i18n.h: * libinfinity/inf-i18n.c: New files containing the common _() macro and a wrapper function to initialize gettext before the first string is translated. * libinfinity/Makefile.am: Add the new files to the build. * libinfinity/common/inf-cert-util.c: * libinfinity/common/inf-connection-manager.c: * libinfinity/common/inf-discovery-avahi.c: * libinfinity/common/inf-error.c: * libinfinity/common/inf-session.c: * libinfinity/common/inf-tcp-connection.c: * libinfinity/common/inf-user.c: * libinfinity/common/inf-xml-util.c: * libinfinity/common/inf-xmpp-connection.c: * libinfinity/client/infc-browser.c: * libinfinity/client/infc-request-manager.c: * libinfinity/client/infc-session-proxy.c: * libinfinity/server/infd-directory.c: * libinfinity/server/infd-filesystem-storage.c: * libinfinity/server/infd-session-proxy.c: * libinfinity/server/infd-xml-server.c: * libinfinity/adopted/inf-adopted-session-record.c: * libinfinity/adopted/inf-adopted-session.c: * libinfinity/adopted/inf-adopted-state-vector.c: * libinftext/inf-text-session.c: * libinfgtk/inf-gtk-browser-store.c: * libinfgtk/inf-gtk-browser-view.c: * libinfgtk/inf-gtk-certificate-dialog.c: * libinfgtk/inf-gtk-certificate-manager.c: * libinfgtk/inf-gtk-certificate-view.c: * libinftextgtk/inf-text-gtk-buffer.c: * infinoted/infinoted-main.c: * infinoted/infinoted-note-plugin.c: Mark all translatable strings. Strings in g_warning() have been omitted, but it might make sense to mark them, too, or at least some of them. 2008-09-17 Armin Burgmeier * libinfinity/common/inf-xmpp-connection.h: * libinfinity/common/inf-xmpp-connection.c: Correctly import certificate chains, produce an error if the server does not provide a certificate. * libinfinity/common/inf-certificate-chain.c: Changed direction so that the first certificate is the server's and the last certificate is the root's, since this how we get the list from GnuTLS. * libinfgtk/inf-gtk-certificate-dialog.c: Fixed showing certificate chains consisting of more than one certificate. * infinoted/infinoted-main.c: Fixed using a whole certificate chain for the server. * infinoted/infinoted-creds.h: * infinoted/infinoted-creds.c: Removed infinoted_creds_read_certificate and infinoted_creds_write_certificate since we use the inf_cert_util functions instead. * configure.ac: * README: Raise required GTK+ version to 2.12, since we use gtk_tree_view_set_show_expanders() which is only available since 2.12. 2008-09-17 Armin Burgmeier * libinfinity/server/infd-directory.c: Fixed warnings about incompatible pointer type in calls to inf_connection_manager_open_group(). 2008-09-17 Armin Burgmeier * libinfinity/common/inf-error.h: * libinfinity/common/inf-error.c: Added inf_gnutls_error_quark() and inf_gnutls_set_error() to convert a gnutls error code into a GError. * libinfinity/common/inf-cert-util.c: * libinfinity/common/inf-xmpp-connection.c: Make use of the new functions, to simplify the code. 2008-09-17 Armin Burgmeier * libinfinity/common/inf-cert-util.h: * libinfinity/common/inf-cert-util.c: Added inf_cert_util_load_file and inf_cert_util_save_file to load or save a certificate list. * libinfgtk/inf-gtk-certificate-manager.c: Use these functions instead of the private inf_gtk_certificate_manager_load_certificate_file and inf_gtk_certificate_manager_save_certificate_file. * libinfgtk/inf-gtk-certificate-dialog.c: Fixed usage of the return value of gtk_icon_theme_lookup_icon. 2008-09-16 Armin Burgmeier * infinoted/infinoted/creds.h: * infinoted/infinoted/creds.c: Include only in the source file not in the header, it is not needed for the declarations. Also set the common name of a generated self-signed certificate to g_get_host_name(). * infinoted/infinoted/main.c: Include since it is no longer included by including infinoted/creds.h. 2008-09-16 Armin Burgmeier * libinfgtk/inf-gtk-certificate-view.h: * libinfgtk/inf-gtk-certificate-view.c: Added a widget that shows a certificate. * libinfgtk/inf-gtk-certificate-dialog.h: * libinfgtk/inf-gtk-certificate-dialog.c: Added a dialog that warns the user when certain things are wrong with a certificate, such as when the issuer is not trusted, the hostname does not match or the certificate expired. * libinfgtk/inf-gtk-certificate-manager.h: * libinfgtk/inf-gtk-certificate-manager.c: Added a class that verifies the certificates of all client connections of a InfXmppManager, and shows InfGtkCertificateDialogs if necessary. * libinfgtk/Makefile.am: Added the new files to the build. 2008-09-16 Armin Burgmeier * libinfinity/common/inf-cert-util.h: * libinfinity/common/inf-cert-util.c: New file containing a few convenience functions to deal with X.509 certificates. * libinfinity/common/inf-certificate-chain.h: * libinfinity/common/inf-certificate-chain.c: Very thin wrapper around an array of gnutls_x509_crt_t to ref-count it and integrate it into the gobject type system. * libinfinity/common/Makefile.am: Added the new files to the build. * libinfinity/common/inf-xmpp-manager.h: * libinfinity/common/inf-xmpp-manager.c: Added a "add-connection" signal that is emitted when a new connection has been added to the manager. * libinfinity/common/inf-xmpp-connection.h: * libinfinity/common/inf-xmpp-connection.c: Query server certificate(s) if we are client, and call a callback to decide whether to accpet the certificate or not. 2008-09-13 Armin Burgmeier * libinfinity/common/inf-xmpp-connection.h: * libinfinity/common/inf-xmpp-connection.c: Make InfXmppConnection take local and remote server address instead of local jid only, and send correct header as required by the RFC. Added support for verification of server's certificate, via a callback. * libinfinity/server/infd-xmpp-server.h: * libinfinity/server/infd-xmpp-server.c: * libinfinity/common/inf-discovery-avahi.c: Set remote server name appropriately. * infinoted/infinoted-main.c: * test/inf-test-browser.c: * test/inf-test-daemon.c: * test/inf-test-xmpp-connection.c: Adapt to API change. 2008-09-11 Armin Burgmeier * libinftextgtk/inf-text-gtk-buffer.c: Don't move own cursor or selection bound if a remote insert operation occurs at the same position. 2008-09-10 Armin Burgmeier * libinftextgtk/inf-text-gtk-buffer.c: Fixed a bug causing wrong text colors when undoing a delete operation having erased text from multiple users. 2008-09-10 Armin Burgmeier * libinfinity/server/infd-session-proxy.c: Notify clients when a connection with subscribed users has unsubscribed. 2008-09-10 Armin Burgmeier * libinftext/inf-text-session.h: * libinftext/inf-text-session.c: Added inf_text_session_set_user_color(), and handle on remote site. 2008-09-10 Armin Burgmeier * libinfinity/client/infc-session-proxy.c: Set connection of joining users to the publisher connection if none was specified. 2008-09-09 Armin Burgmeier * libinfinity/inf-marshal.in: Added VOID:DOUBLE and VOID:ENUM marshallers. * libinftextgtk/inf-text-gtk-hue-chooser.h: * libinftextgtk/inf-text-gtk-hue-chooser.c: Added a new class to choose a hue value. This is basically the same as GtkHSV without the inner triangle. * libinftextgtk/Makefile.am: Added the new files to the build. * libinftextgtk/inf-text-gtk-buffer.c: Added a TODO comment about using gtk_hsv_to_rgb from GTK+ 2.14. 2008-09-07 Armin Burgmeier * libinfinity/client/infc-session-proxy.h: * libinfinity/client/infc-session-proxy.c: Removed infc_session_proxy_set_user_status(), don't handle user-status-change request anymore. * libinfinity/server/infd-session-proxy.c: Don't handle user-status-change anymore, update subscription lists on user status notify. * libinfinity/common/inf-session.h: * libinfinity/common/inf-session.c: Added inf_session_set_user_status(), handle user-status-change requests. 2008-08-27 Armin Burgmeier * libinfinity/adopted/inf-adopted-session-record.c: Flush record file after every request written, so that we don't miss any when we crash. 2008-08-27 Armin Burgmeier * libinftext/inf-text-session.c inf_text_session_request_to_xml(): Don't require a delete operation to be a InfTextDefaultDeleteOperation when for_sync is FALSE, because we only need the length of the operation anyway then. This fixes records of remote delete operations. 2008-08-27 Armin Burgmeier * libinfinity/adopted/inf-adopted-request-log.c: Correctly subtract begin index from end index before dereferencing. 2008-08-27 Armin Burgmeier * libinftext/inf-text-session.c: Correctly read synchronized delete requests, instead of only creating an empty one. 2008-08-26 Armin Burgmeier * libinfinity/server/infd-note-plugin.h: * libinfinity/client/infc-note-plugin.h: Added a user_data parameter to the structs and the callback functions, to ease wrapping InfcNotePlugin and InfdNotePlugin by language bindings. * infinoted/note-plugins/text/infd-note-plugin-text.c: * libinfinity/client/infc-browser.c: * libinfinity/server/infd-directory.c: * test/inf-test-gtk-browser.c: Adapt to API changes. 2008-08-25 Armin Burgmeier * libinfinity/common/inf-user.h: * libinfinity/common/inf-user.c: Replaced INF_USER_AVAILABLE status by INF_USER_ACTIVE and INF_USER_INACTIVE, added inf_user_status_to_string() and inf_user_status_from_string(). * libinfinity/common/inf-error.h: * libinfinity/common/inf-error.c: Merged InfUserJoinError and InfUserStatusChangeError to InfUserError. * libinfinity/adopted/inf-adopted-session.c: Automatically set inactive users active when they issue non-noop requests. * libinfinity/client/infc-session-proxy.h: * libinfinity/client/infc-session-proxy.c: Replaced infc_session_proxy_leave_user() by infc_session_proxy_set_user_status(). * libinfinity/common/inf-session.c: * libinfinity/server/infd-session-proxy.c: * test/inf-test-gtk-browser.c: * test/inf-test-text-cleanup.c: * test/inf-test-text-session.c: Adapt to API changes. 2008-08-24 Armin Burgmeier * libinfinity/server/infd-storage.h: * libinfinity/server/infd-storage.c: Make the remove_node function take an identifier, so that it knows what node to remove. * libinfinity/server/infd-filesystem-storage.c: Implemented accordingly. * libinfinity/server/infd-directory.c: Adapt to API change. 2008-08-24 Armin Burgmeier * libinfgtk/inf-gtk-browser-view.h: * libinfgtk/inf-gtk-browser-view.c: Added inf_gtk_browser_view_set_selected(). 2008-08-23 Armin Burgmeier * libinfgtk/inf-gtk-browser-view.h: * libinfgtk/inf-gtk-browser-view.c: Added the "populate-popup" signal. If signal handlers add menu items to the popup menu, then a popup menu is displayed. 2008-08-22 Armin Burgmeier * libinfinity/common/inf-simulated-connection.h: * libinfinity/common/inf-simulated-connection.c: * libinfinity/common/Makefile.am: Added InfSimulatedConnection, an InfXmlConnection implementation that sends XML data from one simulated connection to another. * libinfinity/adopted/inf-adopted-session-record.c: Add sync-begin and sync-end to initial, so that the content can directly be fed to an InfSession in INF_SESSION_SYNCHRONIZING state on replay. * libinfinity/common/inf-connection-manager.h: * libinfinity/common/inf-connection-manager.c (inf_connection_manager_open_group): Added correct const qualifiers to methods parameter. * libinftext/inf-text-session.c: Don't disconnect from algorithm's signals in INF_SESSION_SYNCHRONIZING state, because we don't have an algorithm yet at that point. This prevents glib warnings. * test/inf-test-text-replay.c: * test/Makefile.am: Added test that replays a record from InfAdoptedSessionRecord internally (without visualization). This can be used to reproduce libinfinity bugs. 2008-08-22 Armin Burgmeier * libinfinity/inf-marshal.in: Added VOID:OBJECT,OBJECT,BOOLEAN marshaller. * libinfinity/adopted/inf-adopted-algorithm.h: * libinfinity/adopted/inf-adopted-algorithm.c: Added user parameter for the "execute-request" signal. * libinfinity/adopted/inf-adopted-session.c: Adapt. * libinfinity/adopted/inf-adopted-session-record.c: Store vector time diffs between requests of the same user, so that the XML can be given directly to InfAdoptedSession for replay. 2008-08-22 Armin Burgmeier * libinfinity/inf-central-method.h: * libinfinity/inf-central-method.c: Moved the implementation of a method implementing central communication into the public libinfinity API, so that it can be used by different networks. * libinfinity/method/local-central/inf-method-local-central.c: Use the InfCentralMethod API. * libinfinity/Makefile.am: Added InfCentralMethod to the build. 2008-08-14 Armin Burgmeier * libinftextgtk/inf-text-gtk-buffer.c (inf_text_gtk_buffer_buffer_iter_get_bytes): Fixed a bug when the iterator only contains a newline. In that case, the function fielded totally wrong values due to an underflow. 2008-08-14 Armin Burgmeier * libinfinity/adopted/inf-adopted-session-record.h: * libinfinity/adopted/inf-adopted-session-record.c: * libinfinity/adopted/Makefile.am: Introduced InfAdoptedSessionRecord, a class to record sessions to replay later. 2008-08-14 Armin Burgmeier * libinfinity/adopted/inf-adopted-session.c: Double the interval within which noop requests are sent, and only send a noop if a remote request has been executed since the last request was sent. 2008-08-08 Armin Burgmeier * libinftextgtk/inf-text-gtk-buffer.c: Call base class dispose instead of finalize, on dispose. 2008-08-08 Armin Burgmeier * libinfgtk/inf-gtk-browser-model.h * libinfgtk/inf-gtk-browser-store.c * libinfgtk/inf-gtk-browser-view.c: Fix searching in browser view by setting the search column correctly, and allowing non-toplevel columns to have a name. 2008-07-23 Benjamin Herr * libinftext/inf-text-session.c: Apply attributes to operation xml element instead of its parent. 2008-07-23 Benjamin Herr * libinftext/inf-text-session.c: Properly initialised operation variable before accessing it. * ChangeLog: Fixed date of preceeding change log entry. 2008-07-18 Armin Burgmeier * libinfinity/adopted/inf-adopted-session.h: * libinfinity/adopted/inf-adopted-session.c: Changed the xml_to_operation and operation_to_xml vfuncs to xml_to_request and request_to_xml, to allow generation of custom requests, and to decouple the update of local user's last send vector from the serialization of a request. Added inf_adopted_session_read_request_info() and inf_adopted_session_write_request_info() to ease implementation by derived classes. * libinftext/inf-text-session.c: Adapted to API change. 2008-07-17 Armin Burgmeier * libinfinity/common/inf-connection-manager.h: * libinfinity/common/inf-connection-manager.c: Added documentation, removed has_connection and lookup_connection functions from InfConnectionManagerMethodDesc, we just rely on the registered connections for this. * libinfinity/methods/local-central/inf-method-local-central.c: Adapt to the API change. * libinfinity/adopted/inf-adopted-session.h: * libinfinity/adopted/inf-adopted-session.c: * libinfinity/adopted/inf-adopted-split-operation.h: * libinfinity/adopted/inf-adopted-state-vector.h: * libinfinity/adopted/inf-adopted-user.h: * libinfinity/common/inf-buffer.h: Added some more documentation. 2008-07-16 Armin Burgmeier * libinfinity/adopted/inf-adopted-algorithm.h: * libinfinity/adopted/inf-adopted-algorithm.c: Added "execute-request" signal that is emitted every time a request is executed. 2008-07-15 Armin Burgmeier * libinfinity/adopted/inf-adopted-request-log.h: * libinfinity/adopted/inf-adopted-request-log.c: Added more documentation. * libinfinity/adopted/inf-adopted-state-vector.c: Fixed formatting slightly. * TODO: Added ideas to improve performance. 2008-07-15 Benjamin Herr * libinfinity/adopted/inf-state-vector.h: Changed state vector typedef from GSequence to an opaque type. * libinfinity/adopted/inf-state-vector.c: Changed state vector to use an array of ids and timestamps instead of a GSequence. * tests/inf-test-state-vector.c: Added a bunch of poorly-thought-out tests. 2008-07-12 Armin Burgmeier * libinfinity/adopted/inf-adopted-algorithm.h: * libinfinity/adopted/inf-adopted-algorithm.c: * libinfinity/adopted/inf-adopted-no-operation.h: * libinfinity/adopted/inf-adopted-no-operation.c: * libinfinity/adopted/inf-adopted-operation.h: * libinfinity/adopted/inf-adopted-operation.c: * libinfinity/adopted/inf-adopted-request.h: * libinfinity/adopted/inf-adopted-request.c: * libinfinity/common/inf-user-table.h: * libinfinity/common/inf-user-table.c: * libinfinity/common/inf-connection-manager.c: * libinfinity/common/inf-io.c: * libinfinity/common/inf-session.c: Added/Fixed documentation. 2008-07-12 Armin Burgmeier * test/inf-test-text-cleanup.c (perform_test): Terminate the call to g_object_new that creates the InfTextSession with NULL, preventing memory corruption. 2008-07-12 Armin Burgmeier * libinfinity/client/infc-browser.c (infc_session_proxy_set_connection): Correctly thaw the notification queue of the session at the end of the function. 2008-07-11 Armin Burgmeier * libinftextgtk/inf-text-gtk-buffer.c: Update user tag "background-color" property on user color change. 2008-07-06 Armin Burgmeier * libinfinity/adopted/inf-adopted-algorithm.c (inf_adopted_algorithm_can_undo_redo): Changed semantics of this function for non-local users so that it returns whether the user in question can issue an Undo or Redo command in its own current state (as known to the local site). * test/inf-test-text-cleanup.c: Allow can-undo and can-redo verifications when the user's vector does not match the current one from the algorithm. * test/cleanup/cleanup-05.xml: * test/cleanup/cleanup-06.xml: * test/cleanup/cleanup-07.xml: Yet another three tests. 2008-07-06 Armin Burgmeier * libinfinity/adopted/inf-adopted-algorithm.c (inf_adopted_algorithm_cleanup): Don't use least common successor but least common predecessor as reference when cleaning up requests. This was always meant to be the predecessor, but used the successor until now because of me being stupid. Also fixed the cleanup process so that when all sites processed all operations the max total log size really is not exceeded. * libinfinity/adopted/inf-adopted-request-log.c (inf_adopted_request_log_remove_requests): Don't touch next-undo or next-redo when no requests are removed. * test/cleanup/cleanup-01.xml: Empty the initial buffer for simplicity. * test/cleanup/cleanup-02.xml: * test/cleanup/cleanup-03.xml: * test/cleanup/cleanup-04.xml: Three more cleanup tests. 2008-07-06 Armin Burgmeier * libinfinity/adopted/inf-adopted-algorithm.c: Use G_MAXUINT instead of 0 for max-total-log-size to mean unlimited, so a max-total-log-size of 0 is allowed. * test/inf-test-text-cleanup.c: * test/inf-test-text-session.c: Only process XML files in the subdirectories, not Makefiles and other stuff. 2008-07-05 Armin Burgmeier * libinfinity/adopted/inf-adopted-algorithm.c (inf_adopted_algorithm_can_undo, inf_adopted_algorithm_can_redo): Added support for returning undo/redo status for non-local users. However, this currently returns whether those users can issue undo/redo in the algorithm's current state. This especially means that a request received from such a non-local user may be valid even if this function returns false, if the request was generated at another state. This will probably be changed in the future to return whether the given user can issue an Undo/Redo request in its own state (as known to the local site). * libinfinity/adopted/inf-adopted-session.c: Added the "max-total-log-size" property that is delegated to the construction of the algorithm. * test/inf-test-text-cleanup.c: Added a test that reads XML files specifying test scenarios from test/cleanup to test whether the algorithm's cleanup routines (correctly shrink request logs, correctly issue can-undo/can-redo) work. * test/cleanup/cleanup-01.xml: First simple cleanup test. * test/session/Makefile.am: * test/cleanup/Makefile.am: * configure.ac: Add the test files to the distribution. * test/Makefile.am: Add the new file to the build. 2008-07-05 Armin Burgmeier * test/session/: Renamed from test/std/. * docs/reference/libinfgtk/Makefile.am: * docs/reference/libinfinity/Makefile.am: * docs/reference/libinftext/Makefile.am: * docs/reference/libinftextgtk/Makefile.am: * libinfgtk/Makefile.am: * libinfinity/Makefile.am: * libinfinity/adopted/Makefile.am: * libinfinity/client/Makefile.am: * libinfinity/common/Makefile.am: * libinfinity/server/Makefile.am: * libinftext/Makefile.am: * libinftextgtk/Makefile.am: Use AM_CPPFLAGS instead of INCLUDES which is deprecated. * test/util/inf-test-util.h: * test/util/inf-test-util.c: Moved some common functions used in multiple tests here for code reuse. * test/Makefile.am: * configure.ac: Add to build. * test/inf-test-text-session.c: Use the new test functions. 2008-07-03 Armin Burgmeier * libinftextgtk/inf-text-gtk-buffer.c (inf_text_gtk_buffer_insert_text_cb, inf_text_gtk_buffer_delete_range_cb): Revalidate iterators at the end, so that others can call gtk_text_buffer_insert and gtk_text_buffer_delete with normal semantics. 2008-06-29 Armin Burgmeier * libinfinity/server/infd-session-proxy.c: Don't assign user IDs that are already in use by users that were already in the initial session. 2008-06-28 Armin Burgmeier * libinfinity/common/inf-xmpp-connection.c: Fixed a crash when was received. * libinfinity/client/infc-session-proxy.h: * libinfinity/client/infc-session-proxy.c: Added infc_session_proxy_get_connection and infc_session_proxy_get_subscription_group, correctly unset underlying session's subscription group when the connection is released. 2008-06-27 Armin Burgmeier * libinfinity/adopted/inf-adopted-session.c (inf_adopted_session_constructor): Add initial local users to the list of local users. * libinfinity/client/infc-browser.c (infc_browser_handle_add_node): Fix the check for a child being present. * libinfinity/common/inf-user-table.c (inf_user_table_add_user_handler): Ref users put into the user table. * libinfinity/common/inf-session.c (inf_session_net_object_sent): Don't assert that the sent message was a synchronization message if we found a synchronization to the connection since we could already have sent stuff that is meant to be processed after the synchronization. (inf_session_add_user): Unref user after having put it into the user table. * libinfinity/server/infd-directory.c: Removed the check that available users in a synced-session need to be from the synchronizing connections since that check has been moved to InfdSessionProxy. * libinfinity/server/infd-session-proxy.c: Added the mentioned check here, and additionally add the user to the list of subscribed users for that connection so that, when the connection unbsubscribes again, the user will be set to unavailable. Also removed the subscribe-sync-conn property, instead allow calling infd_session_proxy_subscribe_to() when the session is in INF_SESSION_SYNCHRONIZING state. * test/inf-test-text-session.c: Unref user after having put in into the user table. * infinoted/note-plugins/text/infd-note-plugin-text.c (infd_note_plugin_text_read_user): Unref user after having put it into the user table. 2008-06-27 Armin Burgmeier * libinfinity/common/inf-session.c (inf_session_sync_strerror): Fix a typo. (inf_session_process_xml_sync_impl): Set connection property to the synchronizing connection if not given. (inf_session_handle_received_sync_message): Cope with the fact that some callback in process_xml_sync could have cancelled the synchronization. * libinfinity/server/infd-directory.c: Make sure that available users in a synced-in session are from the synchronizing connection, and only allow them if the synchronizing connection is subscribed. Otherwise, close the session which effectively cancels the sync-in. * libinfinity/server/infd-session-proxy.c: Fixed two typos in comments. 2008-06-25 Armin Burgmeier * libinfinity/common/infc-session-proxy.c (infc_session_proxy_dispose): Properly release connection on dispose, chain to base class after having unrefed the session, so that weak references are notified after object has been fully disposed. This fixes a warning when a successful sync-in is removed. * libinfinity/common/inf-session.c (inf_session_close_handler): Changed a comment to make clear how synchronizations are removed. 2008-06-24 Armin Burgmeier * libinfinity/common/inf-connection-manager.c (inf_connection_manager_register_connection): Fixed a severe reference counting issue: Registering a connection multiple times did not increase the reference count. * libinftext/inf-text-session.c (inf_text_session_selection_changed_data_free): Fixed the function signature to match GClosureNotify. (inf_text_session_segment_to_xml): Don't assert if the input text is too large, this will be handled in a second run. 2008-06-22 Armin Burgmeier * libinftextgtk/inf-text-gtk-buffer.c (inf_text_gtk_buffer_buffer_iter_get_bytes): Fix two logic errors so that the function behaves as expected. 2008-06-22 Armin Burgmeier * libinfinity/client/infc-browser.c (infc_browser_handle_sync_in): Free type after it has been used, not before, and add the sync in after having created the node, because the sync-in needs to know the node. * libinfinity/client/infc-session-proxy.c (infc_session_proxy_net_object_received): Fix an assertion so that synchronization messages are passed to the underlying InfSession even when they do not come from the subscription connection. * libinfinity/server/infd-directory.c (infd_directory_node_add_sync_in): Send parent node of sync-in, add connection to sync group if it is not the subscription group. * libinfgtk/inf-gtk-browser-view.c: Added two TODO comments about watching a signal to get notified when a sync-in begins. 2008-06-22 Armin Burgmeier * libinfinity/common/inf-session.c (inf_session_close_handler): Check that the connection is still open before calling inf_session_send_sync_error(). This fails otherwise if the session was closed explictely in response to the status change notify of the underlaying connection. (inf_session_synchronization_failed_handler): Don't assert on INF_SESSION_CLOSED since the session could be closed between the beginning of the signal emission and the run of the default handler. * libinfinity/client/infc-browser.c (infc_browser_net_object_received): If an error was set, and the node had a seq set, then fail the corresponding request since the server reply could not be processed. * libinfinity/server/infd-directory.c (infd_directory_add_sync_in): Unref the synchronization group after having passed it to _create_session_proxy(). * libinftextgtk/inf-text-gtk-buffer.c (inf_text_gtk_buffer_set_active_user): Allow the new active user to be NULL to unset the active user, as used in _dispose(). 2008-06-21 Armin Burgmeier * libinfinity/client/infc-browser.h: * libinfinity/client/infc-browser.c: Added infc_browser_iter_get_path(). 2008-06-15 Armin Burgmeier * libinfinity/common/inf-connection-manager.h: * libinfinity/common/inf-connection-manager.c: Added parent parameter for inf_connection_manager_add_connection() and inf_connection_manager_register_connection(). * libinfinity/server/infd-session-proxy.h: * libinfinity/server/infd-session-proxy.c: Added parent_group parameter for infd_session_proxy_subscribe_to(), making sure the first message in the subscription group is sent after the client knows about the subscription (group). * libinfinity/server/infd-directory.c: * libinfinity/methods/local-central/inf-method-local-central.c: Adapt to API changes. 2008-06-14 Armin Burgmeier * test/inf-test-text-operations.c: Remove an unused variable. * infinoted/infinoted-main.c: Listen on IPv6, fall back to IPv4 if that fails. * libinfinity/common/inf-connection-manager.h: * libinfinity/common/inf-connection-manager.c: Do no longer rely on the local/remote address for publisher identification, but use a host-local UUID for this. * libinfinity/common/inf-method-manager.c: Print error message when a method could not be loaded. * libinfinity/methods/local-central/inf-method-local-central.c: * README: * configure.ac: Depend on libuuid. 2008-05-18 Armin Burgmeier * libinfinity/client/infc-browser.c: Added two assertions in infc_browser_handle_sync_in() and infc_browser_add_note_with_content() that make sure that the provided session is not yet subscribed in case that the client wants to subscribe to the newly created node. * libinfgtk/inf-gtk-browser-view.c: Show progress of sync-ins. 2008-05-17 Armin Burgmeier * libinfinity/client/infc-browser.h: * libinfinity/client/infc-browser.c: Replaced the "begin-sync-in" signal and the infc_browser_iter_get_sync_in_requests() method by a infc_browser_iter_get_sync_in() method that provides the same information. 2008-05-17 Armin Burgmeier * libinfinity/common/inf-error.h: * libinfinity/common/inf-error.c: Added INF_DIRECTORY_ERROR_UNEXPECTED_SYNC_IN error code. * libinfinity/client/infc-browser.h: * libinfinity/client/infc-browser.c: Added support for Sync-Ins, resulting in these new methods: infc_browser_add_note_with_content(), infc_browser_iter_get_sync_in_requests(), and the "begin-sync-in" signal. * libinfinity/server/infd-directory.c: Added node name and node type in the reply. 2008-05-13 Armin Burgmeier * libinfinity/server/infd-directory.c: Added child tags into replies that have a child set, telling group name and method of subscription group. 2008-05-12 Armin Burgmeier * libinfinity/adopted/inf-adopted-session.c: Correctly remove noop timer when the session is destroyed. 2008-05-12 Armin Burgmeier * libinfinity/server/infd-session-proxy.h: * libinfinity/server/infd-session-proxy.c: Added a synchronize parameter to infd_session_proxy_subscribe_to, that specifies whether to synchronize the session before subscription. * libinfinity/server/infd-directory.h: * libinfinity/server/infd-directory.c: Added support for so-called Sync-Ins. Sync-Ins are nodes created upon a client request that have initial content synchronized from the client. 2008-05-09 Armin Burgmeier * libinfgtk/inf-gtk-browser-view.c: Don't rely on the underlying model containing all browser nodes since a InfGtkBrowserModelFilter might filter some. 2008-05-09 Armin Burgmeier * libinfgtk/inf-gtk-browser-model-sort.c: * libinfgtk/inf-gtk-browser-model-filter.c: Fix call to gtk_tree_model_{filter,sort}_convert_child_iter_to_iter() in browser_iter_to_tree_iter. * libinfgtk/inf-gtk-browser-view.c: Don't rely on the model to have GTK_TREE_MODEL_ITERS_PERSIST set. 2008-05-09 Armin Burgmeier * libinfinity/common/inf-standalone-io.c: Fixed endless loop when two or more timeouts have been registered. 2008-05-09 Armin Burgmeier * libinfgtk/inf-gtk-browser-model-sort.c: * libinfgtk/inf-gtk-browser-model-filter.c: Explicitely sync with initial model in constructor since we don't get notified for it. 2008-05-09 Armin Burgmeier * libinfgtk/inf-gtk-browser-view.h: * libinfgtk/inf-gtk-browser-view.c: Added the "selection_changed" signal. 2008-05-09 Armin Burgmeier * libinfgtk/inf-gtk-browser-model-filter.c: (inf_gtk_browser_model_filter_new): Fixed property name in g_object_new which is "child-model" instead of "model" for GtkTreeModelFilter. 2008-05-09 Armin Burgmeier * libinfinity/client/infc-browser.h: * libinfinity/client/infc-browser.c: Made the plugin parameter to infc_browser_add_note() const. 2008-05-09 Armin Burgmeier * libinfgtk/inf-gtk-browser-view.h: * libinfgtk/inf-gtk-browser-view.c: Added inf_gtk_browser_view_get_selected(). 2008-05-08 Armin Burgmeier * libinfgtk/inf-gtk-browser-store.h: Removed declaration of inf_gtk_browser_store_resolve(). * libinfgtk/inf-gtk-browser-model.c: Adjusted reference from inf_gtk_browser_store_resove() to inf_gtk_browser_model_resolve(). 2008-05-08 Armin Burgmeier * docs/reference/libinfinity/libinfinity-docs.sgml: Reordered, added a separate section for each sub-library (common, adopted, client, server). * docs/reference/libinftext/Makefile.am: * docs/reference/libinftext/tmpl/*.sgml: * docs/reference/libinftext/libinftext-docs.sgml: * docs/reference/libinftext/libinftext-overrides.txt: * docs/reference/libinftext/libinftext-sections.txt: * docs/reference/libinftext/libinftext.types: * docs/reference/Makefile.am: * configure.ac: Added gtk-doc documentation for libinftext. * docs/reference/libinfgtk/Makefile.am: * docs/reference/libinfgtk/tmpl/*.sgml: * docs/reference/libinfgtk/libinfgtk-docs.sgml: * docs/reference/libinfgtk/libinfgtk-overrides.txt: * docs/reference/libinfgtk/libinfgtk-sections.txt: * docs/reference/libinfgtk/libinfgtk.types: * docs/reference/Makefile.am: * configure.ac: Added gtk-doc documentation for libinfgtk. * docs/reference/libinftextgtk/Makefile.am: * docs/reference/libinftextgtk/tmpl/*.sgml: * docs/reference/libinftextgtk/libinftextgtk-docs.sgml: * docs/reference/libinftextgtk/libinftextgtk-overrides.txt: * docs/reference/libinftextgtk/libinftextgtk-sections.txt: * docs/reference/libinftextgtk/libinftextgtk.types: * docs/reference/Makefile.am: * configure.ac: Added gtk-doc documentation for libinftextgtk. * libinftext/inf-text-buffer.c: * libinftext/inf-text-chunk.c: * libinfgtk/inf-gtk-browser-model.c: * libinfgtk/inf-gtk-browser-model.h: * libinfgtk/inf-gtk-browser-view.c: * libinfgtk/inf-gtk-io.c: Fixed minor documentation errors. 2008-05-08 Armin Burgmeier * libinfgtk/inf-gtk-browser-model-sort.c: Don't call inf_gtk_browser_model_set_browser() on child model in default signal handler of set_browser. This would lead to endless recursion. * libinfgtk/inf-gtk-browser-model-filter.h: * libinfgtk/inf-gtk-browser-model-filter.c: * libinfgtk/Makefile.am: Added InfGtkBrowserModelFilter, deriving from GtkTreeModelFilter and implementing InfGtkBrowserModel. 2008-05-08 Armin Burgmeier * libinfgtk/inf-gtk-browser-store.h: Removed two declarations that are already in inf-gtk-browser-model.h. * libinfgtk/inf-gtk-browser-model-sort.h: * libinfgtk/inf-gtk-browser-model-sort.c: * libinfgtk/Makefile: Added a new class deriving from GtkTreeModelSort that implements InfGtkBrowserModel. 2008-04-20 Armin Burgmeier * libinfgtk/inf-gtk-browser-model.h: * libinfgtk/inf-gtk-browser-model.c: * Makefile.am: Changed this class to an interface with a resolve() and browser_iter_to_tree_iter() virtual function, to allow custom models to be given to InfGtkBrowserView. * libinfgtk/inf-gtk-browser-store.h: * libinfgtk/inf-gtk-browser-store.c: Moved the original InfGtkBrowserModel class to InfGtkBrowserStore, implementing the new interface. * libinfgtk/inf-gtk-browser-view.c: Added a missing include, remove some unused variables. * test/inf-test-gtk-browser.c: Adapt to the new API. 2008-04-20 Armin Burgmeier * infinoted/note-plugins/text/infd-note-plugin-text.c: * libinfinity/common/inf-connection-manager.c: Improved error messages. * libinfinity/server/infd-session-proxy.c: Added a TODO comment about not propagating non-fatal errors to the connection manager. 2008-04-13 Armin Burgmeier * libinfinity/client/infc-browser.c: Remove the session proxy associated to an entry when the corresponding session is closed. 2008-04-13 Armin Burgmeier * libinfinity/common/inf-connection-manager.c: Reset the _private field of queued xmlNodePtr, so that libxml++ (when linked in) does not assume that's the C++ wrapper for the node (it tries to delete it). 2008-04-12 Armin Burgmeier * libinftextgtk/inf-text-gtk-buffer.c: Allow moving the text buffer's cursor and selection without active user. 2008-04-12 Armin Burgmeier * libinfinity/client/infc-browser.c: Emit the subscribe-session signal before finishing a pending request, so that signal handlers of InfcNodeRequest::finished can access the newly created session via infc_browser_iter_get_session(). * libinfinity/common/inf-xmpp-connection.c: Added some more comments about RFC compliance. 2008-03-06 Armin Burgmeier * libinfinity/Makefile.am: Build methods after having built libinfinity, so they can link against it. * libinfinity/methods/local-central/Makefile.am: Link against libinfinity-1.0 instead of libinfinity_common so that the marshal functions are not undefined. 2008-03-06 Armin Burgmeier * libinfgtk/inf-gtk-browser-model.h: * libinfgtk/inf-gtk-browser-model.c: Added a "name" column for toplevel items, to support sensible item names for direct connections. * libinfgtk/inf-gtk-browser-view.c: Show that name. * libinfinity/common/inf-connection-manager.c: Check that such a group is not already present in inf_connection_manager_create_group() and inf_connection_manager_join_group(). * libinfinity/common/inf-discovery-avahi.c: Also weakref discovered XMPP connection when we did not need to create it. We don't strongref it here neither, and must get notified when to invalidate the cache. 2008-03-06 Armin Burgmeier * libinfinity/inf-config.h.in: Configuration file that only contains prefixed defines, so it is safe to be installed. * libinfinity/Makefile.am: Noted that inf-config.h should be installed, in contrast to inf-marshal.h. * configure.ac: Let autoheader generate config.h, not libinfinity/inf-config.h. * libinfinity/common/inf-tcp-connection.c: Fixed a typo (#error -> @error). 2008-03-04 Armin Burgmeier * libinfinity/Makefile.am: * libinfinity/common/Makefile.am: * libinfinity/adopted/Makefile.am: * libinfinity/client/Makefile.am: * libinfinity/server/Makefile.am: Fixed include files installation path. 2008-03-04 Armin Burgmeier * libinfgtk/inf-gtk-browser-view.h: * libinfgtk/inf-gtk-browser-view.c: Don't subscribe on row activation, but emit an activate signal so that client code can subscribe. * test/inf-test-gtk-browser.c: Adapt. 2008-08-24 Armin Burgmeier * libinfinity/common/inf-xml-util.h: * libinfinity/common/inf-xml-util.c: Added inf_xml_util_get_attribute_double(), inf_xml_util_get_attribute_double_required() and inf_xml_util_set_attribute_double(). * libinftext/inf-text-user.h: * libinftext/inf-text-user.c: Added the "hue" property. * libinftext/inf-text-session.c: Adapted get_xml_user_props and set_xml_user_props. * infinoted/note-plugins/text/infd-note-plugin-text.c: Save hue property in filesystem storage. * libinftextgtk/inf-text-gtk-buffer.h: * libinftextgtk/inf-text-gtk-buffer.c: Set tag background color according tu hue property of author, added the "user-table" property, take in inf_text_gtk_buffer_new(). * test/inf-test-gtk-browser.c: Adapt to API change. 2008-02-24 Armin Burgmeier * libinftext/inf-text-session.c: Delay caret updates if too frequent. * libinfinity/common/inf-io.h: * libinfinity/common/inf-io.c: Added a GDestroyNotify parameter to inf_io_watch() and inf_io_add_timeout(). * libinfinity/common/inf-standalone-io.c * libinfgtk/inf-gtk-io.c: Adapt implementation. * libinfinity/common/inf-tcp-connection.c: * libinfinity/common/inf-discovery-avahi.c: * libinfinity/adopted/inf-adopted-session.c: * libinfinity/server/infd-tcp-server.c: * test/inf-test-browser.c: Adapt usage. * libinfinity/server/infd-directory.c: Make use of the notify to get rid of an unpleasant hack. 2008-02-23 Armin Burgmeier * libinfinity/common/inf-session.c: inf_session_get_synchronization_progress(): Don't divide by zero if the initial sync-begin was not yet received. * libinfinity/adopted/inf-adopted-session.c: Send noop request after 15 seconds of inactivity. 2008-02-23 Armin Burgmeier * libinfinity/client/infc-browser.h: * libinfinity/client/infc-browser.c: Added infc_browser_iter_save_session(). * libinfinity/common/inf-session.h: * libinfinity/common/inf-session.c: Added the synchronization-begin signal. * libinfinity/server/infd-session-proxy.c: Don't consider the session idle when there are ongoing synchronizations. 2008-02-22 Armin Burgmeier * libinfinity/server/infd-directory.c: Handle request, automatically store idle sessions into storage, unload from RAM. * libinfinity/server/infd-session-proxy.h: * libinfinity/server/infd-session-proxy.c: Added the "idle" property, the "add-subscription" and "remove-subscription" signals and infd_session_proxy_has_subscriptions(), infd_session_proxy_is_subscribed() and infd_session_proxy_is_idle(). * libinfinity/common/inf-error.h: * libinfinity/common/inf-error.c: Added INF_DIRECTORY_ERROR_UNSUBSCRIBED. * infinoted/note-plugins/text/infd-note-plugin-text.c: Fix a bug (an error was reported when everything was OK) when loading user-modified text. 2008-02-22 Armin Burgmeier * libinfinity/adopted/inf-adopted-request-log.h: * libinfinity/adopted/inf-adopted-request-log.c: Changed inf_adopted_request_log_upper_related() to take the request index instead of the request itself. * libinfinity/common/inf-method-manager.h: * libinfinity/common/inf-user-table.h: * libinfinity/adopted/inf-adopted-session.h: Removed superflous #defines, resulting from cut'n'pasted code. * libinfinity/adopted/inf-adopted-algorithm.c: Implemented caching for translated requests. This speeds up translation of undo requests that need to be transformed against several requests of others. This breaks test #25. However, the problem seems not to be with the cache but with the transformation function. I need to investigate this separately. Also simplified cleanup of request logs. * libinfinity/common/inf-buffer.c: * libinfinity/common/inf-session.c: * libinfinity/adopted/inf-adopted-user.c: * libinfinity/server/infd-directory.c: * docs/reference/libinfinity/libinfinity-sections.txt: Documentation fixes. * test/inf-test-text-session.c: Don't interpret given random seed as test directory. * test/std/test-47.xml: Added new test transforming ten undo requests against ten requests from another user. This is unacceptably slow without the request cache mentioned above. 2008-02-17 Armin Burgmeier * libinfinity/adopted/inf-adopted-split-operation.c: * libinfinity/common/inf-ip-address.c: More documentation. 2008-02-17 Benjamin Herr * libinfinity/common/inf-discovery.c: * libinfinity/common/inf-session.c: Added some more completely made-up documentation! 2008-02-17 Armin Burgmeier * libinfinity/common/inf-io.h: * libinfinity/common/inf-io.c: * libinfinity/server/infd-directory.c: * libinfinity/common/inf-net-object.c: * libinfinity/common/inf-connection-manager.c: * libinfinity/client/infc-request.c: Documented these classes. * docs/reference/libinfinity/libinfinity.types: Committed types file as it seems to be required to generate correct documentation. * docs/reference/libinfinity/libinfinity-sections.txt: Order a bit. 2008-02-17 Benjamin Herr * libinfinity/common/inf-user-table.c: * libinfinity/common/inf-tcp-connection.c: * libinfinity/common/inf-xml-connection.c: Added preliminary documentation to a few signals. 2008-02-17 Benjamin Herr * libinfinity/adopted/inf-adopted-no-operation.c: * libinfinity/adopted/inf-adopted-split-operation.c: * libinfinity/server/infd-storage.c: * libinfinity/server/infd-storage.h: * libinfinity/common/inf-net-object.c: * libinfinity/common/inf-standalone-io.c: * libinfinity/common/inf-user-table.c: * libinfinity/common/inf-method-manager.c: * libinfinity/common/inf-ip-address.c: * libinfinity/common/inf-xmpp-manager.c: * libinfinity/common/inf-connection-manager.c: * libinfinity/common/inf-session.c: * libinfinity/client/infc-request-manager.c: * libinfinity/client/infc-request-manager.h: Solved minor documentation generation errors/warnings 2008-02-17 Armin Burgmeier * docs/reference/libinfinity/tmpl/*.sgml: Committed SGML files required by gtk-doc. 2008-02-17 Benjamin Herr * **/*.c: changes "/** foo:\n *" into "/**\n * foo:" 2008-02-17 Armin Burgmeier * autogen.sh: Added autogen.sh which also calls gtkdocize in addition to creating all the necessary build files. * configure.ac: Added gtk-doc support. * Makefile.am: Added docs to subdirs. * libinfinity/adopted/inf-adopted-state-vector.h: * libinfinity/adopted/inf-adopted-state-vector.c: * libinfinity/client/infc-browser-iter.c: * libinfinity/client/infc-browser.h: * libinfinity/client/infc-browser.c: Documentation fixes. * m4: Added m4 directory as required by some new configure macro. * docs/Makefile.am: * docs/reference/Makefile.am: * docs/reference/libinfinity/Makefile.am: * docs/reference/version.xml.in: * docs/reference/libinfinity/libinfinity-sections.txt: * docs/reference/libinfinity/libinfinity-docs.sgml: * docs/reference/libinfinity/libinfinity-overrides.txt: Added initial gtk-doc files to create documentation. Perhaps some more are required which I will commit when someone misses them. I just don't want to check in generated files. * test/inf-test-text-session.c: Reduced permutations to 100 so that it finishes earlier. 2008-02-15 Armin Burgmeier * libinfinity/adopted/inf-adopted-request-log.c: Fixed possible memory corruption when entries need to be reallocated. * TODO: Update. 2008-02-15 Armin Burgmeier * libinfinity/adopted/inf-adopted-algorithm.c: Replaced user_id -> requset log hash table by a user array, hopefully making some loops faster. 2008-02-15 Armin Burgmeier * libinfinity/adopted/inf-adopted-algorithm.h: * libinfinity/adopted/inf-adopted-algorithm.c: Read participating users directly from user table, remove inf_adopted_algorithm_add_user(). * libinfinity/adopted/inf-adopted-session.c: Adapt to API change. 2008-02-15 Armin Burgmeier * libinfinity/adopted/inf-adopted-algorithm.c: Split the transformation part of inf_adopted_algorithm_translate_request() into a separate function inf_adopted_algorithm_transform_request(). 2008-02-14 Armin Burgmeier * libinfinity/adopted/inf-adopted-algorithm.c: Fixed a bug introduced with the last commit that broke collaboration. 2008-02-14 Armin Burgmeier * libinfinity/common/inf-user-table.h: * libinfinity/common/inf-user-table.c: Added add-local-user and remove-local-user signals, and inf_user_table_foreach_local_user(). * libinfinity/server/infd-note-plugin.h: * libinfinity/server/infd-directory.c: Changed note plugin API so that read_session() creates the session instead of filling an existing session object. * infinoted/note-plugins/text/infd-note-plugin-text.c: Adapt. * libinfinity/client/infc-session-proxy.c: Removed some commented-out code. * libinfinity/adopted/inf-adopted-request.h: * libinfinity/adopted/inf-adopted-request.c: Added inf_adopte_request_affects_buffer(). * libinfinity/adopted/inf-adopted-algorithm.c: Don't increase vector time of an incoming request's user if the request does not affect the buffer. * libinfinity/adopted/inf-adopted-session.c: Don't increase the last send vector if the sent request does not affect the buffer. * libinftext/inf-text-session.c: Broadcast cursor positions and selections. * libinftextgtk/inf-text-gtk-buffer.c: Update active user's cursor position when the "insert" or "selection-bound" mark is moved in the buffer. 2008-02-11 Armin Burgmeier * libinfinity/adopted/inf-adopted-algorithm.h: * libinfinity/adopted/inf-adopted-algorithm.c: Added inf_adopted_algorithm_can_undo() and inf_adopted_algorithm_can_redo() and the apply-request signal. * libinfinity/adopted/inf-adopted-session.h: * libinfinity/adopted/inf-adopted-session.c: Added inf_adopted_session_undo() and inf_adopted_session_redo(). * libinftext/inf-text-session.c: Don't broadcast while the algorithm itself is applying a request. * test/inf-test-gtk-browser.c: Added GUI for undo/redo. 2008-02-11 Armin Burgmeier * libinfinity/adopted/inf-adopted-session.c: Send undo and redo operations as child of the element instead of as an attribute of it. This is how the receiving code expects it. 2008-02-10 Armin Burgmeier * libinfinity/common/inf-connection-manager.h: * libinfinity/common/inf-connection-manager.c: Rewrite connection manager to allow different publishers for groups with the same name, as in the spec. Also support dynamic loading of additional communication methods. * libinfinity/common/Makefile.am * libinfinity/common/inf-method-manager.h: * libinfinity/common/inf-method-manager.c: New InfMethodManager class to manage available communication methods. * libinfinity/Makefile.am * libinfinity/methods/Makefile.am: * libinfinity/methods/local-central/Makefile.am: * libinfinity/methods/local-central/inf-method-local-central.c: Simple "central" method for local networks that uses the publisher as server through which all messages are relayed. * libinfinity/common/inf-error.h: * libinfinity/common/inf-net-object.h: * libinfinity/common/inf-session.h: * libinfinity/common/inf-user.h: * libinfinity/common/inf-error.c: * libinfinity/common/inf-net-object.c: * libinfinity/common/inf-session.c: * libinfinity/common/inf-user.c: * libinfinity/common/inf-xml-connection.c: * libinfinity/common/inf-xmpp-connection.c: * libinfinity/adopted/inf-adopted-session.c: * libinfinity/adopted/inf-adopted-split-operation.c: * libinfinity/server/infd-directory.h: * libinfinity/server/infd-directory.c: * libinfinity/server/infd-server-pool.c: * libinfinity/server/infd-session-proxy.c: * libinfinity/client/infc-browser.h: * libinfinity/client/infc-browser.c: * libinfinity/client/infc-session-proxy.c: * test/inf-test-browser.c: * test/inf-test-daemon.c: * test/inf-test-text-session.c: * test/inf-test-gtk-browser.c: * libinfgtk/inf-gtk-browser-model.h: * libinfgtk/inf-gtk-browser-model.c: * libinftext/inf-text-session.c: * infinoted/infinoted-main.c: Adapt to API changes. * configure.ac: Generate Makefiles in newly added directories. * INSTALL: Autotools seemed to update this. 2007-12-22 Armin Burgmeier * libinftext/inf-text-chunk.c: Fixed a crash on amd64. * infinoted/note-plugins/text/infd-note-plugin-text.c: * libinfinity/adopted/inf-adopted-session.c: * libinfinity/adopted/inf-adopted-split-operation.c: * libinfinity/common/inf-xmpp-manager.c: * libinfinity/common/inf-connection-manager.c: * libinfinity/common/inf-xmpp-connection.c: * libinftext/inf-text-default-insert-operation.c: * test/inf-test-chunk.c: Fixed several warnings. 2007-12-22 Armin Burgmeier * libinfinity/common/inf-connection-manager.c: Changed scope for point to point connections from "p2p" to "ptp", as in the spec. * libinftextgtk/inf-text-gtk-buffer.c: Make sure only one user color tag is applied at once. 2007-12-22 Armin Burgmeier * libinfinity/common/inf-error.c: * libinfinity/common/inf-error.h: * libinfinity/common/inf-session.c: * libinfinity/server/infd-session-proxy.c: * libinfinity/client/infc-session-proxy.c: Replaced user-leave by user-status-change request, which is more general. * libinfinity/server/infd-directory.c: Indentation fixes, fixed a memory leak in infd_directory_handle_explore_node(). * libinftext/inf-text-session.c: Fixed an infinite loop when writing delete operations to XML. * infinoted/infinoted-creds.c: Include for glib 2.15 compatibility. 2007-12-22 Armin Burgmeier * libinfinity/adopted/inf-adopted-session.c: Correctly pass for_sync to inf_adopted_session_xml_to_request() in inf_adopted_session_process_xml_sync(). This fixes editing documents with non-empty history. * libinfinity/adopted/inf-adopted-request-log.c: Adjust log begin when adding first entry to request log and that entry has non-zero vector time for the log's user. * libinfinity/adopted/inf-adopted-algorithm.c: Initialize new user's component of current vector time with the corresponding component of its vector time instead of the end of its request log because the request log might be empty. * infinoted/infinoted-main.c: Don't leak dirname in infinoted_main_create_dirname() in case of success. 2007-12-21 Armin Burgmeier * libinftext/inf-text-chunk.c: * libinftext/inf-text-session.c: Swapped bytes/length arguments to inf_text_chunk_insert_text to fix handling of non-ASCII chars. * test/inf-test-chunk.c: Add an umlaut to the chunk to check UTF-8. * libinfinity/common/inf-session.c: Fixed signature of inf_session_connection_notify_status_cb(). * TODO: Added a note about adding a connection-closed signal to connection manager. 2007-12-21 Armin Burgmeier * libinfinity/common/inf-connection-manager.c: Forward scope="group" messages. * test/inf-test-gtk-browser.c: Retry user join with another name if the name is already in use, use algorithm's current vector time as initial time. 2007-12-04 Armin Burgmeier * configure.ac: * README: Require gnutls >= 1.7.2 and gsasl >= 0.2.21. 2007-12-04 Armin Burgmeier * configure.ac: Define INFINOTE_HAVE_AVAHI instead of HAVE_AVAHI to not conflict with other packages. We probably still need to get rid of autoheader to remove the default defines from inf-config.h. * libinfinity/common/inf-discovery-avahi.h: * libinfinity/common/inf-discovery-avahi.c: * infinoted/infinoted-main.c: * test/inf-test-daemon.c: * test/inf-test-gtk-browser.c: Adjusted and fixed non-avahi build. 2007-12-02 Armin Burgmeier * libinftextgtk-1.0.pc.in: Added missing file. 2007-12-02 Armin Burgmeier * libinfinity/adopted/inf-adopted-request-log.c: * libinfinity/adopted/inf-adopted-session.c: Allow arbitrary ID for first request. * libinfinity/common/inf-connection-manager.c: Re-lookup NetObject for every request in group message. * libinftextgtk/inf-text-gtk-buffer.c: Fixed inf_text_gtk_buffer_buffer_get_slice if region to slice ends before segment ends. 2007-10-21 Armin Burgmeier * libinfinity/common/inf-user.c: Return flags instead of status in inf_user_get_flags. * libinfinity/common/inf-connection-manager.c: Flag all messages as point-to-point in inf_connection_manager_send_multiple_to(), instead of just the first one. Also copy _private the private field in inf_connection_manager_send_to_group() because xmlCopyNode does not already do this. * libinfinity/common/inf-session.c: Correctly initialize GValue with zeroes before calling g_value_init(), implemented status user property. Emit close signal in synchronization failed default handler. * libinfinity/adopted/inf-adopted-request-log.h: * libinfinity/adopted/inf-adopted-request-log.c: Don't take log_begin parameter in inf_adopted_request_log_new(), return NULL instead of crashing in inf_adopted_request_log_next_undo() and inf_adopted_request_log_next_redo() when there is no next undo or redo request, respectively. * libinfinity/adopted/inf-adopted-user.c: Adapt to API change in InfAdoptedRequestLog. * libinfinity/adopted/inf-adopted-session.c: Increase last send vector instead of request's vector in inf_adopted_session_request_to_xml() (as originally intended). Initialize user field when creating InfAdoptedSessionLocalUser. Removed log-begin user property as in the spec. * libinfinity/server/infd-session-proxy.c: Use INF_SESSION_GET_CLASS instead of INF_SESSION_CLASS in infd_session_proxy_handle_user_join, initialize GValues correctly. * libinfinity/client/infc-session-proxy.c: Correctly set flags on user (re)join, don't release session when when it is closed so it is still accessible. * libinftext/inf-text-user.c: Don't make the caret-position and selection-length properties construct only. * libinftext/inf-text-session.c: Deal with author_id=0 in inf_text_session_process_xml_sync(). * libinftextgtk/inf-text-gtk-buffer.c: Fixed assertions in inf_text_gtk_buffer_set_active_user(), fixed potential endless loops in inf_text_gtk_buffer_iter_prev_author_toggle(), inf_text_gtk_buffer_iter_next_author_toggle() and inf_text_gtk_buffer_buffer_get_slice(), connect to text buffer's signals when the buffer property is set, stop emission in inf_text_gtk_buffer_delete_range_cb() and inf_text_gtk_buffer_insert_text_cb() on the correct object. * test/inf-test-gtk-browser.c: Set vector property for join request. 2007-10-17 Armin Burgmeier * infinoted/infinoted-main.c: Added --port-number command line option and load/save diffie-hellman parameters to current directory. This is just temporary to ease testing for me, so I don't have to wait too long when I need to restart the server again. * infinoted/note-plugins/text/infd-note-plugin-text.c: Allow author of segments to be 0, adapt to infd_filesystem_storage_open() API change. * libinfinity/inf-marshal.in: Added VOID:BOXED,BOXED,OBJECT marshaller. * libinfinity/common/inf-connection-manager.c: Allow inf_net_object_received() to remove itself from the connection manager group through which the message was passed, don't print a warning if a message for a nonexistant group is received. * libinfinity/common/inf-session.c: Only unref connection manager group in inf_session_release_connection() when it is set. * libinfinity/server/infd-filesystem-storage.h: * libinfinity/server/infd-filesystem-storage.c: Added note type parameter to infd_filesystem_storage_open(), and address correctly the file on disk. * libinfinity/server/infd-session-proxy.c: Keep session when it is closed, release in disponse(). * libinfinity/server/infd-directory.c: Correctly unref InfConnectionManagerGroup (can't be freed with g_free()) in infd_directory_node_add_note(). * libinfinity/server/infd-server-pool.c: Release reference on InfdTcpServer in infd_server_pool_entry_publish_with(). * libinfinity/client/infc-note-plugin.h: Added an IO parameter to session_new(). * libinfinity/client/infc-browser.h: * libinfinity/client/infc-browser.c: Added infc_browser_iter_get_note_type(), infc_browser_iter_get_plugin() and renamed -infc_browser_subscribe_session() to infc_browser_iter_subscribe_session(). Also take an IO parameter in infc_browser_new(). * libinfinity/client/infc-node-request.c: Register private struct in class_init. * libinftext/inf-text-session.c: Allow user to be NULL in text buffer signal handlers, swap code and domain in invocation of g_set_error in inf_text_session_process_xml_sync() which were the other way around. * libinfgtk/inf-gtk-browser-model.h: * libinfgtk/inf-gtk-browser-model.c: Take an IO parameter in inf_gtk_browser_model_new() for the browsers to create, added the set-browser signal in whose default handler the browser is associated with the InfGtkBrowserModelItem and signal handlers are registered. * libinfgtk/inf-gtk-browser-view.h: * libinfgtk/inf-gtk-browser-view.c: Use the new "set-browser" signal of the model to connect to browser's signals, subscribe to sessions when a non-subdirectory node is activated and a plugin present. * libinftextgtk/inf-text-gtk-buffer.h: * libinftextgtk/inf-text-gtk-buffer.c: Added inf_text_gtk_buffer_get_text_buffer(), fixed interface registration (implement INF_TEXT_TYPE_BUFFER, not INF_TEXT_GTK_TYPE_BUFFER which is not even an interface). * test/inf-test-gtk-browser.c: Added support for subscribing to text sessions. * test/inf-test-browser.c: Pass IO to InfcBrowser. * test/Makefile.am: Link inf-test-gtk-browser against InfText and InfTextGtk. 2007-10-16 Armin Burgmeier * libinfinity/common/inf-session.h: * libinfinity/common/inf-session.c: Added the inf_session_get_synchronization_progress() and inf_session_get_status() functions. * libinfinity/server/infd-directory.c: Fixed a wrong assertion in infd_directory_node_link(). * libinfinity/client/infc-node-request.c: Added the node-id property. * libinfinity/client/infc-browser.h: * libinfinity/client/infc-browser.c: Set node-id property on node requests, added the begin_subscribe and subscribe_session signals, added infc_node_iter_get_subscribe_request() and infc_browser_iter_from_node_request() functions. * libinfgtk/inf-gtk-browser-model.h: * libinfgtk/inf-gtk-browser-model.c: Made error column valid for inner nodes, store errors from explore and subscription requests (We should expand this for all node requests later). * libinfgtk/inf-gtk-browser-view.h: * libinfgtk/inf-gtk-browser-view.c: Show synchronization progress and errors from inner nodes. 2007-10-12 Armin Burgmeier * libinftext/inf-text-session.c: Fixed cursor positioning of executing user after deleting text. * libinftextgtk/inf-text-gtk-buffer.h: * libinftextgtk/inf-text-gtk-buffer.c: * libinftextgtk/Makefile.am: Implemented the InfTextBuffer interface using a GtkTextBuffer. * Makefile.am: * configure.ac: Build libinftextgtk. * README: Update. 2007-10-11 Armin Burgmeier * libinfinity/server/infd-directory.h: * libinfinity/server/infd-directory.c: Added the "io" property and construction paramater. * libinfinity/server/infd-note-plugin.h: Take an InfIo in session_new(). * test/inf-test-daemon.c: Adapt. * infinoted/infinoted-note-plugin.c: Ignore all but the platform's module suffix in infinoted_note_plugin_load_directory(). * infinoted/infinoted-main.c: Load all plugins in ${libdir}/infinoted/note-plugins/. * infinoted/note-plugins/text/infd-note-plugin-text.c: * infinoted/note-plugins/text/Makefile.am: * infinoted/note-plugins/Makefile.am: * infinoted/Makefile.am: * configure.ac: Added a text plugin that saves sessions into an XML tree, in a InfdFilesystemStorage. 2007-10-10 Armin Burgmeier * libinfinity/server/infd-directory.h: * libinfinity/server/infd-directory.c: Added infd_directory_lookup_plugin(). * infinoted/infinoted-note-plugin.h: * infinoted/infinoted-note-plugin.c: * infinoted/Makefile.am: Added functions to load note plugins from a certain directory. * configure.ac: Make infinoted depend on gmodule-2.0. 2007-10-09 Armin Burgmeier * infinoted/infinoted-creds.h: * infinoted/infinoted-creds.c: * infinoted/infinoted-main.c: Made the server actually working. 2007-10-08 Armin Burgmeier * libinfinity/common/inf-tcp-connection.c: Don't ifdef out _inf_tcp_connection_accepted because libinfinity/server is always built. * libinfinity/server/infd-note-plugin.h: Renamed identifier to note_type add added a storage_type member. * libinfinity/server/infd-directory.c: Adapt, and check storage type in infd_directory_add_plugin. * libinfinity/server/infd-filesystem-storage.h: * libinfinity/server/infd-filesystem-storage.c: Added infd_filesystem_storage_open() function. * infinoted/infinoted-creds.h: * infinoted/infinoted-creds.c: * infinoted/infinoted-main.c: * infinoted/Makefile.am: Added code which yields the infinote standalone server one day. Currently it only does certificate handling. * Makefile.am: * configure.ac: Build infinoted. 2007-10-07 Armin Burgmeier * libinfinity/inf-marshal.in: Added VOID:BOXED,OBJECT marshaller. * libinfinity/common/inf-io.c: Return the value returned by the implementation to the caller in inf_io_add_timeout(), instead of nothing. * libinfinity/common/inf-standalone-io.c: Fixed two bugs in timeout handling. * libinfinity/common/inf-tcp-connection.c: Added the device-index and device-name properties. These are only used in IPv6 to set the scope ID for link-local messaging. * libinfinity/common/inf-discovery.h: * libinfinity/common/inf-discovery.c: Make the get_service_name() returned a new string so the implementation does not have to cache the service name. * libinfinity/common/inf-xml-connection.h: * libinfinity/common/inf-xml-connection.c: Added an error signal and local-id and remote-id properties. * libinfinity/common/inf-xmpp-connection.h: * libinfinity/common/inf-xmpp-connection.c: Removed error signal because it is now provided by InfXmlConnection, override the local-id and remote-id properties by using the ip/port pair of the underlaying TCP connection. Allow gnutls to return with GNUTLS_E_AGAIN in gnutls_record_recv since it seems to sometimes call the pull function multiple times. Don't wait for terminating , but just close the connection on failed TLS handshake. * libinfinity/common/inf-discovery-avahi.c: Adapt to interface change in InfDiscovery, include device name and protocol in service name output. * libinfinity/common/inf-local-publisher.c: Replaced g_return_if_fail by g_return_val_if_fail in function returning non-void. * libinfinity/common/inf-xmpp-manager.c: Unref objects retrieved via g_object_get(), connect to every connection's notify::status signal to remove the connection when it is closed. * libinfinity/common/inf-connection-manager.c: Remove the group from the list of groups in inf_connection_manager_group_free(). * libinfinity/client/infc-browser.h: * libinfinity/client/infc-browser.c: Added an iterator pointing to the subdirectory being explored to the begin-explore signal. Don't clear directory tree when the connection is lost but rather when a new connection is set so we can still browse the explored paths when disconnected. * libinfinity/client/infc-explore-request.c: Replaced g_value_set_finished by g_value_set_boolean as it ought to be. I must have been asleep when having coded this. * libinfinity/server/infd-server-pool.c: Use username for service name when the real name is not known. * libinfgtk/inf-gtk-browser-model.h: * libinfgtk/inf-gtk-browser-model.c: Added the INVALID status, keep the item after disconnection so a potential error can still be displayed. Fixed several bugs. * libinfgtk/inf-gtk-browser-view.c: Propagate size_request and size_allocate. Implemented exploration and fixed several bugs. * libinfgtk/inf-gtk-io.h: * libinfgtk/inf-gtk-io.c: * libinfgtk/Makefile.am: Added a InfIo implementation using the default Glib mainloop. * test/inf-test-daemon.c: Publish the infinote service on avahi. * test/inf-test-gtk-browser.c: * test/Makefile.am: Added a test showing a InfGtkBrowserView to browse avahi-discovered infinote servers. 2007-10-04 Armin Burgmeier * libinfinity/inf-marshal.in: Added VOID:OBJECT,OBJECT marshaller. * libinfinity/common/inf-discovery.c: Fixed return statements in functions returning non-void. * libinfinity/client/infc-browser.h: * libinfinity/client/infc-browser.c: Added the infc_browser_iter_is_subdirectory() function. * libinfinity/client/infc-explore-request.h: * libinfinity/client/infc-explore-request.c: Added the infc_explore_request_get_initiated() and infc_explore_request_get_finished() functions. * libinfgtk/inf-gtk-browser-model.h: * libinfgtk/inf-gtk-browser-model.c: Take InfConnectionManager in constructor, added inf_gtk_browser_model_browser_iter_to_tree_iter() and the INF_GTK_BROWSER_MODEL_COL_DISCOVERY column. Fixed reordering when a resolve yielded an already existing connection. * libinfgtk/inf-gtk-browser-view.h: * libinfgtk/inf-gtk-browser-view.c: * libinfgtk/Makefile.am: Implemnted InfGtkBrowserView, a widget displaying a InfGtkBrowserModel. Some implementation bits (mostly exploration on expansion) are still missing. 2007-10-03 Armin Burgmeier * libinfinity/common/infc-browser.c: Removed a TODO comment that was already done by the last commit. * libinfgtk/inf-gtk-browser-model.h: * libinfgtk/inf-gtk-browser-model.c: * libinfgtk/Makefile.am: A container for multiple InfcBrowser and InfDiscovery objects that implements GtkTreeModel to be shown by a GtkTreeView. * Makefile.am: Changed order of SUBDIRS so that always the library directories are walked first, and then pixmaps/ and test/. * configure.ac: Cleaned up final status output. I still don't know why it sometimes appears above the "config.status: Creating Foo/Makfile" output. 2007-10-03 Armin Burgmeier * libinfinity/client/infc-browser.h: * libinfinity/client/infc-browser.c: Added infc_browser_iter_get_explore_request(), infc_browser_iter_from_explore_request() and the begin-explore signal. * pixmaps/16x16/infinote.png: * pixmaps/16x16/Makefile.am: * pixmaps/22x22/infinote.png: * pixmaps/22x22/Makefile.am: Added bitmap icons for small sizes. * pixmaps/scalable/infinote.svg: * pixmaps/scalable/Makefile.am: Moved from pixmaps/infinote.svg * pixmaps/Makefile.am: * configure.ac: Process pixmaps/16x16, pixmaps/22x22 and pixmaps/scalable. 2007-10-02 Armin Burgmeier * libinfinity/common/inf-discovery-info.h: * libinfinity/common/inf-discovery-info.c: Removed, the functioality is incorporated into InfDiscovery. * libinfinity/common/inf-local-publisher.h: * libinfinity/common/inf-local-publisher.c: * libinfinity/common/Makefile.am: A new interface that is implemented by objects that can publish services on the local network. * libinfinity/common/inf-discovery.h: * libinfinity/common/inf-discovery.c: Removed the publish vfunc in favour of InfLocalPublisher. Added info_get_service_name and info_get_service_type vfuncs. * libinfinity/common/inf-discovery-avahi.h: * libinfinity/common/inf-discovery-avahi.c: Class that implements InfDiscovery and InfLocalPublisher by using Avahi. * libinfinity/server/infd-server-pool.h: * libinfinity/server/infd-server-pool.c: Added functionality to associate local publishers with servers and automatically publish service when the corresponding server is up. * libinfinity/Makefile.am: Build with and link against avahi. 2007-09-27 Armin Burgmeier * libinfinity/common/inf-xmpp-connection.c: Set xmpp connection as gsasl session hook so that callback implementations can access the InfXmppConnection object. 2007-09-27 Armin Burgmeier * libinfinity/common/inf-xmpp-connection.h: Fix indentation. * libinfinity/common/inf-xmpp-connection.c: Added a TODO about retrieving the server's (or other entity's) JID. * libinfinity/common/inf-tcp-connection.h: * libinfinity/common/inf-tcp-connection.c: Added inf_tcp_connection_get_remote_address() and inf_tcp_connection_get_remote_port(). * libinfinity/common/inf-discovery.h: * libinfinity/common/inf-discovery.c: Added the get_discovered vfunc and inf_discovery_get_discovered(). * libinfinity/common/inf-xmpp-manager.h: * libinfinity/common/inf-xmpp-manager.c: * libinfinity/common/Makefile.am: Added the InfXmppManager class that manages XMPP connections and provides lookup by IP address and port so that existing connections can be reused. * libinfinity/server/infd-storage.h: Added a TODO comment about possible notification when stored items change. * libinfgtk/Makefile.am: * libinfgtk-1.0.pc.in: * Makefile.am: * configure.ac: Added libinfgtk component, but there are not yet any source files. 2007-09-25 Armin Burgmeier * pixmaps/infinote.svg: Moved from artwork/infinote.svg to pixmaps/infinote.svg. * pixmaps/Makefile.am: Install the icon into $(datadir)/hicolor/scalable/apps. I am not sure whether this in the correct location, though. * libinfinity-1.0.pc.in: * libinftext-1.0.pc.in: * Makefile.am: Added pkgconfig files, added pixmaps subdir. * configure.ac: Added new files to output. * TODO: Added gettext support to TODO list. 2007-09-25 Armin Burgmeier * libinfinity/common/inf-net-object.c: Allow connection to be NULL in inf_net_object_received for now, so the session test can simulate incoming XML. * libinfinity/common/inf-user-table.c: Fixed two typos. * libinfinity/common/inf-buffer.c: Removed read-only property. We might re-introduce an editable property later. * libinfinity/common/inf-session.c: Cope with NULL group and sync connection in inf_session_set_property(). * libinfinity/adopted/inf-adopted-request-log.c: Return NULL in inf_adopted_request_log_find_associated() when there is no Undo request associated to a redo request, instead of running in a failed assertion. This is a completely legal case for caching next_undo and next_redo operations. * libinfinity/adopted/inf-adopted-user.c: Cope with NULL request log in inf_adopted_user_set_property(), don't copy result in inf_adopted_user_get_vector(). * libinfinity/adopted/inf-adopted-state-vector.c: Fixed a crash in inf_adopted_state_vector_causally_before() when the highest key in the first vector was not contained in the second. Also fixed a typo leading to a crash in inf_adotped_state_vector_from_string_diff(). * libinfinity/adopted/inf-adopted-session.c: Include current request in last send vector after having sent the request. Otherwise, we are sending an unnecessary, additional "$id:1" component for each following request. Recognize undo requests by child instead of type="undo" attribute, as in the protocol specification. Keep users in the user table in-sync with those in InfAdoptedAlgorithm. Don't leak the request in inf_adopted_session_process_xml_run(). * libinfinity/adopted/inf-adopted-algorithm.c: Update user vector after having received a request, not only when having processed it. When transforming two operations in the request log, first transform both to the least common successor and then transform both from that point to the final destination. This way, pwords of insert operations are updated correctly. This could lead to a desync. Change the state of undo and redo requests to the same state of the original operation (except the issuing user's component) because they only depend on the original operation. * libinfinity/adopted/inf-adopted-split-operation.h: * libinfinity/adopted/inf-adopted-split-operation.c: Added the inf_adopted_split_operation_transform_other() function that transfors an operation against the split operation. Also don't leak the resulting operations in inf_adopted_split_operation_transform(). * libinfinity/adopted/inf-adopted-operation.c: Use inf_adopted_split_operation_transform_other() in inf_adopted_operation_transform() when against is a InfAdoptedSplitOperation. Fix a copy'n'paste error in the interface's GTypeInfo struct. * libinftext/inf-text-move-operation.h: * libinftext/inf-text-move-operation.c: Renamed inf_text_move_operation_get_pword() to inf_text_move_operation_get_position() and inf_text_move_operation_get_chunk() to inf_text_move_operation_get_length(). This was also a copy'n'paste error by copying the file from libinftext/inf-text-insert-operation.c. * libinftext/inf-text-chunk.h: * libinftext/inf-text-chunk.c: Added a GString to each chunk that holds the chunk's content without author information for integrity checking (can be disabled by not defining CHUNK_DEBUG). Added the inf_text_chunk_equal() function. Fixed two errors when inserting a chunk into another chunk that broke the chunk's integrity. * libinftext/inf-text-buffer.h: * libinftext/inf-text-buffer.c: Reorded bytes and length parameters in inf_text_buffer_insert_text() to match the order of corresponding functions in libinftext. Allow the user parameter to be NULL in which case the text is inserted as author 0. * libinftext/inf-text-user.h: * libinftext/inf-text-user.c: Derive from InfAdoptedUser not from InfUser. * libinftext/inf-text-default-delete-operation.c: End g_object_new() invocation in inf_text_default_delete_operation_transform_split() with NULL so that g_object_new() does not start reading random memory. * libinftext/inf-text-default-insert-operation.c: Cast result to InfTextInsertOperation instead of InfAdoptedOperation in inf_text_default_insert_operation_transform_position(). * libinftext/inf-text-remote-delete-operation.c: Append final recon chunk to list in inf_text_remote_delete_operation_recon_feed(). Don't leak the InfTextChunk obtained by inf_text_buffer_get_slice() in inf_text_remote_delete_operation_make_reversible(). Don't leak the unsplit list in the same function. Feed recon to the resulting operation in inf_text_remote_delete_operation_transform_overlap(), not to the original operation. * libinftext/inf-text-default-buffer.c: Implement the InfBuffer interface. * libinftext/inf-text-pword.c: Swapped the result of inf_text_pword_compare() when the two pwords have different length to obtain the intended behaviour. * libinftext/inf-text-session.c: Pass correct text to g_convert() and xmlFree() in inf_text_session_xml_to_operation(). Don't forget final NULL in g_object_new() call in inf_text_session_new() and inf_text_session_new_with_user_table(). * test/inf-test-chunk.c: Test some basic InfTextChunk operations. * test/inf-test-text-operations.c: Test C1 and C2 properties of the InfText operations. * test/inf-test-text-session.c: Test the implementation of the concurrency control algorithm implemented by InfAdoptedAlgorithm by reading test scenarios from XML files in std/. * test/Makefile.am: Added the new files * test/std/test-01.xml: * test/std/test-02.xml: * test/std/test-03.xml: * test/std/test-04.xml: * test/std/test-05.xml: * test/std/test-06.xml: * test/std/test-07.xml: * test/std/test-08.xml: * test/std/test-09.xml: * test/std/test-10.xml: * test/std/test-11.xml: * test/std/test-12.xml: * test/std/test-13.xml: * test/std/test-14.xml: * test/std/test-15.xml: * test/std/test-16.xml: * test/std/test-17.xml: * test/std/test-18.xml: * test/std/test-19.xml: * test/std/test-20.xml: * test/std/test-21.xml: * test/std/test-22.xml: * test/std/test-23.xml: * test/std/test-24.xml: * test/std/test-25.xml: * test/std/test-26.xml: * test/std/test-27.xml: * test/std/test-28.xml: * test/std/test-29.xml: * test/std/test-30.xml: * test/std/test-31.xml: * test/std/test-32.xml: * test/std/test-33.xml: * test/std/test-34.xml: * test/std/test-35.xml: * test/std/test-36.xml: * test/std/test-37.xml: * test/std/test-38.xml: * test/std/test-39.xml: * test/std/test-40.xml: * test/std/test-41.xml: * test/std/test-42.xml: * test/std/test-43.xml: * test/std/test-44.xml: * test/std/test-45.xml: * test/std/test-46.xml: Added 46 test files for inf-test-text-session.c. 2007-09-17 Armin Burgmeier * libinftext/inf-text-operations.h: File to just forward declare InfTextInsertOperation and InfTextDeleteOperation because their headers both need the two to be declared. * libinftext/inf-text-session.h: * libinftext/inf-text-session.c: Implemented InfTextSession. * libinftext/Makefile.am: Added the new files to the build. 2007-09-17 Armin Burgmeier * libinfinity/common/inf-xml-util.h: * libinfinity/common/inf-xml-util.c: Implemented inf_xml_util_set_attribute_int() and inf_xml_util_set_attribute_int_required(). * libinfinity/adopted/inf-adopted-operation.h: * libinfinity/adopted/inf-adopted-operation.c: Added concurrency_id paramater to the transform vfunc. * libinfinity/adopted/inf-adopted-request.c: * libinfinity/adopted/inf-adopted-no-operation.c: * libinfinity/adopted/inf-adopted-split-operation.c: Adapt to the above API change. * libinfinity/adopted/inf-adopted-session.h: * libinfinity/adopted/inf-adopted-session.c: Added InfUser parameter to the xml_to_operation vfunc. * libinftext/inf-text-delete-operation.h: * libinftext/inf-text-insert-operation.h: * libinftext/inf-text-delete-operation.c: * libinftext/inf-text-insert-operation.c: Made interfaces out of these, implement transformation. * libinftext/inf-text-move-operation.h: * libinftext/inf-text-move-operation.c: Added inf_text_move_operation_transform_insert() and inf_text_move_operation_transform_delete(). * libinftext/inf-text-buffer.h: * libinftext/inf-text-buffer.c: * libinftext/inf-text-default-buffer.c: Added the get_length vfunc. * libinftext/inf-text-default-insert-operation.h: * libinftext/inf-text-default-insert-operation.c: * libinftext/inf-text-default-delete-operation.c: * libinftext/inf-text-default-delete-operation.h: * libinftext/Makefile.am: Readded normal reversible insert and delete operations that were in inf-text-{insert,delete}-operation.[ch] before, and implement the new interface. * libinftext/inf-text-remote-delete-operation.h: * libinftext/inf-text-remote-delete-operation.c: Implement the InfTextDeleteOperation interface. 2007-09-15 Armin Burgmeier * libinfinity/inf-marshal.in: Added VOID:UINT,INT marshaller. * libinftext/inf-text-user.h: * libinftext/inf-text-move-operation.h: * libinftext/inf-text-remote-delete-operation.h: * libinftext/inf-text-user.c: * libinftext/inf-text-move-operation.c: * libinftext/inf-text-remote-delete-operation.c: * libinftext/Makefile.am: Implement InfTextUser (storing cursor and selected text), InfTextMoveOperation (an operation that changes a user's selection and cursor position) and InfTextRemoteDeleteOperation (a delete operation that only saves position and length of the deleted text, but not the actual text that was deleted). 2007-09-14 Armin Burgmeier * libinfinity/adopted/inf-adopted-operation.h: * libinfinity/adopted/inf-adopted-operation.c: * libinfinity/adopted/inf-adopted-no-operation.c: * libinfinity/adopted/inf-adopted-split-operation.c: Removed the is_reversible vfunc and added it as an operation flag. * libinfinity/server/infd-session-proxy.c: Fixed message handling (the message is called user-join, not join-user). * libinftext/inf-text-pword.h: * libinftext/inf-text-insert-operation.h: * libinftext/inf-text-delete-operation.h: * libinftext/inf-text-pword.c: * libinftext/inf-text-insert-operation.c: * libinftext/inf-text-delete-operation.c: * libinftext/Makefile.am: Added the two bosic text operations. * TODO: Removed finished tasks, added new ones about making InfTextChunk reference-counted. 2007-09-10 Armin Burgmeier * libinftext/inf-text-buffer.c: Fixed a marshaller. * libinftext/inf-text-default-buffer.h: * libinftext/inf-text-default-buffer.c: * libinftext/Makefile.am: Added a InfTextBuffer implementation using an underlaying InfTextChunk. 2007-09-10 Armin Burgmeier * libinfinity/common/inf-user-table.h: * libinfinity/common/inf-user-table.c: * libinfinity/common/Makefile.am: Added user table class managing users and providing lookup by ID and name. * libinfinity/common/inf-session.h: * libinfinity/common/inf-session.c: Make use of InfUserTable instead of using an own hash table. Removed some API that is not provided by InfUserTable. * libinfinity/client/infc-session-proxy.c: * libinfinity/server/infd-session-proxy.c: * libinfinity/adopted/inf-adopted-session.c: Adjusted for API change introduced by the new user table. * libinfinity/inf-ink-buffer.h: * libinfinity/inf-ink-stroke.h: * libinfinity/inf-ink-buffer.c: * libinfinity/inf-ink-stroke.c: Removed from repository, InfInk will not be implemented in the short-term. * libinftext/inf-text-chunk.h: * libinftext/inf-text-chunk.c: Added InfTextChunkIter API to iterate over segments. * libinfinity/inf-marshal.in: Replaced POINTER,UINT,UINT,OBJET byC UINT,BOXED,OBJECT marshaller. * libinftext/inf-text-buffer.h: * libinftext/inf-text-buffer.c: * libinftext/Makefile.am: Added InfTextBuffer interface. 2007-09-10 Philipp Kern * configure.ac: some fixes 2007-09-09 Armin Burgmeier * libinfinity/adopted/inf-adopted-request-log.c: Added a TODO comment about possible memory corruption. * libinfinity/inf-text-buffer.h: * libinfinity/inf-text-buffer.c: Removed. InfTextBuffer will get resurrected in the inftext separate module. * libinftext/inf-text-chunk.h: * libinftext/inf-text-chunk.c: * libinftext/Makefile.am: Created inftext module with a first boxed type to store and operate on strings with author information. * Makefile.am: * configure.ac: Added libinftext to build. 2007-09-06 Armin Burgmeier * libinfinity/adopted/inf-adopted-state-vector.h: * libinfinity/adopted/inf-adopted-operation.h: * libinfinity/adopted/inf-adopted-request-log.h: * libinfinity/adopted/inf-adopted-request.h: * libinfinity/adopted/inf-adopted-algorithm.h: * libinfinity/adopted/inf-adopted-state-vector.c: * libinfinity/adopted/inf-adopted-operation.c: * libinfinity/adopted/inf-adopted-request-log.c: * libinfinity/adopted/inf-adopted-request.c: * libinfinity/adopted/inf-adopted-algorithm.c: Made these only have a user ID instead of a user object, so they can exist without actual user objects and InfAdoptedUser can have InfAdoptedRequestLog as property. * libinfinity/adopted/inf-adopted-user.h: * libinfinity/adopted/inf-adopted-user.c: Added the request-log property. * test/inf-test-state-vector.c: Adjusted for the change mentioned above. * libinfinity/adopted/inf-adopted-session.c: * libinfinity/adopted/inf-adopted-session.h: * libinfinity/adopted/Makefile.am: Added the InfAdoptedSession class, implementing the other half of the dark magic (although not-so-dark). Timeouts are not yet implemented. * libinfinity/common/inf-standalone-io.c: Fixed a compiler warning. * libinfinity/common/inf-xml-util.h: Fixed indentation. * libinfinity/common/inf-xml-util.c: Changed an error message so that it includes the (errornous) request's name. * libinfinity/common/inf-error.c: Added a TODO comment. * libinfinity/common/inf-session.h: * libinfinity/common/inf-session.c: Added an error parameter to the process_xml_run vfunc. * libinfinity/client/infc-session-proxy.c: Set subscription group in infc_session_proxy_set_connection(). * TODO: Removed finished items, added the addition of a reversible flag for InfAdoptedOperation instead of an extra vfunc. 2007-09-02 Armin Burgmeier * libinfinity/server/infd-session.h: * libinfinity/server/infd-session.c: * libinfinity/client/infc-session.h: * libinfinity/client/infc-session.c: Removed. * libinfinity/common/inf-session.h: * libinfinity/common/inf-session.c: Added subscription group property. * libinfinity/server/infd-session-proxy.h: * libinfinity/server/infd-session-proxy.c: * libinfinity/client/infc-session-proxy.h: * libinfinity/client/infc-session-proxy.c: Added InfcSessionProxy and InfdSessionProxy classes. These basically have the same functionality as the old InfcSession and InfdSession but own them rather than inherit from them. This is needed because GObject does not allow multiple inheritance: Other types can now inherit from InfSession while InfcSessionProxy (or InfdSessionProxy, respectively) can still do their job. * libinfinity/server/infd-note-plugin.h: * libinfinity/server/infd-directory.h: * libinfinity/server/infd-directory.c: * libinfinity/server/Makefile.am: * libinfinity/client/infc-note-plugin.h: * libinfinity/client/infc-browser.h: * libinfinity/client/infc-browser.c: * libinfinity/client/Makefile.am: Adjusted accordingly. * TODO: Removed finished items 2007-09-01 Armin Burgmeier * libinfinity/common/inf-connection-manager.h: * libinfinity/common/inf-connection-manager.c: Made InfConnectionManagerGroup a boxed type, allow changing a group's InfNetObject via inf_connection_manager_group_set_object(). * TODO: Added plans about making InfcSession and InfdSession not inherit from InfSession. 2007-08-31 Armin Burgmeier * libinfinity/common/inf-connection-manager.h: * libinfinity/common/inf-connection-manager.c: Redesigned connection manager. Now there are groups of which connections can be a member. * libinfinity/common/inf-session.h: * libinfinity/common/inf-session.c: * libinfinity/server/infd-session.h: * libinfinity/server/infd-session.c: * libinfinity/client/infc-session.h: * libinfinity/client/infc-session.c: * libinfinity/client/infc-browser.c: * libinfinity/server/infd-directory.c: Adjusted use. * TODO: Added another item about dropping the message table in InfcSession/InfdSession. 2007-08-27 Armin Burgmeier * libinfinity/common/inf-io.h: * libinfinity/common/inf-io.c: * libinfinity/common/inf-standalone-io.c: Implemented addition and removal of timeouts for InfIo. * TODO: Noted down some basic TODO items that would be nice to have for a first release. 2007-08-26 Armin Burgmeier * libinfinity/inf-marshal.in: Added VOID:OBJECT,BOOLEAN marshaller. * libinfinity/inf-text-chunk.c: Added a comment, and a TODO item. * libinfinity/adopted/inf-adopted-operation.h: Added another TODO item. * libinfinity/adopted/inf-adopted-request-log.h: * libinfinity/adopted/inf-adopted-request-log.c: Added the inf_adopted_request_log_next_undo(), inf_adopted_request_log_next_redo() and inf_adopted_request_log_upper_related() functions. * libinfinity/adopted/inf-adopted-algorithm.h: * libinfinity/adopted/inf-adopted-algorithm.c: * libinfinity/adopted/Makefile.am: Implemented the first part of the really dark magic. 2007-08-22 Armin Burgmeier * libinfinity/adopted/inf-adopted-request-log.c: Allow the given request to be one past the end of the log in which case it is treated as it was the newest in the log. 2007-08-22 Armin Burgmeier * libinfinity/inf-text-chunk.h: * libinfinity/inf-text-chunk.c: Beginning of a InfTextChunk implementation, storing text written by specific users. This will probably later be moved into a separate InfText library. This code is partly written by Benjamin Herr . 2007-08-22 Benjamin Herr * all source files: Appended vim modelines. 2007-08-20 Armin Burgmeier * libinfinity/adopted/inf-adopted-state-vector.h: * libinfinity/adopted/inf-adopted-state-vector.c: Added compare and causal relation functions. * libinfinity/adopted/inf-adopted-request.h: * libinfinity/adopted/inf-adopted-request.c: Made a GObject out of this and implement transfrom, mirror and fold operations. * libinfinity/adopted/inf-adopted-request-log.c: Added next-undo and next-redo properties and additional linking between the entries (original, next associated and previous associated request). 2007-08-18 Armin Burgmeier * libinfinity/adopted/inf-adopted-operation.h: Removed superfluous comma at end of enumeration. * libinfinity/adopted/inf-adopted-request.h: * libinfinity/adopted/inf-adopted-request-log.h: * libinfinity/adopted/inf-adopted-request.c: * libinfinity/adopted/inf-adopted-request-log.c: Implemnted InfAdoptedRequest and InfAdoptedRequestLog, though the latter is still missing can-undo/can-redo tracking. * libinfinity/adopted/Makefile.am: Build the new files. 2007-08-18 Armin Burgmeier * libinfinity/common/inf-buffer.c: Set initialized to TRUE in inf_buffer_base_init so the interface is only initialized once. * libinfinity/common/inf-user.c: Correctly register user flags type as flags instead of as enum. * libinfinity/adopted/inf-adopted-state-vector.h: * libinfinity/adopted/inf-adopted-user.h: * libinfinity/adopted/inf-adopted-operation.h: * libinfinity/adopted/inf-adopted-split-operation.h: * libinfinity/adopted/inf-adopted-no-operation.h: * libinfinity/adopted/inf-adopted-state-vector.c: * libinfinity/adopted/inf-adopted-user.c: * libinfinity/adopted/inf-adopted-operation.c: * libinfinity/adopted/inf-adopted-split-operation.c: * libinfinity/adopted/inf-adopted-no-operation.c: * libinfinity/adopted/Makefile.am: Implemented some initial types for the yet-to-come adopted implementation. * libinfinity/Makefile.am: * configure.ac: Include libinfinity/adopted to build, generate libinfinity/adopted/Makefile. * test/inf-test-state-vector.c: * test/Makefile.am: Added simple state vector test. 2007-08-15 Armin Burgmeier * libinfinity/common/inf-user.h: * libinfinity/common/inf-user.c: Added a flags property with user flags with INF_USER_LOCAL being the only user property so far. * libinfinity/client/infc-session.c: * libinfinity/server/infd-session.c: Set the INF_USER_LOCAL flag as appropriate. * README: Require glib-2.14 to be able to use GSequence. 2007-07-22 Armin Burgmeier * libinfinity/client/infc-browser.h: * libinfinity/client/infc-browser.c: Added infc_browser_iter_get_name(). * libinfinity/common/inf-xmpp-connection.c: ref/unref the XMPP connection object around callback for sent messages because those callbacks might unref the XMPP connection. * libinfinity/common/inf-net-object.c: Don't require virtual functions to be implemented. * libinfinity/common/inf-xml-connection.c: Fixed signal emission of sent and received signal, wrong parameter was passed. * libinfinity/common/inf-connection-manager.c: Only send further messages if there are any, after previous messages have been sent out. * libinfinity/server/infd-filesystem-storage.c: Fixed path to file on disk which was wrong in infd_filesystem_storage_read_subdirectory(). * libinfinity/server/infd-directory.c: Only call infd_directory_node_remove_connection() for explored subdirectory nodes because only those can have connections that have explored that node. * libinfinity/client/infc-request-manager.c: Don't unref the request when removing from the hash table because the hash table already does it via its value_destroy func. Initialize the parameters array with zero in infc_request_manager_add_request_valist() because the GValues therein need to be zero-initialized. * test/inf-test-browser.c: * test/Makefile.am: Added (interactive) test for InfcBrowser connecting to a running infinote server. 2007-07-20 Armin Burgmeier * libinfinity/common/inf-error.h: * libinfinity/common/inf-error.c: Added INF_DIRECTORY_ERROR_ALREADY_SUBSCRIBED. * libinfinity/common/inf-xml-util.c: Fixed error formatting for inf_xml_util_string_to_uint(). * libinfinity/server/infd-directory.c: Changed "subscribe-session" reply request name to from "session-subscribe" to "subscribe-session" and set ID attribute in that request. Don't leak the identifier string in infd_directory_handle_subscribe_session(). * libinfinity/client/infc-explore-request.c: Implement default signal handlers for the "initiated" and "progress" signals that notify the corresponding properties. * libinfinity/client/infc-request-manager.h: * libinfinity/client/infc-request-manager.c: Changed infc_request_manager_add_request(InfcRequestManager*, InfcRequest*) to infc_request_manager_add_request(InfcRequestManager*, GType, const gchar*, const gchar*, ...) and added infc_request_manager_add_request_valist(). * libinfinity/client/infc-node-request.h: * libinfinity/client/infc-node-request.c: Added another request type that handles requests related to nodes in the directory tree. * libinfinity/client/infc-browser-iter.h: * libinfinity/client/infc-browser-iter.c: * libinfinity/client/infc-browser.h: * libinfinity/client/infc-browser.c: Implemented InfcBrowser class that allows browsing a remote directory tree. * libinfinity/client/Makefile.am: Build the new files. 2007-07-19 Armin Burgmeier * libinfinity/common/inf-error.h: * libinfinity/common/inf-error.c: Replaced several "this or that attribute is missing" error by a general "No such attribute" error. * libinfinity/client/infc-request-manager.h: * libinfinity/client/infc-request-manager.c: Added infc_request_manager_get_request_by_xml_required(). * libinfinity/common/inf-xml-util.h: * libinfinity/common/inf-xml-util.c: * libinfinity/common/Makefile.am: Added some common helper functions read attributes from a XML node. * libinfinity/client/infc-session.c: * libinfinity/server/infd-session.c: * libinfinity/server/infd-directory.c: Make use of them. 2007-07-17 Armin Burgmeier * libinfinity/inf-marshal.in: Added VOID:UINT and VOID:UINT,UINT marshallers. * libinfinity/common/inf-error.h: * libinfinity/common/inf-error.c: Added INF_REQUEST_ERROR_INVALID_SEQ, INF_DIRECTORY_ERROR_TOO_MUCH_CHILDREN and INF_REQUEST_ERROR_TOO_FEW_CHILDREN. * libinfinity/server/infd-directory.h: * libinfinity/server/infd-directory.c: Removed g_return_if_fail from non-public functions, initialize next and prev fields of root node to NULL, unref session if corresponding node is freed, send number of child nodes in explore-begin. * libinfinity/client/infc-request-manager.h: * libinfinity/client/infc-request-manager.c: Added InfcRequestManager class that stores pending requests and provides lookup by seq. * libinfinity/client/infc-request.h: * libinfinity/client/infc-request.c: Removed the succeeded signal because it was too specific. It should rather be implemented by subclasses. * libinfinity/client/infc-user-request.h: * libinfinity/client/infc-user-request.c: * libinfinity/client/infc-explore-request.h: * libinfinity/client/infc-explore-request.c: Implemented specific requests for those which affect a user and for exploring a subdirectory. * libinfinity/client/infc-session.h: * libinfinity/client/infc-session.c: Use request manager instead of managing the requests on our own, use InfcUserRequest in infc_session_join_user and infc_session_leave_user. * libinfinity/client/Makefile.am: Added new source files to build. * README: Updated dependencies of infinote. 2007-07-15 Armin Burgmeier * artwork/infinote.svg: Added infinote icon by Benjamin Herr. 2007-06-21 Armin Burgmeier * libinfinity/common/inf-error.h: * libinfinity/common/inf-error.c: Moved directory error codes to common so they can be checked on client side. * libinfinity/server/infd-directory.h: * libinfinity/server/infd-directory.c: Added correct request handling. 2007-06-21 Armin Burgmeier * libinfinity/common/inf-session.h: * libinfinity/common/inf-session.c: Make sure that the synchronization terminates correctly when both sender and receiver sessions are closed any time during synchronization. 2007-05-27 Armin Burgmeier * libinfinity/common/inf-error.h: * libinfinity/common/inf-error.c: Added some more error codes. Those are only used on the client side and so should probably moved into somewhere in libinfinity/client. * libinfinity/client/infc-request.h: * libinfinity/client/infc-request.c: Added seq and name properties. * libinfinity/client/infc-session.h: * libinfinity/client/infc-session.c: * libinfinity/client/Makefile.am: Implemented client-side session. 2007-05-19 Armin Burgmeier * libinfinity/common/inf-error.h: * libinfinity/common/inf-error.c: Added INF_USER_LEAVE_NO_SUCH_USER error code, InfRequestError codes and public API to access error quarks. * libinfinity/server/infd-session.h: * libinfinity/server/infd-session.c: Made xmlNodePtr non-const in InfdSessionMessageFunc because it only makes the pointer const (and not the XML node pointed to). * libinfinity/client/infc-request.h: * libinfinity/client/infc-request.c: Added a general request-specific pointer parameter to the succeeded signal. * docs/terminology: Added a few words about request and seq. 2007-04-18 Armin Burgmeier * configure.ac: * libinfinity/Makefile.am: Added client directory, create libinfinity/client/Makefile. * libinfinity/inf-marshal.in: Added VOID:VOID marshaller. * libinfinity/common/infd-request.h: * libinfinity/common/infd-request.c: * libinfinity/common/Makefile.am: Added InfcRequest class. * libinfinity/common/inf-session.h: * libinfinity/common/inf-session.c: * libinfinity/server/infd-session.c: Replace user_to_xml vfunc by set_xml_user_props, added inf_session_user_to_xml which implements the functionality via the new vfunc. 2007-04-12 Armin Burgmeier * libinfinity/test/inf-test-daemon.c: * libinfinity/test/Makefile.am: Added test file that launches a simple infinote daemon with a filesystem storage in $HOME/.infinote. 2007-04-12 Armin Burgmeier * libinfinity/server/infd-filesystem-storage.h: * libinfinity/server/infd-filesystem-storage.c: * libinfinity/server/Makefile.am: Added a simple storage implementation that maps the directory tree to the disk. 2007-04-11 Armin Burgmeier * libinfinity/server/infd-server-pool.h: * libinfinity/server/infd-server-pool.c: * libinfinity/server/Makefile.am: Renamed from infd-server.[ch], manages an arbitrary amount of InfdXmlServers. 2007-04-10 Armin Burgmeier * libinfintiy/common/inf-connection-manager.h: * libinfintiy/common/inf-connection-manager.c: Removed inf_connection_manager_add_connection, and add connection automatically on first invocation of inf_connection_manager_add_object. * libinfinity/common/inf-session.c: * libinfinity/server/infd-directory.c: Adjusted use. 2007-04-10 Armin Burgmeier * libinfinity/common/inf-xmpp-connection.c: Fixed bugs, server side mostly works. * libinfinity/server/infd-xml-server.h: Fixed typo in InfdXmlServerStatus typedef. * libinfinity/server/infd-xmpp-server.h: * libinfinity/server/infd-xmpp-server.c: Build and Runtime fixes, use key.pem and cert.pem as key files for now. This should probably be replaced with a newly-created certificate later. * test/inf-test-xmpp-server.c: Added simple XMPP server test. * test/inf-test-xmpp-connection.c: Connect to local server instead of jabber.0x539.de. * test/key.pem: * test/cert.pem: Temporary example key files, copied from the GnuTLS distribution. 2007-04-08 Armin Burgmeier * libinfinity/common/inf-xmpp-connection.c: Notify credentials and sasl-context properties when they are created. * libinfinity/server/infd-xmpp-server.h: * libinfintiy/server/infd-xmpp-server.c: * libinfinity/server/Makefile.am: Added XMPP server class, yet untested. 2007-03-29 Armin Burgmeier * libinfinity/server/infd-tcp-server.h: * libinfinity/server/infd-tcp-server.c: Added InfdTcpServer object. * libinfinity/server/infd-xml-server.h: * libinfinity/server/infd-xml-server.c: Added InfdXmlServer interface. * libinfinity/common/inf-tcp-connection.c: Added _inf_tcp_connection_accepted function, do not leak a socket if the connection attempt fails in inf_tcp_connection_open, do not chain up to finalize in dispose, do not leak the IO object, don't rely on errno keeping its value at the end of the recv/send loop. * test/inf-test-tcp-server.c: * test/Makefile.am: Added test for the TCP server. 2007-03-28 Armin Burgmeier * libinfinity/common/inf-xmpp-connection.c: Fixed some bugs, client part mostly works. * libinfinity/common/inf-tcp-connection.c: Exit receiving/sending loop if the connection has been closed in a received/sent signal handler. * libinfinity/common/inf-xml-connection.c: Initialize interface only once. * test/inf-test-xmpp-connection.c: * test/Makefile.am: Added XMPP client test. 2007-03-28 Armin Burgmeier * libinfinity/common/: Moved all libinfinity sources and headers except inf-config.h and inf-marshal.h into a subdirectory. * libinfinity/server/: Moved all libinfinited files into another subdirectory. * libinfinited/: Removed. * libinfinity/common/Makefile.am: * libinfinity/server/Makefile.am: * libinfinity/Makefile.am: * configure.ac: Adjusted build for new directory structure. 2070-03-27 Armin Burgmeier * libinfinity/inf-xmpp-connection.h: * libinfinity/inf-xmpp-connection.c: Added XMPP client and server implementation, yet untested. * libinfinity/inf-xml-stream.h: * libinfinity/inf-xml-stream.c: Removed, this is no longer used and replaced by XMPP. * configure.in: * libinfinity/Makefile.am: Depend on gnutls and libgsasl. 2007-03-19 Armin Burgmeier * libinfinity/inf-marshal.in: Added VOID:POINTER,UINT marshaller. * libinfinity/inf-standalone-io.h: * libinfinity/inf-standalone-io.c: Added simple InfIo implementation. * libinfinity/inf-tcp-connection.h: * libinfinity/inf-tcp-connection.c: Implemented a TCP connection object. * libinfinity/Makefile.am: Added InfIoStandalone and InfTcpConnection to build. * test/inf-test-stream.xml: * test/inf-test-xml-stream.c: Removed those since InfXmlStream will probably be removed too, or at least change semantics. * test/inf-test-tcp-connection.c: * test/Makefile.am: Added simple TCP connection test. 2007-03-18 Armin Burgmeier * libinfinity/inf-ip-address.h: * libinfinity/inf-ip-address.c: * Makefile.am: Boxed type managing an IP address. 2007-03-18 Armin Burgmeier * libinfinity/inf-discovery-info.h: * libinfinity/inf-discovery.h: * libinfinity/inf-discovery-info.c: * libinfinity/inf-discovery.c: * Makefile.am: Added InfDiscovery and InfDiscoveryInfo interfaces. 2007-03-17 Armin Burgmeier * libinfinity/inf-io.h: * libinfinity/inf-io.c: * Makefile.am: Added InfIo interface. 2007-03-15 Armin Burgmeier * libinfinity/inf-xml-connection.h: * libinfinity/inf-xml-connection.c: Added an InfXmlConnection interface that replaces GNetworkConnection. * libinfinity/inf-buffer.c: * libinfinity/inf-buffer.h: Made a property out of the read-only functions and signal. * libinfinity/inf-marshal.in: Replaced VOID:BOOLEAN by VOID:POINTER for InfXmlConnection. * libinfinity/inf-net-object.h: * libinfinity/inf-connection-manager.h: * libinfinity/inf-session.h: * libinfinited/infd-note-plugin.h: * libinfinited/infd-session.h: * libinfinited/infd-directory.h: * libinfinity/inf-net-object.c: * libinfinity/inf-connection-manager.c: * libinfinity/inf-session.c: * libinfinited/infd-session.c: * libinfinited/infd-directory.c: Adjusted to use InfXmlConnection instead of GNetworkConnection. * configure.ac: * libinfinity/Makefile.am: * libinfinited/Makefile.am: Dropped dependency on libgnetwork. Also excluded infd-server.[hc] from build because they would still require GNetworkServer. Another interface in libinfinited is required here. 2007-03-15 Armin Burgmeier * libinfinited/infd-storage.h: * libinfinited/infd-storage.c: Turned the path field of InfdStorageNode to name. * libinfinited/infd-directory.h: * libinfinited/infd-directory.c: Implemented remaining functionality that was missing, some more enhanced operations like copying or moving nodes are still not supported, though. 2007-03-12 Armin Burgmeier * libinfinited/infd-storage.h: * libinfinited/infd-storage.c: Renamed InfdDirectoryStorage to InfdStorage. * libinfinited/infd-note-plugin.h: Added interface for a note plugin. * libinfinited/infd-session.h: * libinfinited/infd-session.c: * libinfinined/Makefile.am: Implemented user joins. 2007-03-12 Armin Burgmeier * libinfinity/inf-user.h: * libinfinity/inf-user.c: Removed connection field again. I don't think it is useful. * libinfinity/inf-session.h: * libinfinity/inf-session.c: Added inf_session_get_synchronization_status() and an exclude parameter to the validate_user_props vfunc. * libinfinity/inf-error.h: * libinfinity/inf-error.c: * libinfinity/Makefile.am: These specify some error codes that are commonly used by client and server. 2007-03-08 Armin Burgmeier * libinfinity/inf-session.c: Connect to notify::status to find out when a connection is closed. 2007-03-08 Armin Burgmeier * libinfinity/inf-session.h: * libinfinity/inf-session.c: Provide getters for connection manager and buffer. Also do a ref on the connection we get in inf_session_synchronize_to() because it will be unrefed when the synchronization is complete or failed. 2007-03-08 Armin Burgmeier * libinfinity/inf-session.c: Before removing the session from the connection manager in inf_session_release_connection(), make sure that the connection manager still has the connection. If the connection was closed, the connection manager might have dropped the connection earlier. * libinfinity/inf-connection-manager.c: Refcount netobject registrations, but make sure objects are added with the same identifier. 2007-03-08 Armin Burgmeier * libinfinity/inf-user.h: * libinfinity/inf-user.c: Added a connection field to InfUser specifiying a (not necessarily direct) connection between the local host and that user. 2007-03-07 Armin Burgmeier * docs/plugin: Added notes about the plugin interface. It is not yet implemented, these are my just ideas how it should work, so I do not forget and could be expanded to a complete specification later. 2007-03-06 Armin Burgmeier * libinfinity/inf-marshal.in: Added VOID:OBJECT,DOUBLE and VOID:OBJECT,POINTER marshallers for synchronization signals. * libinfinity/inf-net-object.h: * libinfinity/inf-net-object.c: * libinfinity/inf-connection-manager.h: * libinfinity/inf-connection-manager.c: Implemented separation between inner and outer queue, added enqueued vfunc in InfNetObject. * libinfinity/inf-session.h: * libinfinity/inf-session.c: Implemented session synchronization. * libinfinity/inf-buffer.c: Minor build fixes. * libinfinity/docs/terminology: Added inner queue and outer queue of connection manager. * libinfinity/docs/session: Applied slight changes that came up during implementation. 2007-03-01 Armin Burgmeier * libinfinity/docs: * libinfinity/docs/terminology: * libinfinity/docs/session: Added some notes, mostly for me to not forget how things are supposed to work, but perhaps also interesting to others. 2007-03-01 Armin Burgmeier * libinfinity/inf-marshal.in: Added VOID:BOOLEAN marshaller. * libinfinity/inf-buffer.h: * libinfinity/inf-buffer.c: * libinfinity/Makefile.am: Added common buffer interface. * libinfinity/inf-text-buffer.c: * libinfinity/inf-ink-buffer.c: Changed prerequiste from GObject to InfBuffer. 2007-02-27 Armin Burgmeier * libinfinity/infd-directory.h: * libinfinity/infd-directory.c: Added some directory API, but most implementations are still missing. 2007-02-27 Armin Burgmeier * libinfinity/inf-marshal.in: Added marshallers required for InfTextBuffer. * libinfinity/inf-text-buffer.h: * libinfinity/inf-text-buffer.c: * libinfinity/Makefile.am: Added InfTextBuffer interface. * libinfinited/inf-directory-storage.h: * libinfinited/inf-directory-storage.c: Added methods to read text notes, write ink and text notes, create a subdirectory and remove nodes. 2007-02-26 Armin Burgmeier * libinfinity/inf-connection-manager.h: * libinfinity/inf-connection-manager.c: Added inf_connection_manager_has_connection(). Also do strong refs instead of weak refs on added net object. This way, net objects are kept alive if there are still connections open. Especially, this should allow keeping sessions alive even if the document in the directory tree is removed. * libinfinited/infd-server.h: * libinfinited/infd-server.c: * libinfinited/Makefile.am: New server class managing acception of incoming connections and (yet to come) service publishing. * libinfinited/infd-directory.h: * libinfinited/infd-directory.c: Implemented directory tree structure, but accessing background storage and handling client requests still missing. 2007-02-26 Armin Burgmeier * libinfinity/inf-marshal.in: Added VOID:OBJECT marshaller. * libinfinity/inf-user.h: * libinfinity/inf-user.c: * libinfinity/inf-session.h: * libinfinity/inf-session.c: * Makefile.am: Added InfUser and InfSession classes. * libinfinity/inf-ink-buffer.c: Changed signal flags for the remove-stroke signal from G_SIGNAL_RUN_CLEANUP to G_SIGNAL_RUN_LAST and surrounded the signal emission by a g_object_ref / g_object_unref pair. This way, the stroke should stay alive after having been removed from the buffer and signal handlers running after the default handler don't get corrupted memory. 2007-02-23 Armin Burgmeier * libinfinity/inf-ink-stroke.h: * libinfinity/inf-ink-stroke.c: Renamed from InfStroke to InfInkStroke. * libinfinity/inf-ink-buffer.h: * libinfinity/inf-ink-buffer.c: Made an interface out of InfBuffer, renamed to InfInkBuffer. * libinfinity/Makefile.am: Adjusted build rules for renamed files. * libinfinited/infd-directory-storage.h: * libinfinited/infd-directory-storage.c: Include inf-ink-buffer.h instead of inf-buffer.h, added text node type for upcoming collaborative text editing support, removed empty flag from node (client should query a node to check whether it is empty, this way it can also treat it as empty if it only contains nodes it is not interested in, for example a subdirectory containing only ink nodes will be shown empty in a text editor). 2007-02-21 Armin Burgmeier * libinfinited/infd-directory.h: * libinfinited/infd-directory.c: Added GNetworkTcpServer object, close on error. 2007-02-21 Armin Burgmeier * libinfinity/inf-connection-manager.c: Take a reference of the connection in inf_connection_manager_add_connection(). * libinfinited/infd-directory.c: * libinfinited/infd-directory-storage.c: * libinfinited/infd-directory.h: * libinfinited/infd-directory-storage.h: * libinfinited/infd-marshal.in: * libinfinited/Makefile.am: Added interface for directory storage in libinfinited and initial directory class. * Makefile.am: * configure.ac: Build libinfinited. 2007-02-21 Armin Burgmeier * libinfinity: Renamed infinity directory to libinfinity. * configure.ac: * Makefile.am: * test/Makefile.am: * test/inf-test-xml-stream.c: * libinfinity/*.[ch]: Changed references and includes from infinity to libinfinity. Also implemented inf_stroke_new_at(). 2007-02-21 Armin Burgmeier * infinity/inf-net-object.c: Add G_TYPE_OBJECT prerequisite. 2007-02-20 Armin Burgmeier * infinity/inf-connection-manager.c: * infinity/inf-xml-stream.c: Chain up in destructor. * infinity/inf-buffer.h: * infinity/inf-buffer.c: Added InfBuffer class managing multiple InfStrokes. * infinity/inf-marshal.in: Added input file for glib-genmarshal. * infinity/Makefile.am: Create inf-marshal.h and inf-marshal.c from inf-marshal.in. Also added inf-buffer.c to build. 2007-02-20 Armin Burgmeier * infinity/inf-stroke.h: * infinity/inf-stroke.c: Added position to InfStroke to which the coordinates of the contained InfStrokePoints are relative. 2007-02-20 Armin Burgmeier * infinity/inf-xml-stream.c: * infinity/inf-connection-manager.c: Documentation fixes. * infinity/inf-net-object.c: Removed return in inf_net_object_sent() and inf_net_object_received() because these functions are void. * infinity/inf-stroke.h: * infinity/inf-stroke.c: Added object representing a single stroke. * infinity/Makefile.am: Added inf-stroke.c to build. 2007-02-19 Armin Burgmeier * infinity/inf-connection-manager.h: * infinity/inf-connection-manager.c: Implemented message processing and inf_connection_manager_send_to_object(). 2007-02-19 Armin Burgmeier * infinity/inf-xml-stream.c: * infinity/inf-xml-stream.h: * infinity/Makefile.am: Added InfXmlStream class. * test/inf-test-xml-stream.c: * test/inf-test-stream.xml: * test/Makefile.am: Simple test routine to test functionality of InfXmlStream. * configure.ac: Create test/Makefile. * Makefile.am: Added test to SUBDIRS. 2007-02-18 Armin Burgmeier * infinity/inf-connection-manager.c: * infinity/inf-connection-manager.h: Added InfConnectionManager class, not yet fully implemented, but compilable. * infinity/Makefile.am: Added inf-connection-manager.[ch]. 2007-02-18 Armin Burgmeier * infinity/inf-net-object.h: * infinity/inf-net-object.c: Renamed inf-netobject.[ch] to inf-net-object.[ch]. 2007-02-18 Armin Burgmeier * infinity/inf-netobject.h: Replaced INF_NET_OBJECT_TYPE by INF_TYPE_NET_OBJECT to follow gobject naming conventions. 2007-02-18 Armin Burgmeier * configure.ac: Added check for glib, gobject, libgnetwork and libxml2. * infinity/Makefile.am: Add CFLAGS and libs of dependencies to libinfinity_1_0_la_CPPFLAGS respectively libinfinity_1_0_la_LIBADD. * infinity/inf-netobject.h: Added libgnetwork/gnetwork-connection.h and libxml/tree.h includes to make it actually compile. * infinity/inf-config.h.in: Removed generated file from repository. 2007-02-16 Armin Burgmeier * configure.ac: * Makefile.am: * AUTHORS: * NEWS: * README: * COPYING: * INSTALL: * infinity/Makefile.am: * infinity/inf-config.h.in: * infinity/inf-netobject.h: * infinity/inf-netobject.c: Initial revision. libinfinity-0.5.5/Makefile.am0000644000175000017500000000100012264763732013021 00000000000000SUBDIRS = libinfinity libinftext pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = \ libinfinity-$(LIBINFINITY_API_VERSION).pc \ libinftext-$(LIBINFINITY_API_VERSION).pc if WITH_INFGTK SUBDIRS += libinfgtk pkgconfig_DATA += libinfgtk-$(LIBINFINITY_API_VERSION).pc endif if WITH_INFTEXTGTK SUBDIRS += libinftextgtk pkgconfig_DATA += libinftextgtk-$(LIBINFINITY_API_VERSION).pc endif if WITH_INFINOTED SUBDIRS += infinoted endif SUBDIRS += pixmaps test docs po DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc libinfinity-0.5.5/ar-lib0000755000175000017500000001330212254056411012055 00000000000000#! /bin/sh # Wrapper for Microsoft lib.exe me=ar-lib scriptversion=2012-03-01.08; # UTC # Copyright (C) 2010-2013 Free Software Foundation, Inc. # Written by Peter Rosin . # # 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 # . # func_error message func_error () { echo "$me: $1" 1>&2 exit 1 } file_conv= # func_file_conv build_file # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv in mingw) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin) file=`cygpath -m "$file" || echo "$file"` ;; wine) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_at_file at_file operation archive # Iterate over all members in AT_FILE performing OPERATION on ARCHIVE # for each of them. # When interpreting the content of the @FILE, do NOT use func_file_conv, # since the user would need to supply preconverted file names to # binutils ar, at least for MinGW. func_at_file () { operation=$2 archive=$3 at_file_contents=`cat "$1"` eval set x "$at_file_contents" shift for member do $AR -NOLOGO $operation:"$member" "$archive" || exit $? done } case $1 in '') func_error "no command. Try '$0 --help' for more information." ;; -h | --h*) cat <. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: libinfinity-0.5.5/libinftext/0000755000175000017500000000000012264766267013234 500000000000000libinfinity-0.5.5/libinftext/inf-text-default-insert-operation.h0000644000175000017500000000515212264763732022002 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_TEXT_DEFAULT_INSERT_OPERATION_H__ #define __INF_TEXT_DEFAULT_INSERT_OPERATION_H__ #include #include G_BEGIN_DECLS #define INF_TEXT_TYPE_DEFAULT_INSERT_OPERATION (inf_text_default_insert_operation_get_type()) #define INF_TEXT_DEFAULT_INSERT_OPERATION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INF_TEXT_TYPE_DEFAULT_INSERT_OPERATION, InfTextDefaultInsertOperation)) #define INF_TEXT_DEFAULT_INSERT_OPERATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INF_TEXT_TYPE_DEFAULT_INSERT_OPERATION, InfTextDefaultInsertOperationClass)) #define INF_TEXT_IS_DEFAULT_INSERT_OPERATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INF_TEXT_TYPE_DEFAULT_INSERT_OPERATION)) #define INF_TEXT_IS_DEFAULT_INSERT_OPERATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INF_TEXT_TYPE_DEFAULT_INSERT_OPERATION)) #define INF_TEXT_DEFAULT_INSERT_OPERATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), INF_TEXT_TYPE_DEFAULT_INSERT_OPERATION, InfTextDefaultInsertOperationClass)) typedef struct _InfTextDefaultInsertOperation InfTextDefaultInsertOperation; typedef struct _InfTextDefaultInsertOperationClass InfTextDefaultInsertOperationClass; struct _InfTextDefaultInsertOperationClass { GObjectClass parent_class; }; struct _InfTextDefaultInsertOperation { GObject parent; }; GType inf_text_default_insert_operation_get_type(void) G_GNUC_CONST; InfTextDefaultInsertOperation* inf_text_default_insert_operation_new(guint pos, InfTextChunk* chunk); InfTextChunk* inf_text_default_insert_operation_get_chunk( InfTextDefaultInsertOperation* operation); G_END_DECLS #endif /* __INF_TEXT_DEFAULT_INSERT_OPERATION_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinftext/inf-text-default-delete-operation.c0000644000175000017500000004041312264763732021732 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include #include #include #include #include #include #include /* Don't check text match in stable releases */ /* #define DELETE_OPERATION_CHECK_TEXT_MATCH */ typedef struct _InfTextDefaultDeleteOperationPrivate InfTextDefaultDeleteOperationPrivate; struct _InfTextDefaultDeleteOperationPrivate { guint position; InfTextChunk* chunk; }; enum { PROP_0, PROP_POSITION, PROP_CHUNK }; #define INF_TEXT_DEFAULT_DELETE_OPERATION_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), INF_TEXT_TYPE_DEFAULT_DELETE_OPERATION, InfTextDefaultDeleteOperationPrivate)) static GObjectClass* parent_class; #ifdef DELETE_OPERATION_CHECK_TEXT_MATCH static gboolean inf_text_default_delete_operation_text_match( InfTextDefaultDeleteOperation* operation, InfTextBuffer* buffer) { InfTextDefaultDeleteOperationPrivate* priv; InfTextChunk* chunk; gchar* first; gchar* second; gsize first_len; gsize second_len; int result; priv = INF_TEXT_DEFAULT_DELETE_OPERATION_PRIVATE(operation); /* TODO: inf_text_chunk_cmp_substring */ chunk = inf_text_buffer_get_slice( buffer, priv->position, inf_text_chunk_get_length(priv->chunk) ); first = inf_text_chunk_get_text(priv->chunk, &first_len); second = inf_text_chunk_get_text(chunk, &second_len); inf_text_chunk_free(chunk); /* TODO: Owners must match, too */ if(first_len == second_len) result = memcmp(first, second, first_len); else result = 1; /* != 0 */ g_free(second); g_free(first); return result == 0; } #endif /* DELETE_OPERATION_CHECK_TEXT_MATCH */ static void inf_text_default_delete_operation_init(GTypeInstance* instance, gpointer g_class) { InfTextDefaultDeleteOperation* operation; InfTextDefaultDeleteOperationPrivate* priv; operation = INF_TEXT_DEFAULT_DELETE_OPERATION(instance); priv = INF_TEXT_DEFAULT_DELETE_OPERATION_PRIVATE(operation); priv->position = 0; priv->chunk = NULL; } static void inf_text_default_delete_operation_finalize(GObject* object) { InfTextDefaultDeleteOperation* operation; InfTextDefaultDeleteOperationPrivate* priv; operation = INF_TEXT_DEFAULT_DELETE_OPERATION(object); priv = INF_TEXT_DEFAULT_DELETE_OPERATION_PRIVATE(operation); inf_text_chunk_free(priv->chunk); G_OBJECT_CLASS(parent_class)->finalize(object); } static void inf_text_default_delete_operation_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec) { InfTextDefaultDeleteOperation* operation; InfTextDefaultDeleteOperationPrivate* priv; operation = INF_TEXT_DEFAULT_DELETE_OPERATION(object); priv = INF_TEXT_DEFAULT_DELETE_OPERATION_PRIVATE(operation); switch(prop_id) { case PROP_POSITION: priv->position = g_value_get_uint(value); break; case PROP_CHUNK: g_assert(priv->chunk == NULL); /* construct only */ priv->chunk = (InfTextChunk*)g_value_dup_boxed(value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void inf_text_default_delete_operation_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec) { InfTextDefaultDeleteOperation* operation; InfTextDefaultDeleteOperationPrivate* priv; operation = INF_TEXT_DEFAULT_DELETE_OPERATION(object); priv = INF_TEXT_DEFAULT_DELETE_OPERATION_PRIVATE(operation); switch(prop_id) { case PROP_POSITION: g_value_set_uint(value, priv->position); break; case PROP_CHUNK: g_value_set_boxed(value, priv->chunk); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static gboolean inf_text_default_delete_operation_need_concurrency_id( InfAdoptedOperation* operation, InfAdoptedOperation* against) { g_assert(INF_TEXT_IS_DEFAULT_DELETE_OPERATION(operation)); return inf_text_delete_operation_need_concurrency_id( INF_TEXT_DELETE_OPERATION(operation), against ); } static InfAdoptedConcurrencyId inf_text_default_delete_operation_get_concurrency_id( InfAdoptedOperation* operation, InfAdoptedOperation* against) { g_assert(INF_TEXT_IS_DEFAULT_DELETE_OPERATION(operation)); return inf_text_delete_operation_get_concurrency_id( INF_TEXT_DELETE_OPERATION(operation), against ); } static InfAdoptedOperation* inf_text_default_delete_operation_transform(InfAdoptedOperation* operation, InfAdoptedOperation* against, InfAdoptedConcurrencyId cid) { g_assert(INF_TEXT_IS_DEFAULT_DELETE_OPERATION(operation)); if(INF_TEXT_IS_INSERT_OPERATION(against)) { return inf_text_delete_operation_transform_insert( INF_TEXT_DELETE_OPERATION(operation), INF_TEXT_INSERT_OPERATION(against), cid ); } else if(INF_TEXT_IS_DELETE_OPERATION(against)) { return inf_text_delete_operation_transform_delete( INF_TEXT_DELETE_OPERATION(operation), INF_TEXT_DELETE_OPERATION(against), cid ); } else { g_assert_not_reached(); return NULL; } } static InfAdoptedOperation* inf_text_default_delete_operation_copy(InfAdoptedOperation* operation) { InfTextDefaultDeleteOperationPrivate* priv; priv = INF_TEXT_DEFAULT_DELETE_OPERATION_PRIVATE(operation); return INF_ADOPTED_OPERATION( g_object_new( INF_TEXT_TYPE_DEFAULT_DELETE_OPERATION, "position", priv->position, "chunk", priv->chunk, NULL ) ); } static InfAdoptedOperationFlags inf_text_default_delete_operation_get_flags(InfAdoptedOperation* operation) { return INF_ADOPTED_OPERATION_AFFECTS_BUFFER | INF_ADOPTED_OPERATION_REVERSIBLE; } static void inf_text_default_delete_operation_apply(InfAdoptedOperation* operation, InfAdoptedUser* by, InfBuffer* buffer) { InfTextDefaultDeleteOperationPrivate* priv; g_assert(INF_TEXT_IS_DEFAULT_DELETE_OPERATION(operation)); g_assert(INF_TEXT_IS_BUFFER(buffer)); priv = INF_TEXT_DEFAULT_DELETE_OPERATION_PRIVATE(operation); #ifdef DELETE_OPERATION_CHECK_TEXT_MATCH g_assert( inf_text_default_delete_operation_text_match( INF_TEXT_DEFAULT_DELETE_OPERATION(operation), INF_TEXT_BUFFER(buffer) ) ); #endif /* DELETE_OPERATION_CHECK_TEXT_MATCH */ inf_text_buffer_erase_text( INF_TEXT_BUFFER(buffer), priv->position, inf_text_chunk_get_length(priv->chunk), INF_USER(by) ); } static InfAdoptedOperation* inf_text_default_delete_operation_revert(InfAdoptedOperation* operation) { InfTextDefaultDeleteOperationPrivate* priv; priv = INF_TEXT_DEFAULT_DELETE_OPERATION_PRIVATE(operation); return INF_ADOPTED_OPERATION( inf_text_default_insert_operation_new( priv->position, priv->chunk ) ); } static guint inf_text_default_delete_operation_get_position( InfTextDeleteOperation* operation) { return INF_TEXT_DEFAULT_DELETE_OPERATION_PRIVATE(operation)->position; } static guint inf_text_default_delete_operation_get_length( InfTextDeleteOperation* operation) { return inf_text_chunk_get_length( INF_TEXT_DEFAULT_DELETE_OPERATION_PRIVATE(operation)->chunk ); } static InfTextDeleteOperation* inf_text_default_delete_operation_transform_position( InfTextDeleteOperation* operation, guint position) { InfTextDefaultDeleteOperationPrivate* priv; priv = INF_TEXT_DEFAULT_DELETE_OPERATION_PRIVATE(operation); return INF_TEXT_DELETE_OPERATION( g_object_new( INF_TEXT_TYPE_DEFAULT_DELETE_OPERATION, "position", position, "chunk", priv->chunk, NULL ) ); } static InfTextDeleteOperation* inf_text_default_delete_operation_transform_overlap( InfTextDeleteOperation* operation, InfTextDeleteOperation* other, guint position, guint begin, guint other_begin, guint length) { InfTextDefaultDeleteOperationPrivate* priv; InfTextChunk* chunk; GObject* result; priv = INF_TEXT_DEFAULT_DELETE_OPERATION_PRIVATE(operation); chunk = inf_text_chunk_copy(priv->chunk); inf_text_chunk_erase(chunk, begin, length); result = g_object_new( INF_TEXT_TYPE_DEFAULT_DELETE_OPERATION, "position", position, "chunk", chunk, NULL ); inf_text_chunk_free(chunk); return INF_TEXT_DELETE_OPERATION(result); } static InfAdoptedSplitOperation* inf_text_default_delete_operation_transform_split( InfTextDeleteOperation* operation, guint split_pos, guint split_len) { InfTextDefaultDeleteOperationPrivate* priv; InfTextChunk* first_chunk; InfTextChunk* second_chunk; GObject* first; GObject* second; InfAdoptedSplitOperation* result; priv = INF_TEXT_DEFAULT_DELETE_OPERATION_PRIVATE(operation); first_chunk = inf_text_chunk_substring(priv->chunk, 0, split_pos); second_chunk = inf_text_chunk_substring( priv->chunk, split_pos, inf_text_chunk_get_length(priv->chunk) - split_pos ); first = g_object_new( INF_TEXT_TYPE_DEFAULT_DELETE_OPERATION, "position", priv->position, "chunk", first_chunk, NULL ); second = g_object_new( INF_TEXT_TYPE_DEFAULT_DELETE_OPERATION, "position", priv->position + split_pos + split_len, "chunk", second_chunk, NULL ); inf_text_chunk_free(first_chunk); inf_text_chunk_free(second_chunk); result = inf_adopted_split_operation_new( INF_ADOPTED_OPERATION(first), INF_ADOPTED_OPERATION(second) ); g_object_unref(first); g_object_unref(second); return result; } static void inf_text_default_delete_operation_class_init(gpointer g_class, gpointer class_data) { GObjectClass* object_class; object_class = G_OBJECT_CLASS(g_class); parent_class = G_OBJECT_CLASS(g_type_class_peek_parent(g_class)); g_type_class_add_private(g_class, sizeof(InfTextDefaultDeleteOperationPrivate)); object_class->finalize = inf_text_default_delete_operation_finalize; object_class->set_property = inf_text_default_delete_operation_set_property; object_class->get_property = inf_text_default_delete_operation_get_property; g_object_class_install_property( object_class, PROP_POSITION, g_param_spec_uint( "position", "Position", "Position where to start deleting characters", 0, G_MAXUINT, 0, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); g_object_class_install_property( object_class, PROP_CHUNK, g_param_spec_boxed( "chunk", "Chunk", "The deleted text", INF_TEXT_TYPE_CHUNK, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); } static void inf_text_default_delete_operation_operation_init(gpointer g_iface, gpointer iface_data) { InfAdoptedOperationIface* iface; iface = (InfAdoptedOperationIface*)g_iface; iface->need_concurrency_id = inf_text_default_delete_operation_need_concurrency_id; iface->get_concurrency_id = inf_text_default_delete_operation_get_concurrency_id; iface->transform = inf_text_default_delete_operation_transform; iface->copy = inf_text_default_delete_operation_copy; iface->get_flags = inf_text_default_delete_operation_get_flags; iface->apply = inf_text_default_delete_operation_apply; iface->revert = inf_text_default_delete_operation_revert; /* DefaultDeleteOperation is always reversible */ iface->make_reversible = NULL; } static void inf_text_default_delete_operation_delete_operation_init(gpointer g_iface, gpointer iface_data) { InfTextDeleteOperationIface* iface; iface = (InfTextDeleteOperationIface*)g_iface; iface->get_position = inf_text_default_delete_operation_get_position; iface->get_length = inf_text_default_delete_operation_get_length; iface->transform_position = inf_text_default_delete_operation_transform_position; iface->transform_overlap = inf_text_default_delete_operation_transform_overlap; iface->transform_split = inf_text_default_delete_operation_transform_split; } GType inf_text_default_delete_operation_get_type(void) { static GType default_delete_operation_type = 0; if(!default_delete_operation_type) { static const GTypeInfo default_delete_operation_type_info = { sizeof(InfTextDefaultDeleteOperationClass), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ inf_text_default_delete_operation_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InfTextDefaultDeleteOperation), /* instance_size */ 0, /* n_preallocs */ inf_text_default_delete_operation_init, /* instance_init */ NULL /* value_table */ }; static const GInterfaceInfo operation_info = { inf_text_default_delete_operation_operation_init, NULL, NULL }; static const GInterfaceInfo delete_operation_info = { inf_text_default_delete_operation_delete_operation_init, NULL, NULL }; default_delete_operation_type = g_type_register_static( G_TYPE_OBJECT, "InfTextDefaultDeleteOperation", &default_delete_operation_type_info, 0 ); g_type_add_interface_static( default_delete_operation_type, INF_ADOPTED_TYPE_OPERATION, &operation_info ); g_type_add_interface_static( default_delete_operation_type, INF_TEXT_TYPE_DELETE_OPERATION, &delete_operation_info ); } return default_delete_operation_type; } /** * inf_text_default_delete_operation_new: * @position: The position at which to delete text. * @chunk: The text to delete. * * Creates a new delete operation that, when applied, deletes the text @chunk * that starts at character offset @position in the buffer. The operation * cannot be applied, if there is some other text at that position in the * buffer. * * Return Value: A new #InfTextDefaultDeleteOperation. **/ InfTextDefaultDeleteOperation* inf_text_default_delete_operation_new(guint position, InfTextChunk* chunk) { GObject* object; g_return_val_if_fail(chunk != NULL, NULL); object = g_object_new( INF_TEXT_TYPE_DEFAULT_DELETE_OPERATION, "position", position, "chunk", chunk, NULL ); return INF_TEXT_DEFAULT_DELETE_OPERATION(object); } /** * inf_text_default_delete_operation_get_chunk: * @operation: A #InfTextDefaultDeleteOperation. * * Returns the text deleted by @operation. * * Return Value: A #InfTextChunk, owned by the operation. **/ InfTextChunk* inf_text_default_delete_operation_get_chunk( InfTextDefaultDeleteOperation* operation) { g_return_val_if_fail(INF_TEXT_IS_DEFAULT_DELETE_OPERATION(operation), NULL); return INF_TEXT_DEFAULT_DELETE_OPERATION_PRIVATE(operation)->chunk; } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinftext/inf-text-insert-operation.c0000644000175000017500000002210712264763732020352 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include static void inf_text_insert_operation_base_init(gpointer g_class) { static gboolean initialized = FALSE; if(!initialized) { initialized = TRUE; } } GType inf_text_insert_operation_get_type(void) { static GType insert_operation_type = 0; if(!insert_operation_type) { static const GTypeInfo insert_operation_info = { sizeof(InfTextInsertOperationIface), /* class_size */ inf_text_insert_operation_base_init, /* base_init */ NULL, /* base_finalize */ NULL, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ 0, /* instance_size */ 0, /* n_preallocs */ NULL, /* instance_init */ NULL /* value_table */ }; insert_operation_type = g_type_register_static( G_TYPE_INTERFACE, "InfTextInsertOperation", &insert_operation_info, 0 ); g_type_interface_add_prerequisite( insert_operation_type, INF_ADOPTED_TYPE_OPERATION ); } return insert_operation_type; } /** * inf_text_insert_operation_get_position: * @operation: A #InfTextInsertOperation. * * Returns the position at which @operation inserts text. * * Return Value: The position to insert text. **/ guint inf_text_insert_operation_get_position(InfTextInsertOperation* operation) { InfTextInsertOperationIface* iface; g_return_val_if_fail(INF_TEXT_IS_INSERT_OPERATION(operation), 0); iface = INF_TEXT_INSERT_OPERATION_GET_IFACE(operation); g_return_val_if_fail(iface->get_position != NULL, 0); return iface->get_position(operation); } /** * inf_text_insert_operation_get_length: * @operation: A #InfTextInsertOperation. * * Returns the length of the text inserted by @operation. * * Return Value: The length of @operation. **/ guint inf_text_insert_operation_get_length(InfTextInsertOperation* operation) { InfTextInsertOperationIface* iface; g_return_val_if_fail(INF_TEXT_IS_INSERT_OPERATION(operation), 0); iface = INF_TEXT_INSERT_OPERATION_GET_IFACE(operation); g_return_val_if_fail(iface->get_length != NULL, 0); return iface->get_length(operation); } /** * inf_text_insert_operation_need_concurrency_id: * @op: A #InfTextInsertOperation. * @against: Another #InfAdoptedOperation. * * Returns whether transforming @op against @against requires a concurrency ID * (see inf_adopted_operation_need_concurrency_id() for further information). * * Returns: Whether transforming @op against @against requires a concurrency * ID. */ gboolean inf_text_insert_operation_need_concurrency_id(InfTextInsertOperation* op, InfAdoptedOperation* against) { InfTextInsertOperation* insert_against; g_return_val_if_fail(INF_TEXT_IS_INSERT_OPERATION(op), FALSE); g_return_val_if_fail(INF_ADOPTED_IS_OPERATION(against), FALSE); if(INF_TEXT_IS_INSERT_OPERATION(against)) { insert_against = INF_TEXT_INSERT_OPERATION(against); if(inf_text_insert_operation_get_position(op) == inf_text_insert_operation_get_position(insert_against)) { return TRUE; } } return FALSE; } /** * inf_text_insert_operation_get_concurrency_id: * @op: A #InfTextInsertOperation. * @against: Another #InfAdoptedOperation. * * Returns a concurrency ID for transformation of @op against @against * (see inf_adopted_operation_get_concurrency_id() for further information). * * Returns: A concurrency ID between @op and @against. */ InfAdoptedConcurrencyId inf_text_insert_operation_get_concurrency_id(InfTextInsertOperation* op, InfAdoptedOperation* against) { InfTextInsertOperation* insert_against; guint own_pos; guint against_pos; g_return_val_if_fail( INF_TEXT_IS_INSERT_OPERATION(op), INF_ADOPTED_CONCURRENCY_NONE ); g_return_val_if_fail( INF_ADOPTED_IS_OPERATION(against), INF_ADOPTED_CONCURRENCY_NONE ); if(INF_TEXT_IS_INSERT_OPERATION(against)) { insert_against = INF_TEXT_INSERT_OPERATION(against); own_pos = inf_text_insert_operation_get_position(op); against_pos = inf_text_insert_operation_get_position(insert_against); if(own_pos < against_pos) return INF_ADOPTED_CONCURRENCY_OTHER; else if(own_pos > against_pos) return INF_ADOPTED_CONCURRENCY_SELF; else return INF_ADOPTED_CONCURRENCY_NONE; } else { _inf_adopted_concurrency_warning(INF_TEXT_TYPE_INSERT_OPERATION); return INF_ADOPTED_CONCURRENCY_NONE; } } /** * inf_text_insert_operation_transform_insert: * @operation: A #InfTextInsertOperation. * @against: Another #InfTextInsertOperation. * @cid: The concurrency ID for the transformation. * * Returns a new operation that includes the effect of @against into * @operation. * * Return Value: A new #InfAdoptedOperation. **/ InfAdoptedOperation* inf_text_insert_operation_transform_insert(InfTextInsertOperation* operation, InfTextInsertOperation* against, InfAdoptedConcurrencyId cid) { InfTextInsertOperationIface* iface; guint op_pos; guint against_pos; guint against_length; g_return_val_if_fail(INF_TEXT_IS_INSERT_OPERATION(operation), NULL); g_return_val_if_fail(INF_TEXT_IS_INSERT_OPERATION(against), NULL); iface = INF_TEXT_INSERT_OPERATION_GET_IFACE(operation); g_return_val_if_fail(iface->transform_position != NULL, NULL); op_pos = inf_text_insert_operation_get_position(operation); against_pos = inf_text_insert_operation_get_position(against); if(op_pos < against_pos || (op_pos == against_pos && cid == INF_ADOPTED_CONCURRENCY_OTHER)) { return inf_adopted_operation_copy(INF_ADOPTED_OPERATION(operation)); } else if(op_pos > against_pos || (op_pos == against_pos && cid == INF_ADOPTED_CONCURRENCY_SELF)) { against_length = inf_text_insert_operation_get_length(against); return INF_ADOPTED_OPERATION( iface->transform_position(operation, op_pos + against_length) ); } else { /* Note this can actually occur when a split operation has to transform * one of its parts against the other. It is also possible for a split * operation to hold two insert operations, for example when reversing a * splitted delete operation. However, it is illegal that two such insert * operations insert text at the same position. */ g_assert_not_reached(); return NULL; } } /** * inf_text_insert_operation_transform_delete: * @operation: A #InfTextInsertOperation. * @against: A #InfTextDeleteOperation. * @cid: The concurrency ID for the transformation. * * Returns a new operation that includes the effect of @against into * @operation. * * Return Value: A new #InfAdoptedOperation. **/ InfAdoptedOperation* inf_text_insert_operation_transform_delete(InfTextInsertOperation* operation, InfTextDeleteOperation* against, InfAdoptedConcurrencyId cid) { InfTextInsertOperationIface* iface; guint own_pos; guint other_pos; guint other_len; g_return_val_if_fail(INF_TEXT_IS_INSERT_OPERATION(operation), NULL); g_return_val_if_fail(INF_TEXT_IS_DELETE_OPERATION(against), NULL); iface = INF_TEXT_INSERT_OPERATION_GET_IFACE(operation); g_return_val_if_fail(iface->transform_position != NULL, NULL); own_pos = inf_text_insert_operation_get_position(operation); other_pos = inf_text_delete_operation_get_position(against); other_len = inf_text_delete_operation_get_length(against); if(own_pos >= other_pos + other_len) { return INF_ADOPTED_OPERATION( iface->transform_position(operation, own_pos - other_len) ); } else if(own_pos < other_pos) { return inf_adopted_operation_copy(INF_ADOPTED_OPERATION(operation)); } else { return INF_ADOPTED_OPERATION( iface->transform_position(operation, other_pos) ); } } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinftext/Makefile.am0000644000175000017500000000241412264763732015203 00000000000000# TODO: Find a way to have the version number set automatically. lib_LTLIBRARIES = libinftext-0.5.la libinftext_0_5_la_CPPFLAGS = \ -I$(top_srcdir) \ $(inftext_CFLAGS) \ $(infinity_CFLAGS) libinftext_0_5_la_LDFLAGS = \ -no-undefined \ -version-info $(LIBINFINITY_LIBTOOL_VERSION) libinftext_0_5_la_LIBADD = \ ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ $(inftext_LIBS) \ $(infinity_LIBS) libinftext_0_5_ladir = \ $(includedir)/libinftext-$(LIBINFINITY_API_VERSION)/libinftext libinftext_0_5_la_HEADERS = \ inf-text-buffer.h \ inf-text-chunk.h \ inf-text-default-buffer.h \ inf-text-default-delete-operation.h \ inf-text-default-insert-operation.h \ inf-text-delete-operation.h \ inf-text-insert-operation.h \ inf-text-move-operation.h \ inf-text-operations.h \ inf-text-remote-delete-operation.h \ inf-text-session.h \ inf-text-undo-grouping.h \ inf-text-user.h libinftext_0_5_la_SOURCES = \ inf-text-buffer.c \ inf-text-chunk.c \ inf-text-default-buffer.c \ inf-text-default-delete-operation.c \ inf-text-default-insert-operation.c \ inf-text-delete-operation.c \ inf-text-insert-operation.c \ inf-text-move-operation.c \ inf-text-remote-delete-operation.c \ inf-text-session.c \ inf-text-undo-grouping.c \ inf-text-user.c libinfinity-0.5.5/libinftext/inf-text-delete-operation.c0000644000175000017500000002212312264763732020306 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include static void inf_text_delete_operation_base_init(gpointer g_class) { static gboolean initialized = FALSE; if(!initialized) { initialized = TRUE; } } GType inf_text_delete_operation_get_type(void) { static GType delete_operation_type = 0; if(!delete_operation_type) { static const GTypeInfo delete_operation_info = { sizeof(InfTextDeleteOperationIface), /* class_size */ inf_text_delete_operation_base_init, /* base_init */ NULL, /* base_finalize */ NULL, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ 0, /* instance_size */ 0, /* n_preallocs */ NULL, /* instance_init */ NULL /* value_table */ }; delete_operation_type = g_type_register_static( G_TYPE_INTERFACE, "InfTextDeleteOperation", &delete_operation_info, 0 ); g_type_interface_add_prerequisite( delete_operation_type, INF_ADOPTED_TYPE_OPERATION ); } return delete_operation_type; } /** * inf_text_delete_operation_get_position: * @operation: A #InfTextDeleteOperation. * * Returns the position at which @operation starts to delete dext. * * Return Value: The position of @operation. **/ guint inf_text_delete_operation_get_position(InfTextDeleteOperation* operation) { InfTextDeleteOperationIface* iface; g_return_val_if_fail(INF_TEXT_IS_DELETE_OPERATION(operation), 0); iface = INF_TEXT_DELETE_OPERATION_GET_IFACE(operation); g_return_val_if_fail(iface->get_position != NULL, 0); return iface->get_position(operation); } /** * inf_text_delete_operation_get_length: * @operation: A #InfTextDeleteOperation. * * Returns the number of characters deleted by @operation. * * Return Value: The length of @operation. **/ guint inf_text_delete_operation_get_length(InfTextDeleteOperation* operation) { InfTextDeleteOperationIface* iface; g_return_val_if_fail(INF_TEXT_IS_DELETE_OPERATION(operation), 0); iface = INF_TEXT_DELETE_OPERATION_GET_IFACE(operation); g_return_val_if_fail(iface->get_length != NULL, 0); return iface->get_length(operation); } /** * inf_text_delete_operation_need_concurrency_id: * @op: A #InfTextDeleteOperation. * @against: Another #InfAdoptedOperation. * * Returns whether transforming @op against @against requires a concurrency ID * (see inf_adopted_operation_need_concurrency_id() for further information). * * Returns: Whether transforming @op against @against requires a concurrency * ID. */ gboolean inf_text_delete_operation_need_concurrency_id(InfTextDeleteOperation* op, InfAdoptedOperation* against) { g_return_val_if_fail(INF_TEXT_IS_DELETE_OPERATION(op), FALSE); g_return_val_if_fail(INF_ADOPTED_IS_OPERATION(against), FALSE); return FALSE; } /** * inf_text_delete_operation_get_concurrency_id: * @op: A #InfTextDeleteOperation. * @against: Another #InfAdoptedOperation. * * Returns a concurrency ID for transformation of @op against @against * (see inf_adopted_operation_get_concurrency_id() for further information). * * Returns: A concurrency ID between @op and @against. */ InfAdoptedConcurrencyId inf_text_delete_operation_get_concurrency_id(InfTextDeleteOperation* op, InfAdoptedOperation* against) { g_return_val_if_fail( INF_TEXT_IS_DELETE_OPERATION(op), INF_ADOPTED_CONCURRENCY_NONE ); g_return_val_if_fail( INF_ADOPTED_IS_OPERATION(against), INF_ADOPTED_CONCURRENCY_NONE ); _inf_adopted_concurrency_warning(INF_TEXT_TYPE_DELETE_OPERATION); return INF_ADOPTED_CONCURRENCY_NONE; } /** * inf_text_delete_operation_transform_insert: * @operation: A #InfTextDeleteOperation. * @against: A #InfTextInsertOperation. * @cid: The concurrency ID for the transformation. * * Returns a new operation that includes the effect of @against into * @operation. * * Return Value: A new #InfAdoptedOperation. **/ InfAdoptedOperation* inf_text_delete_operation_transform_insert(InfTextDeleteOperation* operation, InfTextInsertOperation* against, InfAdoptedConcurrencyId cid) { InfTextDeleteOperationIface* iface; guint own_pos; guint own_len; guint other_pos; guint other_len; g_return_val_if_fail(INF_TEXT_IS_DELETE_OPERATION(operation), NULL); g_return_val_if_fail(INF_TEXT_IS_INSERT_OPERATION(against), NULL); iface = INF_TEXT_DELETE_OPERATION_GET_IFACE(operation); g_return_val_if_fail(iface->transform_position != NULL, NULL); g_return_val_if_fail(iface->transform_split != NULL, NULL); own_pos = inf_text_delete_operation_get_position(operation); own_len = inf_text_delete_operation_get_length(operation); other_pos = inf_text_insert_operation_get_position(against); other_len = inf_text_insert_operation_get_length(against); if(other_pos >= own_pos + own_len) { return inf_adopted_operation_copy(INF_ADOPTED_OPERATION(operation)); } else if(other_pos <= own_pos) { return INF_ADOPTED_OPERATION( iface->transform_position(operation, own_pos + other_len) ); } else { return INF_ADOPTED_OPERATION( iface->transform_split(operation, other_pos - own_pos, other_len) ); } } /** * inf_text_delete_operation_transform_delete: * @operation: A #InfTextDeleteOperation. * @against: Another #InfTextDeleteOperation. * @cid: The concurrency ID for the transformation. * * Returns a new operation that includes the effect of @against into * @operation. * * Return Value: A new #InfAdoptedOperation. **/ InfAdoptedOperation* inf_text_delete_operation_transform_delete(InfTextDeleteOperation* operation, InfTextDeleteOperation* against, InfAdoptedConcurrencyId cid) { InfTextDeleteOperationIface* iface; guint own_pos; guint own_len; guint other_pos; guint other_len; g_return_val_if_fail(INF_TEXT_IS_DELETE_OPERATION(operation), NULL); g_return_val_if_fail(INF_TEXT_IS_DELETE_OPERATION(against), NULL); iface = INF_TEXT_DELETE_OPERATION_GET_IFACE(operation); g_return_val_if_fail(iface->transform_position != NULL, NULL); g_return_val_if_fail(iface->transform_overlap != NULL, NULL); own_pos = inf_text_delete_operation_get_position(operation); own_len = inf_text_delete_operation_get_length(operation); other_pos = inf_text_delete_operation_get_position(against); other_len = inf_text_delete_operation_get_length(against); if(own_pos + own_len <= other_pos) { return inf_adopted_operation_copy(INF_ADOPTED_OPERATION(operation)); } else if(own_pos >= other_pos + other_len) { return INF_ADOPTED_OPERATION( iface->transform_position(operation, own_pos - other_len) ); } /* Somehow overlapping now */ else if(other_pos <= own_pos && other_pos + other_len >= own_pos + own_len) { return INF_ADOPTED_OPERATION( iface->transform_overlap( operation, against, other_pos, 0, own_pos - other_pos, own_len ) ); } else if(other_pos <= own_pos && other_pos + other_len < own_pos + own_len) { return INF_ADOPTED_OPERATION( iface->transform_overlap( operation, against, other_pos, 0, own_pos - other_pos, other_pos + other_len - own_pos ) ); } else if(other_pos > own_pos && other_pos + other_len >= own_pos + own_len) { return INF_ADOPTED_OPERATION( iface->transform_overlap( operation, against, own_pos, other_pos - own_pos, 0, own_pos + own_len - other_pos ) ); } else { return INF_ADOPTED_OPERATION( iface->transform_overlap( operation, against, own_pos, other_pos - own_pos, 0, other_len ) ); } } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinftext/inf-text-delete-operation.h0000644000175000017500000000737512264763732020327 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_TEXT_DELETE_OPERATION_H__ #define __INF_TEXT_DELETE_OPERATION_H__ #include #include #include #include G_BEGIN_DECLS #define INF_TEXT_TYPE_DELETE_OPERATION (inf_text_delete_operation_get_type()) #define INF_TEXT_DELETE_OPERATION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INF_TEXT_TYPE_DELETE_OPERATION, InfTextDeleteOperation)) #define INF_TEXT_IS_DELETE_OPERATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INF_TEXT_TYPE_DELETE_OPERATION)) #define INF_TEXT_DELETE_OPERATION_GET_IFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE((inst), INF_TEXT_TYPE_DELETE_OPERATION, InfTextDeleteOperationIface)) typedef struct _InfTextDeleteOperationIface InfTextDeleteOperationIface; struct _InfTextDeleteOperationIface { GTypeInterface parent; /* Virtual table */ guint(*get_position)(InfTextDeleteOperation* operation); guint(*get_length)(InfTextDeleteOperation* operation); InfTextDeleteOperation*(*transform_position)(InfTextDeleteOperation* op, guint position); InfTextDeleteOperation*(*transform_overlap)(InfTextDeleteOperation* op, InfTextDeleteOperation* other, guint position, guint begin, guint other_begin, guint length); InfAdoptedSplitOperation*(*transform_split)(InfTextDeleteOperation* op, guint split_pos, guint split_length); }; GType inf_text_delete_operation_get_type(void) G_GNUC_CONST; guint inf_text_delete_operation_get_position(InfTextDeleteOperation* operation); guint inf_text_delete_operation_get_length(InfTextDeleteOperation* operation); gboolean inf_text_delete_operation_need_concurrency_id(InfTextDeleteOperation* op, InfAdoptedOperation* against); InfAdoptedConcurrencyId inf_text_delete_operation_get_concurrency_id(InfTextDeleteOperation* op, InfAdoptedOperation* against); InfAdoptedOperation* inf_text_delete_operation_transform_insert(InfTextDeleteOperation* operation, InfTextInsertOperation* against, InfAdoptedConcurrencyId cid); InfAdoptedOperation* inf_text_delete_operation_transform_delete(InfTextDeleteOperation* operation, InfTextDeleteOperation* against, InfAdoptedConcurrencyId cid); G_END_DECLS #endif /* __INF_TEXT_DELETE_OPERATION_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinftext/inf-text-remote-delete-operation.h0000644000175000017500000000474312264763732021614 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_TEXT_REMOTE_DELETE_OPERATION_H__ #define __INF_TEXT_REMOTE_DELETE_OPERATION_H__ #include #include G_BEGIN_DECLS #define INF_TEXT_TYPE_REMOTE_DELETE_OPERATION (inf_text_remote_delete_operation_get_type()) #define INF_TEXT_REMOTE_DELETE_OPERATION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INF_TEXT_TYPE_REMOTE_DELETE_OPERATION, InfTextRemoteDeleteOperation)) #define INF_TEXT_REMOTE_DELETE_OPERATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INF_TEXT_TYPE_REMOTE_DELETE_OPERATION, InfTextRemoteDeleteOperationClass)) #define INF_TEXT_IS_REMOTE_DELETE_OPERATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INF_TEXT_TYPE_REMOTE_DELETE_OPERATION)) #define INF_TEXT_IS_REMOTE_DELETE_OPERATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INF_TEXT_TYPE_REMOTE_DELETE_OPERATION)) #define INF_TEXT_REMOTE_DELETE_OPERATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), INF_TEXT_TYPE_REMOTE_DELETE_OPERATION, InfTextRemoteDeleteOperationClass)) typedef struct _InfTextRemoteDeleteOperation InfTextRemoteDeleteOperation; typedef struct _InfTextRemoteDeleteOperationClass InfTextRemoteDeleteOperationClass; struct _InfTextRemoteDeleteOperationClass { GObjectClass parent_class; }; struct _InfTextRemoteDeleteOperation { GObject parent; }; GType inf_text_remote_delete_operation_get_type(void) G_GNUC_CONST; InfTextRemoteDeleteOperation* inf_text_remote_delete_operation_new(guint position, guint length); G_END_DECLS #endif /* __INF_TEXT_REMOTE_DELETE_OPERATION_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinftext/inf-text-insert-operation.h0000644000175000017500000000614412264763732020362 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_TEXT_INSERT_OPERATION_H__ #define __INF_TEXT_INSERT_OPERATION_H__ #include #include #include G_BEGIN_DECLS #define INF_TEXT_TYPE_INSERT_OPERATION (inf_text_insert_operation_get_type()) #define INF_TEXT_INSERT_OPERATION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INF_TEXT_TYPE_INSERT_OPERATION, InfTextInsertOperation)) #define INF_TEXT_IS_INSERT_OPERATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INF_TEXT_TYPE_INSERT_OPERATION)) #define INF_TEXT_INSERT_OPERATION_GET_IFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE((inst), INF_TEXT_TYPE_INSERT_OPERATION, InfTextInsertOperationIface)) typedef struct _InfTextInsertOperationIface InfTextInsertOperationIface; struct _InfTextInsertOperationIface { GTypeInterface parent; /* Virtual table */ guint(*get_position)(InfTextInsertOperation* operation); guint(*get_length)(InfTextInsertOperation* operation); InfTextInsertOperation*(*transform_position)(InfTextInsertOperation* op, guint position); }; GType inf_text_insert_operation_get_type(void) G_GNUC_CONST; guint inf_text_insert_operation_get_position(InfTextInsertOperation* operation); guint inf_text_insert_operation_get_length(InfTextInsertOperation* operation); gboolean inf_text_insert_operation_need_concurrency_id(InfTextInsertOperation* op, InfAdoptedOperation* against); InfAdoptedConcurrencyId inf_text_insert_operation_get_concurrency_id(InfTextInsertOperation* op, InfAdoptedOperation* against); InfAdoptedOperation* inf_text_insert_operation_transform_insert(InfTextInsertOperation* operation, InfTextInsertOperation* against, InfAdoptedConcurrencyId cid); InfAdoptedOperation* inf_text_insert_operation_transform_delete(InfTextInsertOperation* operation, InfTextDeleteOperation* against, InfAdoptedConcurrencyId cid); G_END_DECLS #endif /* __INF_TEXT_INSERT_OPERATION_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinftext/inf-text-buffer.h0000644000175000017500000001304612264763732016330 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_TEXT_BUFFER_H__ #define __INF_TEXT_BUFFER_H__ #include #include #include #include G_BEGIN_DECLS #define INF_TEXT_TYPE_BUFFER (inf_text_buffer_get_type()) #define INF_TEXT_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INF_TEXT_TYPE_BUFFER, InfTextBuffer)) #define INF_TEXT_IS_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INF_TEXT_TYPE_BUFFER)) #define INF_TEXT_BUFFER_GET_IFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE((inst), INF_TEXT_TYPE_BUFFER, InfTextBufferIface)) typedef struct _InfTextBuffer InfTextBuffer; typedef struct _InfTextBufferIface InfTextBufferIface; typedef struct _InfTextBufferIter InfTextBufferIter; struct _InfTextBufferIface { GTypeInterface parent; /* Virtual table */ const gchar* (*get_encoding)(InfTextBuffer* buffer); guint(*get_length)(InfTextBuffer* buffer); InfTextChunk*(*get_slice)(InfTextBuffer* buffer, guint pos, guint len); void(*insert_text)(InfTextBuffer* buffer, guint pos, InfTextChunk* chunk, InfUser* user); void(*erase_text)(InfTextBuffer* buffer, guint pos, guint len, InfUser* user); InfTextBufferIter*(*create_iter)(InfTextBuffer* buffer); void(*destroy_iter)(InfTextBuffer* buffer, InfTextBufferIter* iter); gboolean(*iter_next)(InfTextBuffer* buffer, InfTextBufferIter* iter); gboolean(*iter_prev)(InfTextBuffer* buffer, InfTextBufferIter* iter); gpointer(*iter_get_text)(InfTextBuffer* buffer, InfTextBufferIter* iter); guint(*iter_get_length)(InfTextBuffer* buffer, InfTextBufferIter* iter); gsize(*iter_get_bytes)(InfTextBuffer* buffer, InfTextBufferIter* iter); guint(*iter_get_author)(InfTextBuffer* buffer, InfTextBufferIter* iter); /* Signals */ void(*text_inserted)(InfTextBuffer* buffer, guint pos, InfTextChunk* chunk, InfUser* user); void(*text_erased)(InfTextBuffer* buffer, guint pos, InfTextChunk* chunk, InfUser* user); }; GType inf_text_buffer_get_type(void) G_GNUC_CONST; const gchar* inf_text_buffer_get_encoding(InfTextBuffer* buffer); guint inf_text_buffer_get_length(InfTextBuffer* buffer); InfTextChunk* inf_text_buffer_get_slice(InfTextBuffer* buffer, guint pos, guint len); void inf_text_buffer_insert_text(InfTextBuffer* buffer, guint pos, gconstpointer text, gsize bytes, guint len, InfUser* user); void inf_text_buffer_insert_chunk(InfTextBuffer* buffer, guint pos, InfTextChunk* chunk, InfUser* user); void inf_text_buffer_erase_text(InfTextBuffer* buffer, guint pos, guint len, InfUser* user); InfTextBufferIter* inf_text_buffer_create_iter(InfTextBuffer* buffer); void inf_text_buffer_destroy_iter(InfTextBuffer* buffer, InfTextBufferIter* iter); gboolean inf_text_buffer_iter_next(InfTextBuffer* buffer, InfTextBufferIter* iter); gboolean inf_text_buffer_iter_prev(InfTextBuffer* buffer, InfTextBufferIter* iter); gpointer inf_text_buffer_iter_get_text(InfTextBuffer* buffer, InfTextBufferIter* iter); guint inf_text_buffer_iter_get_length(InfTextBuffer* buffer, InfTextBufferIter* iter); gsize inf_text_buffer_iter_get_bytes(InfTextBuffer* buffer, InfTextBufferIter* iter); guint inf_text_buffer_iter_get_author(InfTextBuffer* buffer, InfTextBufferIter* iter); void inf_text_buffer_text_inserted(InfTextBuffer* buffer, guint pos, InfTextChunk* chunk, InfUser* user); void inf_text_buffer_text_erased(InfTextBuffer* buffer, guint pos, InfTextChunk* chunk, InfUser* user); G_END_DECLS #endif /* __INF_TEXT_BUFFER_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinftext/Makefile.in0000644000175000017500000012136712264766066015230 00000000000000# Makefile.in generated by automake 1.13.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = libinftext DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/mkinstalldirs $(top_srcdir)/depcomp \ $(libinftext_0_5_la_HEADERS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/libinfinity/inf-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" \ "$(DESTDIR)$(libinftext_0_5_ladir)" LTLIBRARIES = $(lib_LTLIBRARIES) am__DEPENDENCIES_1 = libinftext_0_5_la_DEPENDENCIES = ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_libinftext_0_5_la_OBJECTS = libinftext_0_5_la-inf-text-buffer.lo \ libinftext_0_5_la-inf-text-chunk.lo \ libinftext_0_5_la-inf-text-default-buffer.lo \ libinftext_0_5_la-inf-text-default-delete-operation.lo \ libinftext_0_5_la-inf-text-default-insert-operation.lo \ libinftext_0_5_la-inf-text-delete-operation.lo \ libinftext_0_5_la-inf-text-insert-operation.lo \ libinftext_0_5_la-inf-text-move-operation.lo \ libinftext_0_5_la-inf-text-remote-delete-operation.lo \ libinftext_0_5_la-inf-text-session.lo \ libinftext_0_5_la-inf-text-undo-grouping.lo \ libinftext_0_5_la-inf-text-user.lo libinftext_0_5_la_OBJECTS = $(am_libinftext_0_5_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libinftext_0_5_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(libinftext_0_5_la_LDFLAGS) $(LDFLAGS) \ -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -I$(top_builddir)/libinfinity 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) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libinftext_0_5_la_SOURCES) DIST_SOURCES = $(libinftext_0_5_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(libinftext_0_5_la_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBINFINITY_API_VERSION = @LIBINFINITY_API_VERSION@ LIBINFINITY_LIBTOOL_VERSION = @LIBINFINITY_LIBTOOL_VERSION@ LIBINFINITY_VERSION = @LIBINFINITY_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ avahi_CFLAGS = @avahi_CFLAGS@ avahi_LIBS = @avahi_LIBS@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gtk_requirement = @gtk_requirement@ gtk_version = @gtk_version@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infgtk_CFLAGS = @infgtk_CFLAGS@ infgtk_LIBS = @infgtk_LIBS@ infinity_CFLAGS = @infinity_CFLAGS@ infinity_LIBS = @infinity_LIBS@ infinoted_CFLAGS = @infinoted_CFLAGS@ infinoted_LIBS = @infinoted_LIBS@ infodir = @infodir@ inftext_CFLAGS = @inftext_CFLAGS@ inftext_LIBS = @inftext_LIBS@ inftextgtk_CFLAGS = @inftextgtk_CFLAGS@ inftextgtk_LIBS = @inftextgtk_LIBS@ install_sh = @install_sh@ libdaemon_CFLAGS = @libdaemon_CFLAGS@ libdaemon_LIBS = @libdaemon_LIBS@ 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@ # TODO: Find a way to have the version number set automatically. lib_LTLIBRARIES = libinftext-0.5.la libinftext_0_5_la_CPPFLAGS = \ -I$(top_srcdir) \ $(inftext_CFLAGS) \ $(infinity_CFLAGS) libinftext_0_5_la_LDFLAGS = \ -no-undefined \ -version-info $(LIBINFINITY_LIBTOOL_VERSION) libinftext_0_5_la_LIBADD = \ ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ $(inftext_LIBS) \ $(infinity_LIBS) libinftext_0_5_ladir = \ $(includedir)/libinftext-$(LIBINFINITY_API_VERSION)/libinftext libinftext_0_5_la_HEADERS = \ inf-text-buffer.h \ inf-text-chunk.h \ inf-text-default-buffer.h \ inf-text-default-delete-operation.h \ inf-text-default-insert-operation.h \ inf-text-delete-operation.h \ inf-text-insert-operation.h \ inf-text-move-operation.h \ inf-text-operations.h \ inf-text-remote-delete-operation.h \ inf-text-session.h \ inf-text-undo-grouping.h \ inf-text-user.h libinftext_0_5_la_SOURCES = \ inf-text-buffer.c \ inf-text-chunk.c \ inf-text-default-buffer.c \ inf-text-default-delete-operation.c \ inf-text-default-insert-operation.c \ inf-text-delete-operation.c \ inf-text-insert-operation.c \ inf-text-move-operation.c \ inf-text-remote-delete-operation.c \ inf-text-session.c \ inf-text-undo-grouping.c \ inf-text-user.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libinftext/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu libinftext/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libinftext-0.5.la: $(libinftext_0_5_la_OBJECTS) $(libinftext_0_5_la_DEPENDENCIES) $(EXTRA_libinftext_0_5_la_DEPENDENCIES) $(AM_V_CCLD)$(libinftext_0_5_la_LINK) -rpath $(libdir) $(libinftext_0_5_la_OBJECTS) $(libinftext_0_5_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinftext_0_5_la-inf-text-buffer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinftext_0_5_la-inf-text-chunk.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinftext_0_5_la-inf-text-default-buffer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinftext_0_5_la-inf-text-default-delete-operation.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinftext_0_5_la-inf-text-default-insert-operation.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinftext_0_5_la-inf-text-delete-operation.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinftext_0_5_la-inf-text-insert-operation.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinftext_0_5_la-inf-text-move-operation.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinftext_0_5_la-inf-text-remote-delete-operation.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinftext_0_5_la-inf-text-session.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinftext_0_5_la-inf-text-undo-grouping.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinftext_0_5_la-inf-text-user.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< libinftext_0_5_la-inf-text-buffer.lo: inf-text-buffer.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinftext_0_5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinftext_0_5_la-inf-text-buffer.lo -MD -MP -MF $(DEPDIR)/libinftext_0_5_la-inf-text-buffer.Tpo -c -o libinftext_0_5_la-inf-text-buffer.lo `test -f 'inf-text-buffer.c' || echo '$(srcdir)/'`inf-text-buffer.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinftext_0_5_la-inf-text-buffer.Tpo $(DEPDIR)/libinftext_0_5_la-inf-text-buffer.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-text-buffer.c' object='libinftext_0_5_la-inf-text-buffer.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinftext_0_5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinftext_0_5_la-inf-text-buffer.lo `test -f 'inf-text-buffer.c' || echo '$(srcdir)/'`inf-text-buffer.c libinftext_0_5_la-inf-text-chunk.lo: inf-text-chunk.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinftext_0_5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinftext_0_5_la-inf-text-chunk.lo -MD -MP -MF $(DEPDIR)/libinftext_0_5_la-inf-text-chunk.Tpo -c -o libinftext_0_5_la-inf-text-chunk.lo `test -f 'inf-text-chunk.c' || echo '$(srcdir)/'`inf-text-chunk.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinftext_0_5_la-inf-text-chunk.Tpo $(DEPDIR)/libinftext_0_5_la-inf-text-chunk.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-text-chunk.c' object='libinftext_0_5_la-inf-text-chunk.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinftext_0_5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinftext_0_5_la-inf-text-chunk.lo `test -f 'inf-text-chunk.c' || echo '$(srcdir)/'`inf-text-chunk.c libinftext_0_5_la-inf-text-default-buffer.lo: inf-text-default-buffer.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinftext_0_5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinftext_0_5_la-inf-text-default-buffer.lo -MD -MP -MF $(DEPDIR)/libinftext_0_5_la-inf-text-default-buffer.Tpo -c -o libinftext_0_5_la-inf-text-default-buffer.lo `test -f 'inf-text-default-buffer.c' || echo '$(srcdir)/'`inf-text-default-buffer.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinftext_0_5_la-inf-text-default-buffer.Tpo $(DEPDIR)/libinftext_0_5_la-inf-text-default-buffer.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-text-default-buffer.c' object='libinftext_0_5_la-inf-text-default-buffer.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinftext_0_5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinftext_0_5_la-inf-text-default-buffer.lo `test -f 'inf-text-default-buffer.c' || echo '$(srcdir)/'`inf-text-default-buffer.c libinftext_0_5_la-inf-text-default-delete-operation.lo: inf-text-default-delete-operation.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinftext_0_5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinftext_0_5_la-inf-text-default-delete-operation.lo -MD -MP -MF $(DEPDIR)/libinftext_0_5_la-inf-text-default-delete-operation.Tpo -c -o libinftext_0_5_la-inf-text-default-delete-operation.lo `test -f 'inf-text-default-delete-operation.c' || echo '$(srcdir)/'`inf-text-default-delete-operation.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinftext_0_5_la-inf-text-default-delete-operation.Tpo $(DEPDIR)/libinftext_0_5_la-inf-text-default-delete-operation.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-text-default-delete-operation.c' object='libinftext_0_5_la-inf-text-default-delete-operation.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinftext_0_5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinftext_0_5_la-inf-text-default-delete-operation.lo `test -f 'inf-text-default-delete-operation.c' || echo '$(srcdir)/'`inf-text-default-delete-operation.c libinftext_0_5_la-inf-text-default-insert-operation.lo: inf-text-default-insert-operation.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinftext_0_5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinftext_0_5_la-inf-text-default-insert-operation.lo -MD -MP -MF $(DEPDIR)/libinftext_0_5_la-inf-text-default-insert-operation.Tpo -c -o libinftext_0_5_la-inf-text-default-insert-operation.lo `test -f 'inf-text-default-insert-operation.c' || echo '$(srcdir)/'`inf-text-default-insert-operation.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinftext_0_5_la-inf-text-default-insert-operation.Tpo $(DEPDIR)/libinftext_0_5_la-inf-text-default-insert-operation.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-text-default-insert-operation.c' object='libinftext_0_5_la-inf-text-default-insert-operation.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinftext_0_5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinftext_0_5_la-inf-text-default-insert-operation.lo `test -f 'inf-text-default-insert-operation.c' || echo '$(srcdir)/'`inf-text-default-insert-operation.c libinftext_0_5_la-inf-text-delete-operation.lo: inf-text-delete-operation.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinftext_0_5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinftext_0_5_la-inf-text-delete-operation.lo -MD -MP -MF $(DEPDIR)/libinftext_0_5_la-inf-text-delete-operation.Tpo -c -o libinftext_0_5_la-inf-text-delete-operation.lo `test -f 'inf-text-delete-operation.c' || echo '$(srcdir)/'`inf-text-delete-operation.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinftext_0_5_la-inf-text-delete-operation.Tpo $(DEPDIR)/libinftext_0_5_la-inf-text-delete-operation.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-text-delete-operation.c' object='libinftext_0_5_la-inf-text-delete-operation.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinftext_0_5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinftext_0_5_la-inf-text-delete-operation.lo `test -f 'inf-text-delete-operation.c' || echo '$(srcdir)/'`inf-text-delete-operation.c libinftext_0_5_la-inf-text-insert-operation.lo: inf-text-insert-operation.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinftext_0_5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinftext_0_5_la-inf-text-insert-operation.lo -MD -MP -MF $(DEPDIR)/libinftext_0_5_la-inf-text-insert-operation.Tpo -c -o libinftext_0_5_la-inf-text-insert-operation.lo `test -f 'inf-text-insert-operation.c' || echo '$(srcdir)/'`inf-text-insert-operation.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinftext_0_5_la-inf-text-insert-operation.Tpo $(DEPDIR)/libinftext_0_5_la-inf-text-insert-operation.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-text-insert-operation.c' object='libinftext_0_5_la-inf-text-insert-operation.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinftext_0_5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinftext_0_5_la-inf-text-insert-operation.lo `test -f 'inf-text-insert-operation.c' || echo '$(srcdir)/'`inf-text-insert-operation.c libinftext_0_5_la-inf-text-move-operation.lo: inf-text-move-operation.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinftext_0_5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinftext_0_5_la-inf-text-move-operation.lo -MD -MP -MF $(DEPDIR)/libinftext_0_5_la-inf-text-move-operation.Tpo -c -o libinftext_0_5_la-inf-text-move-operation.lo `test -f 'inf-text-move-operation.c' || echo '$(srcdir)/'`inf-text-move-operation.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinftext_0_5_la-inf-text-move-operation.Tpo $(DEPDIR)/libinftext_0_5_la-inf-text-move-operation.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-text-move-operation.c' object='libinftext_0_5_la-inf-text-move-operation.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinftext_0_5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinftext_0_5_la-inf-text-move-operation.lo `test -f 'inf-text-move-operation.c' || echo '$(srcdir)/'`inf-text-move-operation.c libinftext_0_5_la-inf-text-remote-delete-operation.lo: inf-text-remote-delete-operation.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinftext_0_5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinftext_0_5_la-inf-text-remote-delete-operation.lo -MD -MP -MF $(DEPDIR)/libinftext_0_5_la-inf-text-remote-delete-operation.Tpo -c -o libinftext_0_5_la-inf-text-remote-delete-operation.lo `test -f 'inf-text-remote-delete-operation.c' || echo '$(srcdir)/'`inf-text-remote-delete-operation.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinftext_0_5_la-inf-text-remote-delete-operation.Tpo $(DEPDIR)/libinftext_0_5_la-inf-text-remote-delete-operation.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-text-remote-delete-operation.c' object='libinftext_0_5_la-inf-text-remote-delete-operation.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinftext_0_5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinftext_0_5_la-inf-text-remote-delete-operation.lo `test -f 'inf-text-remote-delete-operation.c' || echo '$(srcdir)/'`inf-text-remote-delete-operation.c libinftext_0_5_la-inf-text-session.lo: inf-text-session.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinftext_0_5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinftext_0_5_la-inf-text-session.lo -MD -MP -MF $(DEPDIR)/libinftext_0_5_la-inf-text-session.Tpo -c -o libinftext_0_5_la-inf-text-session.lo `test -f 'inf-text-session.c' || echo '$(srcdir)/'`inf-text-session.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinftext_0_5_la-inf-text-session.Tpo $(DEPDIR)/libinftext_0_5_la-inf-text-session.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-text-session.c' object='libinftext_0_5_la-inf-text-session.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinftext_0_5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinftext_0_5_la-inf-text-session.lo `test -f 'inf-text-session.c' || echo '$(srcdir)/'`inf-text-session.c libinftext_0_5_la-inf-text-undo-grouping.lo: inf-text-undo-grouping.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinftext_0_5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinftext_0_5_la-inf-text-undo-grouping.lo -MD -MP -MF $(DEPDIR)/libinftext_0_5_la-inf-text-undo-grouping.Tpo -c -o libinftext_0_5_la-inf-text-undo-grouping.lo `test -f 'inf-text-undo-grouping.c' || echo '$(srcdir)/'`inf-text-undo-grouping.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinftext_0_5_la-inf-text-undo-grouping.Tpo $(DEPDIR)/libinftext_0_5_la-inf-text-undo-grouping.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-text-undo-grouping.c' object='libinftext_0_5_la-inf-text-undo-grouping.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinftext_0_5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinftext_0_5_la-inf-text-undo-grouping.lo `test -f 'inf-text-undo-grouping.c' || echo '$(srcdir)/'`inf-text-undo-grouping.c libinftext_0_5_la-inf-text-user.lo: inf-text-user.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinftext_0_5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinftext_0_5_la-inf-text-user.lo -MD -MP -MF $(DEPDIR)/libinftext_0_5_la-inf-text-user.Tpo -c -o libinftext_0_5_la-inf-text-user.lo `test -f 'inf-text-user.c' || echo '$(srcdir)/'`inf-text-user.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinftext_0_5_la-inf-text-user.Tpo $(DEPDIR)/libinftext_0_5_la-inf-text-user.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-text-user.c' object='libinftext_0_5_la-inf-text-user.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinftext_0_5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinftext_0_5_la-inf-text-user.lo `test -f 'inf-text-user.c' || echo '$(srcdir)/'`inf-text-user.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-libinftext_0_5_laHEADERS: $(libinftext_0_5_la_HEADERS) @$(NORMAL_INSTALL) @list='$(libinftext_0_5_la_HEADERS)'; test -n "$(libinftext_0_5_ladir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(libinftext_0_5_ladir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libinftext_0_5_ladir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libinftext_0_5_ladir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(libinftext_0_5_ladir)" || exit $$?; \ done uninstall-libinftext_0_5_laHEADERS: @$(NORMAL_UNINSTALL) @list='$(libinftext_0_5_la_HEADERS)'; test -n "$(libinftext_0_5_ladir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(libinftext_0_5_ladir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(libinftext_0_5_ladir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-libinftext_0_5_laHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES \ uninstall-libinftext_0_5_laHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-libLTLIBRARIES \ install-libinftext_0_5_laHEADERS install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES \ uninstall-libinftext_0_5_laHEADERS # 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: libinfinity-0.5.5/libinftext/inf-text-undo-grouping.h0000644000175000017500000000472612264763732017661 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_TEXT_UNDO_GROUPING_H__ #define __INF_TEXT_UNDO_GROUPING_H__ #include #include G_BEGIN_DECLS #define INF_TEXT_TYPE_UNDO_GROUPING (inf_text_undo_grouping_get_type()) #define INF_TEXT_UNDO_GROUPING(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INF_TEXT_TYPE_UNDO_GROUPING, InfTextUndoGrouping)) #define INF_TEXT_UNDO_GROUPING_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INF_TEXT_TYPE_UNDO_GROUPING, InfTextUndoGroupingClass)) #define INF_TEXT_IS_UNDO_GROUPING(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INF_TEXT_TYPE_UNDO_GROUPING)) #define INF_TEXT_IS_UNDO_GROUPING_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INF_TEXT_TYPE_UNDO_GROUPING)) #define INF_TEXT_UNDO_GROUPING_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), INF_TEXT_TYPE_UNDO_GROUPING, InfTextUndoGroupingClass)) typedef struct _InfTextUndoGrouping InfTextUndoGrouping; typedef struct _InfTextUndoGroupingClass InfTextUndoGroupingClass; /** * InfATextUndoGroupingClass: * * This structure does not contain any public fields. */ struct _InfTextUndoGroupingClass { /*< private >*/ InfAdoptedUndoGroupingClass parent_class; }; /** * InfTextUndoGrouping: * * #InfTextUndoGrouping is an opaque data type. You should only access it via * the public API functions. */ struct _InfTextUndoGrouping { /*< private >*/ InfAdoptedUndoGrouping parent; }; GType inf_text_undo_grouping_get_type(void); InfTextUndoGrouping* inf_text_undo_grouping_new(void); G_END_DECLS #endif /* __INF_TEXT_UNDO_GROUPING_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinftext/inf-text-chunk.h0000644000175000017500000000624612264763732016173 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_TEXT_CHUNK_H__ #define __INF_TEXT_CHUNK_H__ #include #include G_BEGIN_DECLS #define INF_TEXT_TYPE_CHUNK (inf_text_chunk_get_type()) typedef struct _InfTextChunk InfTextChunk; typedef struct _InfTextChunkIter InfTextChunkIter; struct _InfTextChunkIter { InfTextChunk* chunk; GSequenceIter* first; GSequenceIter* second; }; GType inf_text_chunk_get_type(void) G_GNUC_CONST; InfTextChunk* inf_text_chunk_new(const gchar* encoding); InfTextChunk* inf_text_chunk_copy(InfTextChunk* self); void inf_text_chunk_free(InfTextChunk* self); const gchar* inf_text_chunk_get_encoding(InfTextChunk* self); guint inf_text_chunk_get_length(InfTextChunk* self); InfTextChunk* inf_text_chunk_substring(InfTextChunk* self, guint begin, guint length); void inf_text_chunk_insert_text(InfTextChunk* self, guint offset, gconstpointer text, gsize bytes, guint length, guint author); void inf_text_chunk_insert_chunk(InfTextChunk* self, guint offset, InfTextChunk* text); void inf_text_chunk_erase(InfTextChunk* self, guint begin, guint length); gpointer inf_text_chunk_get_text(InfTextChunk* self, gsize* length); gboolean inf_text_chunk_equal(InfTextChunk* self, InfTextChunk* other); #if 0 void inf_text_chunk_to_xml(InfTextChunk* self, xmlNodePtr xml); InfTextChunk* inf_text_chunk_from_xml(xmlNodePtr xml, const gchar* encoding, GError** error); #endif gboolean inf_text_chunk_iter_init(InfTextChunk* self, InfTextChunkIter* iter); gboolean inf_text_chunk_iter_next(InfTextChunkIter* iter); gboolean inf_text_chunk_iter_prev(InfTextChunkIter* iter); gconstpointer inf_text_chunk_iter_get_text(InfTextChunkIter* iter); guint inf_text_chunk_iter_get_length(InfTextChunkIter* iter); gsize inf_text_chunk_iter_get_bytes(InfTextChunkIter* iter); guint inf_text_chunk_iter_get_author(InfTextChunkIter* iter); G_END_DECLS #endif /* __INF_TEXT_CHUNK_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinftext/inf-text-default-delete-operation.h0000644000175000017500000000515712264763732021745 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_TEXT_DEFAULT_DELETE_OPERATION_H__ #define __INF_TEXT_DEFAULT_DELETE_OPERATION_H__ #include #include G_BEGIN_DECLS #define INF_TEXT_TYPE_DEFAULT_DELETE_OPERATION (inf_text_default_delete_operation_get_type()) #define INF_TEXT_DEFAULT_DELETE_OPERATION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INF_TEXT_TYPE_DEFAULT_DELETE_OPERATION, InfTextDefaultDeleteOperation)) #define INF_TEXT_DEFAULT_DELETE_OPERATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INF_TEXT_TYPE_DEFAULT_DELETE_OPERATION, InfTextDefaultDeleteOperationClass)) #define INF_TEXT_IS_DEFAULT_DELETE_OPERATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INF_TEXT_TYPE_DEFAULT_DELETE_OPERATION)) #define INF_TEXT_IS_DEFAULT_DELETE_OPERATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INF_TEXT_TYPE_DEFAULT_DELETE_OPERATION)) #define INF_TEXT_DEFAULT_DELETE_OPERATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), INF_TEXT_TYPE_DEFAULT_DELETE_OPERATION, InfTextDefaultDeleteOperationClass)) typedef struct _InfTextDefaultDeleteOperation InfTextDefaultDeleteOperation; typedef struct _InfTextDefaultDeleteOperationClass InfTextDefaultDeleteOperationClass; struct _InfTextDefaultDeleteOperationClass { GObjectClass parent_class; }; struct _InfTextDefaultDeleteOperation { GObject parent; }; GType inf_text_default_delete_operation_get_type(void) G_GNUC_CONST; InfTextDefaultDeleteOperation* inf_text_default_delete_operation_new(guint position, InfTextChunk* chunk); InfTextChunk* inf_text_default_delete_operation_get_chunk( InfTextDefaultDeleteOperation* operation); G_END_DECLS #endif /* __INF_TEXT_DEFAULT_DELETE_OPERATION_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinftext/inf-text-session.c0000644000175000017500000015472412264763732016546 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include /* TODO: Optionally broadcast operations delayed to merge adjacent operations * and send as a single request. */ typedef struct _InfTextSessionLocalUser InfTextSessionLocalUser; struct _InfTextSessionLocalUser { InfTextSession* session; InfTextUser* user; GTimeVal last_caret_update; InfIoTimeout* caret_timeout; }; typedef struct _InfTextSessionPrivate InfTextSessionPrivate; struct _InfTextSessionPrivate { guint caret_update_interval; GSList* local_users; gboolean apply_request; }; enum { PROP_0, PROP_CARET_UPDATE_INTERVAL }; typedef struct _InfTextSessionInsertForeachData InfTextSessionInsertForeachData; typedef struct _InfTextSessionEraseForeachData InfTextSessionEraseForeachData; struct _InfTextSessionInsertForeachData { guint position; InfTextChunk* chunk; InfUser* user; }; struct _InfTextSessionEraseForeachData { guint position; guint length; InfUser* user; }; #define INF_TEXT_SESSION_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), INF_TEXT_TYPE_SESSION, InfTextSessionPrivate)) static InfAdoptedSessionClass* parent_class; static GQuark inf_text_session_error_quark; /* * Utility functions */ /* Returns the difference between two GTimeVal, in milliseconds */ static guint inf_text_session_timeval_diff(GTimeVal* first, GTimeVal* second) { g_assert(first->tv_sec > second->tv_sec || (first->tv_sec == second->tv_sec && first->tv_usec >= second->tv_usec)); /* Don't risk overflow, don't need to convert to signed int */ return (first->tv_sec - second->tv_sec) * 1000 + (first->tv_usec+500)/1000 - (second->tv_usec+500)/1000; } /* Converts at most *bytes bytes with cd and writes the result, which are * at most 1024 bytes, into xml, setting the given author. *bytes will be * set to the number of bytes not yet processed. */ static void inf_text_session_segment_to_xml(GIConv* cd, xmlNodePtr xml, gconstpointer text, gsize* bytes, /* in/out */ guint author) { gchar utf8_text[1024]; gsize result; gsize bytes_left; gchar* inbuf; gchar* outbuf; bytes_left = 1024; inbuf = *(gchar**)(gpointer)&text; /* cast const away without warning */ outbuf = utf8_text; result = g_iconv( *cd, &inbuf, bytes, &outbuf, &bytes_left ); /* Conversion into UTF-8 should always succeed */ g_assert(result == 0 || errno == E2BIG); inf_xml_util_add_child_text(xml, utf8_text, 1024 - bytes_left); inf_xml_util_set_attribute_uint(xml, "author", author); } static gpointer inf_text_session_segment_from_xml(GIConv* cd, xmlNodePtr xml, guint* length, gsize* bytes, guint* author, GError** error) { gsize bytes_read; gchar* utf8_text; gpointer text; if(!inf_xml_util_get_attribute_uint_required(xml, "author", author, error)) return NULL; utf8_text = inf_xml_util_get_child_text(xml, &bytes_read, length, error); if(!utf8_text) return NULL; text = g_convert_with_iconv( utf8_text, bytes_read, *cd, NULL, bytes, error ); g_free(utf8_text); return text; } /* * Caret/Selection handling */ static InfTextSessionLocalUser* inf_text_session_find_local_user(InfTextSession* session, InfTextUser* user) { InfTextSessionPrivate* priv; GSList* item; InfTextSessionLocalUser* local; priv = INF_TEXT_SESSION_PRIVATE(session); for(item = priv->local_users; item != NULL; item = g_slist_next(item)) { local = (InfTextSessionLocalUser*)item->data; if(local->user == user) return local; } return NULL; } static void inf_text_session_broadcast_caret_selection(InfTextSession* session, InfTextSessionLocalUser* local) { InfAdoptedOperation* operation; InfAdoptedAlgorithm* algorithm; InfAdoptedRequest* request; guint position; int sel; algorithm = inf_adopted_session_get_algorithm(INF_ADOPTED_SESSION(session)); position = inf_text_user_get_caret_position(local->user); sel = inf_text_user_get_selection_length(local->user); operation = INF_ADOPTED_OPERATION( inf_text_move_operation_new(position, sel) ); request = inf_adopted_algorithm_generate_request_noexec( algorithm, INF_ADOPTED_USER(local->user), operation ); g_object_unref(operation); inf_adopted_session_broadcast_request( INF_ADOPTED_SESSION(session), request ); g_object_unref(request); g_get_current_time(&local->last_caret_update); if(local->caret_timeout != NULL) { inf_io_remove_timeout( inf_adopted_session_get_io(INF_ADOPTED_SESSION(session)), local->caret_timeout ); local->caret_timeout = NULL; } } static void inf_text_session_caret_update_timeout_func(gpointer user_data) { InfTextSessionLocalUser* local; local = (InfTextSessionLocalUser*)user_data; local->caret_timeout = NULL; inf_text_session_broadcast_caret_selection(local->session, local); } static void inf_text_session_selection_changed_cb(InfTextUser* user, guint position, gint sel, gboolean by_request, gpointer user_data) { InfTextSession* session; InfTextSessionPrivate* priv; InfTextSessionLocalUser* local; GTimeVal current; guint diff; session = INF_TEXT_SESSION(user_data); priv = INF_TEXT_SESSION_PRIVATE(session); /* We should block all changes that have by_request set to FALSE... breaks * if someone else does that... should maybe emit a warning instead. */ g_assert( (priv->apply_request == TRUE && by_request == FALSE) || (priv->apply_request == FALSE && by_request == TRUE)); if(priv->apply_request == FALSE) { local = inf_text_session_find_local_user(session, user); g_assert(local != NULL); g_get_current_time(¤t); diff = inf_text_session_timeval_diff(¤t, &local->last_caret_update); if(diff < priv->caret_update_interval) { if(local->caret_timeout == NULL) { /* TODO: Interrupt timeout if a -caret request is sent from that * local user. */ local->caret_timeout = inf_io_add_timeout( inf_adopted_session_get_io(INF_ADOPTED_SESSION(local->session)), priv->caret_update_interval - diff, inf_text_session_caret_update_timeout_func, local, NULL ); } } else { inf_text_session_broadcast_caret_selection(session, local); } } } static void inf_text_session_add_local_user(InfTextSession* session, InfTextUser* user) { InfTextSessionPrivate* priv; InfTextSessionLocalUser* local; priv = INF_TEXT_SESSION_PRIVATE(session); local = g_slice_new(InfTextSessionLocalUser); local->session = session; local->user = user; g_get_current_time(&local->last_caret_update); local->caret_timeout = NULL; priv->local_users = g_slist_prepend(priv->local_users, local); g_signal_connect_after( G_OBJECT(user), "selection-changed", G_CALLBACK(inf_text_session_selection_changed_cb), session ); } static void inf_text_session_remove_local_user(InfTextSession* session, InfTextSessionLocalUser* local) { InfTextSessionPrivate* priv; priv = INF_TEXT_SESSION_PRIVATE(session); if(local->caret_timeout != NULL) { inf_io_remove_timeout( inf_adopted_session_get_io(INF_ADOPTED_SESSION(session)), local->caret_timeout ); } inf_signal_handlers_disconnect_by_func( G_OBJECT(local->user), G_CALLBACK(inf_text_session_selection_changed_cb), session ); g_slice_free(InfTextSessionLocalUser, local); priv->local_users = g_slist_remove(priv->local_users, local); } static void inf_text_session_local_user_added_cb(InfUserTable* user_table, InfUser* user, gpointer user_data) { g_assert(INF_TEXT_IS_USER(user)); inf_text_session_add_local_user( INF_TEXT_SESSION(user_data), INF_TEXT_USER(user) ); } static void inf_text_session_local_user_removed_cb(InfUserTable* user_table, InfUser* user, gpointer user_data) { InfTextSession* session; InfTextSessionLocalUser* local; g_assert(INF_TEXT_IS_USER(user)); session = INF_TEXT_SESSION(user_data); local = inf_text_session_find_local_user(session, INF_TEXT_USER(user)); g_assert(local != NULL); inf_text_session_remove_local_user(session, local); } static void inf_text_session_block_local_users_selection_changed(InfTextSession* session) { InfTextSessionPrivate* priv; GSList* item; InfTextSessionLocalUser* local; priv = INF_TEXT_SESSION_PRIVATE(session); for(item = priv->local_users; item != NULL; item = g_slist_next(item)) { local = (InfTextSessionLocalUser*)item->data; inf_signal_handlers_block_by_func( G_OBJECT(local->user), G_CALLBACK(inf_text_session_selection_changed_cb), session ); } } static void inf_text_session_unblock_local_users_selection_changed(InfTextSession* sess) { InfTextSessionPrivate* priv; GSList* item; InfTextSessionLocalUser* local; priv = INF_TEXT_SESSION_PRIVATE(sess); for(item = priv->local_users; item != NULL; item = g_slist_next(item)) { local = (InfTextSessionLocalUser*)item->data; inf_signal_handlers_unblock_by_func( G_OBJECT(local->user), G_CALLBACK(inf_text_session_selection_changed_cb), sess ); } } static void inf_text_session_buffer_text_inserted_cb_foreach_func(InfUser* user, gpointer user_data) { InfTextSessionInsertForeachData* data; guint position; gint length; data = (InfTextSessionInsertForeachData*)user_data; if(inf_user_get_status(user) != INF_USER_UNAVAILABLE) { /* TODO: Handle separately if insert-caret */ position = inf_text_user_get_caret_position(INF_TEXT_USER(user)); length = inf_text_user_get_selection_length(INF_TEXT_USER(user)); inf_text_move_operation_transform_insert( data->position, inf_text_chunk_get_length(data->chunk), &position, &length, /* Right gravity for local insertions, left gravity for remote ones */ user == data->user ? FALSE : TRUE ); inf_text_user_set_selection( INF_TEXT_USER(user), position, length, user == data->user ? TRUE : FALSE ); } } static void inf_text_session_buffer_text_erased_cb_foreach_func(InfUser* user, gpointer user_data) { InfTextSessionEraseForeachData* data; guint position; gint length; data = (InfTextSessionEraseForeachData*)user_data; if(inf_user_get_status(user) != INF_USER_UNAVAILABLE) { /* TODO: Handle separately if erase-caret */ position = inf_text_user_get_caret_position(INF_TEXT_USER(user)); length = inf_text_user_get_selection_length(INF_TEXT_USER(user)); inf_text_move_operation_transform_delete( data->position, data->length, &position, &length ); inf_text_user_set_selection( INF_TEXT_USER(user), position, length, user == data->user ? TRUE : FALSE ); } } /* The after handlers readjust the caret and selection properties of the * users. Block handlers so we don't broadcast this. */ static void inf_text_session_buffer_text_inserted_cb(InfTextBuffer* buffer, guint pos, InfTextChunk* chunk, InfUser* user, gpointer user_data) { InfTextSession* session; InfTextSessionPrivate* priv; InfAdoptedOperation* operation; InfAdoptedAlgorithm* algorithm; InfAdoptedRequest* request; InfUserTable* user_table; InfTextSessionInsertForeachData data; g_assert(INF_TEXT_IS_USER(user)); session = INF_TEXT_SESSION(user_data); priv = INF_TEXT_SESSION_PRIVATE(session); user_table = inf_session_get_user_table(INF_SESSION(session)); if(priv->apply_request == FALSE) { operation = INF_ADOPTED_OPERATION( inf_text_default_insert_operation_new(pos, chunk) ); algorithm = inf_adopted_session_get_algorithm( INF_ADOPTED_SESSION(session) ); request = inf_adopted_algorithm_generate_request_noexec( algorithm, INF_ADOPTED_USER(user), operation ); inf_adopted_session_broadcast_request( INF_ADOPTED_SESSION(session), request ); g_object_unref(request); g_object_unref(operation); } data.position = pos; data.chunk = chunk; data.user = user; inf_text_session_block_local_users_selection_changed(session); inf_user_table_foreach_user( user_table, inf_text_session_buffer_text_inserted_cb_foreach_func, &data ); #if 0 /* TODO: If that was an insert-caret request, then do this: */ if(user != NULL) { inf_text_user_set_selection( INF_TEXT_USER(user), pos + inf_text_chunk_get_length(chunk), 0, TRUE ); } #endif inf_text_session_unblock_local_users_selection_changed(session); } static void inf_text_session_buffer_text_erased_cb(InfTextBuffer* buffer, guint pos, InfTextChunk* chunk, InfUser* user, gpointer user_data) { InfTextSession* session; InfTextSessionPrivate* priv; InfAdoptedOperation* operation; InfAdoptedAlgorithm* algorithm; InfAdoptedRequest* request; InfUserTable* user_table; InfTextSessionEraseForeachData data; g_assert(INF_TEXT_IS_USER(user)); session = INF_TEXT_SESSION(user_data); priv = INF_TEXT_SESSION_PRIVATE(session); user_table = inf_session_get_user_table(INF_SESSION(session)); if(priv->apply_request == FALSE) { operation = INF_ADOPTED_OPERATION( inf_text_default_delete_operation_new(pos, chunk) ); algorithm = inf_adopted_session_get_algorithm( INF_ADOPTED_SESSION(session) ); request = inf_adopted_algorithm_generate_request_noexec( algorithm, INF_ADOPTED_USER(user), operation ); inf_adopted_session_broadcast_request( INF_ADOPTED_SESSION(session), request ); g_object_unref(request); g_object_unref(operation); } data.position = pos; data.length = inf_text_chunk_get_length(chunk); data.user = user; inf_text_session_block_local_users_selection_changed(session); inf_user_table_foreach_user( user_table, inf_text_session_buffer_text_erased_cb_foreach_func, &data ); /* TODO: If that was an erase-caret request, then do this: */ #if 0 if(user != NULL) inf_text_user_set_selection(INF_TEXT_USER(user), pos, 0, TRUE); #endif inf_text_session_unblock_local_users_selection_changed(session); } /* Remember when a buffer operation happens in response to the algorithm * applying a request so we don't re-broadcast incoming requests, and so that * we don't broadcast the effect of an Undo if the user calls * inf_adopted_session_undo(). */ static void inf_text_session_apply_request_cb_before(InfAdoptedAlgorithm* algorithm, InfAdoptedUser* user, InfAdoptedRequest* request, gpointer user_data) { InfTextSession* session; InfTextSessionPrivate* priv; /*InfTextBuffer* buffer;*/ session = INF_TEXT_SESSION(user_data); priv = INF_TEXT_SESSION_PRIVATE(session); /*buffer = INF_TEXT_BUFFER(inf_session_get_buffer(INF_SESSION(session)));*/ priv->apply_request = TRUE; } static void inf_text_session_apply_request_cb_after(InfAdoptedAlgorithm* algorithm, InfAdoptedUser* user, InfAdoptedRequest* request, gpointer user_data) { InfTextSession* session; InfTextSessionPrivate* priv; /*InfTextBuffer* buffer;*/ session = INF_TEXT_SESSION(user_data); priv = INF_TEXT_SESSION_PRIVATE(session); /*buffer = INF_TEXT_BUFFER(inf_session_get_buffer(INF_SESSION(session)));*/ priv->apply_request = FALSE; } static void inf_text_session_init_text_handlers_user_foreach_func(InfUser* user, gpointer user_data) { g_assert(INF_TEXT_IS_USER(user)); inf_text_session_add_local_user( INF_TEXT_SESSION(user_data), INF_TEXT_USER(user) ); } static void inf_text_session_init_text_handlers(InfTextSession* session) { InfTextBuffer* buffer; InfAdoptedAlgorithm* algorithm; InfUserTable* user_table; buffer = INF_TEXT_BUFFER(inf_session_get_buffer(INF_SESSION(session))); algorithm = inf_adopted_session_get_algorithm(INF_ADOPTED_SESSION(session)); user_table = inf_session_get_user_table(INF_SESSION(session)); g_signal_connect( G_OBJECT(buffer), "text-inserted", G_CALLBACK(inf_text_session_buffer_text_inserted_cb), session ); g_signal_connect( G_OBJECT(buffer), "text-erased", G_CALLBACK(inf_text_session_buffer_text_erased_cb), session ); g_signal_connect( G_OBJECT(user_table), "add-local-user", G_CALLBACK(inf_text_session_local_user_added_cb), session ); g_signal_connect( G_OBJECT(user_table), "remove-local-user", G_CALLBACK(inf_text_session_local_user_removed_cb), session ); g_signal_connect( G_OBJECT(algorithm), "apply-request", G_CALLBACK(inf_text_session_apply_request_cb_before), session ); g_signal_connect_after( G_OBJECT(algorithm), "apply-request", G_CALLBACK(inf_text_session_apply_request_cb_after), session ); inf_user_table_foreach_local_user( user_table, inf_text_session_init_text_handlers_user_foreach_func, session ); } /* * GObject overrides. */ static void inf_text_session_init(GTypeInstance* instance, gpointer g_class) { InfTextSession* session; InfTextSessionPrivate* priv; session = INF_TEXT_SESSION(instance); priv = INF_TEXT_SESSION_PRIVATE(session); priv->caret_update_interval = 500; priv->apply_request = FALSE; } static GObject* inf_text_session_constructor(GType type, guint n_construct_properties, GObjectConstructParam* construct_properties) { GObject* object; InfTextSession* session; InfTextSessionPrivate* priv; InfTextBuffer* buffer; InfSessionStatus status; object = G_OBJECT_CLASS(parent_class)->constructor( type, n_construct_properties, construct_properties ); session = INF_TEXT_SESSION(object); priv = INF_TEXT_SESSION_PRIVATE(session); buffer = INF_TEXT_BUFFER(inf_session_get_buffer(INF_SESSION(session))); g_object_get(G_OBJECT(session), "status", &status, NULL); /* We can either be already synchronized in which case we use the given * buffer as initial buffer. This is used to initiate a new session with * predefined content. In that case, we can directly start through. In the * other case we are getting synchronized in which case the buffer must be * empty (we will fill it during synchronization). Text handlers are * connected when synchronization is complete. */ g_assert( status == INF_SESSION_RUNNING || inf_text_buffer_get_length(buffer) == 0 ); if(status == INF_SESSION_RUNNING) inf_text_session_init_text_handlers(session); return object; } /*static void inf_text_session_dispose_foreach_local_user_func(InfUser* user, gpointer user_data) { g_assert(INF_TEXT_IS_USER(user)); g_signal_handlers_disconnect_matched( G_OBJECT(user), G_SIGNAL_MATCH_FUNC, 0, 0, NULL, G_CALLBACK(inf_text_session_selection_changed_cb), NULL ); }*/ static void inf_text_session_dispose(GObject* object) { InfTextSession* session; InfTextSessionPrivate* priv; InfTextBuffer* buffer; InfUserTable* user_table; InfAdoptedAlgorithm* algorithm; session = INF_TEXT_SESSION(object); priv = INF_TEXT_SESSION_PRIVATE(session); buffer = INF_TEXT_BUFFER(inf_session_get_buffer(INF_SESSION(session))); user_table = inf_session_get_user_table(INF_SESSION(session)); algorithm = inf_adopted_session_get_algorithm(INF_ADOPTED_SESSION(session)); while(priv->local_users != NULL) { inf_text_session_remove_local_user( session, (InfTextSessionLocalUser*)priv->local_users->data ); } inf_signal_handlers_disconnect_by_func( G_OBJECT(buffer), G_CALLBACK(inf_text_session_buffer_text_inserted_cb), session ); inf_signal_handlers_disconnect_by_func( G_OBJECT(buffer), G_CALLBACK(inf_text_session_buffer_text_erased_cb), session ); inf_signal_handlers_disconnect_by_func( G_OBJECT(user_table), G_CALLBACK(inf_text_session_local_user_added_cb), session ); inf_signal_handlers_disconnect_by_func( G_OBJECT(user_table), G_CALLBACK(inf_text_session_local_user_removed_cb), session ); /* Algorithm may be NULL if we were still synchronizing */ if(algorithm != NULL) { inf_signal_handlers_disconnect_by_func( G_OBJECT(algorithm), G_CALLBACK(inf_text_session_apply_request_cb_before), session ); inf_signal_handlers_disconnect_by_func( G_OBJECT(algorithm), G_CALLBACK(inf_text_session_apply_request_cb_after), session ); } G_OBJECT_CLASS(parent_class)->dispose(object); } static void inf_text_session_finalize(GObject* object) { InfTextSession* session; InfTextSessionPrivate* priv; session = INF_TEXT_SESSION(object); priv = INF_TEXT_SESSION_PRIVATE(session); G_OBJECT_CLASS(parent_class)->finalize(object); } static void inf_text_session_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec) { InfTextSession* session; InfTextSessionPrivate* priv; session = INF_TEXT_SESSION(object); priv = INF_TEXT_SESSION_PRIVATE(session); switch(prop_id) { case PROP_CARET_UPDATE_INTERVAL: priv->caret_update_interval = g_value_get_uint(value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void inf_text_session_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec) { InfTextSession* session; InfTextSessionPrivate* priv; session = INF_TEXT_SESSION(object); priv = INF_TEXT_SESSION_PRIVATE(session); switch(prop_id) { case PROP_CARET_UPDATE_INTERVAL: g_value_set_uint(value, priv->caret_update_interval); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } /* * Network command handlers */ static InfCommunicationScope inf_text_session_handle_user_color_change(InfTextSession* session, InfXmlConnection* connection, xmlNodePtr xml, GError** error) { InfUserTable* user_table; guint user_id; InfUser* user; gdouble hue; user_table = inf_session_get_user_table(INF_SESSION(session)); if(!inf_xml_util_get_attribute_uint_required(xml, "id", &user_id, error)) return INF_COMMUNICATION_SCOPE_PTP; if(!inf_xml_util_get_attribute_double_required(xml, "hue", &hue, error)) return INF_COMMUNICATION_SCOPE_PTP; /* TODO: A public function in InfSession that does the following two checks * (and returns the user). This can also be used in * inf_session_handle_user_status_change */ user = inf_user_table_lookup_user_by_id(user_table, user_id); if(user == NULL) { g_set_error( error, inf_user_error_quark(), INF_USER_ERROR_NO_SUCH_USER, _("No such user with ID '%u'"), user_id ); return INF_COMMUNICATION_SCOPE_PTP; } if(inf_user_get_status(user) == INF_USER_UNAVAILABLE || inf_user_get_connection(user) != connection) { g_set_error( error, inf_user_error_quark(), INF_USER_ERROR_NOT_JOINED, "%s", _("User did not join from this connection") ); return INF_COMMUNICATION_SCOPE_PTP; } g_assert(INF_TEXT_IS_USER(user)); if(hue < 0.0 || hue > 1.0) { g_set_error( error, inf_text_session_error_quark, INF_TEXT_SESSION_ERROR_INVALID_HUE, _("Invalid hue value: '%g'"), hue ); return INF_COMMUNICATION_SCOPE_PTP; } g_object_set(G_OBJECT(user), "hue", hue, NULL); return INF_COMMUNICATION_SCOPE_GROUP; } /* * InfSession overrides */ static void inf_text_session_to_xml_sync(InfSession* session, xmlNodePtr parent) { InfTextBuffer* buffer; InfTextBufferIter* iter; xmlNodePtr xml; gboolean result; gchar* text; gsize total_bytes; gsize bytes_left; GIConv cd; g_assert(INF_SESSION_CLASS(parent_class)->to_xml_sync != NULL); INF_SESSION_CLASS(parent_class)->to_xml_sync(session, parent); buffer = INF_TEXT_BUFFER(inf_session_get_buffer(session)); cd = g_iconv_open("UTF-8", inf_text_buffer_get_encoding(buffer)); iter = inf_text_buffer_create_iter(buffer); if(iter != NULL) { result = TRUE; while(result == TRUE) { /* Write segment in 1024 byte chunks */ text = inf_text_buffer_iter_get_text(buffer, iter); total_bytes = inf_text_buffer_iter_get_bytes(buffer, iter); bytes_left = total_bytes; while(bytes_left > 0) { xml = xmlNewChild(parent, NULL, (const xmlChar*)"sync-segment", NULL); inf_text_session_segment_to_xml( &cd, xml, text + total_bytes - bytes_left, &bytes_left, inf_text_buffer_iter_get_author(buffer, iter) ); } g_free(text); result = inf_text_buffer_iter_next(buffer, iter); } inf_text_buffer_destroy_iter(buffer, iter); } g_iconv_close(cd); } static gboolean inf_text_session_process_xml_sync(InfSession* session, InfXmlConnection* connection, const xmlNodePtr xml, GError** error) { InfTextBuffer* buffer; GIConv cd; gpointer text; gsize bytes; guint length; guint author; InfUser* user; if(strcmp((const char*)xml->name, "sync-segment") == 0) { buffer = INF_TEXT_BUFFER(inf_session_get_buffer(session)); cd = g_iconv_open(inf_text_buffer_get_encoding(buffer), "UTF-8"); text = inf_text_session_segment_from_xml( &cd, xml, &length, &bytes, &author, error ); g_iconv_close(cd); if(text == NULL) return FALSE; if(author != 0) { /* TODO: inf_user_table_lookup_user_by_id_required, with error. */ user = inf_user_table_lookup_user_by_id( inf_session_get_user_table(session), author ); if(user == NULL) { g_free(text); g_set_error( error, inf_user_error_quark(), INF_USER_ERROR_NO_SUCH_USER, _("No such user with ID '%u'"), author ); return FALSE; } } else { user = NULL; } inf_text_buffer_insert_text( buffer, inf_text_buffer_get_length(buffer), text, bytes, length, user ); g_free(text); return TRUE; } else { g_assert(INF_SESSION_CLASS(parent_class)->process_xml_sync != NULL); return INF_SESSION_CLASS(parent_class)->process_xml_sync( session, connection, xml, error ); } } static InfCommunicationScope inf_text_session_process_xml_run(InfSession* session, InfXmlConnection* connection, const xmlNodePtr xml, GError** error) { g_assert(INF_SESSION_CLASS(parent_class)->process_xml_run != NULL); if(strcmp((const char*)xml->name, "user-color-change") == 0) { return inf_text_session_handle_user_color_change( INF_TEXT_SESSION(session), connection, xml, error ); } else { return INF_SESSION_CLASS(parent_class)->process_xml_run( session, connection, xml, error ); } } static GArray* inf_text_session_get_xml_user_props(InfSession* session, InfXmlConnection* connection, const xmlNodePtr xml) { GArray* array; GParameter* parameter; guint caret; gint selection; gdouble hue; g_assert(INF_SESSION_CLASS(parent_class)->get_xml_user_props != NULL); array = INF_SESSION_CLASS(parent_class)->get_xml_user_props( session, connection, xml ); /* TODO: Error reporting for get_xml_user_props */ if(inf_xml_util_get_attribute_uint(xml, "caret", &caret, NULL)) { parameter = inf_session_get_user_property(array, "caret-position"); g_value_init(¶meter->value, G_TYPE_UINT); g_value_set_uint(¶meter->value, caret); } parameter = inf_session_get_user_property(array, "selection-length"); g_value_init(¶meter->value, G_TYPE_INT); if(inf_xml_util_get_attribute_int(xml, "selection", &selection, NULL)) g_value_set_int(¶meter->value, selection); else g_value_set_int(¶meter->value, 0); parameter = inf_session_get_user_property(array, "hue"); g_value_init(¶meter->value, G_TYPE_DOUBLE); /* Use a random hue if none set */ if(inf_xml_util_get_attribute_double(xml, "hue", &hue, NULL)) g_value_set_double(¶meter->value, hue); else g_value_set_double(¶meter->value, g_random_double()); return array; } static void inf_text_session_set_xml_user_props(InfSession* session, const GParameter* params, guint n_params, xmlNodePtr xml) { const GParameter* param; INF_SESSION_CLASS(parent_class)->set_xml_user_props( session, params, n_params, xml ); param = inf_session_lookup_user_property( params, n_params, "caret-position" ); if(param != NULL) { inf_xml_util_set_attribute_uint( xml, "caret", g_value_get_uint(¶m->value) ); } param = inf_session_lookup_user_property( params, n_params, "selection-length" ); if(param != NULL) { inf_xml_util_set_attribute_int( xml, "selection", g_value_get_int(¶m->value) ); } param = inf_session_lookup_user_property( params, n_params, "hue" ); if(param != NULL) { inf_xml_util_set_attribute_double( xml, "hue", g_value_get_double(¶m->value) ); } } static gboolean inf_text_session_validate_user_props(InfSession* session, const GParameter* params, guint n_params, InfUser* exclude, GError** error) { const GParameter* caret; gboolean result; result = INF_SESSION_CLASS(parent_class)->validate_user_props( session, params, n_params, exclude, error ); if(result == FALSE) return FALSE; caret = inf_session_lookup_user_property( params, n_params, "caret-position" ); if(caret == NULL) { g_set_error( error, inf_request_error_quark(), INF_REQUEST_ERROR_NO_SUCH_ATTRIBUTE, "%s", _("'caret' attribute in user message is missing") ); return FALSE; } /* Selection is optional and 0 if not given */ return result; } static InfUser* inf_text_session_user_new(InfSession* session, GParameter* params, guint n_params) { GObject* object; object = g_object_newv(INF_TEXT_TYPE_USER, n_params, params); return INF_USER(object); } static void inf_text_session_synchronization_complete(InfSession* session, InfXmlConnection* connection) { InfSessionStatus status; status = inf_session_get_status(session); INF_SESSION_CLASS(parent_class)->synchronization_complete( session, connection ); /* init_text_handlers needs to access the algorithm which is created in the * parent class default signal handler which is why we call this afterwards. * Note that we need to query status before, so we know whether the session * itself was synchronized (status == SYNCHRONIZING) or whether we just * synchronized the session to someone else (status == RUNNING). */ if(status == INF_SESSION_SYNCHRONIZING) inf_text_session_init_text_handlers(INF_TEXT_SESSION(session)); } /* * InfAdoptedSession overrides */ static void inf_text_session_request_to_xml(InfAdoptedSession* session, xmlNodePtr xml, InfAdoptedRequest* request, InfAdoptedStateVector* diff_vec, gboolean for_sync) { InfTextChunk* chunk; InfTextChunkIter iter; gboolean result; xmlNodePtr op_xml; gchar* utf8_text; gsize bytes_read; gsize bytes_written; GIConv cd; xmlNodePtr child; const gchar* text; gsize total_bytes; gsize bytes_left; InfAdoptedOperation* operation; switch(inf_adopted_request_get_request_type(request)) { case INF_ADOPTED_REQUEST_DO: operation = inf_adopted_request_get_operation(request); if(INF_TEXT_IS_INSERT_OPERATION(operation)) { op_xml = xmlNewNode(NULL, (const xmlChar*)"insert-caret"); inf_xml_util_set_attribute_uint( op_xml, "pos", inf_text_insert_operation_get_position( INF_TEXT_INSERT_OPERATION(operation) ) ); /* Must be default insert operation so we get the inserted text */ g_assert(INF_TEXT_IS_DEFAULT_INSERT_OPERATION(operation)); chunk = inf_text_default_insert_operation_get_chunk( INF_TEXT_DEFAULT_INSERT_OPERATION(operation) ); result = inf_text_chunk_iter_init(chunk, &iter); g_assert(result == TRUE); utf8_text = g_convert( inf_text_chunk_iter_get_text(&iter), inf_text_chunk_iter_get_bytes(&iter), "UTF-8", inf_text_chunk_get_encoding(chunk), &bytes_read, &bytes_written, NULL ); /* Conversion to UTF-8 should always succeed */ g_assert(utf8_text != NULL); g_assert(bytes_read == inf_text_chunk_iter_get_bytes(&iter)); inf_xml_util_add_child_text(op_xml, utf8_text, bytes_written); g_free(utf8_text); /* We only allow a single segment because the whole inserted text must * be written by a single user. */ g_assert(inf_text_chunk_iter_next(&iter) == FALSE); } else if(INF_TEXT_IS_DELETE_OPERATION(operation)) { op_xml = xmlNewNode(NULL, (const xmlChar*)"delete-caret"); inf_xml_util_set_attribute_uint( op_xml, "pos", inf_text_delete_operation_get_position( INF_TEXT_DELETE_OPERATION(operation) ) ); if(for_sync == TRUE) { /* Must be default delete operation so we get chunk */ g_assert(INF_TEXT_IS_DEFAULT_DELETE_OPERATION(operation)); chunk = inf_text_default_delete_operation_get_chunk( INF_TEXT_DEFAULT_DELETE_OPERATION(operation) ); /* Need to transmit all deleted data */ cd = g_iconv_open("UTF-8", inf_text_chunk_get_encoding(chunk)); result = inf_text_chunk_iter_init(chunk, &iter); while(result == TRUE) { text = inf_text_chunk_iter_get_text(&iter); total_bytes = inf_text_chunk_iter_get_bytes(&iter); bytes_left = total_bytes; child = xmlNewChild(op_xml, NULL, (const xmlChar*)"segment", NULL); while(bytes_left > 0) { inf_text_session_segment_to_xml( &cd, child, text + total_bytes - bytes_left, &bytes_left, inf_text_chunk_iter_get_author(&iter) ); } result = inf_text_chunk_iter_next(&iter); } g_iconv_close(cd); } else { /* Just transmit position and length, the other site generates a * InfTextRemoteDeleteOperation from that and is able to restore the * deleted text for potential Undo. */ inf_xml_util_set_attribute_uint( op_xml, "len", inf_text_delete_operation_get_length( INF_TEXT_DELETE_OPERATION(operation) ) ); } } else if(for_sync == FALSE && INF_TEXT_IS_MOVE_OPERATION(operation)) { op_xml = xmlNewNode(NULL, (const xmlChar*)"move"); inf_xml_util_set_attribute_uint( op_xml, "caret", inf_text_move_operation_get_position( INF_TEXT_MOVE_OPERATION(operation) ) ); inf_xml_util_set_attribute_int( op_xml, "selection", inf_text_move_operation_get_length(INF_TEXT_MOVE_OPERATION(operation)) ); } else if(for_sync == FALSE && INF_ADOPTED_IS_NO_OPERATION(operation)) { op_xml = xmlNewNode(NULL, (const xmlChar*)"no-op"); } else { g_assert_not_reached(); } break; case INF_ADOPTED_REQUEST_UNDO: op_xml = xmlNewNode(NULL, (const xmlChar*)"undo-caret"); break; case INF_ADOPTED_REQUEST_REDO: op_xml = xmlNewNode(NULL, (const xmlChar*)"redo-caret"); break; default: g_assert_not_reached(); break; } g_assert(op_xml != NULL); inf_adopted_session_write_request_info( session, request, diff_vec, xml, op_xml ); } static InfAdoptedRequest* inf_text_session_xml_to_request(InfAdoptedSession* session, xmlNodePtr xml, InfAdoptedStateVector* diff_vec, gboolean for_sync, GError** error) { InfTextBuffer* buffer; InfAdoptedUser* user; guint user_id; InfAdoptedStateVector* vector; xmlNodePtr op_xml; InfAdoptedOperation* operation; InfAdoptedRequestType type; InfAdoptedRequest* request; guint pos; gchar* text; gsize bytes; InfTextChunk* chunk; gchar* utf8_text; gsize in_bytes; guint length; xmlNodePtr child; GIConv cd; guint author; gboolean cmp; gint selection; buffer = INF_TEXT_BUFFER(inf_session_get_buffer(INF_SESSION(session))); cmp = inf_adopted_session_read_request_info( session, xml, diff_vec, &user, &vector, &op_xml, error ); if(cmp == FALSE) return FALSE; user_id = (user == NULL) ? 0 : inf_user_get_id(INF_USER(user)); if(strcmp((const char*)op_xml->name, "insert") == 0 || strcmp((const char*)op_xml->name, "insert-caret") == 0) { type = INF_ADOPTED_REQUEST_DO; if(!inf_xml_util_get_attribute_uint_required(op_xml, "pos", &pos, error)) goto fail; utf8_text = inf_xml_util_get_child_text(op_xml, &in_bytes, &length, error); if(!utf8_text) goto fail; text = g_convert( utf8_text, in_bytes, inf_text_buffer_get_encoding(buffer), "UTF-8", NULL, &bytes, error ); g_free(utf8_text); if(text == NULL) goto fail; chunk = inf_text_chunk_new(inf_text_buffer_get_encoding(buffer)); inf_text_chunk_insert_text(chunk, 0, text, bytes, length, user_id); g_free(text); operation = INF_ADOPTED_OPERATION( inf_text_default_insert_operation_new(pos, chunk) ); inf_text_chunk_free(chunk); } else if(strcmp((const char*)op_xml->name, "delete") == 0 || strcmp((const char*)op_xml->name, "delete-caret") == 0) { type = INF_ADOPTED_REQUEST_DO; if(!inf_xml_util_get_attribute_uint_required(op_xml, "pos", &pos, error)) goto fail; if(for_sync == TRUE) { chunk = inf_text_chunk_new(inf_text_buffer_get_encoding(buffer)); cd = g_iconv_open(inf_text_buffer_get_encoding(buffer), "UTF-8"); g_assert(cd != (GIConv)(-1)); for(child = op_xml->children; child != NULL; child = child->next) { if(strcmp((const char*)child->name, "segment") == 0) { text = inf_text_session_segment_from_xml( &cd, child, &length, &bytes, &author, error ); if(text == NULL) { inf_text_chunk_free(chunk); g_iconv_close(cd); goto fail; } else { inf_text_chunk_insert_text( chunk, inf_text_chunk_get_length(chunk), text, bytes, length, author ); g_free(text); } } else { /* TODO: Error */ } } g_iconv_close(cd); operation = INF_ADOPTED_OPERATION( inf_text_default_delete_operation_new(pos, chunk) ); inf_text_chunk_free(chunk); } else { cmp = inf_xml_util_get_attribute_uint_required( op_xml, "len", &length, error ); if(cmp == FALSE) goto fail; operation = INF_ADOPTED_OPERATION( inf_text_remote_delete_operation_new(pos, length) ); } } else if(strcmp((const char*)op_xml->name, "move") == 0) { type = INF_ADOPTED_REQUEST_DO; cmp = inf_xml_util_get_attribute_uint_required( op_xml, "caret", &pos, error ); if(cmp == FALSE) goto fail; cmp = inf_xml_util_get_attribute_int_required( op_xml, "selection", &selection, error ); if(cmp == FALSE) goto fail; operation = INF_ADOPTED_OPERATION( inf_text_move_operation_new(pos, selection) ); } else if(strcmp((const char*)op_xml->name, "no-op") == 0) { type = INF_ADOPTED_REQUEST_DO; operation = INF_ADOPTED_OPERATION(inf_adopted_no_operation_new()); } else if(strcmp((const char*)op_xml->name, "undo") == 0 || strcmp((const char*)op_xml->name, "undo-caret") == 0) { type = INF_ADOPTED_REQUEST_UNDO; } else if(strcmp((const char*)op_xml->name, "redo") == 0 || strcmp((const char*)op_xml->name, "redo-caret") == 0) { type = INF_ADOPTED_REQUEST_REDO; } else { /* TODO: Error */ goto fail; } switch(type) { case INF_ADOPTED_REQUEST_DO: g_assert(operation != NULL); request = inf_adopted_request_new_do(vector, user_id, operation); g_object_unref(operation); break; case INF_ADOPTED_REQUEST_UNDO: request = inf_adopted_request_new_undo(vector, user_id); break; case INF_ADOPTED_REQUEST_REDO: request = inf_adopted_request_new_redo(vector, user_id); break; default: g_assert_not_reached(); break; } inf_adopted_state_vector_free(vector); return request; fail: inf_adopted_state_vector_free(vector); return NULL; } /* * Gype registration. */ static void inf_text_session_class_init(gpointer g_class, gpointer class_data) { GObjectClass* object_class; InfSessionClass* session_class; InfAdoptedSessionClass* adopted_session_class; object_class = G_OBJECT_CLASS(g_class); session_class = INF_SESSION_CLASS(g_class); adopted_session_class = INF_ADOPTED_SESSION_CLASS(g_class); parent_class = INF_ADOPTED_SESSION_CLASS(g_type_class_peek_parent(g_class)); g_type_class_add_private(g_class, sizeof(InfTextSessionPrivate)); object_class->constructor = inf_text_session_constructor; object_class->dispose = inf_text_session_dispose; object_class->finalize = inf_text_session_finalize; object_class->set_property = inf_text_session_set_property; object_class->get_property = inf_text_session_get_property; session_class->to_xml_sync = inf_text_session_to_xml_sync; session_class->process_xml_sync = inf_text_session_process_xml_sync; session_class->process_xml_run = inf_text_session_process_xml_run; session_class->get_xml_user_props = inf_text_session_get_xml_user_props; session_class->set_xml_user_props = inf_text_session_set_xml_user_props; session_class->validate_user_props = inf_text_session_validate_user_props; session_class->user_new = inf_text_session_user_new; session_class->synchronization_complete = inf_text_session_synchronization_complete; adopted_session_class->xml_to_request = inf_text_session_xml_to_request; adopted_session_class->request_to_xml = inf_text_session_request_to_xml; inf_text_session_error_quark = g_quark_from_static_string( "INF_TEXT_SESSION_ERROR" ); g_object_class_install_property( object_class, PROP_CARET_UPDATE_INTERVAL, g_param_spec_uint( "caret-update-interval", "Caret update interval", "Minimum number of milliseconds between caret update broadcasts", 0, G_MAXUINT, 500, G_PARAM_READWRITE | G_PARAM_CONSTRUCT ) ); } GType inf_text_session_get_type(void) { static GType session_type = 0; if(!session_type) { static const GTypeInfo session_type_info = { sizeof(InfTextSessionClass), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ inf_text_session_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InfTextSession), /* instance_size */ 0, /* n_preallocs */ inf_text_session_init, /* instance_init */ NULL /* value_table */ }; session_type = g_type_register_static( INF_ADOPTED_TYPE_SESSION, "InfTextSession", &session_type_info, 0 ); } return session_type; } /* * Public API. */ /** * inf_text_session_new: * @manager: A #InfCommunicationManager. * @buffer: An initial #InfTextBuffer. * @io: A #InfIo object. * @status: The initial status of the session. * @sync_group: A group in which the session is synchronized. Ignored if * @status is %INF_SESSION_RUNNING. * @sync_connection: A connection to synchronize the session from. Ignored if * @status is %INF_SESSION_RUNNING. * * Creates a new #InfTextSession. The communication manager is used to send * and receive requests from subscription and synchronization. @buffer will be * set to be initially empty if the session is initially synchronized * (see below). @io is required to trigger timeouts. * * If @status is %INF_SESSION_PRESYNC or %INF_SESSION_SYNCHRONIZING, then the * session will initially be sychronized, meaning the initial content is * retrieved from @sync_connection. If you are subscribed to the session, set * the subscription group via inf_session_set_subscription_group(). * * Return Value: A new #InfTextSession. **/ InfTextSession* inf_text_session_new(InfCommunicationManager* manager, InfTextBuffer* buffer, InfIo* io, InfSessionStatus status, InfCommunicationGroup* sync_group, InfXmlConnection* sync_connection) { GObject* object; g_return_val_if_fail(INF_COMMUNICATION_IS_MANAGER(manager), NULL); g_return_val_if_fail(INF_TEXT_IS_BUFFER(buffer), NULL); g_return_val_if_fail(INF_IS_IO(io), NULL); g_return_val_if_fail( (status == INF_SESSION_RUNNING && sync_group == NULL && sync_connection == NULL) || (status != INF_SESSION_RUNNING && INF_COMMUNICATION_IS_GROUP(sync_group) && INF_IS_XML_CONNECTION(sync_connection)), NULL ); object = g_object_new( INF_TEXT_TYPE_SESSION, "communication-manager", manager, "buffer", buffer, "status", status, "sync-group", sync_group, "sync-connection", sync_connection, "io", io, NULL ); return INF_TEXT_SESSION(object); } /** * inf_text_session_new_with_user_table: * @manager: A #InfCommunicationManager. * @buffer: An initial #InfTextBuffer. * @io: A #InfIo object. * @user_table: A #InfUserTable. * @status: The initial status for the session. * @sync_group: A group in which the session is synchronized. Ignored if * @status is %INF_SESSION_RUNNING. * @sync_connection: A connection to synchronize the session from. Ignored if * @status is %INF_SESSION_RUNNING. * * Creates a new #InfTextSession. The connection manager is used to send and * receive requests from subscription and synchronization. @buffer will be * set to be initially empty if the session is initially synchronized * (see below). @io is required to trigger timeouts. * * If @status is %INF_SESSION_PRESYNC or %INF_SESSION_SYNCHRONIZING, then the * session will initially be sychronized, meaning the initial content is * retrieved from @sync_connection. If you are subscribed to the session, set * the subscription group via inf_session_set_subscription_group(). * * @user_table is used as an initial user table. The user table should only * contain unavailable users, if any, that may rejoin during the session. If * there was an available user in the user table, it would probably belong * to another session, but different sessions cannot share the same user * object. * * Return Value: A new #InfTextSession. **/ InfTextSession* inf_text_session_new_with_user_table(InfCommunicationManager* manager, InfTextBuffer* buffer, InfIo* io, InfUserTable* user_table, InfSessionStatus status, InfCommunicationGroup* sync_group, InfXmlConnection* sync_connection) { /* TODO: Can it happen that the user_table is set explicitely PLUS the * session is synchronized? If not then this function can be simplified */ GObject* object; g_return_val_if_fail(INF_COMMUNICATION_IS_MANAGER(manager), NULL); g_return_val_if_fail(INF_TEXT_IS_BUFFER(buffer), NULL); g_return_val_if_fail(INF_IS_IO(io), NULL); g_return_val_if_fail(INF_IS_USER_TABLE(user_table), NULL); g_return_val_if_fail( (status == INF_SESSION_RUNNING && sync_group == NULL && sync_connection == NULL) || (status != INF_SESSION_RUNNING && INF_COMMUNICATION_IS_GROUP(sync_group) && INF_IS_XML_CONNECTION(sync_connection)), NULL ); object = g_object_new( INF_TEXT_TYPE_SESSION, "communication-manager", manager, "buffer", buffer, "user-table", user_table, "status", status, "sync-group", sync_group, "sync-connection", sync_connection, "io", io, NULL ); return INF_TEXT_SESSION(object); } /** * inf_text_session_set_user_color: * @session: A #InfTextSession. * @user: A local #InfTextUser from @session's user table. * @hue: New hue value for @user's color. Ranges from 0.0 (red) to 1.0 (red). * * Changes the user color of @user. @user must have the %INF_USER_LOCAL flag * set. */ void inf_text_session_set_user_color(InfTextSession* session, InfTextUser* user, gdouble hue) { xmlNodePtr xml; g_return_if_fail(INF_TEXT_IS_SESSION(session)); g_return_if_fail(INF_TEXT_IS_USER(user)); g_return_if_fail(hue >= 0.0 && hue <= 1.0); g_return_if_fail( inf_user_get_status(INF_USER(user)) != INF_USER_UNAVAILABLE ); g_return_if_fail( (inf_user_get_flags(INF_USER(user)) & INF_USER_LOCAL) != 0 ); xml = xmlNewNode(NULL, (const xmlChar*)"user-color-change"); inf_xml_util_set_attribute_uint(xml, "id", inf_user_get_id(INF_USER(user))); inf_xml_util_set_attribute_double(xml, "hue", hue); inf_session_send_to_subscriptions(INF_SESSION(session), xml); g_object_set(G_OBJECT(user), "hue", hue, NULL); } /** * inf_text_session_flush_requests_for_user: * @session: A #InfTextSession. * @user: The #InfTextUser for which to flush messages. * * This function sends all pending requests for @user immediately. Requests * that modify the buffer are not queued normally, but cursor movement * requests are delayed in case are issued frequently, to save bandwidth. * * The main purpose of this function is to send all pending requests before * changing a user's status to inactive or unavailable since inactive users * are automatically activated as soon as they issue a request. * * TODO: We should probably detect this automatically, without requiring * people to call this function, i.e. flush requests for local users just * before they become inactive. * * @user must have the %INF_USER_LOCAL flag set. */ void inf_text_session_flush_requests_for_user(InfTextSession* session, InfTextUser* user) { InfTextSessionLocalUser* local; g_return_if_fail(INF_TEXT_IS_SESSION(session)); g_return_if_fail(INF_TEXT_IS_USER(user)); local = inf_text_session_find_local_user(session, user); g_assert(local != NULL); if(local->caret_timeout != NULL) { inf_text_session_broadcast_caret_selection(session, local); } } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinftext/inf-text-default-buffer.h0000644000175000017500000000424412264763732017752 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_TEXT_DEFAULT_BUFFER_H__ #define __INF_TEXT_DEFAULT_BUFFER_H__ #include G_BEGIN_DECLS #define INF_TEXT_TYPE_DEFAULT_BUFFER (inf_text_default_buffer_get_type()) #define INF_TEXT_DEFAULT_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INF_TEXT_TYPE_DEFAULT_BUFFER, InfTextDefaultBuffer)) #define INF_TEXT_DEFAULT_BUFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INF_TEXT_TYPE_DEFAULT_BUFFER, InfTextDefaultBufferClass)) #define INF_TEXT_IS_DEFAULT_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INF_TEXT_TYPE_DEFAULT_BUFFER)) #define INF_TEXT_IS_DEFAULT_BUFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INF_TEXT_TYPE_DEFAULT_BUFFER)) #define INF_TEXT_DEFAULT_BUFFER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), INF_TEXT_TYPE_DEFAULT_BUFFER, InfTextDefaultBufferClass)) typedef struct _InfTextDefaultBuffer InfTextDefaultBuffer; typedef struct _InfTextDefaultBufferClass InfTextDefaultBufferClass; struct _InfTextDefaultBufferClass { GObjectClass parent_class; }; struct _InfTextDefaultBuffer { GObject parent; }; GType inf_text_default_buffer_get_type(void) G_GNUC_CONST; InfTextDefaultBuffer* inf_text_default_buffer_new(const gchar* encoding); G_END_DECLS #endif /* __INF_TEXT_DEFAULT_BUFFER_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinftext/inf-text-user.h0000644000175000017500000000514412264763732016035 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_TEXT_USER_H__ #define __INF_TEXT_USER_H__ #include #include G_BEGIN_DECLS #define INF_TEXT_TYPE_USER (inf_text_user_get_type()) #define INF_TEXT_USER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INF_TEXT_TYPE_USER, InfTextUser)) #define INF_TEXT_USER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INF_TEXT_TYPE_USER, InfTextUserClass)) #define INF_TEXT_IS_USER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INF_TEXT_TYPE_USER)) #define INF_TEXT_IS_USER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INF_TEXT_TYPE_USER)) #define INF_TEXT_USER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), INF_TEXT_TYPE_USER, InfTextUserClass)) typedef struct _InfTextUser InfTextUser; typedef struct _InfTextUserClass InfTextUserClass; struct _InfTextUserClass { InfAdoptedUserClass parent_class; void(*selection_changed)(InfTextUser* user, guint position, guint length, gboolean by_request); }; struct _InfTextUser { InfAdoptedUser parent; }; GType inf_text_user_get_type(void) G_GNUC_CONST; InfTextUser* inf_text_user_new(guint id, const gchar* name, InfAdoptedStateVector* vector, double hue); guint inf_text_user_get_caret_position(InfTextUser* user); gint inf_text_user_get_selection_length(InfTextUser* user); void inf_text_user_set_selection(InfTextUser* user, guint position, gint length, gboolean by_request); gdouble inf_text_user_get_hue(InfTextUser* user); G_END_DECLS #endif /* __INF_TEXT_USER_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinftext/inf-text-chunk.c0000644000175000017500000010521012264763732016155 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include /* Don't check integrity in stable releases */ /*#define CHUNK_CHECK_INTEGRITY*/ struct _InfTextChunk { GSequence* segments; guint length; /* in characters */ GQuark encoding; }; typedef struct _InfTextChunkSegment InfTextChunkSegment; struct _InfTextChunkSegment { guint author; /* This is gchar so that we can do pointer arithmetic. It does not * necessarily store a full character in each byte. This depends on the * encoding specified in the InfTextChunk. */ gchar* text; gsize length; /* in bytes */ guint offset; /* absolute to chunk begin in characters, sort criteria */ }; static void inf_text_chunk_segment_free(InfTextChunkSegment* segment) { g_free(segment->text); g_slice_free(InfTextChunkSegment, segment); } static int inf_text_chunk_segment_cmp(gconstpointer first, gconstpointer second, gpointer userdata) { const InfTextChunkSegment* first_segment; const InfTextChunkSegment* second_segment; first_segment = (const InfTextChunkSegment*)first; second_segment = (const InfTextChunkSegment*)second; g_return_val_if_fail(second != NULL && first != NULL, 0); if (first_segment->offset < second_segment->offset) return -1; else if (first_segment->offset == second_segment->offset) return 0; else return 1; } static guint inf_text_chunk_next_offset(InfTextChunk* self, GSequenceIter* iter) { GSequenceIter* next_iter; g_assert(iter != g_sequence_get_end_iter(self->segments)); next_iter = g_sequence_iter_next(iter); if(next_iter == g_sequence_get_end_iter(self->segments)) return self->length; else return ((InfTextChunkSegment*)g_sequence_get(next_iter))->offset; } #ifdef CHUNK_CHECK_INTEGRITY static gboolean inf_text_chunk_check_integrity(InfTextChunk* self) { GSequenceIter* iter; InfTextChunkSegment* segment; guint offset; guint new_offset; offset = 0; for(iter = g_sequence_get_begin_iter(self->segments); iter != g_sequence_get_end_iter(self->segments); iter = g_sequence_iter_next(iter)) { segment = (InfTextChunkSegment*)g_sequence_get(iter); if(offset != segment->offset) return FALSE; new_offset = inf_text_chunk_next_offset(self, iter); if(new_offset <= offset) return FALSE; if(new_offset - offset > segment->length) return FALSE; offset = new_offset; } return TRUE; } #endif static GSequenceIter* inf_text_chunk_get_segment(InfTextChunk* self, guint pos, gsize* index) { InfTextChunkSegment* found; InfTextChunkSegment key; GSequenceIter* iter; GIConv cd; gchar buffer[4]; gchar* inbuf; gchar* outbuf; gsize inlen; gsize outlen; guint count; gsize result; g_assert(pos <= self->length); /* only offset is relevant for lookup */ key.offset = pos; /* TODO: Verify this does binary search */ iter = g_sequence_search( self->segments, &key, inf_text_chunk_segment_cmp, NULL ); if(self->length > 0) { g_assert(iter != g_sequence_get_begin_iter(self->segments)); iter = g_sequence_iter_prev(iter); found = g_sequence_get(iter); g_assert(pos >= found->offset); /* This is not "<=" because it should rather find position 0 on the * next segment in that case. */ g_assert(pos <= inf_text_chunk_next_offset(self, iter)); /* Find byte index in the segment where the specified character starts. * This is rather ugly, I wish iconv or glib or someone had some nice(r) * API for this. */ if(index != NULL) { if(pos == inf_text_chunk_next_offset(self, iter)) { *index = found->length; } else { /* We convert the segment's text into UCS-4, character by character. * This assumes every UCS-4 character is 4 bytes in length */ /* TODO: Can we use some faster glib UTF-8 functions in case * self->encoding is UTF-8? */ cd = g_iconv_open("UCS-4", g_quark_to_string(self->encoding)); g_assert(cd != (GIConv)-1); inbuf = found->text; inlen = found->length; for(count = 0; count < pos - found->offset; ++ count) { g_assert(inlen > 0); outbuf = buffer; outlen = 4; result = g_iconv(cd, &inbuf, &inlen, &outbuf, &outlen); g_assert(result == (size_t)(-1)); /* errno == E2BIG */ } g_iconv_close(cd); *index = found->length - inlen; } } } else { if(*index) *index = 0; } return iter; } GType inf_text_chunk_get_type(void) { static GType chunk_type = 0; if(!chunk_type) { chunk_type = g_boxed_type_register_static( "InfTextChunk", (GBoxedCopyFunc)inf_text_chunk_copy, (GBoxedFreeFunc)inf_text_chunk_free ); } return chunk_type; } /** * inf_text_chunk_new: * @encoding: A content encoding, such as "UTF-8" or "LATIN1". * * Creates a new #InfTextChunk with no initial content that holds text * in the given encoding. TODO: Allow binary data with %NULL encoding. * * Return Value: A new #InfTextChunk. **/ InfTextChunk* inf_text_chunk_new(const gchar* encoding) { InfTextChunk* chunk = g_slice_new(InfTextChunk); chunk->segments = g_sequence_new( (GDestroyNotify)inf_text_chunk_segment_free ); chunk->length = 0; chunk->encoding = g_quark_from_string(encoding); return chunk; } /** * inf_text_chunk_copy: * @self: A #InfTextChunk. * * Returns a copy of @self. * * Return Value: A new #InfTextChunk. **/ InfTextChunk* inf_text_chunk_copy(InfTextChunk* self) { InfTextChunk* new_chunk; GSequenceIter* iter; g_return_val_if_fail(self != NULL, NULL); new_chunk = g_slice_new(InfTextChunk); new_chunk->segments = g_sequence_new( (GDestroyNotify)inf_text_chunk_segment_free ); for(iter = g_sequence_get_begin_iter(self->segments); iter != g_sequence_get_end_iter(self->segments); iter = g_sequence_iter_next(iter)) { InfTextChunkSegment* segment = g_sequence_get(iter); InfTextChunkSegment* new_segment = g_slice_new(InfTextChunkSegment); new_segment->author = segment->author; new_segment->text = g_memdup(segment->text, segment->length); new_segment->length = segment->length; new_segment->offset = segment->offset; g_sequence_append(new_chunk->segments, new_segment); } new_chunk->length = self->length; new_chunk->encoding = self->encoding; return new_chunk; } /** * inf_text_chunk_free: * @self: A #InfTextChunk. * * Frees a #InfTextChunk allocated with inf_text_chunk_new(), * inf_text_chunk_copy() or inf_text_chunk_substring(). **/ void inf_text_chunk_free(InfTextChunk* self) { g_return_if_fail(self != NULL); g_sequence_free(self->segments); g_slice_free(InfTextChunk, self); } /** * inf_text_chunk_get_encoding: * @self: A #InfTextChunk. * * Returns the character encoding in which the content of @self is encoded. * * Return Value: The encoding of @self. **/ const gchar* inf_text_chunk_get_encoding(InfTextChunk* self) { g_return_val_if_fail(self != NULL, NULL); return g_quark_to_string(self->encoding); } /** * inf_text_chunk_get_length: * @self: A #InfTextChunk. * * Returns the number of characters contained in @self. * * Return Value: The number of characters of @self. **/ guint inf_text_chunk_get_length(InfTextChunk* self) { g_return_val_if_fail(self != NULL, 0); return self->length; } /** * inf_text_chunk_substring: * @self: A #InfTextChunk. * @begin: A character offset into @self. * @length: The length of the text to extract. * * Returns a new #InfTextChunk containing a substring of @self, beginning * at character offset @begin and @length characters long. * * Return Value: A new #InfTextChunk. **/ InfTextChunk* inf_text_chunk_substring(InfTextChunk* self, guint begin, guint length) { GSequenceIter* begin_iter; GSequenceIter* end_iter; gsize begin_index; gsize end_index; InfTextChunk* result; InfTextChunkSegment* segment; InfTextChunkSegment* new_segment; guint current_length; g_return_val_if_fail(self != NULL, NULL); g_return_val_if_fail(begin + length <= self->length, NULL); if(self->length > 0 && length > 0) { begin_iter = inf_text_chunk_get_segment(self, begin, &begin_index); end_iter = inf_text_chunk_get_segment(self, begin + length, &end_index); if(end_index == 0) { g_assert(end_iter != g_sequence_get_end_iter(self->segments)); end_iter = g_sequence_iter_prev(end_iter); end_index = ((InfTextChunkSegment*)g_sequence_get(end_iter))->length; } result = inf_text_chunk_new(g_quark_to_string(self->encoding)); current_length = 0; segment = g_sequence_get(begin_iter); while(begin_iter != end_iter) { new_segment = g_slice_new(InfTextChunkSegment); new_segment->author = segment->author; new_segment->text = g_memdup( segment->text + begin_index, segment->length - begin_index ); new_segment->length = segment->length - begin_index; new_segment->offset = current_length; begin_iter = g_sequence_iter_next(begin_iter); segment = g_sequence_get(begin_iter); /* Add (remaining) length of this segment to current length */ current_length = segment->offset - begin; /* So we get the next segment from the beginning. This may only be * non-zero during the first iteration. */ begin_index = 0; /* begin = new_segment->offset;*/ g_sequence_append(result->segments, new_segment); } /* Don't forget last segment */ new_segment = g_slice_new(InfTextChunkSegment); new_segment->author = segment->author; new_segment->text = g_memdup( segment->text + begin_index, end_index - begin_index ); new_segment->length = end_index - begin_index; new_segment->offset = current_length; g_sequence_append(result->segments, new_segment); result->length = length; result->encoding = self->encoding; } else { g_assert(length == 0 || begin == 0); /* New, empty chunk */ result = inf_text_chunk_new(g_quark_to_string(self->encoding)); } #ifdef CHUNK_CHECK_INTEGRITY g_assert(inf_text_chunk_check_integrity(result) == TRUE); #endif return result; } /** * inf_text_chunk_insert_text: * @self: A #InfTextChunk. * @offset: Character offset at which to insert text * @text: Text to insert. * @length: Number of characters contained in @text. * @bytes: Number of bytes of @text. * @author: User that wrote @text. * * Inserts text written by @author into @self. @text is expected to be in * the chunk's encoding. **/ void inf_text_chunk_insert_text(InfTextChunk* self, guint offset, gconstpointer text, gsize bytes, guint length, guint author) { GSequenceIter* iter; gsize offset_index; InfTextChunkSegment* segment; InfTextChunkSegment* new_segment; g_return_if_fail(self != NULL); g_return_if_fail(offset <= self->length); if(self->length > 0) { iter = inf_text_chunk_get_segment(self, offset, &offset_index); segment = (InfTextChunkSegment*)g_sequence_get(iter); /* Have to split segment, unless it is between two segments in which * case we can perhaps append to the previous. */ if(segment->author != author && offset > 0 && offset_index == 0) { g_assert(iter != g_sequence_get_begin_iter(self->segments)); iter = g_sequence_iter_prev(iter); segment = (InfTextChunkSegment*)g_sequence_get(iter); offset_index = segment->length; } if(segment->author != author) { /* No luck, split if necessary */ if(offset_index > 0 && offset_index < segment->length) { new_segment = g_slice_new(InfTextChunkSegment); new_segment->author = segment->author; new_segment->text = g_memdup( segment->text + offset_index, segment->length - offset_index ); new_segment->length = segment->length - offset_index; new_segment->offset = offset; iter = g_sequence_iter_next(iter); iter = g_sequence_insert_before(iter, new_segment); /* Don't realloc to make smaller */ segment->length = offset_index; /* Note that we did not invalidate offsets so far */ } else if(offset_index == segment->length) { /* Insert behind segment */ iter = g_sequence_iter_next(iter); } new_segment = g_slice_new(InfTextChunkSegment); new_segment->author = author; new_segment->text = g_memdup(text, bytes); new_segment->length = bytes; new_segment->offset = offset; g_sequence_insert_before(iter, new_segment); } else { /* TODO: g_malloc + g_free + 2*memcpy? */ segment->text = g_realloc(segment->text, segment->length + bytes); if(offset_index < segment->length) { g_memmove( segment->text + offset_index + bytes, segment->text + offset_index, segment->length - offset_index ); } memcpy(segment->text + offset_index, text, bytes); segment->length += bytes; iter = g_sequence_iter_next(iter); } /* Adjust offsets */ while(iter != g_sequence_get_end_iter(self->segments)) { segment = (InfTextChunkSegment*)g_sequence_get(iter); segment->offset += length; iter = g_sequence_iter_next(iter); } self->length += length; } else { new_segment = g_slice_new(InfTextChunkSegment); new_segment->author = author; new_segment->text = g_memdup(text, bytes); new_segment->length = bytes; new_segment->offset = 0; g_sequence_append(self->segments, new_segment); self->length = length; } #ifdef CHUNK_CHECK_INTEGRITY g_assert(inf_text_chunk_check_integrity(self) == TRUE); #endif } /** * inf_text_chunk_insert_chunk: * @self: A #InfTextChunk. * @offset: Character offset at which to insert text. * @text: Chunk to insert into @self. * * Inserts @text into @self at position @offset. @text and @self must * have the same encoding. **/ void inf_text_chunk_insert_chunk(InfTextChunk* self, guint offset, InfTextChunk* text) { GSequenceIter* iter; GSequenceIter* text_iter; gsize offset_index; InfTextChunkSegment* segment; InfTextChunkSegment* new_segment; GSequenceIter* first_iter; GSequenceIter* last_iter; InfTextChunkSegment* first; InfTextChunkSegment* last; InfTextChunkSegment* first_merge; InfTextChunkSegment* last_merge; GSequenceIter* beyond; g_return_if_fail(self != NULL); g_return_if_fail(offset <= self->length); g_return_if_fail(text != NULL); g_return_if_fail(self->encoding == text->encoding); if(self->length > 0 && text->length > 0) { if(g_sequence_get_length(text->segments) == 1) { segment = g_sequence_get(g_sequence_get_begin_iter(text->segments)); inf_text_chunk_insert_text( self, offset, segment->text, segment->length, text->length, segment->author ); } else { iter = inf_text_chunk_get_segment(self, offset, &offset_index); segment = (InfTextChunkSegment*)g_sequence_get(iter); /* First, we insert the first and last segment of text into self, * possibly merging with adjacent segments. Then, the rest is * copied. */ first_iter = g_sequence_get_begin_iter(text->segments); last_iter = g_sequence_iter_prev( g_sequence_get_end_iter(text->segments) ); first = (InfTextChunkSegment*)g_sequence_get(first_iter); last = (InfTextChunkSegment*)g_sequence_get(last_iter); /* 0 and 1 segment special cases have been handled above */ g_assert(first != last); last_merge = segment; first_merge = segment; /* beyond points to the first segment that needs offset adjustment * after insertion */ beyond = iter; /* Try merge with end of previous segment if inserting inbetween two * segments. */ if(offset_index == 0 && offset > 0) { g_assert(iter != g_sequence_get_begin_iter(self->segments)); iter = g_sequence_iter_prev(iter); first_merge = (InfTextChunkSegment*)g_sequence_get(iter); offset_index = first_merge->length; } if(offset == 0 || offset == self->length || first_merge != last_merge) { /* Insert between two segments, or at beginning/end */ if(first_merge->author == first->author && offset > 0) { /* Can merge first segment */ first_merge->length += first->length; first_merge->text = g_realloc( first_merge->text, first_merge->length ); memcpy( first_merge->text + first_merge->length - first->length, first->text, first->length ); /* Already inserted */ first_iter = g_sequence_iter_next(first_iter); } if(last_merge->author == last->author && offset < self->length) { /* Can merge last segment */ last_merge->length += last->length; last_merge->text = g_realloc(last_merge->text, last_merge->length); g_memmove( last_merge->text + last->length, last_merge->text, last_merge->length - last->length ); memcpy(last_merge->text, last->text, last->length); last_merge->offset = offset + last->offset; /* Merged with last, so don't need to adjust last_merge->offset * anymore, continue behind with offset adjustment. */ beyond = g_sequence_iter_next(beyond); } else { /* Could not merge last segment, so we have to insert it. Therefore, * make last_iter point to the end of the sequence. */ last_iter = g_sequence_iter_next(last_iter); if(offset_index > 0) /* Note: This is only false for offset == 0 */ beyond = g_sequence_iter_next(iter); } if(offset_index > 0) /* Note: This is only false for offset == 0 */ { /* Pointing to the position before which to insert * the rest of text. */ iter = g_sequence_iter_next(iter); } } else { /* Insert within a segment, split segment */ new_segment = g_slice_new(InfTextChunkSegment); new_segment->author = last_merge->author; if(last_merge->author == last->author) { /* Merge last part into new segment */ new_segment->length = last_merge->length - offset_index + last->length; new_segment->text = g_malloc(new_segment->length); memcpy(new_segment->text, last->text, last->length); memcpy( new_segment->text + last->length, last_merge->text + offset_index, last_merge->length - offset_index ); new_segment->offset = offset + last->offset; } else { /* Split up last part */ new_segment->length = last_merge->length - offset_index; new_segment->text = g_malloc(new_segment->length); memcpy( new_segment->text, last_merge->text + offset_index, new_segment->length ); new_segment->offset = offset + text->length; /* We still have to insert last segment since we could not merge */ last_iter = g_sequence_iter_next(last_iter); } iter = g_sequence_iter_next(iter); iter = g_sequence_insert_before(iter, new_segment); /* The segment just inserted is the last one being inserted, so * we need to adjust beyond that */ beyond = g_sequence_iter_next(iter); /* Note first_merge == last_merge */ if(first_merge->author == first->author) { /* Merge into first */ if(first_merge->length < offset_index + first->length) { first_merge->text = g_realloc( first_merge->text, offset_index + first->length ); } first_merge->length = offset_index + first->length; memcpy( first_merge->text + offset_index, first->text, first->length ); /* Already inserted */ first_iter = g_sequence_iter_next(first_iter); } else { /* Cannot merge, just cut */ first_merge->length = offset_index; } } /* iter now points to the segment before which the rest of text has to * be inserted */ for(text_iter = first_iter; text_iter != last_iter; text_iter = g_sequence_iter_next(text_iter)) { segment = g_sequence_get(text_iter); new_segment = g_slice_new(InfTextChunkSegment); new_segment->author = segment->author; new_segment->text = g_memdup(segment->text, segment->length); new_segment->length = segment->length; new_segment->offset = offset + segment->offset; g_sequence_insert_before(iter, new_segment); } for(iter = beyond; iter != g_sequence_get_end_iter(self->segments); iter = g_sequence_iter_next(iter)) { segment = g_sequence_get(iter); segment->offset += inf_text_chunk_get_length(text); } self->length += text->length; } } else { for(text_iter = g_sequence_get_begin_iter(text->segments); text_iter != g_sequence_get_end_iter(text->segments); text_iter = g_sequence_iter_next(text_iter)) { segment = (InfTextChunkSegment*)g_sequence_get(text_iter); new_segment = g_slice_new(InfTextChunkSegment); new_segment->author = segment->author; new_segment->text = g_memdup(segment->text, segment->length); new_segment->length = segment->length; new_segment->offset = segment->offset; g_sequence_append(self->segments, new_segment); } self->length += text->length; } #ifdef CHUNK_CHECK_INTEGRITY g_assert(inf_text_chunk_check_integrity(self) == TRUE); #endif } /** * inf_text_chunk_erase: * @self: A #InfTextChunk. * @begin: A character offset into @self. * @length: Number of characters to erase. * * Removes @length characters of @self, starting from character offset @begin. **/ void inf_text_chunk_erase(InfTextChunk* self, guint begin, guint length) { GSequenceIter* first_iter; GSequenceIter* last_iter; GSequenceIter* beyond; gsize first_index; gsize last_index; InfTextChunkSegment* first; InfTextChunkSegment* last; g_return_if_fail(self != NULL); g_return_if_fail(begin + length <= self->length); if(self->length > 0 && length > 0) { first_iter = inf_text_chunk_get_segment(self, begin, &first_index); last_iter = inf_text_chunk_get_segment(self, begin + length, &last_index); first = (InfTextChunkSegment*)g_sequence_get(first_iter); last = (InfTextChunkSegment*)g_sequence_get(last_iter); if(begin > 0 && begin + length < self->length) { if(first_index == 0) { g_assert(first_iter != g_sequence_get_end_iter(self->segments)); first_iter = g_sequence_iter_prev(first_iter); first = (InfTextChunkSegment*)g_sequence_get(first_iter); first_index = first->length; } if(first->author == last->author) { /* Can merge */ if(first == last) { /* Remove within a segment */ g_memmove( first->text + first_index, first->text + last_index, first->length - last_index ); first->length -= (last_index - first_index); beyond = g_sequence_iter_next(last_iter); } else { if(first->length < first_index + last->length - last_index) { first->text = g_realloc( first->text, first_index + last->length - last_index ); } first->length = first_index + last->length - last_index; memcpy( first->text + first_index, last->text + last_index, last->length - last_index ); last_iter = g_sequence_iter_next(last_iter); beyond = last_iter; } } else { /* This could only happen if these are the first or last segment, * of the whole chunk, respectively, which they are not * (as checked above). */ g_assert(first_index > 0); g_assert(last_index < last->length); /* Erase from border segments */ first->length = first_index; if(last_index > 0) { g_memmove( last->text, last->text + last_index, last->length - last_index ); } last->length -= last_index; last->offset = begin; /* We already adjusted offset of last, so only adjust behind */ beyond = g_sequence_iter_next(last_iter); } /* Keep first alive, we merged stuff into it */ first_iter = g_sequence_iter_next(first_iter); } else { if(begin == 0 && length == self->length) { /* Erase everything */ last_iter = g_sequence_iter_next(last_iter); g_assert(last_iter == g_sequence_get_end_iter(self->segments)); beyond = last_iter; } else if(begin == 0) { g_assert(last_index < last->length); /* Erase from beginning */ if(last_index > 0) { g_memmove( last->text, last->text + last_index, last->length - last_index ); last->length -= last_index; last->offset = 0; beyond = g_sequence_iter_next(last_iter); } else { /* First segments are completely removed */ beyond = last_iter; } } else { /* Erase until end */ /* This could only be possible in the last segment, but then we * would erase 0-length, which is a special case we would have * catched elsewhere. */ g_assert(first_index < first->length); if(first_index > 0) { /* Cannot erase whole first chunk */ first->length = first_index; first_iter = g_sequence_iter_next(first_iter); } last_iter = g_sequence_iter_next(last_iter); g_assert(last_iter == g_sequence_get_end_iter(self->segments)); beyond = last_iter; } } /* first_iter and last_iter have been adjusted so that we have to * remove [first_iter, last_iter). */ /* segments are freed through the sequence's destroy function */ g_sequence_remove_range(first_iter, last_iter); /* adjust offsets */ for(first_iter = beyond; first_iter != g_sequence_get_end_iter(self->segments); first_iter = g_sequence_iter_next(first_iter)) { first = (InfTextChunkSegment*)g_sequence_get(first_iter); first->offset -= length; } } self->length -= length; #ifdef CHUNK_CHECK_INTEGRITY g_assert(inf_text_chunk_check_integrity(self) == TRUE); #endif } /** * inf_text_chunk_get_text: * @self: A #InfTextChunk. * @length: Location to write the number of bytes to, or %NULL. * * Returns the content of @self as an array. The text is encoded in * @self's encoding. @length is set to the number of bytes in the returned * buffer, if non-%NULL. The result is _not_ zero-terminated. * * Return Value: Content of @self. Free with g_free() if no longer in use. **/ gpointer inf_text_chunk_get_text(InfTextChunk* self, gsize* length) { GSequenceIter* iter; InfTextChunkSegment* segment; gsize bytes; gsize cur; gchar* result; g_return_val_if_fail(self != NULL, NULL); bytes = 0; /* First pass, determine size */ for(iter = g_sequence_get_begin_iter(self->segments); iter != g_sequence_get_end_iter(self->segments); iter = g_sequence_iter_next(iter)) { segment = (InfTextChunkSegment*)g_sequence_get(iter); bytes += segment->length; } /* Second pass, copy */ result = g_malloc(bytes); cur = 0; for(iter = g_sequence_get_begin_iter(self->segments); iter != g_sequence_get_end_iter(self->segments); iter = g_sequence_iter_next(iter)) { segment = (InfTextChunkSegment*)g_sequence_get(iter); memcpy(result + cur, segment->text, segment->length); cur += segment->length; } if(length != NULL) *length = bytes; return result; } /** * inf_text_chunk_equal: * @self: A #InfTextChunk. * @other: Another #InfTextChunk. * * Returns whether the two text chunks contain the same text and the same * segments were written by the same authors. * * Return Value: Whether the two chunks are equal. **/ gboolean inf_text_chunk_equal(InfTextChunk* self, InfTextChunk* other) { GSequenceIter* iter1; GSequenceIter* iter2; InfTextChunkSegment* segment1; InfTextChunkSegment* segment2; g_return_val_if_fail(self != NULL, FALSE); g_return_val_if_fail(other != NULL, FALSE); g_return_val_if_fail(self->encoding == other->encoding, FALSE); iter1 = g_sequence_get_begin_iter(self->segments); iter2 = g_sequence_get_begin_iter(other->segments); while(iter1 != g_sequence_get_end_iter(self->segments) && iter2 != g_sequence_get_end_iter(other->segments)) { segment1 = (InfTextChunkSegment*)g_sequence_get(iter1); segment2 = (InfTextChunkSegment*)g_sequence_get(iter2); if(segment1->length != segment2->length) return FALSE; if(memcmp(segment1->text, segment2->text, segment1->length) != 0) return FALSE; iter1 = g_sequence_iter_next(iter1); iter2 = g_sequence_iter_next(iter2); } if(iter1 != g_sequence_get_end_iter(self->segments) || iter2 != g_sequence_get_end_iter(other->segments)) { return FALSE; } return TRUE; } /** * inf_text_chunk_iter_init: * @self: A #InfTextChunk. * @iter: A #InfTextChunkIter. * * Sets @iter to point to the first segment of @self. If there are no * segments (i.e. @self is empty), @iter is left untouched and the function * returns %FALSE. * * Return Value: Whether @iter was set. **/ gboolean inf_text_chunk_iter_init(InfTextChunk* self, InfTextChunkIter* iter) { g_return_val_if_fail(self != NULL, FALSE); g_return_val_if_fail(iter != NULL, FALSE); if(self->length > 0) { iter->chunk = self; iter->first = g_sequence_get_begin_iter(self->segments); iter->second = g_sequence_iter_next(iter->first); return TRUE; } else { return FALSE; } } /** * inf_text_chunk_iter_next: * @iter: An initialized #InfTextChunkIter. * * Sets @iter to point to the next segment. If @iter already points to the * last segment, the function returns %FALSE. * * Return Value: Whether @iter was set. **/ gboolean inf_text_chunk_iter_next(InfTextChunkIter* iter) { g_return_val_if_fail(iter != NULL, FALSE); if(g_sequence_iter_is_end(iter->second) == FALSE) { iter->first = iter->second; iter->second = g_sequence_iter_next(iter->first); return TRUE; } else { return FALSE; } } /** * inf_text_chunk_iter_prev: * @iter: An initialized #InfTextChunkIter. * * Sets @iter to point to the previous segment. If @iter already points to * the first segment, the function returns %FALSE. * * Returns: Whether @iter has changed. **/ gboolean inf_text_chunk_iter_prev(InfTextChunkIter* iter) { g_return_val_if_fail(iter != NULL, FALSE); if(g_sequence_iter_is_begin(iter->first) == FALSE) { iter->second = iter->first; iter->first = g_sequence_iter_prev(iter->first); return TRUE; } else { return FALSE; } } /** * inf_text_chunk_iter_get_text: * @iter: An initialized #InfTextChunkIter. * * Returns the text of the segment @iter points to. The text is in the * underlaying #InfTextChunk's encoding. * * Return Value: The text of the segment @iter points to. **/ gconstpointer inf_text_chunk_iter_get_text(InfTextChunkIter* iter) { g_return_val_if_fail(iter != NULL, NULL); return ((InfTextChunkSegment*)g_sequence_get(iter->first))->text; } /** * inf_text_chunk_iter_get_length: * @iter: An initialized #InfTextChunkIter. * * Returns the number of characters in the segment @iter points to. * * Return Value: The number of characters in the segment @iter points to. **/ guint inf_text_chunk_iter_get_length(InfTextChunkIter* iter) { InfTextChunkSegment* first; InfTextChunkSegment* second; g_return_val_if_fail(iter != NULL, 0); if(g_sequence_iter_is_end(iter->second) == TRUE) { first = (InfTextChunkSegment*)g_sequence_get(iter->first); return iter->chunk->length - first->offset; } else { first = (InfTextChunkSegment*)g_sequence_get(iter->first); second = (InfTextChunkSegment*)g_sequence_get(iter->second); return second->offset - first->offset; } } /** * inf_text_chunk_iter_get_bytes: * @iter: An initialized #InfTextChunkIter. * * Returns the number of bytes in the segment @iter points to. * * Return Value: The number of bytes in the segment @iter points to. **/ gsize inf_text_chunk_iter_get_bytes(InfTextChunkIter* iter) { g_return_val_if_fail(iter != NULL, 0); return ((InfTextChunkSegment*)g_sequence_get(iter->first))->length; } /** * inf_text_chunk_iter_get_author: * @iter: An initialized #InfTextChunkIter. * * Returns the user ID of the author of the segment @iter points to. * * Return Value: The user ID of the author of the segment @iter points to. **/ guint inf_text_chunk_iter_get_author(InfTextChunkIter* iter) { g_return_val_if_fail(iter != NULL, 0); return ((InfTextChunkSegment*)g_sequence_get(iter->first))->author; } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinftext/inf-text-move-operation.h0000644000175000017500000000564112264763732020025 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_TEXT_MOVE_OPERATION_H__ #define __INF_TEXT_MOVE_OPERATION_H__ #include G_BEGIN_DECLS #define INF_TEXT_TYPE_MOVE_OPERATION (inf_text_move_operation_get_type()) #define INF_TEXT_MOVE_OPERATION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INF_TEXT_TYPE_MOVE_OPERATION, InfTextMoveOperation)) #define INF_TEXT_MOVE_OPERATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INF_TEXT_TYPE_MOVE_OPERATION, InfTextMoveOperationClass)) #define INF_TEXT_IS_MOVE_OPERATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INF_TEXT_TYPE_MOVE_OPERATION)) #define INF_TEXT_IS_MOVE_OPERATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INF_TEXT_TYPE_MOVE_OPERATION)) #define INF_TEXT_MOVE_OPERATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), INF_TEXT_TYPE_MOVE_OPERATION, InfTextMoveOperationClass)) typedef struct _InfTextMoveOperation InfTextMoveOperation; typedef struct _InfTextMoveOperationClass InfTextMoveOperationClass; struct _InfTextMoveOperationClass { GObjectClass parent_class; }; struct _InfTextMoveOperation { GObject parent; }; GType inf_text_move_operation_get_type(void) G_GNUC_CONST; InfTextMoveOperation* inf_text_move_operation_new(guint position, gint length); guint inf_text_move_operation_get_position(InfTextMoveOperation* operation); gint inf_text_move_operation_get_length(InfTextMoveOperation* operation); void inf_text_move_operation_transform_insert(guint insert_position, guint insert_length, guint* move_position, gint* move_length, gboolean left_gravity); void inf_text_move_operation_transform_delete(guint delete_position, guint delete_length, guint* move_position, gint* move_length); G_END_DECLS #endif /* __INF_TEXT_MOVE_OPERATION_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinftext/inf-text-remote-delete-operation.c0000644000175000017500000005744712264763732021620 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include #include #include #include #include /* recon is helper information to reconstruct the original delete operation. * It stores the parts that have been erased from the remote delete operation * by transforming against other delete operations, including the deleted * text that is obtained from the operations transformed against. This * is necessary because that information is no longer available in the buffer * in the state the remote delete operation is made reversible. */ typedef struct _InfTextRemoteDeleteOperationRecon InfTextRemoteDeleteOperationRecon; struct _InfTextRemoteDeleteOperationRecon { guint position; InfTextChunk* chunk; }; typedef struct _InfTextRemoteDeleteOperationPrivate InfTextRemoteDeleteOperationPrivate; struct _InfTextRemoteDeleteOperationPrivate { guint position; guint length; /* TODO: Don't use GSList but link InfTextRemoteDeleteOperationRecon * directly? */ GSList* recon; /* TODO: We don't actually need recon_offset, it is just used in an * assertion. Perhaps keep in debug code. */ guint recon_offset; }; enum { PROP_0, PROP_POSITION, PROP_LENGTH }; #define INF_TEXT_REMOTE_DELETE_OPERATION_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), INF_TEXT_TYPE_REMOTE_DELETE_OPERATION, InfTextRemoteDeleteOperationPrivate)) static GObjectClass* parent_class; /* This appends an element to a GSList more efficiently than * g_slist_append() when the last item of the list in known. This updates * *last to point to the new last item. */ static GSList* g_slist_append_fast(GSList* list, GSList** last, gpointer item) { GSList* temp; g_assert(last != NULL); if(list == NULL) { list = g_slist_prepend(list, item); *last = list; } else { g_assert(*last != NULL); /* We don't actually need the return value, but glib warns if it * remains unused. We know that g_slist_append does not change the list * because the list has at least one element (otherwise it would be * NULL). */ temp = g_slist_append(*last, item); *last = (*last)->next; } return list; } static GSList* inf_text_remote_delete_operation_recon_copy(GSList* recon_list) { GSList* item; InfTextRemoteDeleteOperationRecon* recon; GSList* new_list; GSList* last; InfTextRemoteDeleteOperationRecon* new_recon; new_list = NULL; for(item = recon_list; item != NULL; item = g_slist_next(item)) { recon = (InfTextRemoteDeleteOperationRecon*)item->data; new_recon = g_slice_new(InfTextRemoteDeleteOperationRecon); new_recon->position = recon->position; new_recon->chunk = inf_text_chunk_copy(recon->chunk); new_list = g_slist_append_fast(new_list, &last, new_recon); } return new_list; } static void inf_text_remote_delete_operation_recon_free(GSList* recon_list) { GSList* item; InfTextRemoteDeleteOperationRecon* recon; for(item = recon_list; item != NULL; item = g_slist_next(item)) { recon = (InfTextRemoteDeleteOperationRecon*)item->data; inf_text_chunk_free(recon->chunk); g_slice_free(InfTextRemoteDeleteOperationRecon, recon); } g_slist_free(recon_list); } /* TODO: Make this work inline, adjust usages */ /* TODO: Merge adjacent text chunks */ static GSList* inf_text_remote_delete_operation_recon_feed(GSList* recon_list, guint position, InfTextChunk* chunk) { GSList* item; InfTextRemoteDeleteOperationRecon* recon; GSList* new_list; GSList* last; InfTextRemoteDeleteOperationRecon* new_recon; guint text_pos; guint cur_len; guint text_len; new_list = NULL; text_pos = 0; cur_len = 0; for(item = recon_list; item != NULL; item = g_slist_next(item)) { recon = (InfTextRemoteDeleteOperationRecon*)item->data; if(position + text_pos + cur_len < recon->position && text_pos < inf_text_chunk_get_length(chunk)) { text_len = recon->position - position - text_pos - cur_len; if(text_len > inf_text_chunk_get_length(chunk) - text_pos) text_len = inf_text_chunk_get_length(chunk) - text_pos; new_recon = g_slice_new(InfTextRemoteDeleteOperationRecon); new_recon->position = position + text_pos + cur_len; new_recon->chunk = inf_text_chunk_substring(chunk, text_pos, text_len); new_list = g_slist_append_fast(new_list, &last, new_recon); text_pos += text_len; } cur_len += inf_text_chunk_get_length(recon->chunk); new_recon = g_slice_new(InfTextRemoteDeleteOperationRecon); new_recon->position = recon->position; new_recon->chunk = inf_text_chunk_copy(recon->chunk); new_list = g_slist_append_fast(new_list, &last, new_recon); } if(text_pos < inf_text_chunk_get_length(chunk)) { new_recon = g_slice_new(InfTextRemoteDeleteOperationRecon); new_recon->position = position + text_pos + cur_len; new_recon->chunk = inf_text_chunk_substring( chunk, text_pos, inf_text_chunk_get_length(chunk) - text_pos ); new_list = g_slist_append_fast(new_list, &last, new_recon); } return new_list; } static void inf_text_remote_delete_operation_init(GTypeInstance* instance, gpointer g_class) { InfTextRemoteDeleteOperation* operation; InfTextRemoteDeleteOperationPrivate* priv; operation = INF_TEXT_REMOTE_DELETE_OPERATION(instance); priv = INF_TEXT_REMOTE_DELETE_OPERATION_PRIVATE(operation); priv->position = 0; priv->length = 0; priv->recon = NULL; priv->recon_offset = 0; } static void inf_text_remote_delete_operation_finalize(GObject* object) { InfTextRemoteDeleteOperation* operation; InfTextRemoteDeleteOperationPrivate* priv; operation = INF_TEXT_REMOTE_DELETE_OPERATION(object); priv = INF_TEXT_REMOTE_DELETE_OPERATION_PRIVATE(operation); inf_text_remote_delete_operation_recon_free(priv->recon); G_OBJECT_CLASS(parent_class)->finalize(object); } static void inf_text_remote_delete_operation_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec) { InfTextRemoteDeleteOperation* operation; InfTextRemoteDeleteOperationPrivate* priv; operation = INF_TEXT_REMOTE_DELETE_OPERATION(object); priv = INF_TEXT_REMOTE_DELETE_OPERATION_PRIVATE(operation); switch(prop_id) { case PROP_POSITION: priv->position = g_value_get_uint(value); break; case PROP_LENGTH: priv->length = g_value_get_uint(value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void inf_text_remote_delete_operation_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec) { InfTextRemoteDeleteOperation* operation; InfTextRemoteDeleteOperationPrivate* priv; operation = INF_TEXT_REMOTE_DELETE_OPERATION(object); priv = INF_TEXT_REMOTE_DELETE_OPERATION_PRIVATE(operation); switch(prop_id) { case PROP_POSITION: g_value_set_uint(value, priv->position); break; case PROP_LENGTH: g_value_set_uint(value, priv->length); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static gboolean inf_text_remote_delete_operation_need_concurrency_id( InfAdoptedOperation* operation, InfAdoptedOperation* against) { g_assert(INF_TEXT_IS_REMOTE_DELETE_OPERATION(operation)); return inf_text_delete_operation_need_concurrency_id( INF_TEXT_DELETE_OPERATION(operation), against ); } static InfAdoptedConcurrencyId inf_text_remote_delete_operation_get_concurrency_id( InfAdoptedOperation* operation, InfAdoptedOperation* against) { g_assert(INF_TEXT_IS_REMOTE_DELETE_OPERATION(operation)); return inf_text_delete_operation_get_concurrency_id( INF_TEXT_DELETE_OPERATION(operation), against ); } static InfAdoptedOperation* inf_text_remote_delete_operation_transform(InfAdoptedOperation* operation, InfAdoptedOperation* against, InfAdoptedConcurrencyId cid) { g_assert(INF_TEXT_IS_REMOTE_DELETE_OPERATION(operation)); if(INF_TEXT_IS_INSERT_OPERATION(against)) { return inf_text_delete_operation_transform_insert( INF_TEXT_DELETE_OPERATION(operation), INF_TEXT_INSERT_OPERATION(against), cid ); } else if(INF_TEXT_IS_DELETE_OPERATION(against)) { return inf_text_delete_operation_transform_delete( INF_TEXT_DELETE_OPERATION(operation), INF_TEXT_DELETE_OPERATION(against), cid ); } else { g_assert_not_reached(); return NULL; } } static InfAdoptedOperation* inf_text_remote_delete_operation_copy(InfAdoptedOperation* operation) { InfTextRemoteDeleteOperationPrivate* priv; GObject* result; InfTextRemoteDeleteOperationPrivate* result_priv; priv = INF_TEXT_REMOTE_DELETE_OPERATION_PRIVATE(operation); result = g_object_new( INF_TEXT_TYPE_REMOTE_DELETE_OPERATION, "position", priv->position, "length", priv->length, NULL ); result_priv = INF_TEXT_REMOTE_DELETE_OPERATION_PRIVATE(result); result_priv->recon = inf_text_remote_delete_operation_recon_copy( priv->recon ); result_priv->recon_offset = priv->recon_offset; return INF_ADOPTED_OPERATION(result); } static InfAdoptedOperationFlags inf_text_remote_delete_operation_get_flags(InfAdoptedOperation* operation) { /* RemoteDeleteOperation is not reversible because it does not know * what text has been deleted */ return INF_ADOPTED_OPERATION_AFFECTS_BUFFER; } static void inf_text_remote_delete_operation_apply(InfAdoptedOperation* operation, InfAdoptedUser* by, InfBuffer* buffer) { InfTextRemoteDeleteOperationPrivate* priv; g_assert(INF_TEXT_IS_REMOTE_DELETE_OPERATION(operation)); g_assert(INF_TEXT_IS_BUFFER(buffer)); priv = INF_TEXT_REMOTE_DELETE_OPERATION_PRIVATE(operation); inf_text_buffer_erase_text( INF_TEXT_BUFFER(buffer), priv->position, priv->length, INF_USER(by) ); } static InfAdoptedOperation* inf_text_remote_delete_operation_make_reversible(InfAdoptedOperation* op, InfAdoptedOperation* with, InfBuffer* buffer) { InfTextRemoteDeleteOperationPrivate* priv; InfTextChunk* chunk; InfTextChunk* temp_slice; GSList* list; GSList* item; GSList* recon_list; GSList* recon_item; InfTextRemoteDeleteOperationRecon* recon; InfTextDefaultDeleteOperation* result; g_assert(INF_TEXT_IS_REMOTE_DELETE_OPERATION(op)); g_assert(INF_TEXT_IS_BUFFER(buffer)); /* TODO: We can probably optimize this function, but then we should * a) profile it and b) in many cases input parameters to this function * are trivial anyway. */ if(INF_ADOPTED_IS_SPLIT_OPERATION(with)) { list = inf_adopted_split_operation_unsplit( INF_ADOPTED_SPLIT_OPERATION(with) ); } else { list = g_slist_prepend(NULL, with); } chunk = inf_text_chunk_new( inf_text_buffer_get_encoding(INF_TEXT_BUFFER(buffer)) ); /* We assume the list of remote delete operations to be in order */ for(item = list; item != NULL; item = g_slist_next(item)) { g_assert(INF_TEXT_IS_REMOTE_DELETE_OPERATION(item->data)); priv = INF_TEXT_REMOTE_DELETE_OPERATION_PRIVATE(item->data); if(priv->length > 0) { temp_slice = inf_text_buffer_get_slice( INF_TEXT_BUFFER(buffer), priv->position, priv->length ); recon_list = inf_text_remote_delete_operation_recon_feed( priv->recon, 0, temp_slice ); inf_text_chunk_free(temp_slice); } else { recon_list = priv->recon; } for(recon_item = recon_list; recon_item != NULL; recon_item = g_slist_next(recon_item)) { recon = (InfTextRemoteDeleteOperationRecon*)recon_item->data; g_assert(priv->recon_offset + recon->position == inf_text_chunk_get_length(chunk)); inf_text_chunk_insert_chunk( chunk, inf_text_chunk_get_length(chunk), recon->chunk ); } /* Free recon list if newly allocated */ if(priv->length > 0) inf_text_remote_delete_operation_recon_free(recon_list); } g_slist_free(list); priv = INF_TEXT_REMOTE_DELETE_OPERATION_PRIVATE(op); result = inf_text_default_delete_operation_new(priv->position, chunk); inf_text_chunk_free(chunk); return INF_ADOPTED_OPERATION(result); } static guint inf_text_remote_delete_operation_get_position( InfTextDeleteOperation* operation) { return INF_TEXT_REMOTE_DELETE_OPERATION_PRIVATE(operation)->position; } static guint inf_text_remote_delete_operation_get_length(InfTextDeleteOperation* operation) { return INF_TEXT_REMOTE_DELETE_OPERATION_PRIVATE(operation)->length; } static InfTextDeleteOperation* inf_text_remote_delete_operation_transform_position( InfTextDeleteOperation* operation, guint position) { InfTextRemoteDeleteOperationPrivate* priv; GObject* result; InfTextRemoteDeleteOperationPrivate* result_priv; priv = INF_TEXT_REMOTE_DELETE_OPERATION_PRIVATE(operation); result = g_object_new( INF_TEXT_TYPE_REMOTE_DELETE_OPERATION, "position", position, "length", priv->length, NULL ); result_priv = INF_TEXT_REMOTE_DELETE_OPERATION_PRIVATE(result); result_priv->recon = inf_text_remote_delete_operation_recon_copy( priv->recon ); result_priv->recon_offset = priv->recon_offset; return INF_TEXT_DELETE_OPERATION(result); } static InfTextDeleteOperation* inf_text_remote_delete_operation_transform_overlap( InfTextDeleteOperation* operation, InfTextDeleteOperation* other, guint position, guint begin, guint other_begin, guint length) { InfTextRemoteDeleteOperationPrivate* priv; InfTextChunk* chunk; GObject* result; InfTextRemoteDeleteOperationPrivate* result_priv; /* It is actually possible that two remote delete operations are * transformed against each other (actually the parts of a splitted * remote delete operation). However, they must not overlap. */ g_assert(INF_TEXT_IS_DEFAULT_DELETE_OPERATION(other)); priv = INF_TEXT_REMOTE_DELETE_OPERATION_PRIVATE(operation); chunk = inf_text_chunk_substring( inf_text_default_delete_operation_get_chunk( INF_TEXT_DEFAULT_DELETE_OPERATION(other) ), other_begin, length ); result = g_object_new( INF_TEXT_TYPE_REMOTE_DELETE_OPERATION, "position", position, "length", priv->length - length, NULL ); result_priv = INF_TEXT_REMOTE_DELETE_OPERATION_PRIVATE(result); result_priv->recon = inf_text_remote_delete_operation_recon_feed( priv->recon, begin, chunk ); inf_text_chunk_free(chunk); result_priv->recon_offset = priv->recon_offset; return INF_TEXT_DELETE_OPERATION(result); } static InfAdoptedSplitOperation* inf_text_remote_delete_operation_transform_split( InfTextDeleteOperation* operation, guint split_pos, guint split_len) { /* Need to split the delete operation and the recon list */ InfTextRemoteDeleteOperationPrivate* priv; InfAdoptedSplitOperation* result; GObject* first_operation; GObject* second_operation; InfTextRemoteDeleteOperationPrivate* result_priv; InfTextRemoteDeleteOperationRecon* recon; InfTextRemoteDeleteOperationRecon* new_recon; GSList* first_recon; GSList* second_recon; guint recon_cur_len; GSList* item; priv = INF_TEXT_REMOTE_DELETE_OPERATION_PRIVATE(operation); first_recon = NULL; second_recon = NULL; recon_cur_len = 0; for(item = priv->recon; item != NULL; item = g_slist_next(item)) { recon = (InfTextRemoteDeleteOperationRecon*)item->data; g_assert(recon->position >= recon_cur_len); if(recon->position - recon_cur_len <= split_pos) { new_recon = g_slice_new(InfTextRemoteDeleteOperationRecon); new_recon->position = recon->position; new_recon->chunk = inf_text_chunk_copy(recon->chunk); first_recon = g_slist_prepend(first_recon, new_recon); recon_cur_len += inf_text_chunk_get_length(recon->chunk); } else { new_recon = g_slice_new(InfTextRemoteDeleteOperationRecon); new_recon->position = recon->position - (split_pos + recon_cur_len); new_recon->chunk = inf_text_chunk_copy(recon->chunk); second_recon = g_slist_prepend(second_recon, new_recon); } } first_operation = g_object_new( INF_TEXT_TYPE_REMOTE_DELETE_OPERATION, "position", priv->position, "length", split_pos, NULL ); second_operation = g_object_new( INF_TEXT_TYPE_REMOTE_DELETE_OPERATION, "position", priv->position + split_pos + split_len, "length", priv->length - split_pos, NULL ); result_priv = INF_TEXT_REMOTE_DELETE_OPERATION_PRIVATE(first_operation); result_priv->recon = g_slist_reverse(first_recon); result_priv->recon_offset = priv->recon_offset; result_priv = INF_TEXT_REMOTE_DELETE_OPERATION_PRIVATE(second_operation); result_priv->recon = g_slist_reverse(second_recon); result_priv->recon_offset = priv->recon_offset + split_pos + recon_cur_len; result = inf_adopted_split_operation_new( INF_ADOPTED_OPERATION(first_operation), INF_ADOPTED_OPERATION(second_operation) ); g_object_unref(G_OBJECT(second_operation)); g_object_unref(G_OBJECT(first_operation)); return result; } static void inf_text_remote_delete_operation_class_init(gpointer g_class, gpointer class_data) { GObjectClass* object_class; object_class = G_OBJECT_CLASS(g_class); parent_class = G_OBJECT_CLASS(g_type_class_peek_parent(g_class)); g_type_class_add_private(g_class, sizeof(InfTextRemoteDeleteOperationPrivate)); object_class->finalize = inf_text_remote_delete_operation_finalize; object_class->set_property = inf_text_remote_delete_operation_set_property; object_class->get_property = inf_text_remote_delete_operation_get_property; g_object_class_install_property( object_class, PROP_POSITION, g_param_spec_uint( "position", "Position", "Position where to start deleting characters", 0, G_MAXUINT, 0, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); g_object_class_install_property( object_class, PROP_LENGTH, g_param_spec_uint( "length", "Length", "The length of the deleted text", 0, G_MAXUINT, 0, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); } static void inf_text_remote_delete_operation_operation_init(gpointer g_iface, gpointer iface_data) { InfAdoptedOperationIface* iface; iface = (InfAdoptedOperationIface*)g_iface; iface->need_concurrency_id = inf_text_remote_delete_operation_need_concurrency_id; iface->get_concurrency_id = inf_text_remote_delete_operation_get_concurrency_id; iface->transform = inf_text_remote_delete_operation_transform; iface->copy = inf_text_remote_delete_operation_copy; iface->get_flags = inf_text_remote_delete_operation_get_flags; iface->apply = inf_text_remote_delete_operation_apply; /* RemoteDeleteOperation is not reversible */ iface->revert = NULL; iface->make_reversible = inf_text_remote_delete_operation_make_reversible; } static void inf_text_remote_delete_operation_delete_operation_init(gpointer g_iface, gpointer iface_data) { InfTextDeleteOperationIface* iface; iface = (InfTextDeleteOperationIface*)g_iface; iface->get_position = inf_text_remote_delete_operation_get_position; iface->get_length = inf_text_remote_delete_operation_get_length; iface->transform_position = inf_text_remote_delete_operation_transform_position; iface->transform_overlap = inf_text_remote_delete_operation_transform_overlap; iface->transform_split = inf_text_remote_delete_operation_transform_split; } GType inf_text_remote_delete_operation_get_type(void) { static GType remote_delete_operation_type = 0; if(!remote_delete_operation_type) { static const GTypeInfo remote_delete_operation_type_info = { sizeof(InfTextRemoteDeleteOperationClass), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ inf_text_remote_delete_operation_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InfTextRemoteDeleteOperation), /* instance_size */ 0, /* n_preallocs */ inf_text_remote_delete_operation_init, /* instance_init */ NULL /* value_table */ }; static const GInterfaceInfo operation_info = { inf_text_remote_delete_operation_operation_init, NULL, NULL }; static const GInterfaceInfo delete_operation_info = { inf_text_remote_delete_operation_delete_operation_init, NULL, NULL }; remote_delete_operation_type = g_type_register_static( G_TYPE_OBJECT, "InfTextRemoteDeleteOperation", &remote_delete_operation_type_info, 0 ); g_type_add_interface_static( remote_delete_operation_type, INF_ADOPTED_TYPE_OPERATION, &operation_info ); g_type_add_interface_static( remote_delete_operation_type, INF_TEXT_TYPE_DELETE_OPERATION, &delete_operation_info ); } return remote_delete_operation_type; } /** * inf_text_remote_delete_operation_new: * @position: The position at which to delete text. * @length: The number of characters to delete. * * Creates a new delete operation that, when applied, deletes @length * characters starting from position @position. Note that this operation is * not reversible because it does not know the text to delete and is therefore * only used to transmit a delete operation through the network to reduce * bandwidth usage. The other part can then reconstruct the deleted text * using the make_reversible vfunc. * * However, it is easier to just use #InfTextDefaultDeleteOperation if you * want the operation to be reversible. * * Return Value: A new #InfTextRemoteDeleteOperation. **/ InfTextRemoteDeleteOperation* inf_text_remote_delete_operation_new(guint position, guint length) { GObject* object; object = g_object_new( INF_TEXT_TYPE_REMOTE_DELETE_OPERATION, "position", position, "length", length, NULL ); return INF_TEXT_REMOTE_DELETE_OPERATION(object); } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinftext/inf-text-move-operation.c0000644000175000017500000004031012264763732020010 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include #include #include #include typedef struct _InfTextMoveOperationPrivate InfTextMoveOperationPrivate; struct _InfTextMoveOperationPrivate { guint position; gint length; }; enum { PROP_0, PROP_POSITION, PROP_LENGTH }; #define INF_TEXT_MOVE_OPERATION_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), INF_TEXT_TYPE_MOVE_OPERATION, InfTextMoveOperationPrivate)) static GObjectClass* parent_class; static void inf_text_move_operation_init(GTypeInstance* instance, gpointer g_class) { InfTextMoveOperation* operation; InfTextMoveOperationPrivate* priv; operation = INF_TEXT_MOVE_OPERATION(instance); priv = INF_TEXT_MOVE_OPERATION_PRIVATE(operation); priv->position = 0; priv->length = 0; } static void inf_text_move_operation_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec) { InfTextMoveOperation* operation; InfTextMoveOperationPrivate* priv; operation = INF_TEXT_MOVE_OPERATION(object); priv = INF_TEXT_MOVE_OPERATION_PRIVATE(operation); switch(prop_id) { case PROP_POSITION: priv->position = g_value_get_uint(value); break; case PROP_LENGTH: priv->length = g_value_get_int(value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void inf_text_move_operation_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec) { InfTextMoveOperation* operation; InfTextMoveOperationPrivate* priv; operation = INF_TEXT_MOVE_OPERATION(object); priv = INF_TEXT_MOVE_OPERATION_PRIVATE(operation); switch(prop_id) { case PROP_POSITION: g_value_set_uint(value, priv->position); break; case PROP_LENGTH: g_value_set_int(value, priv->length); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static gboolean inf_text_move_operation_need_concurrency_id(InfAdoptedOperation* operation, InfAdoptedOperation* against) { g_assert(INF_TEXT_IS_MOVE_OPERATION(operation)); return FALSE; } static InfAdoptedConcurrencyId inf_text_move_operation_get_concurrency_id(InfAdoptedOperation* operation, InfAdoptedOperation* against) { g_assert(INF_TEXT_IS_MOVE_OPERATION(operation)); _inf_adopted_concurrency_warning(INF_TEXT_TYPE_MOVE_OPERATION); return INF_ADOPTED_CONCURRENCY_NONE; } static InfAdoptedOperation* inf_text_move_operation_transform(InfAdoptedOperation* operation, InfAdoptedOperation* against, gint concurrency_id) { InfTextMoveOperationPrivate* priv; guint new_pos; gint new_len; g_assert(INF_TEXT_IS_MOVE_OPERATION(operation)); priv = INF_TEXT_MOVE_OPERATION_PRIVATE(operation); new_pos = priv->position; new_len = priv->length; if(INF_TEXT_IS_INSERT_OPERATION(against)) { inf_text_move_operation_transform_insert( inf_text_insert_operation_get_position( INF_TEXT_INSERT_OPERATION(against) ), inf_text_insert_operation_get_length( INF_TEXT_INSERT_OPERATION(against) ), &new_pos, &new_len, TRUE /* left gravity */ ); } else if(INF_TEXT_IS_DELETE_OPERATION(against)) { inf_text_move_operation_transform_delete( inf_text_delete_operation_get_position( INF_TEXT_DELETE_OPERATION(against) ), inf_text_delete_operation_get_length( INF_TEXT_DELETE_OPERATION(against) ), &new_pos, &new_len ); } else { g_assert_not_reached(); return NULL; } return INF_ADOPTED_OPERATION( g_object_new( INF_TEXT_TYPE_MOVE_OPERATION, "position", new_pos, "length", new_len, NULL ) ); } static InfAdoptedOperation* inf_text_move_operation_copy(InfAdoptedOperation* operation) { InfTextMoveOperationPrivate* priv; GObject* object; g_assert(INF_TEXT_IS_MOVE_OPERATION(operation)); priv = INF_TEXT_MOVE_OPERATION_PRIVATE(operation); object = g_object_new( INF_TEXT_TYPE_MOVE_OPERATION, "position", priv->position, "length", priv->length, NULL ); return INF_ADOPTED_OPERATION(object); } static InfAdoptedOperationFlags inf_text_move_operation_get_flags(InfAdoptedOperation* operation) { /* Does not affect the buffer */ return 0; } static void inf_text_move_operation_apply(InfAdoptedOperation* operation, InfAdoptedUser* by, InfBuffer* buffer) { InfTextMoveOperationPrivate* priv; g_assert(INF_TEXT_IS_MOVE_OPERATION(operation)); g_assert(INF_TEXT_IS_USER(by)); priv = INF_TEXT_MOVE_OPERATION_PRIVATE(operation); inf_text_user_set_selection( INF_TEXT_USER(by), priv->position, priv->length, TRUE /* explicit move request */ ); } static InfAdoptedOperation* inf_text_move_operation_revert(InfAdoptedOperation* operation) { /* Not reversible */ g_assert_not_reached(); return NULL; } static InfAdoptedOperation* inf_text_move_operation_make_reversible(InfAdoptedOperation* operation, InfAdoptedOperation* with, InfBuffer* buffer) { /* MoveOperation cannot be made reversible */ g_assert_not_reached(); return NULL; } static void inf_text_move_operation_class_init(gpointer g_class, gpointer class_data) { GObjectClass* object_class; object_class = G_OBJECT_CLASS(g_class); parent_class = G_OBJECT_CLASS(g_type_class_peek_parent(g_class)); g_type_class_add_private(g_class, sizeof(InfTextMoveOperationPrivate)); object_class->set_property = inf_text_move_operation_set_property; object_class->get_property = inf_text_move_operation_get_property; g_object_class_install_property( object_class, PROP_POSITION, g_param_spec_uint( "position", "Position", "Position where to place the user's caret at", 0, G_MAXUINT, 0, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); g_object_class_install_property( object_class, PROP_LENGTH, g_param_spec_int( "length", "Length", "The number of characters of the selected text", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); } static void inf_text_move_operation_operation_init(gpointer g_iface, gpointer iface_data) { InfAdoptedOperationIface* iface; iface = (InfAdoptedOperationIface*)g_iface; iface->need_concurrency_id = inf_text_move_operation_need_concurrency_id; iface->get_concurrency_id = inf_text_move_operation_get_concurrency_id; iface->transform = inf_text_move_operation_transform; iface->copy = inf_text_move_operation_copy; iface->get_flags = inf_text_move_operation_get_flags; iface->apply = inf_text_move_operation_apply; iface->revert = inf_text_move_operation_revert; iface->make_reversible = inf_text_move_operation_make_reversible; } GType inf_text_move_operation_get_type(void) { static GType move_operation_type = 0; if(!move_operation_type) { static const GTypeInfo move_operation_type_info = { sizeof(InfTextMoveOperationClass), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ inf_text_move_operation_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InfTextMoveOperation), /* instance_size */ 0, /* n_preallocs */ inf_text_move_operation_init, /* instance_init */ NULL /* value_table */ }; static const GInterfaceInfo operation_info = { inf_text_move_operation_operation_init, NULL, NULL }; move_operation_type = g_type_register_static( G_TYPE_OBJECT, "InfTextMoveOperation", &move_operation_type_info, 0 ); g_type_add_interface_static( move_operation_type, INF_ADOPTED_TYPE_OPERATION, &operation_info ); } return move_operation_type; } /** * inf_text_move_operation_new: * @position: The position to place the user's caret at. * @length: The number of characters to select. Negative means selection * towards the beginning of the buffer. * * Creates a new move operation that, when applied, changes the caret and * selection of the applying user. * * Return Value: A new #InfTextMoveOperation. **/ InfTextMoveOperation* inf_text_move_operation_new(guint position, gint length) { GObject* object; object = g_object_new( INF_TEXT_TYPE_MOVE_OPERATION, "position", position, "length", length, NULL ); return INF_TEXT_MOVE_OPERATION(object); } /** * inf_text_move_operation_get_position: * @operation: A #InfTextMoveOperation. * * Returns the position at which @operation places the user's cursor. * * Return Value: The position of @operation. **/ guint inf_text_move_operation_get_position(InfTextMoveOperation* operation) { g_return_val_if_fail(INF_TEXT_IS_MOVE_OPERATION(operation), 0); return INF_TEXT_MOVE_OPERATION_PRIVATE(operation)->position; } /** * inf_text_move_operation_get_length: * @operation: A #InfTextMoveOperation. * * Returns the length to which @operation changes the user's selection. * Negative means selection towards the beginning of the buffer. * * Return Value: The length of @operation. **/ gint inf_text_move_operation_get_length(InfTextMoveOperation* operation) { g_return_val_if_fail(INF_TEXT_IS_MOVE_OPERATION(operation), 0); return INF_TEXT_MOVE_OPERATION_PRIVATE(operation)->length; } /** * inf_text_move_operation_transform_insert: * @insert_position: The position at which text is inserted. * @insert_length: The number of inserted characters. * @move_position: Points to the character offset to which the caret is moved. * @move_length: Points to the number of characters selected. Negative means * towards the beginning. * @left_gravity: Whether the move position and length have left gravity. * * Changes *@move_position and *@move_length so that they point to the same * region when @insert_length characters are inserted at @insert_position. * * If text is inserted at the same position as @move_position, then * @move_position is kept at the position it currently is if @left_gravity is * %TRUE, otherwise it is shifted to the right. * * If *@move_length is nonzero, then the selection length is never enlarged if * text is inserted at the selection bounds, not depending on whether * @left_gravity is set or not. **/ void inf_text_move_operation_transform_insert(guint insert_position, guint insert_length, guint* move_position, gint* move_length, gboolean left_gravity) { guint cur_pos; guint cur_bound; g_return_if_fail(move_position != NULL); g_return_if_fail(move_length != NULL); cur_pos = *move_position; cur_bound = *move_position + *move_length; if(cur_pos == cur_bound) { if( (insert_position < cur_pos) || (insert_position == cur_pos && !left_gravity)) { cur_pos += insert_length; cur_bound += insert_length; } } else { if(cur_bound > cur_pos) { if(insert_position <= cur_pos) { cur_pos += insert_length; cur_bound += insert_length; } else if(insert_position < cur_bound) { cur_bound += insert_length; } } else { if(insert_position <= cur_bound) { cur_pos += insert_length; cur_bound += insert_length; } else if(insert_position < cur_pos) { cur_pos += insert_length; } } } *move_position = cur_pos; *move_length = (gint)cur_bound - (gint)cur_pos; } /** * inf_text_move_operation_transform_delete: * @delete_position: The position at which text is deleted. * @delete_length: The number of deleted characters. * @move_position: Points to the character offset to which the caret is moved. * @move_length: Points to the number of characters selected. Negative means * towards the beginning. * * Changes *@move_position and *@move_length so that they point to the same * region when @delete_length characters are deleted starting from * @delete_position. **/ void inf_text_move_operation_transform_delete(guint delete_position, guint delete_length, guint* move_position, gint* move_length) { guint cur_pos; gint cur_len; g_return_if_fail(move_position != NULL); g_return_if_fail(move_length != NULL); cur_pos = *move_position; cur_len = *move_length; if(cur_pos >= delete_position + delete_length) *move_position = cur_pos - delete_length; else if(cur_pos > delete_position) *move_position = delete_position; else *move_position = cur_pos; if(cur_len < 0) { if(delete_position + delete_length <= cur_pos + cur_len) { *move_length = cur_len; } else if(delete_position >= cur_pos) { *move_length = cur_len; } else if(delete_position <= cur_pos + cur_len && delete_position + delete_length >= cur_pos) { *move_length = 0; } else if(delete_position <= cur_pos + cur_len && delete_position + delete_length > cur_pos + cur_len) { *move_length = -(gint)(cur_pos - (delete_position + delete_length)); } else if(delete_position > cur_pos + cur_len && delete_position + delete_length > cur_pos) { *move_length = delete_position - (cur_pos + cur_len); } else if(delete_position > cur_pos + cur_len && delete_position + delete_length <= cur_pos) { *move_length = cur_len + (gint)delete_length; } else { g_assert_not_reached(); } } else { if(delete_position + delete_length <= cur_pos) { *move_length = cur_len; } else if(delete_position >= cur_pos + cur_len) { *move_length = cur_len; } else if(delete_position <= cur_pos && delete_position + delete_length >= cur_pos + cur_len) { *move_length = 0; } else if(delete_position <= cur_pos && delete_position + delete_length > cur_pos) { *move_length = cur_pos + cur_len - (delete_position + delete_length); } else if(delete_position > cur_pos && delete_position + delete_length > cur_pos + cur_len) { *move_length = cur_pos - delete_position; } else if(delete_position > cur_pos && delete_position + delete_length <= cur_pos + cur_len) { *move_length = cur_len - delete_length; } else { g_assert_not_reached(); } } } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinftext/inf-text-buffer.c0000644000175000017500000003555112264763732016330 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include enum { TEXT_INSERTED, TEXT_ERASED, LAST_SIGNAL }; static guint text_buffer_signals[LAST_SIGNAL]; static void inf_text_buffer_base_init(gpointer g_class) { static gboolean initialized = FALSE; if(!initialized) { text_buffer_signals[TEXT_INSERTED] = g_signal_new( "text-inserted", INF_TEXT_TYPE_BUFFER, G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET(InfTextBufferIface, text_inserted), NULL, NULL, inf_marshal_VOID__UINT_BOXED_OBJECT, G_TYPE_NONE, 3, G_TYPE_UINT, INF_TEXT_TYPE_CHUNK | G_SIGNAL_TYPE_STATIC_SCOPE, INF_TYPE_USER ); text_buffer_signals[TEXT_ERASED] = g_signal_new( "text-erased", INF_TEXT_TYPE_BUFFER, G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET(InfTextBufferIface, text_erased), NULL, NULL, inf_marshal_VOID__UINT_BOXED_OBJECT, G_TYPE_NONE, 3, G_TYPE_UINT, INF_TEXT_TYPE_CHUNK | G_SIGNAL_TYPE_STATIC_SCOPE, INF_TYPE_USER ); initialized = TRUE; } } GType inf_text_buffer_get_type(void) { static GType text_buffer_type = 0; if(!text_buffer_type) { static const GTypeInfo text_buffer_info = { sizeof(InfTextBufferIface), /* class_size */ inf_text_buffer_base_init, /* base_init */ NULL, /* base_finalize */ NULL, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ 0, /* instance_size */ 0, /* n_preallocs */ NULL, /* instance_init */ NULL /* value_table */ }; text_buffer_type = g_type_register_static( G_TYPE_INTERFACE, "InfTextBuffer", &text_buffer_info, 0 ); g_type_interface_add_prerequisite(text_buffer_type, INF_TYPE_BUFFER); } return text_buffer_type; } /** * inf_text_buffer_get_encoding: * @buffer: A #InfTextBuffer. * * Returns the character encoding that the buffer uses. This means that all * #InfTextChunk return values are encoded in this encoding and all * #InfTextChunk parameters are expected to be encoded in that encoding. * * Return Value: The character encoding for @buffer. **/ const gchar* inf_text_buffer_get_encoding(InfTextBuffer* buffer) { InfTextBufferIface* iface; g_return_val_if_fail(INF_TEXT_IS_BUFFER(buffer), NULL); iface = INF_TEXT_BUFFER_GET_IFACE(buffer); g_return_val_if_fail(iface->get_encoding != NULL, NULL); return iface->get_encoding(buffer); } /** * inf_text_buffer_get_length: * @buffer: A #InfTextBuffer. * * Returns the number of characters in @buffer. * * Return Value: The length of @buffer. **/ guint inf_text_buffer_get_length(InfTextBuffer* buffer) { InfTextBufferIface* iface; g_return_val_if_fail(INF_TEXT_IS_BUFFER(buffer), 0); iface = INF_TEXT_BUFFER_GET_IFACE(buffer); g_return_val_if_fail(iface->get_length != NULL, 0); return iface->get_length(buffer); } /** * inf_text_buffer_get_slice: * @buffer: A #InfTextBuffer. * @pos: Character offset of where to start extracting. * @len: Number of characters to extract. * * Reads @len characters, starting at @pos, from the buffer, and returns them * as a #InfTextChunk. * * Return Value: A #InfTextChunk. **/ InfTextChunk* inf_text_buffer_get_slice(InfTextBuffer* buffer, guint pos, guint len) { InfTextBufferIface* iface; g_return_val_if_fail(INF_TEXT_IS_BUFFER(buffer), NULL); iface = INF_TEXT_BUFFER_GET_IFACE(buffer); g_return_val_if_fail(iface->get_slice != NULL, NULL); return iface->get_slice(buffer, pos, len); } /** * inf_text_buffer_insert_text: * @buffer: A #InfTextBuffer. * @pos: A character offset into @buffer. * @text: A pointer to the text to insert. * @len: The length (in characters) of @text. * @bytes: The length (in bytes) of @text. * @user: A #InfUser that has inserted the new text, or %NULL. * * Inserts @text into @buffer as written by @author. @text must be encoded in * the character encoding of the buffer, see inf_text_buffer_get_encoding(). **/ void inf_text_buffer_insert_text(InfTextBuffer* buffer, guint pos, gconstpointer text, gsize bytes, guint len, InfUser* user) { InfTextBufferIface* iface; InfTextChunk* chunk; g_return_if_fail(INF_TEXT_IS_BUFFER(buffer)); g_return_if_fail(text != NULL); g_return_if_fail(user == NULL || INF_IS_USER(user)); iface = INF_TEXT_BUFFER_GET_IFACE(buffer); g_return_if_fail(iface->insert_text != NULL); chunk = inf_text_chunk_new(inf_text_buffer_get_encoding(buffer)); inf_text_chunk_insert_text( chunk, 0, text, bytes, len, user == NULL ? 0 : inf_user_get_id(user) ); iface->insert_text(buffer, pos, chunk, user); inf_text_chunk_free(chunk); } /** * inf_text_buffer_insert_chunk: * @buffer: A #InfTextBuffer. * @pos: A character offset into @buffer. * @chunk: A #InfTextChunk. * @user: A #InfUser inserting @chunk, or %NULL. * * Inserts a #InfTextChunk into @buffer. @user must not necessarily be the * author of @chunk (@chunk may even consist of multiple segments). This * happens when undoing a delete operation that erased another user's text. **/ void inf_text_buffer_insert_chunk(InfTextBuffer* buffer, guint pos, InfTextChunk* chunk, InfUser* user) { InfTextBufferIface* iface; g_return_if_fail(INF_TEXT_IS_BUFFER(buffer)); g_return_if_fail(chunk != NULL); g_return_if_fail(user == NULL || INF_IS_USER(user)); iface = INF_TEXT_BUFFER_GET_IFACE(buffer); g_return_if_fail(iface->insert_text != NULL); iface->insert_text(buffer, pos, chunk, user); } /** * inf_text_buffer_erase_text: * @buffer: A #InfTextBuffer. * @pos: The position to begin deleting characters from. * @len: The amount of characters to delete. * @user: A #InfUser that erases the text, or %NULL. * * Erases characters from the text buffer. **/ void inf_text_buffer_erase_text(InfTextBuffer* buffer, guint pos, guint len, InfUser* user) { InfTextBufferIface* iface; g_return_if_fail(INF_TEXT_IS_BUFFER(buffer)); g_return_if_fail(user == NULL || INF_IS_USER(user)); iface = INF_TEXT_BUFFER_GET_IFACE(buffer); g_return_if_fail(iface->erase_text != NULL); iface->erase_text(buffer, pos, len, user); } /** * inf_text_buffer_create_iter: * @buffer: A #InfTextBuffer. * * Creates a #InfTextBufferIter pointing to the first segment of @buffer. * A #InfTextBufferIter is used to traverse the buffer contents in steps of * so-called segments each of which is written by the same user. The function * returns %NULL if there are no segments (i.e. the buffer is empty). * * The iterator stays valid as long as the buffer remains unmodified and * must be freed with inf_text_buffer_destroy_iter() before. * * Return Value: A #InfTextBufferIter to be freed by * inf_text_buffer_destroy_iter() when done using it, or %NULL. **/ InfTextBufferIter* inf_text_buffer_create_iter(InfTextBuffer* buffer) { InfTextBufferIface* iface; g_return_val_if_fail(INF_TEXT_IS_BUFFER(buffer), NULL); iface = INF_TEXT_BUFFER_GET_IFACE(buffer); g_return_val_if_fail(iface->create_iter != NULL, NULL); return iface->create_iter(buffer); } /** * inf_text_buffer_destroy_iter: * @buffer: A #InfTextBuffer. * @iter: A #InfTextBufferIter pointing into @buffer. * * Destroys a #InfTextBufferIter created by inf_text_buffer_create_iter(). **/ void inf_text_buffer_destroy_iter(InfTextBuffer* buffer, InfTextBufferIter* iter) { InfTextBufferIface* iface; g_return_if_fail(INF_TEXT_IS_BUFFER(buffer)); g_return_if_fail(iter != NULL); iface = INF_TEXT_BUFFER_GET_IFACE(buffer); g_return_if_fail(iface->destroy_iter != NULL); iface->destroy_iter(buffer, iter); } /** * inf_text_buffer_iter_next: * @buffer: A #InfTextBuffer. * @iter: A #InfTextBufferIter pointing into @buffer. * * Moves @iter to point to the next segment in the buffer. If @iter already * points to the last segment, @iter is left unmodified and the function * returns %FALSE. * * Return Value: Whether @iter was moved. **/ gboolean inf_text_buffer_iter_next(InfTextBuffer* buffer, InfTextBufferIter* iter) { InfTextBufferIface* iface; g_return_val_if_fail(INF_TEXT_IS_BUFFER(buffer), FALSE); g_return_val_if_fail(iter != NULL, FALSE); iface = INF_TEXT_BUFFER_GET_IFACE(buffer); g_return_val_if_fail(iface->iter_next != NULL, FALSE); return iface->iter_next(buffer, iter); } /** * inf_text_buffer_iter_prev: * @buffer: A #InfTextBuffer. * @iter: A #InfTextBufferIter pointing into @buffer. * * Moves @iter to point to the previous segment in the buffer. If @iter * already points to the first segment, @iter is left unmodified and the * function returns %FALSE. * * Return Value: Whether @iter was moved. **/ gboolean inf_text_buffer_iter_prev(InfTextBuffer* buffer, InfTextBufferIter* iter) { InfTextBufferIface* iface; g_return_val_if_fail(INF_TEXT_IS_BUFFER(buffer), FALSE); g_return_val_if_fail(iter != NULL, FALSE); iface = INF_TEXT_BUFFER_GET_IFACE(buffer); g_return_val_if_fail(iface->iter_prev != NULL, FALSE); return iface->iter_prev(buffer, iter); } /** * inf_text_buffer_iter_get_text: * @buffer: A #InfTextBuffer. * @iter: A #InfTextBufferIter pointing into @buffer. * * Returns the text of the segment @iter points to. It is encoded in * @buffer's encoding (see inf_text_buffer_get_encoding()). * * Return Value: The text of the segment @iter points to. Free with g_free() * when done using it. **/ gpointer inf_text_buffer_iter_get_text(InfTextBuffer* buffer, InfTextBufferIter* iter) { InfTextBufferIface* iface; g_return_val_if_fail(INF_TEXT_IS_BUFFER(buffer), NULL); g_return_val_if_fail(iter != NULL, NULL); iface = INF_TEXT_BUFFER_GET_IFACE(buffer); g_return_val_if_fail(iface->iter_get_text != NULL, NULL); return iface->iter_get_text(buffer, iter); } /** * inf_text_buffer_iter_get_length: * @buffer: A #InfTextBuffer. * @iter: A #InfTextBufferIter pointing into @buffer. * * Returns the length of the segment @iter points to, in characters. * * Return Value: The number of characters of the segment @iter points to. **/ guint inf_text_buffer_iter_get_length(InfTextBuffer* buffer, InfTextBufferIter* iter) { InfTextBufferIface* iface; g_return_val_if_fail(INF_TEXT_IS_BUFFER(buffer), 0); g_return_val_if_fail(iter != NULL, 0); iface = INF_TEXT_BUFFER_GET_IFACE(buffer); g_return_val_if_fail(iface->iter_get_length != NULL, 0); return iface->iter_get_length(buffer, iter); } /** * inf_text_buffer_iter_get_bytes: * @buffer: A #InfTextBuffer. * @iter: A #InfTextBufferIter pointing into @buffer. * * Returns the length of the segment @iter points to, in bytes. * * Return Value: The number of bytes of the segment @iter points to. **/ gsize inf_text_buffer_iter_get_bytes(InfTextBuffer* buffer, InfTextBufferIter* iter) { InfTextBufferIface* iface; g_return_val_if_fail(INF_TEXT_IS_BUFFER(buffer), 0); g_return_val_if_fail(iter != NULL, 0); iface = INF_TEXT_BUFFER_GET_IFACE(buffer); g_return_val_if_fail(iface->iter_get_bytes != NULL, 0); return iface->iter_get_bytes(buffer, iter); } /** * inf_text_buffer_iter_get_author: * @buffer: A #InfTextBuffer. * @iter: A #InfTextBufferIter pointing into @buffer. * * Returns the user ID of the user that has written the segment @iter points * to. * * Return Value: The user ID of the user that wrote the segment @iter points * to. **/ guint inf_text_buffer_iter_get_author(InfTextBuffer* buffer, InfTextBufferIter* iter) { InfTextBufferIface* iface; g_return_val_if_fail(INF_TEXT_IS_BUFFER(buffer), 0); g_return_val_if_fail(iter != NULL, 0); iface = INF_TEXT_BUFFER_GET_IFACE(buffer); g_return_val_if_fail(iface->iter_get_author != NULL, 0); return iface->iter_get_author(buffer, iter); } /** * inf_text_buffer_text_inserted: * @buffer: A #InfTextBuffer. * @pos: A character offset into @buffer. * @chunk: A #InfTextChunk. * @user: A #InfUser inserting @chunk, or %NULL. * * Emits the #InfTextBuffer::text-inserted signal. This is meant to be used * by interface implementations in their @insert_text function, or when text * was inserted by other means. **/ void inf_text_buffer_text_inserted(InfTextBuffer* buffer, guint pos, InfTextChunk* chunk, InfUser* user) { g_return_if_fail(INF_TEXT_IS_BUFFER(buffer)); g_return_if_fail(chunk != NULL); g_return_if_fail(user == NULL || INF_IS_USER(user)); g_signal_emit( G_OBJECT(buffer), text_buffer_signals[TEXT_INSERTED], 0, pos, chunk, user ); } /** * inf_text_buffer_text_erased: * @buffer: A #InfTextBuffer. * @pos: The position to begin deleting characters from. * @chunk: A #InfTextChunk containing the erased text. * @user: A #InfUser that erases the text, or %NULL. * * Emits the #InfTextBuffer::text-erased signal. This is meant to be used * by interface implementations in their @erase_text function, or when text * was erased by other means. **/ void inf_text_buffer_text_erased(InfTextBuffer* buffer, guint pos, InfTextChunk* chunk, InfUser* user) { g_return_if_fail(INF_TEXT_IS_BUFFER(buffer)); g_return_if_fail(chunk != NULL); g_return_if_fail(user == NULL || INF_IS_USER(user)); g_signal_emit( G_OBJECT(buffer), text_buffer_signals[TEXT_ERASED], 0, pos, chunk, user ); } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinftext/inf-text-operations.h0000644000175000017500000000242512264763732017241 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_TEXT_OPERATIONS_H__ #define __INF_TEXT_OPERATIONS_H__ #include G_BEGIN_DECLS /* Forward declaration for inf-text-insert-operation.h and * inf-text-delete-operation.h each of which needs both. */ typedef struct _InfTextDeleteOperation InfTextDeleteOperation; typedef struct _InfTextInsertOperation InfTextInsertOperation; G_END_DECLS #endif /* __INF_TEXT_OPERATIONS_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinftext/inf-text-session.h0000644000175000017500000000652512264763732016546 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_TEXT_SESSION_H__ #define __INF_TEXT_SESSION_H__ #include #include #include #include #include #include G_BEGIN_DECLS #define INF_TEXT_TYPE_SESSION (inf_text_session_get_type()) #define INF_TEXT_SESSION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INF_TEXT_TYPE_SESSION, InfTextSession)) #define INF_TEXT_SESSION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INF_TEXT_TYPE_SESSION, InfTextSessionClass)) #define INF_TEXT_IS_SESSION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INF_TEXT_TYPE_SESSION)) #define INF_TEXT_IS_SESSION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INF_TEXT_TYPE_SESSION)) #define INF_TEXT_SESSION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), INF_TEXT_TYPE_SESSION, InfTextSessionClass)) typedef struct _InfTextSession InfTextSession; typedef struct _InfTextSessionClass InfTextSessionClass; typedef enum _InfTextSessionError { INF_TEXT_SESSION_ERROR_INVALID_HUE, INF_TEXT_SESSION_ERROR_FAILED } InfTextSessionError; struct _InfTextSessionClass { InfAdoptedSessionClass parent_class; }; struct _InfTextSession { InfAdoptedSession parent; }; GType inf_text_session_get_type(void); InfTextSession* inf_text_session_new(InfCommunicationManager* manager, InfTextBuffer* buffer, InfIo* io, InfSessionStatus status, InfCommunicationGroup* sync_group, InfXmlConnection* sync_connection); InfTextSession* inf_text_session_new_with_user_table(InfCommunicationManager* manager, InfTextBuffer* buffer, InfIo* io, InfUserTable* user_table, InfSessionStatus status, InfCommunicationGroup* sync_group, InfXmlConnection* sync_connection); void inf_text_session_set_user_color(InfTextSession* session, InfTextUser* user, gdouble hue); void inf_text_session_flush_requests_for_user(InfTextSession* session, InfTextUser* user); G_END_DECLS #endif /* __INF_TEXT_SESSION_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinftext/inf-text-default-insert-operation.c0000644000175000017500000003126412264763732022000 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include #include #include #include typedef struct _InfTextDefaultInsertOperationPrivate InfTextDefaultInsertOperationPrivate; struct _InfTextDefaultInsertOperationPrivate { guint position; InfTextChunk* chunk; }; enum { PROP_0, PROP_POSITION, PROP_CHUNK }; #define INF_TEXT_DEFAULT_INSERT_OPERATION_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), INF_TEXT_TYPE_DEFAULT_INSERT_OPERATION, InfTextDefaultInsertOperationPrivate)) static GObjectClass* parent_class; static void inf_text_default_insert_operation_init(GTypeInstance* instance, gpointer g_class) { InfTextDefaultInsertOperation* operation; InfTextDefaultInsertOperationPrivate* priv; operation = INF_TEXT_DEFAULT_INSERT_OPERATION(instance); priv = INF_TEXT_DEFAULT_INSERT_OPERATION_PRIVATE(operation); priv->position = 0; priv->chunk = NULL; } static void inf_text_default_insert_operation_finalize(GObject* object) { InfTextDefaultInsertOperation* operation; InfTextDefaultInsertOperationPrivate* priv; operation = INF_TEXT_DEFAULT_INSERT_OPERATION(object); priv = INF_TEXT_DEFAULT_INSERT_OPERATION_PRIVATE(operation); inf_text_chunk_free(priv->chunk); G_OBJECT_CLASS(parent_class)->finalize(object); } static void inf_text_default_insert_operation_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec) { InfTextDefaultInsertOperation* operation; InfTextDefaultInsertOperationPrivate* priv; operation = INF_TEXT_DEFAULT_INSERT_OPERATION(object); priv = INF_TEXT_DEFAULT_INSERT_OPERATION_PRIVATE(operation); switch(prop_id) { case PROP_POSITION: priv->position = g_value_get_uint(value); break; case PROP_CHUNK: g_assert(priv->chunk == NULL); /* construct only */ priv->chunk = (InfTextChunk*)g_value_dup_boxed(value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void inf_text_default_insert_operation_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec) { InfTextDefaultInsertOperation* operation; InfTextDefaultInsertOperationPrivate* priv; operation = INF_TEXT_DEFAULT_INSERT_OPERATION(object); priv = INF_TEXT_DEFAULT_INSERT_OPERATION_PRIVATE(operation); switch(prop_id) { case PROP_POSITION: g_value_set_uint(value, priv->position); break; case PROP_CHUNK: g_value_set_boxed(value, priv->chunk); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static gboolean inf_text_default_insert_operation_need_concurrency_id( InfAdoptedOperation* operation, InfAdoptedOperation* against) { g_assert(INF_TEXT_IS_DEFAULT_INSERT_OPERATION(operation)); return inf_text_insert_operation_need_concurrency_id( INF_TEXT_INSERT_OPERATION(operation), against ); } static InfAdoptedConcurrencyId inf_text_default_insert_operation_get_concurrency_id( InfAdoptedOperation* operation, InfAdoptedOperation* against) { g_assert(INF_TEXT_IS_DEFAULT_INSERT_OPERATION(operation)); return inf_text_insert_operation_get_concurrency_id( INF_TEXT_INSERT_OPERATION(operation), against ); } static InfAdoptedOperation* inf_text_default_insert_operation_transform(InfAdoptedOperation* operation, InfAdoptedOperation* against, InfAdoptedConcurrencyId cid) { g_assert(INF_TEXT_IS_DEFAULT_INSERT_OPERATION(operation)); if(INF_TEXT_IS_INSERT_OPERATION(against)) { return inf_text_insert_operation_transform_insert( INF_TEXT_INSERT_OPERATION(operation), INF_TEXT_INSERT_OPERATION(against), cid ); } else if(INF_TEXT_IS_DELETE_OPERATION(against)) { return inf_text_insert_operation_transform_delete( INF_TEXT_INSERT_OPERATION(operation), INF_TEXT_DELETE_OPERATION(against), cid ); } else { g_assert_not_reached(); return NULL; } } static InfAdoptedOperation* inf_text_default_insert_operation_copy(InfAdoptedOperation* operation) { InfTextDefaultInsertOperationPrivate* priv; priv = INF_TEXT_DEFAULT_INSERT_OPERATION_PRIVATE(operation); return INF_ADOPTED_OPERATION( g_object_new( INF_TEXT_TYPE_DEFAULT_INSERT_OPERATION, "position", priv->position, "chunk", priv->chunk, NULL ) ); } static InfAdoptedOperationFlags inf_text_default_insert_operation_get_flags(InfAdoptedOperation* operation) { return INF_ADOPTED_OPERATION_AFFECTS_BUFFER | INF_ADOPTED_OPERATION_REVERSIBLE; } static void inf_text_default_insert_operation_apply(InfAdoptedOperation* operation, InfAdoptedUser* by, InfBuffer* buffer) { InfTextDefaultInsertOperationPrivate* priv; g_assert(INF_TEXT_IS_DEFAULT_INSERT_OPERATION(operation)); g_assert(INF_TEXT_IS_BUFFER(buffer)); priv = INF_TEXT_DEFAULT_INSERT_OPERATION_PRIVATE(operation); inf_text_buffer_insert_chunk( INF_TEXT_BUFFER(buffer), priv->position, priv->chunk, INF_USER(by) ); } static InfAdoptedOperation* inf_text_default_insert_operation_revert(InfAdoptedOperation* operation) { InfTextDefaultInsertOperationPrivate* priv; priv = INF_TEXT_DEFAULT_INSERT_OPERATION_PRIVATE(operation); return INF_ADOPTED_OPERATION( inf_text_default_delete_operation_new(priv->position, priv->chunk) ); } static guint inf_text_default_insert_operation_get_position(InfTextInsertOperation* op) { return INF_TEXT_DEFAULT_INSERT_OPERATION_PRIVATE(op)->position; } static guint inf_text_default_insert_operation_get_length( InfTextInsertOperation* operation) { return inf_text_chunk_get_length( INF_TEXT_DEFAULT_INSERT_OPERATION_PRIVATE(operation)->chunk ); } static InfTextInsertOperation* inf_text_default_insert_operation_transform_position( InfTextInsertOperation* operation, guint position) { InfTextDefaultInsertOperationPrivate* priv; GObject* result; priv = INF_TEXT_DEFAULT_INSERT_OPERATION_PRIVATE(operation); result = g_object_new( INF_TEXT_TYPE_DEFAULT_INSERT_OPERATION, "position", position, "chunk", priv->chunk, NULL ); return INF_TEXT_INSERT_OPERATION(result); } static void inf_text_default_insert_operation_class_init(gpointer g_class, gpointer class_data) { GObjectClass* object_class; object_class = G_OBJECT_CLASS(g_class); parent_class = G_OBJECT_CLASS(g_type_class_peek_parent(g_class)); g_type_class_add_private( g_class, sizeof(InfTextDefaultInsertOperationPrivate) ); object_class->finalize = inf_text_default_insert_operation_finalize; object_class->set_property = inf_text_default_insert_operation_set_property; object_class->get_property = inf_text_default_insert_operation_get_property; g_object_class_install_property( object_class, PROP_POSITION, g_param_spec_uint( "position", "Position", "Insertion position", 0, G_MAXUINT, 0, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); g_object_class_install_property( object_class, PROP_CHUNK, g_param_spec_boxed( "chunk", "Chunk", "The text to insert", INF_TEXT_TYPE_CHUNK, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); } static void inf_text_default_insert_operation_operation_init(gpointer g_iface, gpointer iface_data) { InfAdoptedOperationIface* iface; iface = (InfAdoptedOperationIface*)g_iface; iface->need_concurrency_id = inf_text_default_insert_operation_need_concurrency_id; iface->get_concurrency_id = inf_text_default_insert_operation_get_concurrency_id; iface->transform = inf_text_default_insert_operation_transform; iface->copy = inf_text_default_insert_operation_copy; iface->get_flags = inf_text_default_insert_operation_get_flags; iface->apply = inf_text_default_insert_operation_apply; iface->revert = inf_text_default_insert_operation_revert; /* DefaultInsertOperation is always reversible */ iface->make_reversible = NULL; } static void inf_text_default_insert_operation_insert_operation_init(gpointer g_iface, gpointer iface_data) { InfTextInsertOperationIface* iface; iface = (InfTextInsertOperationIface*)g_iface; iface->get_position = inf_text_default_insert_operation_get_position; iface->get_length = inf_text_default_insert_operation_get_length; iface->transform_position = inf_text_default_insert_operation_transform_position; } GType inf_text_default_insert_operation_get_type(void) { static GType default_insert_operation_type = 0; if(!default_insert_operation_type) { static const GTypeInfo default_insert_operation_type_info = { sizeof(InfTextDefaultInsertOperationClass), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ inf_text_default_insert_operation_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InfTextDefaultInsertOperation), /* instance_size */ 0, /* n_preallocs */ inf_text_default_insert_operation_init, /* instance_init */ NULL /* value_table */ }; static const GInterfaceInfo operation_info = { inf_text_default_insert_operation_operation_init, NULL, NULL }; static const GInterfaceInfo insert_operation_info = { inf_text_default_insert_operation_insert_operation_init, NULL, NULL }; default_insert_operation_type = g_type_register_static( G_TYPE_OBJECT, "InfTextDefaultInsertOperation", &default_insert_operation_type_info, 0 ); g_type_add_interface_static( default_insert_operation_type, INF_ADOPTED_TYPE_OPERATION, &operation_info ); g_type_add_interface_static( default_insert_operation_type, INF_TEXT_TYPE_INSERT_OPERATION, &insert_operation_info ); } return default_insert_operation_type; } /** * inf_text_default_insert_operation_new: * @pos: The position at which to insert text. * @chunk: The text to insert. * * Creates a new insert operation that, when applied, inserts @chunk * at @pos. * * Return Value: A new #InfTextDefaultInsertOperation. **/ InfTextDefaultInsertOperation* inf_text_default_insert_operation_new(guint pos, InfTextChunk* chunk) { GObject* object; g_return_val_if_fail(chunk != NULL, NULL); object = g_object_new( INF_TEXT_TYPE_DEFAULT_INSERT_OPERATION, "position", pos, "chunk", chunk, NULL ); return INF_TEXT_DEFAULT_INSERT_OPERATION(object); } /** * inf_text_default_insert_operation_get_chunk: * @operation: A #InfTextDefaultInsertOperation. * * Returns the text inserted by @operation. * * Return Value: A #InfTextChunk, owned by the operation. **/ InfTextChunk* inf_text_default_insert_operation_get_chunk(InfTextDefaultInsertOperation* operation) { g_return_val_if_fail(INF_TEXT_IS_DEFAULT_INSERT_OPERATION(operation), NULL); return INF_TEXT_DEFAULT_INSERT_OPERATION_PRIVATE(operation)->chunk; } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinftext/inf-text-user.c0000644000175000017500000002125212264763732016026 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include typedef struct _InfTextUserPrivate InfTextUserPrivate; struct _InfTextUserPrivate { guint caret; gint selection; gdouble hue; }; enum { PROP_0, PROP_CARET, PROP_SELECTION, PROP_HUE }; enum { SELECTION_CHANGED, LAST_SIGNAL }; #define INF_TEXT_USER_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), INF_TEXT_TYPE_USER, InfTextUserPrivate)) static InfUserClass* parent_class; static guint user_signals[LAST_SIGNAL] = { 0 }; static void inf_text_user_init(GTypeInstance* instance, gpointer g_class) { InfTextUser* user; InfTextUserPrivate* priv; user = INF_TEXT_USER(instance); priv = INF_TEXT_USER_PRIVATE(user); priv->caret = 0; priv->selection = 0; priv->hue = 0.0; } static void inf_text_user_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec) { InfTextUser* user; InfTextUserPrivate* priv; user = INF_TEXT_USER(object); priv = INF_TEXT_USER_PRIVATE(user); switch(prop_id) { case PROP_CARET: priv->caret = g_value_get_uint(value); break; case PROP_SELECTION: priv->selection = g_value_get_int(value); break; case PROP_HUE: priv->hue = g_value_get_double(value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void inf_text_user_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec) { InfTextUser* user; InfTextUserPrivate* priv; user = INF_TEXT_USER(object); priv = INF_TEXT_USER_PRIVATE(user); switch(prop_id) { case PROP_CARET: g_value_set_uint(value, priv->caret); break; case PROP_SELECTION: g_value_set_int(value, priv->selection); break; case PROP_HUE: g_value_set_double(value, priv->hue); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void inf_text_user_selection_changed(InfTextUser* user, guint position, guint length, gboolean by_request) { InfTextUserPrivate* priv; priv = INF_TEXT_USER_PRIVATE(user); priv->caret = position; priv->selection = length; g_object_notify(G_OBJECT(user), "caret-position"); g_object_notify(G_OBJECT(user), "selection-length"); } static void inf_text_user_class_init(gpointer g_class, gpointer class_data) { GObjectClass* object_class; InfTextUserClass* user_class; object_class = G_OBJECT_CLASS(g_class); user_class = INF_TEXT_USER_CLASS(g_class); parent_class = INF_USER_CLASS(g_type_class_peek_parent(g_class)); g_type_class_add_private(g_class, sizeof(InfTextUserPrivate)); object_class->set_property = inf_text_user_set_property; object_class->get_property = inf_text_user_get_property; user_class->selection_changed = inf_text_user_selection_changed; g_object_class_install_property( object_class, PROP_CARET, g_param_spec_uint( "caret-position", "Caret position", "The position of this user's caret", 0, G_MAXUINT, 0, G_PARAM_READWRITE | G_PARAM_CONSTRUCT ) ); g_object_class_install_property( object_class, PROP_SELECTION, g_param_spec_int( "selection-length", "Selection length", "The number of characters of this user's selection", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE | G_PARAM_CONSTRUCT ) ); g_object_class_install_property( object_class, PROP_HUE, g_param_spec_double( "hue", "Hue", "The hue value of the user's color. saturation and lightness are set " "by each client individually.", 0.0, 1.0, 0.0, G_PARAM_READWRITE | G_PARAM_CONSTRUCT ) ); user_signals[SELECTION_CHANGED] = g_signal_new( "selection-changed", G_OBJECT_CLASS_TYPE(object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(InfTextUserClass, selection_changed), NULL, NULL, inf_marshal_VOID__UINT_INT_BOOLEAN, G_TYPE_NONE, 3, G_TYPE_UINT, G_TYPE_INT, G_TYPE_BOOLEAN ); } GType inf_text_user_get_type(void) { static GType user_type = 0; if(!user_type) { static const GTypeInfo user_type_info = { sizeof(InfTextUserClass), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ inf_text_user_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InfTextUser), /* instance_size */ 0, /* n_preallocs */ inf_text_user_init, /* instance_init */ NULL /* value_table */ }; user_type = g_type_register_static( INF_ADOPTED_TYPE_USER, "InfTextUser", &user_type_info, 0 ); } return user_type; } /** * inf_text_user_new: * @id: The user ID for this user. * @name: The user's name. * @vector: The state at which the user is at, or %NULL. * @hue: The hue value of the user's color. * * Creates a new #InfTextUser. @id should be unique for all users working * together. #InfUserTable will refuse to add users with duplicate id. If * @vector is %NULL, then the vector with all components zero is used. * * Returns: A new #InfTextUser. Free with g_object_unref() when no longer * needed. */ InfTextUser* inf_text_user_new(guint id, const gchar* name, InfAdoptedStateVector* vector, double hue) { g_return_val_if_fail(name != NULL, NULL); return INF_TEXT_USER( g_object_new( INF_TEXT_TYPE_USER, "id", id, "name", name, "vector", vector, "hue", hue, NULL ) ); } /** * inf_text_user_get_caret_position: * @user: A #InfTextUser. * * Returns the position of @user's caret. * * Return Value: @user's caret position. **/ guint inf_text_user_get_caret_position(InfTextUser* user) { g_return_val_if_fail(INF_TEXT_IS_USER(user), 0); return INF_TEXT_USER_PRIVATE(user)->caret; } /** * inf_text_user_get_selection_length: * @user: A #InfTextUser. * * Returns the number of characters this user has selected, starting from * the caret position. Negative number mean selection towards the beginning * of the buffer. * * Return Value: @user's selection length in characters. **/ gint inf_text_user_get_selection_length(InfTextUser* user) { g_return_val_if_fail(INF_TEXT_IS_USER(user), 0); return INF_TEXT_USER_PRIVATE(user)->selection; } /** * inf_text_user_set_selection: * @user: A #InfTextUser. * @position: The new position for the user's caret. * @length: The number of characters to select. Negative numbers mean * selection towards the beginning. * * Changes @user's selection (i.e. caret position and selection length). **/ void inf_text_user_set_selection(InfTextUser* user, guint position, gint length, gboolean by_request) { g_return_if_fail(INF_TEXT_IS_USER(user)); g_signal_emit( G_OBJECT(user), user_signals[SELECTION_CHANGED], 0, position, length, by_request ); } /** * inf_text_user_get_hue: * @user: A #InfTextUser. * * Returns the hue of the user's color as a double ranging from 0 to 1. * The other components (saturation and lightness) are not specific to the * user and may be chosen indivudually to optimize the actual visual display. * * Returns: The hue of the @user's color. **/ gdouble inf_text_user_get_hue(InfTextUser* user) { g_return_val_if_fail(INF_TEXT_IS_USER(user), 0.0); return INF_TEXT_USER_PRIVATE(user)->hue; } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinftext/inf-text-undo-grouping.c0000644000175000017500000002471112264763732017650 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include #include #include #include #include /** * SECTION:inf-text-undo-grouping * @title:InfTextUndoGrouping * @short_description: Undo grouping for text operations * @include: libinftext/inf-text-undo-grouping.h * @see_also: #InfAdoptedUndoGrouping * @stabilitiy: Unstable * * #InfTextUndoGrouping handles undo grouping for text operations. It makes * sure many insert or delete operations occuring in a row can be undone * simultaneousely, taking into account that other users might have issued * requests inbetween. * * Using this class you don't need to connect to * #InfAdoptedUndoGrouping::group-requests to perform the grouping. */ #define INF_TEXT_UNDO_GROUPING_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), INF_TEXT_TYPE_UNDO_GROUPING, InfTextUndoGroupingPrivate)) static InfAdoptedUndoGroupingClass* parent_class; /* Returns the gunichar of the first character of a InfTextChunk */ static gunichar inf_text_undo_grouping_get_char_from_chunk(InfTextChunk* chunk) { GIConv cd; InfTextChunkIter iter; gchar* inbuf; size_t inlen; gchar* outbuf; size_t outlen; size_t result; gchar buffer[6]; cd = g_iconv_open("UTF-8", inf_text_chunk_get_encoding(chunk)); g_assert(cd != (GIConv)-1); inf_text_chunk_iter_init(chunk, &iter); /* cast const away without warning */ /* more or less */ *(gconstpointer*) &inbuf = inf_text_chunk_iter_get_text(&iter); inlen = inf_text_chunk_iter_get_bytes(&iter); outbuf = buffer; outlen = 6; /* max length of a UTF-8 character */ result = g_iconv(cd, &inbuf, &inlen, &outbuf, &outlen); /* we expect exactly one char in chunk, so there should be enough space */ g_assert(result == 0);/* || (result == (size_t)(-1) && errno == E2BIG));*/ g_iconv_close(cd); return g_utf8_get_char(buffer); } static guint inf_text_undo_grouping_get_translated_position(InfAdoptedAlgorithm* algorithm, InfAdoptedRequest* from, InfAdoptedRequest* to, guint pos) { guint move_id; InfAdoptedOperation* move_op; InfAdoptedStateVector* move_vec; InfAdoptedRequest* move_req; guint move_pos; move_id = inf_adopted_request_get_user_id(from); move_op = INF_ADOPTED_OPERATION(inf_text_move_operation_new(pos, 0)); move_vec = inf_adopted_state_vector_copy(inf_adopted_request_get_vector(from)); inf_adopted_state_vector_set( move_vec, move_id, inf_adopted_state_vector_get(inf_adopted_request_get_vector(to), move_id) ); move_req = inf_adopted_request_new_do(move_vec, move_id, move_op); inf_adopted_state_vector_free(move_vec); /* TODO: I think that it might be possible that this translatation is not * always possible as we might have already removed some request log entries * in other user's request logs to do the transformation. * * Instead we should: Do the transformation if all requests are available * If not, check whether to follows from, in which case no transformation is * necessary. If that is not the case, we can't decide, * so don't group. */ inf_adopted_algorithm_translate_request( algorithm, move_req, inf_adopted_request_get_vector(to) ); g_object_unref(move_req); move_pos = inf_text_move_operation_get_position(INF_TEXT_MOVE_OPERATION(move_op)); g_object_unref(move_op); return move_pos; } static gboolean inf_text_undo_grouping_group_requests(InfAdoptedUndoGrouping* grouping, InfAdoptedRequest* first, InfAdoptedRequest* second) { InfAdoptedOperation* first_op; InfAdoptedOperation* second_op; guint first_length; guint second_length; guint first_pos; guint second_pos; gunichar first_char; gunichar second_char; g_assert(inf_adopted_request_get_request_type(first) == INF_ADOPTED_REQUEST_DO); g_assert(inf_adopted_request_get_request_type(second) == INF_ADOPTED_REQUEST_DO); first_op = inf_adopted_request_get_operation(first); second_op = inf_adopted_request_get_operation(second); g_assert(INF_TEXT_IS_DEFAULT_INSERT_OPERATION(first_op) || INF_TEXT_IS_DEFAULT_DELETE_OPERATION(first_op)); g_assert(INF_TEXT_IS_DEFAULT_INSERT_OPERATION(second_op) || INF_TEXT_IS_DEFAULT_DELETE_OPERATION(second_op)); /* Never group insert and delete operations */ if(INF_TEXT_IS_DEFAULT_INSERT_OPERATION(first_op) && INF_TEXT_IS_DEFAULT_DELETE_OPERATION(second_op)) { return FALSE; } else if(INF_TEXT_IS_DEFAULT_DELETE_OPERATION(first_op) && INF_TEXT_IS_DEFAULT_INSERT_OPERATION(second_op)) { return FALSE; } else if(INF_TEXT_IS_INSERT_OPERATION(first_op)) { first_length = inf_text_insert_operation_get_length( INF_TEXT_INSERT_OPERATION(first_op) ); second_length = inf_text_insert_operation_get_length( INF_TEXT_INSERT_OPERATION(second_op) ); if(first_length > 1 || second_length > 1) { return FALSE; } else { first_pos = inf_text_insert_operation_get_position( INF_TEXT_INSERT_OPERATION(first_op) ); first_pos = inf_text_undo_grouping_get_translated_position( inf_adopted_undo_grouping_get_algorithm(grouping), first, second, first_pos + 1 ); second_pos = inf_text_insert_operation_get_position( INF_TEXT_INSERT_OPERATION(second_op) ); if(first_pos != second_pos) return FALSE; /* start new group when going from whitespace to non-whitespace */ first_char = inf_text_undo_grouping_get_char_from_chunk( inf_text_default_insert_operation_get_chunk( INF_TEXT_DEFAULT_INSERT_OPERATION(first_op) ) ); second_char = inf_text_undo_grouping_get_char_from_chunk( inf_text_default_insert_operation_get_chunk( INF_TEXT_DEFAULT_INSERT_OPERATION(second_op) ) ); if(g_unichar_isspace(first_char) && !g_unichar_isspace(second_char)) return FALSE; return TRUE; } } else if(INF_TEXT_IS_DELETE_OPERATION(first_op)) { first_length = inf_text_delete_operation_get_length( INF_TEXT_DELETE_OPERATION(first_op) ); second_length = inf_text_delete_operation_get_length( INF_TEXT_DELETE_OPERATION(second_op) ); if(first_length > 1 || second_length > 1) { return FALSE; } else { first_pos = inf_text_delete_operation_get_position( INF_TEXT_DELETE_OPERATION(first_op) ); first_pos = inf_text_undo_grouping_get_translated_position( inf_adopted_undo_grouping_get_algorithm(grouping), first, second, first_pos ); second_pos = inf_text_delete_operation_get_position( INF_TEXT_DELETE_OPERATION(second_op) ); if(first_pos != second_pos && first_pos != second_pos + 1) return FALSE; /* start new group when going from whitespace to non-whitespace */ first_char = inf_text_undo_grouping_get_char_from_chunk( inf_text_default_delete_operation_get_chunk( INF_TEXT_DEFAULT_DELETE_OPERATION(first_op) ) ); second_char = inf_text_undo_grouping_get_char_from_chunk( inf_text_default_delete_operation_get_chunk( INF_TEXT_DEFAULT_DELETE_OPERATION(second_op) ) ); if(g_unichar_isspace(first_char) && !g_unichar_isspace(second_char)) return FALSE; return TRUE; } } else { g_assert_not_reached(); return FALSE; } } /* * GType registration. */ static void inf_text_undo_grouping_class_init(gpointer g_class, gpointer class_data) { GObjectClass* object_class; InfAdoptedUndoGroupingClass* undo_grouping_class; object_class = G_OBJECT_CLASS(g_class); undo_grouping_class = INF_ADOPTED_UNDO_GROUPING_CLASS(g_class); parent_class = INF_ADOPTED_UNDO_GROUPING_CLASS(g_type_class_peek_parent(g_class)); undo_grouping_class->group_requests = inf_text_undo_grouping_group_requests; } GType inf_text_undo_grouping_get_type(void) { static GType undo_grouping_type = 0; if(!undo_grouping_type) { static const GTypeInfo undo_grouping_type_info = { sizeof(InfTextUndoGroupingClass), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ inf_text_undo_grouping_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InfTextUndoGrouping), /* instance_size */ 0, /* n_preallocs */ NULL, /* instance_init */ NULL /* value_table */ }; undo_grouping_type = g_type_register_static( INF_ADOPTED_TYPE_UNDO_GROUPING, "InfTextUndoGrouping", &undo_grouping_type_info, 0 ); } return undo_grouping_type; } /* * Public API. */ /** * inf_text_undo_grouping_new: * * Creates a new #InfTextUndoGrouping. * * Return Value: A new #InfTextUndoGrouping. To be freed with g_object_unref(). **/ InfTextUndoGrouping* inf_text_undo_grouping_new(void) { GObject* object; object = g_object_new(INF_TEXT_TYPE_UNDO_GROUPING, NULL); return INF_TEXT_UNDO_GROUPING(object); } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinftext/inf-text-default-buffer.c0000644000175000017500000003054112264763732017744 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include #include struct _InfTextBufferIter { InfTextChunkIter chunk_iter; }; typedef struct _InfTextDefaultBufferPrivate InfTextDefaultBufferPrivate; struct _InfTextDefaultBufferPrivate { gchar* encoding; InfTextChunk* chunk; gboolean modified; }; enum { PROP_0, /* overwritten */ PROP_MODIFIED, PROP_ENCODING }; #define INF_TEXT_DEFAULT_BUFFER_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), INF_TEXT_TYPE_DEFAULT_BUFFER, InfTextDefaultBufferPrivate)) static GObjectClass* parent_class; static void inf_text_default_buffer_init(GTypeInstance* instance, gpointer g_class) { InfTextDefaultBuffer* default_buffer; InfTextDefaultBufferPrivate* priv; default_buffer = INF_TEXT_DEFAULT_BUFFER(instance); priv = INF_TEXT_DEFAULT_BUFFER_PRIVATE(default_buffer); priv->encoding = NULL; priv->chunk = NULL; priv->modified = FALSE; } static void inf_text_default_buffer_finalize(GObject* object) { InfTextDefaultBuffer* default_buffer; InfTextDefaultBufferPrivate* priv; default_buffer = INF_TEXT_DEFAULT_BUFFER(object); priv = INF_TEXT_DEFAULT_BUFFER_PRIVATE(default_buffer); inf_text_chunk_free(priv->chunk); g_free(priv->encoding); G_OBJECT_CLASS(parent_class)->finalize(object); } static void inf_text_default_buffer_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec) { InfTextDefaultBuffer* default_buffer; InfTextDefaultBufferPrivate* priv; default_buffer = INF_TEXT_DEFAULT_BUFFER(object); priv = INF_TEXT_DEFAULT_BUFFER_PRIVATE(default_buffer); switch(prop_id) { case PROP_ENCODING: /* construct only */ g_assert(priv->encoding == NULL); g_assert(priv->chunk == NULL); priv->encoding = g_value_dup_string(value); priv->chunk = inf_text_chunk_new(priv->encoding); break; case PROP_MODIFIED: priv->modified = g_value_get_boolean(value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void inf_text_default_buffer_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec) { InfTextDefaultBuffer* default_buffer; InfTextDefaultBufferPrivate* priv; default_buffer = INF_TEXT_DEFAULT_BUFFER(object); priv = INF_TEXT_DEFAULT_BUFFER_PRIVATE(default_buffer); switch(prop_id) { case PROP_ENCODING: g_value_set_string(value, priv->encoding); break; case PROP_MODIFIED: g_value_set_boolean(value, priv->modified); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static gboolean inf_text_default_buffer_buffer_get_modified(InfBuffer* buffer) { return INF_TEXT_DEFAULT_BUFFER_PRIVATE(buffer)->modified; } static void inf_text_default_buffer_buffer_set_modified(InfBuffer* buffer, gboolean modified) { InfTextDefaultBuffer* default_buffer; InfTextDefaultBufferPrivate* priv; default_buffer = INF_TEXT_DEFAULT_BUFFER(buffer); priv = INF_TEXT_DEFAULT_BUFFER_PRIVATE(default_buffer); if(priv->modified != modified) { priv->modified = modified; g_object_notify(G_OBJECT(buffer), "modified"); } } static const gchar* inf_text_default_buffer_buffer_get_encoding(InfTextBuffer* buffer) { return INF_TEXT_DEFAULT_BUFFER_PRIVATE(buffer)->encoding; } static guint inf_text_default_buffer_get_length(InfTextBuffer* buffer) { InfTextDefaultBufferPrivate* priv; priv = INF_TEXT_DEFAULT_BUFFER_PRIVATE(buffer); return inf_text_chunk_get_length(priv->chunk); } static InfTextChunk* inf_text_default_buffer_buffer_get_slice(InfTextBuffer* buffer, guint pos, guint len) { InfTextDefaultBufferPrivate* priv; priv = INF_TEXT_DEFAULT_BUFFER_PRIVATE(buffer); return inf_text_chunk_substring(priv->chunk, pos, len); } static void inf_text_default_buffer_buffer_insert_text(InfTextBuffer* buffer, guint pos, InfTextChunk* chunk, InfUser* user) { InfTextDefaultBufferPrivate* priv; priv = INF_TEXT_DEFAULT_BUFFER_PRIVATE(buffer); inf_text_chunk_insert_chunk(priv->chunk, pos, chunk); inf_text_buffer_text_inserted(buffer, pos, chunk, user); if(priv->modified == FALSE) { priv->modified = TRUE; g_object_notify(G_OBJECT(buffer), "modified"); } } static void inf_text_default_buffer_buffer_erase_text(InfTextBuffer* buffer, guint pos, guint len, InfUser* user) { InfTextDefaultBufferPrivate* priv; InfTextChunk* chunk; priv = INF_TEXT_DEFAULT_BUFFER_PRIVATE(buffer); chunk = inf_text_chunk_substring(priv->chunk, pos, len); inf_text_chunk_erase(priv->chunk, pos, len); inf_text_buffer_text_erased(buffer, pos, chunk, user); inf_text_chunk_free(chunk); if(priv->modified == FALSE) { priv->modified = TRUE; g_object_notify(G_OBJECT(buffer), "modified"); } } static InfTextBufferIter* inf_text_default_buffer_buffer_create_iter(InfTextBuffer* buffer) { InfTextDefaultBufferPrivate* priv; InfTextChunkIter chunk_iter; InfTextBufferIter* iter; priv = INF_TEXT_DEFAULT_BUFFER_PRIVATE(buffer); if(inf_text_chunk_iter_init(priv->chunk, &chunk_iter) == TRUE) { iter = g_slice_new(InfTextBufferIter); iter->chunk_iter = chunk_iter; return iter; } else { return NULL; } } static void inf_text_default_buffer_buffer_destroy_iter(InfTextBuffer* buffer, InfTextBufferIter* iter) { g_slice_free(InfTextBufferIter, iter); } static gboolean inf_text_default_buffer_buffer_iter_next(InfTextBuffer* buffer, InfTextBufferIter* iter) { return inf_text_chunk_iter_next(&iter->chunk_iter); } static gboolean inf_text_default_buffer_buffer_iter_prev(InfTextBuffer* buffer, InfTextBufferIter* iter) { return inf_text_chunk_iter_prev(&iter->chunk_iter); } static gpointer inf_text_default_buffer_buffer_iter_get_text(InfTextBuffer* buffer, InfTextBufferIter* iter) { return g_memdup( inf_text_chunk_iter_get_text(&iter->chunk_iter), inf_text_chunk_iter_get_bytes(&iter->chunk_iter) ); } static guint inf_text_default_buffer_buffer_iter_get_length(InfTextBuffer* buffer, InfTextBufferIter* iter) { return inf_text_chunk_iter_get_length(&iter->chunk_iter); } static gsize inf_text_default_buffer_buffer_iter_get_bytes(InfTextBuffer* buffer, InfTextBufferIter* iter) { return inf_text_chunk_iter_get_bytes(&iter->chunk_iter); } static guint inf_text_default_buffer_buffer_iter_get_author(InfTextBuffer* buffer, InfTextBufferIter* iter) { return inf_text_chunk_iter_get_author(&iter->chunk_iter); } static void inf_text_default_buffer_class_init(gpointer g_class, gpointer class_data) { GObjectClass* object_class; object_class = G_OBJECT_CLASS(g_class); parent_class = G_OBJECT_CLASS(g_type_class_peek_parent(g_class)); g_type_class_add_private(g_class, sizeof(InfTextDefaultBufferPrivate)); object_class->finalize = inf_text_default_buffer_finalize; object_class->set_property = inf_text_default_buffer_set_property; object_class->get_property = inf_text_default_buffer_get_property; g_object_class_override_property(object_class, PROP_MODIFIED, "modified"); g_object_class_install_property( object_class, PROP_ENCODING, g_param_spec_string( "encoding", "Encoding", "The character encoding of the text buffer", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); } static void inf_text_default_buffer_buffer_init(gpointer g_iface, gpointer iface_data) { InfBufferIface* iface; iface = (InfBufferIface*)g_iface; iface->get_modified = inf_text_default_buffer_buffer_get_modified; iface->set_modified = inf_text_default_buffer_buffer_set_modified; } static void inf_text_default_buffer_text_buffer_init(gpointer g_iface, gpointer iface_data) { InfTextBufferIface* iface; iface = (InfTextBufferIface*)g_iface; iface->get_encoding = inf_text_default_buffer_buffer_get_encoding; iface->get_length = inf_text_default_buffer_get_length; iface->get_slice = inf_text_default_buffer_buffer_get_slice; iface->insert_text = inf_text_default_buffer_buffer_insert_text; iface->erase_text = inf_text_default_buffer_buffer_erase_text; iface->create_iter = inf_text_default_buffer_buffer_create_iter; iface->destroy_iter = inf_text_default_buffer_buffer_destroy_iter; iface->iter_next = inf_text_default_buffer_buffer_iter_next; iface->iter_prev = inf_text_default_buffer_buffer_iter_prev; iface->iter_get_text = inf_text_default_buffer_buffer_iter_get_text; iface->iter_get_length = inf_text_default_buffer_buffer_iter_get_length; iface->iter_get_bytes = inf_text_default_buffer_buffer_iter_get_bytes; iface->iter_get_author = inf_text_default_buffer_buffer_iter_get_author; iface->text_inserted = NULL; iface->text_erased = NULL; } GType inf_text_default_buffer_get_type(void) { static GType default_buffer_type = 0; if(!default_buffer_type) { static const GTypeInfo default_buffer_type_info = { sizeof(InfTextDefaultBufferClass), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ inf_text_default_buffer_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InfTextDefaultBuffer), /* instance_size */ 0, /* n_preallocs */ inf_text_default_buffer_init, /* instance_init */ NULL /* value_table */ }; static const GInterfaceInfo buffer_info = { inf_text_default_buffer_buffer_init, NULL, NULL }; static const GInterfaceInfo text_buffer_info = { inf_text_default_buffer_text_buffer_init, NULL, NULL }; default_buffer_type = g_type_register_static( G_TYPE_OBJECT, "InfTextDefaultBuffer", &default_buffer_type_info, 0 ); g_type_add_interface_static( default_buffer_type, INF_TYPE_BUFFER, &buffer_info ); g_type_add_interface_static( default_buffer_type, INF_TEXT_TYPE_BUFFER, &text_buffer_info ); } return default_buffer_type; } /** * inf_text_default_buffer_new: * @encoding: The character encoding to use for the buffer. * * Creates a new, empty #InfTextDefaultBuffer. * * Return Value: A #InfTextDefaultBuffer. **/ InfTextDefaultBuffer* inf_text_default_buffer_new(const gchar* encoding) { GObject* object; object = g_object_new( INF_TEXT_TYPE_DEFAULT_BUFFER, "encoding", encoding, NULL ); return INF_TEXT_DEFAULT_BUFFER(object); } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/configure0000755000175000017500000201447712264766064012725 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for libinfinity 0.5.5. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and armin@arbur.net $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_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" SHELL=${CONFIG_SHELL-/bin/sh} test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='libinfinity' PACKAGE_TARNAME='libinfinity' PACKAGE_VERSION='0.5.5' PACKAGE_STRING='libinfinity 0.5.5' PACKAGE_BUGREPORT='armin@arbur.net' PACKAGE_URL='' ac_unique_file="libinfinity/common/inf-init.c" # 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 MKINSTALLDIRS POSUB POFILES PO_IN_DATADIR_FALSE PO_IN_DATADIR_TRUE INTLLIBS INSTOBJEXT GMOFILES DATADIRNAME CATOBJEXT CATALOGS XGETTEXT GMSGFMT MSGFMT_OPTS MSGFMT USE_NLS GETTEXT_PACKAGE LIBINFINITY_HAVE_LIBDAEMON_FALSE LIBINFINITY_HAVE_LIBDAEMON_TRUE libdaemon_LIBS libdaemon_CFLAGS LIBINFINITY_HAVE_AVAHI_FALSE LIBINFINITY_HAVE_AVAHI_TRUE avahi_LIBS avahi_CFLAGS WITH_INFINOTED_FALSE WITH_INFINOTED_TRUE infinoted_LIBS infinoted_CFLAGS WITH_INFGTK_FALSE WITH_INFGTK_TRUE infgtk_LIBS infgtk_CFLAGS WITH_INFTEXTGTK_FALSE WITH_INFTEXTGTK_TRUE inftextgtk_LIBS inftextgtk_CFLAGS gtk_version gtk_requirement inftext_LIBS inftext_CFLAGS infinity_LIBS infinity_CFLAGS GTK_DOC_USE_REBASE_FALSE GTK_DOC_USE_REBASE_TRUE GTK_DOC_USE_LIBTOOL_FALSE GTK_DOC_USE_LIBTOOL_TRUE GTK_DOC_BUILD_PDF_FALSE GTK_DOC_BUILD_PDF_TRUE GTK_DOC_BUILD_HTML_FALSE GTK_DOC_BUILD_HTML_TRUE ENABLE_GTK_DOC_FALSE ENABLE_GTK_DOC_TRUE GTKDOC_DEPS_LIBS GTKDOC_DEPS_CFLAGS HTML_DIR GTKDOC_MKPDF GTKDOC_REBASE GTKDOC_CHECK PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB DLLTOOL OBJDUMP NM ac_ct_DUMPBIN DUMPBIN LD FGREP SED LIBTOOL ac_ct_AR AR LN_S EGREP GREP CPP am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC host_os host_vendor host_cpu host build_os build_vendor build_cpu build LIBINFINITY_LIBTOOL_VERSION LIBINFINITY_API_VERSION LIBINFINITY_VERSION MAINT MAINTAINER_MODE_FALSE MAINTAINER_MODE_TRUE AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_maintainer_mode enable_dependency_tracking enable_shared enable_static with_pic enable_fast_install with_gnu_ld with_sysroot enable_libtool_lock with_html_dir enable_gtk_doc enable_gtk_doc_html enable_gtk_doc_pdf with_gtk3 with_inftextgtk with_infgtk with_infinoted with_avahi with_libdaemon ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR GTKDOC_DEPS_CFLAGS GTKDOC_DEPS_LIBS infinity_CFLAGS infinity_LIBS inftext_CFLAGS inftext_LIBS inftextgtk_CFLAGS inftextgtk_LIBS infgtk_CFLAGS infgtk_LIBS infinoted_CFLAGS infinoted_LIBS avahi_CFLAGS avahi_LIBS libdaemon_CFLAGS libdaemon_LIBS' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures libinfinity 0.5.5 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/libinfinity] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of libinfinity 0.5.5:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --enable-gtk-doc use gtk-doc to build documentation [[default=no]] --enable-gtk-doc-html build documentation in html format [[default=yes]] --enable-gtk-doc-pdf build documentation in pdf format [[default=no]] Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot=DIR Search for dependent libraries within DIR (or the compiler's sysroot if not specified). --with-html-dir=PATH path to installed docs --with-gtk3 Builds libinfgtk and libinftextgtk against GTK+ 3 [[default=no]] --with-inftextgtk Builds the libinftextgtk library [[default=auto]] --with-infgtk Builds the libinfgtk library [[default=auto]] --with-infinoted Build the infinote standalone server [[default=yes]] --with-avahi Enables avahi support [[default=auto]] --with-libdaemon Enables daemonizing support in infinoted [[default=auto]] 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 GTKDOC_DEPS_CFLAGS C compiler flags for GTKDOC_DEPS, overriding pkg-config GTKDOC_DEPS_LIBS linker flags for GTKDOC_DEPS, overriding pkg-config infinity_CFLAGS C compiler flags for infinity, overriding pkg-config infinity_LIBS linker flags for infinity, overriding pkg-config inftext_CFLAGS C compiler flags for inftext, overriding pkg-config inftext_LIBS linker flags for inftext, overriding pkg-config inftextgtk_CFLAGS C compiler flags for inftextgtk, overriding pkg-config inftextgtk_LIBS linker flags for inftextgtk, overriding pkg-config infgtk_CFLAGS C compiler flags for infgtk, overriding pkg-config infgtk_LIBS linker flags for infgtk, overriding pkg-config infinoted_CFLAGS C compiler flags for infinoted, overriding pkg-config infinoted_LIBS linker flags for infinoted, overriding pkg-config avahi_CFLAGS C compiler flags for avahi, overriding pkg-config avahi_LIBS linker flags for avahi, overriding pkg-config libdaemon_CFLAGS C compiler flags for libdaemon, overriding pkg-config libdaemon_LIBS linker flags for libdaemon, 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 . _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 libinfinity configure 0.5.5 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_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_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 armin@arbur.net ## ## ------------------------------ ##" ) | 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_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func 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 libinfinity $as_me 0.5.5, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu am__api_version='1.13' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='libinfinity' VERSION='0.5.5' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 $as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } # Check whether --enable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then : enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 $as_echo "$USE_MAINTAINER_MODE" >&6; } if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi MAINT=$MAINTAINER_MODE_TRUE ac_config_headers="$ac_config_headers config.h libinfinity/inf-config.h" LIBINFINITY_VERSION=0.5.5 LIBINFINITY_API_VERSION=0.5 LIBINFINITY_LIBTOOL_VERSION=0:0:0 # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac # Remove -Wno-strict-prototypes for the feature tests has_strict_prototypes="" if (echo $CFLAGS | grep -- -Wstrict-prototype) then has_strict_prototypes="true" old_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -Wno-strict-prototypes" fi # Make GNU and POSIX extensions such as readdir_r, O_NOFOLLOW and # fdopendir available DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # 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 ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" if test "x$ac_cv_header_minix_config_h" = xyes; then : MINIX=yes else MINIX= fi if test "$MINIX" = yes; then $as_echo "#define _POSIX_SOURCE 1" >>confdefs.h $as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h $as_echo "#define _MINIX 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 $as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } if ${ac_cv_safe_to_define___extensions__+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # define __EXTENSIONS__ 1 $ac_includes_default int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_safe_to_define___extensions__=yes else ac_cv_safe_to_define___extensions__=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 $as_echo "$ac_cv_safe_to_define___extensions__" >&6; } test $ac_cv_safe_to_define___extensions__ = yes && $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h $as_echo "#define _ALL_SOURCE 1" >>confdefs.h $as_echo "#define _GNU_SOURCE 1" >>confdefs.h $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi ac_ext=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 whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi { $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 if test -n "$ac_tool_prefix"; then for ac_prog in ar lib "link -lib" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar lib "link -lib" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} { $as_echo "$as_me:${as_lineno-$LINENO}: checking the archiver ($AR) interface" >&5 $as_echo_n "checking the archiver ($AR) interface... " >&6; } if ${am_cv_ar_interface+:} false; then : $as_echo_n "(cached) " >&6 else am_cv_ar_interface=ar cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int some_variable = 0; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5 (eval $am_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then am_cv_ar_interface=ar else am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5 (eval $am_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then am_cv_ar_interface=lib else am_cv_ar_interface=unknown fi fi rm -f conftest.lib libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_ar_interface" >&5 $as_echo "$am_cv_ar_interface" >&6; } case $am_cv_ar_interface in ar) ;; lib) # Microsoft lib, so override with the ar-lib wrapper script. # FIXME: It is wrong to rewrite AR. # 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__AR in this case, # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something # similar. AR="$am_aux_dir/ar-lib $AR" ;; unknown) as_fn_error $? "could not determine $AR interface" "$LINENO" 5 ;; esac case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.2' macro_revision='1.3337' ltmain="$ac_aux_dir/ltmain.sh" # Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 $as_echo_n "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case "$ECHO" in printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 $as_echo "printf" >&6; } ;; print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 $as_echo "print -r" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 $as_echo "cat" >&6; } ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n $lt_cv_sys_max_cmd_len ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 $as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 $as_echo "$xsi_shell" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 $as_echo_n "checking whether the shell understands \"+=\"... " >&6; } lt_shell_append=no ( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 $as_echo "$lt_shell_append" >&6; } if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 $as_echo_n "checking how to convert $build file names to $host format... " >&6; } if ${lt_cv_to_host_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 $as_echo "$lt_cv_to_host_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } if ${lt_cv_to_tool_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 $as_echo "$lt_cv_to_tool_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test "$GCC" != yes; then reload_cmds=false fi ;; darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 $as_echo_n "checking how to associate runtime and link libraries... " >&6; } if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 $as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} : ${AR_FLAGS=cru} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 $as_echo_n "checking for archiver @FILE support... " >&6; } if ${lt_cv_ar_at_file+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$lt_cv_ar_at_file" >&6; } if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then : withval=$with_sysroot; else with_sysroot=no fi lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 $as_echo "${with_sysroot}" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 $as_echo "${lt_sysroot:-no}" >&6; } # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD="${LD-ld}_sol2" fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 $as_echo "$MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 $as_echo "$ac_ct_MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if ${lt_cv_path_mainfest_tool+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 $as_echo "$lt_cv_path_mainfest_tool" >&6; } if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if ${lt_cv_ld_force_load+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR cru libconftest.a conftest.o" >&5 $AR cru libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 $as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[012]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac for ac_header in dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF fi done # Set options enable_dlopen=no enable_win32_dll=no # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac else enable_shared=yes fi # Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else enable_static=yes fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS="$lt_save_ifs" ;; esac else pic_mode=default fi test -z "$pic_mode" && pic_mode=default # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac else enable_fast_install=yes fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC="$CC" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 $as_echo "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test x"$lt_cv_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test x"$lt_cv_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) link_all_deplibs=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='${wl}--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' link_all_deplibs=yes ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi link_all_deplibs=no else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi export_dynamic_flag_spec='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test "$lt_cv_ld_force_load" = "yes"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 $as_echo_n "checking if $CC understands -b... " >&6; } if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$lt_cv_prog_compiler__b" >&6; } if test x"$lt_cv_prog_compiler__b" = xyes; then archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_irix_exported_symbol=yes else lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$lt_cv_irix_exported_symbol" >&6; } if test "$lt_cv_irix_exported_symbol" = yes; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='${wl}-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='${wl}-z,text' allow_undefined_flag='${wl}-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='${wl}-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test "$ld_shlibs" = no && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 $as_echo "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([A-Za-z]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test "X$hardcode_automatic" = "Xyes" ; then # We can hardcode non-existent directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } if test "$hardcode_action" = relink || test "$inherit_rpath" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : lt_cv_dlopen="shl_load" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes; then : lt_cv_dlopen="dlopen" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report which library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" ac_config_commands="$ac_config_commands libtool" # Only expand once: # Seems to be required for building a binary from multiple source files # automake complains without it in infinoted/. 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 ################################### # Gtk-Doc ################################### if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 $as_echo "$ac_pt_PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } PKG_CONFIG="" fi fi # Extract the first word of "gtkdoc-check", so it can be a program name with args. set dummy gtkdoc-check; 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_GTKDOC_CHECK+:} false; then : $as_echo_n "(cached) " >&6 else case $GTKDOC_CHECK in [\\/]* | ?:[\\/]*) ac_cv_path_GTKDOC_CHECK="$GTKDOC_CHECK" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GTKDOC_CHECK="$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 GTKDOC_CHECK=$ac_cv_path_GTKDOC_CHECK if test -n "$GTKDOC_CHECK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_CHECK" >&5 $as_echo "$GTKDOC_CHECK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi for ac_prog in gtkdoc-rebase 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_path_GTKDOC_REBASE+:} false; then : $as_echo_n "(cached) " >&6 else case $GTKDOC_REBASE in [\\/]* | ?:[\\/]*) ac_cv_path_GTKDOC_REBASE="$GTKDOC_REBASE" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GTKDOC_REBASE="$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 GTKDOC_REBASE=$ac_cv_path_GTKDOC_REBASE if test -n "$GTKDOC_REBASE"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_REBASE" >&5 $as_echo "$GTKDOC_REBASE" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$GTKDOC_REBASE" && break done test -n "$GTKDOC_REBASE" || GTKDOC_REBASE="true" # Extract the first word of "gtkdoc-mkpdf", so it can be a program name with args. set dummy gtkdoc-mkpdf; 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_GTKDOC_MKPDF+:} false; then : $as_echo_n "(cached) " >&6 else case $GTKDOC_MKPDF in [\\/]* | ?:[\\/]*) ac_cv_path_GTKDOC_MKPDF="$GTKDOC_MKPDF" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GTKDOC_MKPDF="$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 GTKDOC_MKPDF=$ac_cv_path_GTKDOC_MKPDF if test -n "$GTKDOC_MKPDF"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_MKPDF" >&5 $as_echo "$GTKDOC_MKPDF" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Check whether --with-html-dir was given. if test "${with_html_dir+set}" = set; then : withval=$with_html_dir; else with_html_dir='${datadir}/gtk-doc/html' fi HTML_DIR="$with_html_dir" # Check whether --enable-gtk-doc was given. if test "${enable_gtk_doc+set}" = set; then : enableval=$enable_gtk_doc; else enable_gtk_doc=no fi if test x$enable_gtk_doc = xyes; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk-doc >= 1.4\""; } >&5 ($PKG_CONFIG --exists --print-errors "gtk-doc >= 1.4") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : else as_fn_error $? "You need to have gtk-doc >= 1.4 installed to build $PACKAGE_NAME" "$LINENO" 5 fi if test "x$PACKAGE_NAME" != "xglib"; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTKDOC_DEPS" >&5 $as_echo_n "checking for GTKDOC_DEPS... " >&6; } if test -n "$GTKDOC_DEPS_CFLAGS"; then pkg_cv_GTKDOC_DEPS_CFLAGS="$GTKDOC_DEPS_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.10.0 gobject-2.0 >= 2.10.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GTKDOC_DEPS_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$GTKDOC_DEPS_LIBS"; then pkg_cv_GTKDOC_DEPS_LIBS="$GTKDOC_DEPS_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.10.0 gobject-2.0 >= 2.10.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GTKDOC_DEPS_LIBS=`$PKG_CONFIG --libs "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then GTKDOC_DEPS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0" 2>&1` else GTKDOC_DEPS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GTKDOC_DEPS_PKG_ERRORS" >&5 : elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } : else GTKDOC_DEPS_CFLAGS=$pkg_cv_GTKDOC_DEPS_CFLAGS GTKDOC_DEPS_LIBS=$pkg_cv_GTKDOC_DEPS_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build gtk-doc documentation" >&5 $as_echo_n "checking whether to build gtk-doc documentation... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_gtk_doc" >&5 $as_echo "$enable_gtk_doc" >&6; } # Check whether --enable-gtk-doc-html was given. if test "${enable_gtk_doc_html+set}" = set; then : enableval=$enable_gtk_doc_html; else enable_gtk_doc_html=yes fi # Check whether --enable-gtk-doc-pdf was given. if test "${enable_gtk_doc_pdf+set}" = set; then : enableval=$enable_gtk_doc_pdf; else enable_gtk_doc_pdf=no fi if test -z "$GTKDOC_MKPDF"; then enable_gtk_doc_pdf=no fi if test -z "$AM_DEFAULT_VERBOSITY"; then AM_DEFAULT_VERBOSITY=1 fi if test x$enable_gtk_doc = xyes; then ENABLE_GTK_DOC_TRUE= ENABLE_GTK_DOC_FALSE='#' else ENABLE_GTK_DOC_TRUE='#' ENABLE_GTK_DOC_FALSE= fi if test x$enable_gtk_doc_html = xyes; then GTK_DOC_BUILD_HTML_TRUE= GTK_DOC_BUILD_HTML_FALSE='#' else GTK_DOC_BUILD_HTML_TRUE='#' GTK_DOC_BUILD_HTML_FALSE= fi if test x$enable_gtk_doc_pdf = xyes; then GTK_DOC_BUILD_PDF_TRUE= GTK_DOC_BUILD_PDF_FALSE='#' else GTK_DOC_BUILD_PDF_TRUE='#' GTK_DOC_BUILD_PDF_FALSE= fi if test -n "$LIBTOOL"; then GTK_DOC_USE_LIBTOOL_TRUE= GTK_DOC_USE_LIBTOOL_FALSE='#' else GTK_DOC_USE_LIBTOOL_TRUE='#' GTK_DOC_USE_LIBTOOL_FALSE= fi if test -n "$GTKDOC_REBASE"; then GTK_DOC_USE_REBASE_TRUE= GTK_DOC_USE_REBASE_FALSE='#' else GTK_DOC_USE_REBASE_TRUE='#' GTK_DOC_USE_REBASE_FALSE= fi ################################### # Platform checks ################################### case "$host_os" in *mingw*) platform='win32' ;; *) platform='unix' ;; esac # Check for MSG_NOSIGNAL { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MSG_NOSIGNAL" >&5 $as_echo_n "checking for MSG_NOSIGNAL... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { int f = MSG_NOSIGNAL; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define HAVE_MSG_NOSIGNAL 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Check for SO_REUSEADDR { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SO_REUSEADDR" >&5 $as_echo_n "checking for SO_REUSEADDR... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { int f = SO_REUSEADDR; printf("%d\n", f); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define HAVE_SO_REUSEADDR 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Check for dirent.d_type { $as_echo "$as_me:${as_lineno-$LINENO}: checking for d_type" >&5 $as_echo_n "checking for d_type... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { struct dirent d; printf("%d\n", d.d_type); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define HAVE_D_TYPE 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ################################### # Check for regular dependencies ################################### infinity_libraries='glib-2.0 >= 2.16 gobject-2.0 >= 2.16 gmodule-2.0 >= 2.16 gthread-2.0 >= 2.16 libxml-2.0 gnutls >= 1.7.2 libgsasl >= 0.2.21' pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for infinity" >&5 $as_echo_n "checking for infinity... " >&6; } if test -n "$infinity_CFLAGS"; then pkg_cv_infinity_CFLAGS="$infinity_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$infinity_libraries\""; } >&5 ($PKG_CONFIG --exists --print-errors "$infinity_libraries") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_infinity_CFLAGS=`$PKG_CONFIG --cflags "$infinity_libraries" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$infinity_LIBS"; then pkg_cv_infinity_LIBS="$infinity_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$infinity_libraries\""; } >&5 ($PKG_CONFIG --exists --print-errors "$infinity_libraries") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_infinity_LIBS=`$PKG_CONFIG --libs "$infinity_libraries" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then infinity_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$infinity_libraries" 2>&1` else infinity_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$infinity_libraries" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$infinity_PKG_ERRORS" >&5 as_fn_error $? "Package requirements ($infinity_libraries) were not met: $infinity_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 infinity_CFLAGS and infinity_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 infinity_CFLAGS and infinity_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 infinity_CFLAGS=$pkg_cv_infinity_CFLAGS infinity_LIBS=$pkg_cv_infinity_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 inftext" >&5 $as_echo_n "checking for inftext... " >&6; } if test -n "$inftext_CFLAGS"; then pkg_cv_inftext_CFLAGS="$inftext_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.16 gobject-2.0 >= 2.16 libxml-2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.16 gobject-2.0 >= 2.16 libxml-2.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_inftext_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0 >= 2.16 gobject-2.0 >= 2.16 libxml-2.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$inftext_LIBS"; then pkg_cv_inftext_LIBS="$inftext_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.16 gobject-2.0 >= 2.16 libxml-2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.16 gobject-2.0 >= 2.16 libxml-2.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_inftext_LIBS=`$PKG_CONFIG --libs "glib-2.0 >= 2.16 gobject-2.0 >= 2.16 libxml-2.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then inftext_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glib-2.0 >= 2.16 gobject-2.0 >= 2.16 libxml-2.0" 2>&1` else inftext_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glib-2.0 >= 2.16 gobject-2.0 >= 2.16 libxml-2.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$inftext_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (glib-2.0 >= 2.16 gobject-2.0 >= 2.16 libxml-2.0) were not met: $inftext_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 inftext_CFLAGS and inftext_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 inftext_CFLAGS and inftext_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 inftext_CFLAGS=$pkg_cv_inftext_CFLAGS inftext_LIBS=$pkg_cv_inftext_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi if test $platform = 'win32'; then infinity_LIBS="$infinity_LIBS -lws2_32" fi ################################### # Check for GTK+ 3 ################################### # Check whether --with-gtk3 was given. if test "${with_gtk3+set}" = set; then : withval=$with_gtk3; with_gtk3=$withval else with_gtk3=no fi if test "x$with_gtk3" = "xyes" then gtk_requirement="gtk+-3.0 >= 2.90.6" gtk_version=3 else gtk_requirement="gtk+-2.0 >= 2.12" gtk_version=2 fi ################################### # libinftextgtk optional package ################################### # Check whether --with-inftextgtk was given. if test "${with_inftextgtk+set}" = set; then : withval=$with_inftextgtk; with_inftextgtk=$withval else with_inftextgtk=auto fi if test "x$with_inftextgtk" = "xauto" then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inftextgtk" >&5 $as_echo_n "checking for inftextgtk... " >&6; } if test -n "$inftextgtk_CFLAGS"; then pkg_cv_inftextgtk_CFLAGS="$inftextgtk_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$gtk_requirement\""; } >&5 ($PKG_CONFIG --exists --print-errors "$gtk_requirement") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_inftextgtk_CFLAGS=`$PKG_CONFIG --cflags "$gtk_requirement" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$inftextgtk_LIBS"; then pkg_cv_inftextgtk_LIBS="$inftextgtk_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$gtk_requirement\""; } >&5 ($PKG_CONFIG --exists --print-errors "$gtk_requirement") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_inftextgtk_LIBS=`$PKG_CONFIG --libs "$gtk_requirement" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then inftextgtk_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$gtk_requirement" 2>&1` else inftextgtk_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$gtk_requirement" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$inftextgtk_PKG_ERRORS" >&5 with_inftextgtk=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } with_inftextgtk=no else inftextgtk_CFLAGS=$pkg_cv_inftextgtk_CFLAGS inftextgtk_LIBS=$pkg_cv_inftextgtk_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } with_inftextgtk=yes fi elif test "x$with_inftextgtk" = "xyes" then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inftextgtk" >&5 $as_echo_n "checking for inftextgtk... " >&6; } if test -n "$inftextgtk_CFLAGS"; then pkg_cv_inftextgtk_CFLAGS="$inftextgtk_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$gtk_requirement\""; } >&5 ($PKG_CONFIG --exists --print-errors "$gtk_requirement") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_inftextgtk_CFLAGS=`$PKG_CONFIG --cflags "$gtk_requirement" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$inftextgtk_LIBS"; then pkg_cv_inftextgtk_LIBS="$inftextgtk_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$gtk_requirement\""; } >&5 ($PKG_CONFIG --exists --print-errors "$gtk_requirement") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_inftextgtk_LIBS=`$PKG_CONFIG --libs "$gtk_requirement" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then inftextgtk_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$gtk_requirement" 2>&1` else inftextgtk_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$gtk_requirement" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$inftextgtk_PKG_ERRORS" >&5 as_fn_error $? "Package requirements ($gtk_requirement) were not met: $inftextgtk_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 inftextgtk_CFLAGS and inftextgtk_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 inftextgtk_CFLAGS and inftextgtk_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 inftextgtk_CFLAGS=$pkg_cv_inftextgtk_CFLAGS inftextgtk_LIBS=$pkg_cv_inftextgtk_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi fi if test "x$with_inftextgtk" = "xyes" then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for atan2 in -lm" >&5 $as_echo_n "checking for atan2 in -lm... " >&6; } if ${ac_cv_lib_m_atan2+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $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 atan2 (); int main () { return atan2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_m_atan2=yes else ac_cv_lib_m_atan2=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_m_atan2" >&5 $as_echo "$ac_cv_lib_m_atan2" >&6; } if test "x$ac_cv_lib_m_atan2" = xyes; then : inftextgtk_LIBS="$inftextgtk_LIBS -lm" else as_fn_error $? "libm not found" "$LINENO" 5 fi fi if test "x$with_inftextgtk" = "xyes"; then WITH_INFTEXTGTK_TRUE= WITH_INFTEXTGTK_FALSE='#' else WITH_INFTEXTGTK_TRUE='#' WITH_INFTEXTGTK_FALSE= fi ############################### # libinfgtk optional package ############################### # Check whether --with-infgtk was given. if test "${with_infgtk+set}" = set; then : withval=$with_infgtk; with_infgtk=$withval else with_infgtk=auto fi if test "x$with_infgtk" = "xauto" then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for infgtk" >&5 $as_echo_n "checking for infgtk... " >&6; } if test -n "$infgtk_CFLAGS"; then pkg_cv_infgtk_CFLAGS="$infgtk_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$gtk_requirement\""; } >&5 ($PKG_CONFIG --exists --print-errors "$gtk_requirement") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_infgtk_CFLAGS=`$PKG_CONFIG --cflags "$gtk_requirement" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$infgtk_LIBS"; then pkg_cv_infgtk_LIBS="$infgtk_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$gtk_requirement\""; } >&5 ($PKG_CONFIG --exists --print-errors "$gtk_requirement") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_infgtk_LIBS=`$PKG_CONFIG --libs "$gtk_requirement" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then infgtk_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$gtk_requirement" 2>&1` else infgtk_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$gtk_requirement" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$infgtk_PKG_ERRORS" >&5 with_infgtk=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } with_infgtk=no else infgtk_CFLAGS=$pkg_cv_infgtk_CFLAGS infgtk_LIBS=$pkg_cv_infgtk_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } with_infgtk=yes fi elif test "x$with_infgtk" = "xyes" then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for infgtk" >&5 $as_echo_n "checking for infgtk... " >&6; } if test -n "$infgtk_CFLAGS"; then pkg_cv_infgtk_CFLAGS="$infgtk_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$gtk_requirement\""; } >&5 ($PKG_CONFIG --exists --print-errors "$gtk_requirement") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_infgtk_CFLAGS=`$PKG_CONFIG --cflags "$gtk_requirement" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$infgtk_LIBS"; then pkg_cv_infgtk_LIBS="$infgtk_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$gtk_requirement\""; } >&5 ($PKG_CONFIG --exists --print-errors "$gtk_requirement") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_infgtk_LIBS=`$PKG_CONFIG --libs "$gtk_requirement" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then infgtk_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$gtk_requirement" 2>&1` else infgtk_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$gtk_requirement" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$infgtk_PKG_ERRORS" >&5 as_fn_error $? "Package requirements ($gtk_requirement) were not met: $infgtk_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 infgtk_CFLAGS and infgtk_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 infgtk_CFLAGS and infgtk_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 infgtk_CFLAGS=$pkg_cv_infgtk_CFLAGS infgtk_LIBS=$pkg_cv_infgtk_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi fi if test "x$with_infgtk" = "xyes"; then WITH_INFGTK_TRUE= WITH_INFGTK_FALSE='#' else WITH_INFGTK_TRUE='#' WITH_INFGTK_FALSE= fi ############################### # infinoted optional package ############################### # Check whether --with-infinoted was given. if test "${with_infinoted+set}" = set; then : withval=$with_infinoted; with_infinoted=$withval else with_infinoted=yes fi if test "x$with_infinoted" = "xyes" then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for infinoted" >&5 $as_echo_n "checking for infinoted... " >&6; } if test -n "$infinoted_CFLAGS"; then pkg_cv_infinoted_CFLAGS="$infinoted_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.16 gobject-2.0 >= 2.16 gmodule-2.0 >= 2.14 gnutls >= 1.7.2\""; } >&5 ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.16 gobject-2.0 >= 2.16 gmodule-2.0 >= 2.14 gnutls >= 1.7.2") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_infinoted_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0 >= 2.16 gobject-2.0 >= 2.16 gmodule-2.0 >= 2.14 gnutls >= 1.7.2" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$infinoted_LIBS"; then pkg_cv_infinoted_LIBS="$infinoted_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.16 gobject-2.0 >= 2.16 gmodule-2.0 >= 2.14 gnutls >= 1.7.2\""; } >&5 ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.16 gobject-2.0 >= 2.16 gmodule-2.0 >= 2.14 gnutls >= 1.7.2") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_infinoted_LIBS=`$PKG_CONFIG --libs "glib-2.0 >= 2.16 gobject-2.0 >= 2.16 gmodule-2.0 >= 2.14 gnutls >= 1.7.2" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then infinoted_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glib-2.0 >= 2.16 gobject-2.0 >= 2.16 gmodule-2.0 >= 2.14 gnutls >= 1.7.2" 2>&1` else infinoted_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glib-2.0 >= 2.16 gobject-2.0 >= 2.16 gmodule-2.0 >= 2.14 gnutls >= 1.7.2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$infinoted_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (glib-2.0 >= 2.16 gobject-2.0 >= 2.16 gmodule-2.0 >= 2.14 gnutls >= 1.7.2) were not met: $infinoted_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 infinoted_CFLAGS and infinoted_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 infinoted_CFLAGS and infinoted_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 infinoted_CFLAGS=$pkg_cv_infinoted_CFLAGS infinoted_LIBS=$pkg_cv_infinoted_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi fi if test "x$with_infinoted" = "xyes"; then WITH_INFINOTED_TRUE= WITH_INFINOTED_FALSE='#' else WITH_INFINOTED_TRUE='#' WITH_INFINOTED_FALSE= fi #################### # Check for avahi #################### # Check whether --with-avahi was given. if test "${with_avahi+set}" = set; then : withval=$with_avahi; use_avahi=$withval else use_avahi=auto fi if test "x$use_avahi" = "xauto" then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for avahi" >&5 $as_echo_n "checking for avahi... " >&6; } if test -n "$avahi_CFLAGS"; then pkg_cv_avahi_CFLAGS="$avahi_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"avahi-client\""; } >&5 ($PKG_CONFIG --exists --print-errors "avahi-client") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_avahi_CFLAGS=`$PKG_CONFIG --cflags "avahi-client" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$avahi_LIBS"; then pkg_cv_avahi_LIBS="$avahi_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"avahi-client\""; } >&5 ($PKG_CONFIG --exists --print-errors "avahi-client") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_avahi_LIBS=`$PKG_CONFIG --libs "avahi-client" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then avahi_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "avahi-client" 2>&1` else avahi_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "avahi-client" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$avahi_PKG_ERRORS" >&5 use_avahi=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } use_avahi=no else avahi_CFLAGS=$pkg_cv_avahi_CFLAGS avahi_LIBS=$pkg_cv_avahi_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } use_avahi=yes fi elif test "x$use_avahi" = "xyes" then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for avahi" >&5 $as_echo_n "checking for avahi... " >&6; } if test -n "$avahi_CFLAGS"; then pkg_cv_avahi_CFLAGS="$avahi_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"avahi-client\""; } >&5 ($PKG_CONFIG --exists --print-errors "avahi-client") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_avahi_CFLAGS=`$PKG_CONFIG --cflags "avahi-client" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$avahi_LIBS"; then pkg_cv_avahi_LIBS="$avahi_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"avahi-client\""; } >&5 ($PKG_CONFIG --exists --print-errors "avahi-client") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_avahi_LIBS=`$PKG_CONFIG --libs "avahi-client" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then avahi_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "avahi-client" 2>&1` else avahi_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "avahi-client" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$avahi_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (avahi-client) were not met: $avahi_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 avahi_CFLAGS and avahi_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 avahi_CFLAGS and avahi_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 avahi_CFLAGS=$pkg_cv_avahi_CFLAGS avahi_LIBS=$pkg_cv_avahi_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi fi if test "x$use_avahi" = "xyes" then $as_echo "#define LIBINFINITY_HAVE_AVAHI 1" >>confdefs.h fi if test "x$use_avahi" = "xyes"; then LIBINFINITY_HAVE_AVAHI_TRUE= LIBINFINITY_HAVE_AVAHI_FALSE='#' else LIBINFINITY_HAVE_AVAHI_TRUE='#' LIBINFINITY_HAVE_AVAHI_FALSE= fi #################### # Check for libdaemon #################### # Check whether --with-libdaemon was given. if test "${with_libdaemon+set}" = set; then : withval=$with_libdaemon; use_libdaemon=$withval else use_libdaemon=auto fi if test "x$use_libdaemon" = "xauto" then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libdaemon" >&5 $as_echo_n "checking for libdaemon... " >&6; } if test -n "$libdaemon_CFLAGS"; then pkg_cv_libdaemon_CFLAGS="$libdaemon_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libdaemon\""; } >&5 ($PKG_CONFIG --exists --print-errors "libdaemon") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libdaemon_CFLAGS=`$PKG_CONFIG --cflags "libdaemon" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$libdaemon_LIBS"; then pkg_cv_libdaemon_LIBS="$libdaemon_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libdaemon\""; } >&5 ($PKG_CONFIG --exists --print-errors "libdaemon") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libdaemon_LIBS=`$PKG_CONFIG --libs "libdaemon" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then libdaemon_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libdaemon" 2>&1` else libdaemon_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libdaemon" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$libdaemon_PKG_ERRORS" >&5 use_libdaemon=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } use_libdaemon=no else libdaemon_CFLAGS=$pkg_cv_libdaemon_CFLAGS libdaemon_LIBS=$pkg_cv_libdaemon_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } use_libdaemon=yes fi elif test "x$use_libdaemon" = "xyes" then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libdaemon" >&5 $as_echo_n "checking for libdaemon... " >&6; } if test -n "$libdaemon_CFLAGS"; then pkg_cv_libdaemon_CFLAGS="$libdaemon_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libdaemon\""; } >&5 ($PKG_CONFIG --exists --print-errors "libdaemon") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libdaemon_CFLAGS=`$PKG_CONFIG --cflags "libdaemon" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$libdaemon_LIBS"; then pkg_cv_libdaemon_LIBS="$libdaemon_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libdaemon\""; } >&5 ($PKG_CONFIG --exists --print-errors "libdaemon") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_libdaemon_LIBS=`$PKG_CONFIG --libs "libdaemon" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then libdaemon_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libdaemon" 2>&1` else libdaemon_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libdaemon" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$libdaemon_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (libdaemon) were not met: $libdaemon_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 libdaemon_CFLAGS and libdaemon_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 libdaemon_CFLAGS and libdaemon_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 libdaemon_CFLAGS=$pkg_cv_libdaemon_CFLAGS libdaemon_LIBS=$pkg_cv_libdaemon_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi fi if test "x$use_libdaemon" = "xyes" then $as_echo "#define LIBINFINITY_HAVE_LIBDAEMON 1" >>confdefs.h fi if test "x$use_libdaemon" = "xyes"; then LIBINFINITY_HAVE_LIBDAEMON_TRUE= LIBINFINITY_HAVE_LIBDAEMON_FALSE='#' else LIBINFINITY_HAVE_LIBDAEMON_TRUE='#' LIBINFINITY_HAVE_LIBDAEMON_FALSE= fi ################# # Check for pam # ################# { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pam" >&5 $as_echo_n "checking for pam... " >&6; } as_ac_Lib=`$as_echo "ac_cv_lib_ pam ''_ pam_start " | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pam_start in -l pam " >&5 $as_echo_n "checking for pam_start in -l pam ... " >&6; } if eval \${$as_ac_Lib+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-l pam $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 pam_start (); int main () { return pam_start (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$as_ac_Lib=yes" else eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi eval ac_res=\$$as_ac_Lib { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define LIBINFINITY_HAVE_PAM 1" >>confdefs.h use_pam=yes infinity_LIBS="$infinity_LIBS -lpam" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } use_pam=no fi # Check for PAM_FAIL_DELAY { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PAM_FAIL_DELAY" >&5 $as_echo_n "checking for PAM_FAIL_DELAY... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { int f = PAM_FAIL_DELAY; printf("%d\n", f); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define HAVE_PAM_FAIL_DELAY 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ############ # gettext ############ GETTEXT_PACKAGE="libinfinity-0.5" cat >>confdefs.h <<_ACEOF #define GETTEXT_PACKAGE "$GETTEXT_PACKAGE" _ACEOF ALL_LINGUAS="`grep -v '^#' "$srcdir/po/LINGUAS" | tr '\n' ' '`" for ac_header in locale.h do : ac_fn_c_check_header_mongrel "$LINENO" "locale.h" "ac_cv_header_locale_h" "$ac_includes_default" if test "x$ac_cv_header_locale_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LOCALE_H 1 _ACEOF fi done if test $ac_cv_header_locale_h = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LC_MESSAGES" >&5 $as_echo_n "checking for LC_MESSAGES... " >&6; } if ${am_cv_val_LC_MESSAGES+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { return LC_MESSAGES ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : am_cv_val_LC_MESSAGES=yes else am_cv_val_LC_MESSAGES=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_val_LC_MESSAGES" >&5 $as_echo "$am_cv_val_LC_MESSAGES" >&6; } if test $am_cv_val_LC_MESSAGES = yes; then $as_echo "#define HAVE_LC_MESSAGES 1" >>confdefs.h fi fi USE_NLS=yes gt_cv_have_gettext=no CATOBJEXT=NONE XGETTEXT=: INTLLIBS= ac_fn_c_check_header_mongrel "$LINENO" "libintl.h" "ac_cv_header_libintl_h" "$ac_includes_default" if test "x$ac_cv_header_libintl_h" = xyes; then : gt_cv_func_dgettext_libintl="no" libintl_extra_libs="" # # First check in libc # { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ngettext in libc" >&5 $as_echo_n "checking for ngettext in libc... " >&6; } if ${gt_cv_func_ngettext_libc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { return !ngettext ("","", 1) ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : gt_cv_func_ngettext_libc=yes else gt_cv_func_ngettext_libc=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_ngettext_libc" >&5 $as_echo "$gt_cv_func_ngettext_libc" >&6; } if test "$gt_cv_func_ngettext_libc" = "yes" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dgettext in libc" >&5 $as_echo_n "checking for dgettext in libc... " >&6; } if ${gt_cv_func_dgettext_libc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { return !dgettext ("","") ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : gt_cv_func_dgettext_libc=yes else gt_cv_func_dgettext_libc=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_dgettext_libc" >&5 $as_echo "$gt_cv_func_dgettext_libc" >&6; } fi if test "$gt_cv_func_ngettext_libc" = "yes" ; then for ac_func in bind_textdomain_codeset do : ac_fn_c_check_func "$LINENO" "bind_textdomain_codeset" "ac_cv_func_bind_textdomain_codeset" if test "x$ac_cv_func_bind_textdomain_codeset" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_BIND_TEXTDOMAIN_CODESET 1 _ACEOF fi done fi # # If we don't have everything we want, check in libintl # if test "$gt_cv_func_dgettext_libc" != "yes" \ || test "$gt_cv_func_ngettext_libc" != "yes" \ || test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bindtextdomain in -lintl" >&5 $as_echo_n "checking for bindtextdomain in -lintl... " >&6; } if ${ac_cv_lib_intl_bindtextdomain+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char bindtextdomain (); int main () { return bindtextdomain (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_intl_bindtextdomain=yes else ac_cv_lib_intl_bindtextdomain=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_bindtextdomain" >&5 $as_echo "$ac_cv_lib_intl_bindtextdomain" >&6; } if test "x$ac_cv_lib_intl_bindtextdomain" = xyes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ngettext in -lintl" >&5 $as_echo_n "checking for ngettext in -lintl... " >&6; } if ${ac_cv_lib_intl_ngettext+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char ngettext (); int main () { return ngettext (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_intl_ngettext=yes else ac_cv_lib_intl_ngettext=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_ngettext" >&5 $as_echo "$ac_cv_lib_intl_ngettext" >&6; } if test "x$ac_cv_lib_intl_ngettext" = xyes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dgettext in -lintl" >&5 $as_echo_n "checking for dgettext in -lintl... " >&6; } if ${ac_cv_lib_intl_dgettext+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dgettext (); int main () { return dgettext (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_intl_dgettext=yes else ac_cv_lib_intl_dgettext=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_dgettext" >&5 $as_echo "$ac_cv_lib_intl_dgettext" >&6; } if test "x$ac_cv_lib_intl_dgettext" = xyes; then : gt_cv_func_dgettext_libintl=yes fi fi fi if test "$gt_cv_func_dgettext_libintl" != "yes" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if -liconv is needed to use gettext" >&5 $as_echo_n "checking if -liconv is needed to use gettext... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 $as_echo "" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ngettext in -lintl" >&5 $as_echo_n "checking for ngettext in -lintl... " >&6; } if ${ac_cv_lib_intl_ngettext+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl -liconv $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char ngettext (); int main () { return ngettext (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_intl_ngettext=yes else ac_cv_lib_intl_ngettext=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_ngettext" >&5 $as_echo "$ac_cv_lib_intl_ngettext" >&6; } if test "x$ac_cv_lib_intl_ngettext" = xyes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dcgettext in -lintl" >&5 $as_echo_n "checking for dcgettext in -lintl... " >&6; } if ${ac_cv_lib_intl_dcgettext+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl -liconv $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dcgettext (); int main () { return dcgettext (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_intl_dcgettext=yes else ac_cv_lib_intl_dcgettext=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_dcgettext" >&5 $as_echo "$ac_cv_lib_intl_dcgettext" >&6; } if test "x$ac_cv_lib_intl_dcgettext" = xyes; then : gt_cv_func_dgettext_libintl=yes libintl_extra_libs=-liconv else : fi else : fi fi # # If we found libintl, then check in it for bind_textdomain_codeset(); # we'll prefer libc if neither have bind_textdomain_codeset(), # and both have dgettext and ngettext # if test "$gt_cv_func_dgettext_libintl" = "yes" ; then glib_save_LIBS="$LIBS" LIBS="$LIBS -lintl $libintl_extra_libs" unset ac_cv_func_bind_textdomain_codeset for ac_func in bind_textdomain_codeset do : ac_fn_c_check_func "$LINENO" "bind_textdomain_codeset" "ac_cv_func_bind_textdomain_codeset" if test "x$ac_cv_func_bind_textdomain_codeset" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_BIND_TEXTDOMAIN_CODESET 1 _ACEOF fi done LIBS="$glib_save_LIBS" if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then gt_cv_func_dgettext_libc=no else if test "$gt_cv_func_dgettext_libc" = "yes" \ && test "$gt_cv_func_ngettext_libc" = "yes"; then gt_cv_func_dgettext_libintl=no fi fi fi fi if test "$gt_cv_func_dgettext_libc" = "yes" \ || test "$gt_cv_func_dgettext_libintl" = "yes"; then gt_cv_have_gettext=yes fi if test "$gt_cv_func_dgettext_libintl" = "yes"; then INTLLIBS="-lintl $libintl_extra_libs" fi if test "$gt_cv_have_gettext" = "yes"; then $as_echo "#define HAVE_GETTEXT 1" >>confdefs.h # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_MSGFMT+:} false; then : $as_echo_n "(cached) " >&6 else case "$MSGFMT" in /*) ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then ac_cv_path_MSGFMT="$ac_dir/$ac_word" break fi fi done IFS="$ac_save_ifs" test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT="no" ;; esac fi MSGFMT="$ac_cv_path_MSGFMT" if test "$MSGFMT" != "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5 $as_echo "$MSGFMT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "$MSGFMT" != "no"; then glib_save_LIBS="$LIBS" LIBS="$LIBS $INTLLIBS" for ac_func in dcgettext do : ac_fn_c_check_func "$LINENO" "dcgettext" "ac_cv_func_dcgettext" if test "x$ac_cv_func_dcgettext" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DCGETTEXT 1 _ACEOF fi done MSGFMT_OPTS= { $as_echo "$as_me:${as_lineno-$LINENO}: checking if msgfmt accepts -c" >&5 $as_echo_n "checking if msgfmt accepts -c... " >&6; } cat >conftest.foo <<_ACEOF msgid "" msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Project-Id-Version: test 1.0\n" "PO-Revision-Date: 2007-02-15 12:01+0100\n" "Last-Translator: test \n" "Language-Team: C \n" "MIME-Version: 1.0\n" "Content-Transfer-Encoding: 8bit\n" _ACEOF if { { $as_echo "$as_me:${as_lineno-$LINENO}: \$MSGFMT -c -o /dev/null conftest.foo"; } >&5 ($MSGFMT -c -o /dev/null conftest.foo) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then MSGFMT_OPTS=-c; { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } echo "$as_me: failed input was:" >&5 sed 's/^/| /' conftest.foo >&5 fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_GMSGFMT+:} false; then : $as_echo_n "(cached) " >&6 else case $GMSGFMT in [\\/]* | ?:[\\/]*) ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" ;; esac fi GMSGFMT=$ac_cv_path_GMSGFMT if test -n "$GMSGFMT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GMSGFMT" >&5 $as_echo "$GMSGFMT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_XGETTEXT+:} false; then : $as_echo_n "(cached) " >&6 else case "$XGETTEXT" in /*) ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then ac_cv_path_XGETTEXT="$ac_dir/$ac_word" break fi fi done IFS="$ac_save_ifs" test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" ;; esac fi XGETTEXT="$ac_cv_path_XGETTEXT" if test "$XGETTEXT" != ":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5 $as_echo "$XGETTEXT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { extern int _nl_msg_cat_cntr; return _nl_msg_cat_cntr ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : CATOBJEXT=.gmo DATADIRNAME=share else case $host in *-*-solaris*) ac_fn_c_check_func "$LINENO" "bind_textdomain_codeset" "ac_cv_func_bind_textdomain_codeset" if test "x$ac_cv_func_bind_textdomain_codeset" = xyes; then : CATOBJEXT=.gmo DATADIRNAME=share else CATOBJEXT=.mo DATADIRNAME=lib fi ;; *-*-openbsd*) CATOBJEXT=.mo DATADIRNAME=share ;; *) CATOBJEXT=.mo DATADIRNAME=lib ;; esac fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$glib_save_LIBS" INSTOBJEXT=.mo else gt_cv_have_gettext=no fi fi fi if test "$gt_cv_have_gettext" = "yes" ; then $as_echo "#define ENABLE_NLS 1" >>confdefs.h fi if test "$XGETTEXT" != ":"; then if $XGETTEXT --omit-header /dev/null 2> /dev/null; then : ; else { $as_echo "$as_me:${as_lineno-$LINENO}: result: found xgettext program is not GNU xgettext; ignore it" >&5 $as_echo "found xgettext program is not GNU xgettext; ignore it" >&6; } XGETTEXT=":" fi fi # We need to process the po/ directory. POSUB=po ac_config_commands="$ac_config_commands default-1" for lang in $ALL_LINGUAS; do GMOFILES="$GMOFILES $lang.gmo" POFILES="$POFILES $lang.po" done if test "$gt_cv_have_gettext" = "yes"; then if test "x$ALL_LINGUAS" = "x"; then LINGUAS= else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for catalogs to be installed" >&5 $as_echo_n "checking for catalogs to be installed... " >&6; } NEW_LINGUAS= for presentlang in $ALL_LINGUAS; do useit=no if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then desiredlanguages="$LINGUAS" else desiredlanguages="$ALL_LINGUAS" fi for desiredlang in $desiredlanguages; do # Use the presentlang catalog if desiredlang is # a. equal to presentlang, or # b. a variant of presentlang (because in this case, # presentlang can be used as a fallback for messages # which are not translated in the desiredlang catalog). case "$desiredlang" in "$presentlang"*) useit=yes;; esac done if test $useit = yes; then NEW_LINGUAS="$NEW_LINGUAS $presentlang" fi done LINGUAS=$NEW_LINGUAS { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LINGUAS" >&5 $as_echo "$LINGUAS" >&6; } fi if test -n "$LINGUAS"; then for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done fi fi MKINSTALLDIRS= if test -n "$ac_aux_dir"; then MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" fi if test -z "$MKINSTALLDIRS"; then MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" fi test -d po || mkdir po if test "x$srcdir" != "x."; then if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then posrcprefix="$srcdir/" else posrcprefix="../$srcdir/" fi else posrcprefix="../" fi rm -f po/POTFILES sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ < $srcdir/po/POTFILES.in > po/POTFILES glib_save_prefix="$prefix" glib_save_exec_prefix="$exec_prefix" glib_save_datarootdir="$datarootdir" test "x$prefix" = xNONE && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix=$prefix datarootdir=`eval echo "${datarootdir}"` if test "x$CATOBJEXT" = "x.mo" ; then localedir=`eval echo "${libdir}/locale"` else localedir=`eval echo "${datadir}/locale"` fi prefix="$glib_save_prefix" exec_prefix="$glib_save_exec_prefix" datarootdir="$glib_save_datarootdir" cat >>confdefs.h <<_ACEOF #define INF_LOCALEDIR "$localedir" _ACEOF ########### # Output ########### if test -n $has_strict_prototypes then CFLAGS=$old_CFLAGS fi ac_config_files="$ac_config_files Makefile libinfinity/Makefile libinfinity/communication/Makefile libinfinity/common/Makefile libinfinity/adopted/Makefile libinfinity/server/Makefile libinfinity/client/Makefile libinftext/Makefile libinfgtk/Makefile libinftextgtk/Makefile infinoted/Makefile infinoted/note-plugins/Makefile infinoted/note-plugins/text/Makefile pixmaps/Makefile pixmaps/16x16/Makefile pixmaps/22x22/Makefile pixmaps/scalable/Makefile test/Makefile test/util/Makefile test/session/Makefile test/cleanup/Makefile docs/Makefile docs/reference/Makefile docs/reference/version.xml.in docs/reference/api_version.xml.in docs/reference/libinfinity/Makefile docs/reference/libinftext/Makefile docs/reference/libinfgtk/Makefile docs/reference/libinftextgtk/Makefile po/Makefile.in" # These are separate for the macros to be expanded # (note no square brackets) ac_config_files="$ac_config_files libinfinity-0.5.pc:libinfinity.pc.in libinftext-0.5.pc:libinftext.pc.in libinfgtk-0.5.pc:libinfgtk.pc.in libinftextgtk-0.5.pc:libinftextgtk.pc.in" 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_GTK_DOC_TRUE}" && test -z "${ENABLE_GTK_DOC_FALSE}"; then as_fn_error $? "conditional \"ENABLE_GTK_DOC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${GTK_DOC_BUILD_HTML_TRUE}" && test -z "${GTK_DOC_BUILD_HTML_FALSE}"; then as_fn_error $? "conditional \"GTK_DOC_BUILD_HTML\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${GTK_DOC_BUILD_PDF_TRUE}" && test -z "${GTK_DOC_BUILD_PDF_FALSE}"; then as_fn_error $? "conditional \"GTK_DOC_BUILD_PDF\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${GTK_DOC_USE_LIBTOOL_TRUE}" && test -z "${GTK_DOC_USE_LIBTOOL_FALSE}"; then as_fn_error $? "conditional \"GTK_DOC_USE_LIBTOOL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${GTK_DOC_USE_REBASE_TRUE}" && test -z "${GTK_DOC_USE_REBASE_FALSE}"; then as_fn_error $? "conditional \"GTK_DOC_USE_REBASE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_INFTEXTGTK_TRUE}" && test -z "${WITH_INFTEXTGTK_FALSE}"; then as_fn_error $? "conditional \"WITH_INFTEXTGTK\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_INFGTK_TRUE}" && test -z "${WITH_INFGTK_FALSE}"; then as_fn_error $? "conditional \"WITH_INFGTK\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_INFINOTED_TRUE}" && test -z "${WITH_INFINOTED_FALSE}"; then as_fn_error $? "conditional \"WITH_INFINOTED\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${LIBINFINITY_HAVE_AVAHI_TRUE}" && test -z "${LIBINFINITY_HAVE_AVAHI_FALSE}"; then as_fn_error $? "conditional \"LIBINFINITY_HAVE_AVAHI\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${LIBINFINITY_HAVE_LIBDAEMON_TRUE}" && test -z "${LIBINFINITY_HAVE_LIBDAEMON_FALSE}"; then as_fn_error $? "conditional \"LIBINFINITY_HAVE_LIBDAEMON\" 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 -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by libinfinity $as_me 0.5.5, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ libinfinity config.status 0.5.5 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ DLLTOOL \ sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ nm_file_list_spec \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ sys_lib_dlsearch_path_spec; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' xsi_shell='$xsi_shell' lt_shell_append='$lt_shell_append' # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "libinfinity/inf-config.h") CONFIG_HEADERS="$CONFIG_HEADERS libinfinity/inf-config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "default-1") CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "libinfinity/Makefile") CONFIG_FILES="$CONFIG_FILES libinfinity/Makefile" ;; "libinfinity/communication/Makefile") CONFIG_FILES="$CONFIG_FILES libinfinity/communication/Makefile" ;; "libinfinity/common/Makefile") CONFIG_FILES="$CONFIG_FILES libinfinity/common/Makefile" ;; "libinfinity/adopted/Makefile") CONFIG_FILES="$CONFIG_FILES libinfinity/adopted/Makefile" ;; "libinfinity/server/Makefile") CONFIG_FILES="$CONFIG_FILES libinfinity/server/Makefile" ;; "libinfinity/client/Makefile") CONFIG_FILES="$CONFIG_FILES libinfinity/client/Makefile" ;; "libinftext/Makefile") CONFIG_FILES="$CONFIG_FILES libinftext/Makefile" ;; "libinfgtk/Makefile") CONFIG_FILES="$CONFIG_FILES libinfgtk/Makefile" ;; "libinftextgtk/Makefile") CONFIG_FILES="$CONFIG_FILES libinftextgtk/Makefile" ;; "infinoted/Makefile") CONFIG_FILES="$CONFIG_FILES infinoted/Makefile" ;; "infinoted/note-plugins/Makefile") CONFIG_FILES="$CONFIG_FILES infinoted/note-plugins/Makefile" ;; "infinoted/note-plugins/text/Makefile") CONFIG_FILES="$CONFIG_FILES infinoted/note-plugins/text/Makefile" ;; "pixmaps/Makefile") CONFIG_FILES="$CONFIG_FILES pixmaps/Makefile" ;; "pixmaps/16x16/Makefile") CONFIG_FILES="$CONFIG_FILES pixmaps/16x16/Makefile" ;; "pixmaps/22x22/Makefile") CONFIG_FILES="$CONFIG_FILES pixmaps/22x22/Makefile" ;; "pixmaps/scalable/Makefile") CONFIG_FILES="$CONFIG_FILES pixmaps/scalable/Makefile" ;; "test/Makefile") CONFIG_FILES="$CONFIG_FILES test/Makefile" ;; "test/util/Makefile") CONFIG_FILES="$CONFIG_FILES test/util/Makefile" ;; "test/session/Makefile") CONFIG_FILES="$CONFIG_FILES test/session/Makefile" ;; "test/cleanup/Makefile") CONFIG_FILES="$CONFIG_FILES test/cleanup/Makefile" ;; "docs/Makefile") CONFIG_FILES="$CONFIG_FILES docs/Makefile" ;; "docs/reference/Makefile") CONFIG_FILES="$CONFIG_FILES docs/reference/Makefile" ;; "docs/reference/version.xml.in") CONFIG_FILES="$CONFIG_FILES docs/reference/version.xml.in" ;; "docs/reference/api_version.xml.in") CONFIG_FILES="$CONFIG_FILES docs/reference/api_version.xml.in" ;; "docs/reference/libinfinity/Makefile") CONFIG_FILES="$CONFIG_FILES docs/reference/libinfinity/Makefile" ;; "docs/reference/libinftext/Makefile") CONFIG_FILES="$CONFIG_FILES docs/reference/libinftext/Makefile" ;; "docs/reference/libinfgtk/Makefile") CONFIG_FILES="$CONFIG_FILES docs/reference/libinfgtk/Makefile" ;; "docs/reference/libinftextgtk/Makefile") CONFIG_FILES="$CONFIG_FILES docs/reference/libinftextgtk/Makefile" ;; "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;; "libinfinity-0.5.pc") CONFIG_FILES="$CONFIG_FILES libinfinity-0.5.pc:libinfinity.pc.in" ;; "libinftext-0.5.pc") CONFIG_FILES="$CONFIG_FILES libinftext-0.5.pc:libinftext.pc.in" ;; "libinfgtk-0.5.pc") CONFIG_FILES="$CONFIG_FILES libinfgtk-0.5.pc:libinfgtk.pc.in" ;; "libinftextgtk-0.5.pc") CONFIG_FILES="$CONFIG_FILES libinftextgtk-0.5.pc:libinftextgtk.pc.in" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; "libtool":C) # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # The names of the tagged configurations supported by this script. available_tags="" # ### BEGIN LIBTOOL CONFIG # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # An object symbol dumper. OBJDUMP=$lt_OBJDUMP # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # DLL creation program. DLLTOOL=$lt_DLLTOOL # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and in which our libraries should be installed. lt_sysroot=$lt_sysroot # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain="$ac_aux_dir/ltmain.sh" # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) if test x"$xsi_shell" = xyes; then sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ func_dirname ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ } # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_basename ()$/,/^} # func_basename /c\ func_basename ()\ {\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ func_dirname_and_basename ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ func_stripname ()\ {\ \ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ \ # positional parameters, so assign one to ordinary parameter first.\ \ func_stripname_result=${3}\ \ func_stripname_result=${func_stripname_result#"${1}"}\ \ func_stripname_result=${func_stripname_result%"${2}"}\ } # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ func_split_long_opt ()\ {\ \ func_split_long_opt_name=${1%%=*}\ \ func_split_long_opt_arg=${1#*=}\ } # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ func_split_short_opt ()\ {\ \ func_split_short_opt_arg=${1#??}\ \ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ } # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ func_lo2o ()\ {\ \ case ${1} in\ \ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ \ *) func_lo2o_result=${1} ;;\ \ esac\ } # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_xform ()$/,/^} # func_xform /c\ func_xform ()\ {\ func_xform_result=${1%.*}.lo\ } # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_arith ()$/,/^} # func_arith /c\ func_arith ()\ {\ func_arith_result=$(( $* ))\ } # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_len ()$/,/^} # func_len /c\ func_len ()\ {\ func_len_result=${#1}\ } # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$lt_shell_append" = xyes; then sed -e '/^func_append ()$/,/^} # func_append /c\ func_append ()\ {\ eval "${1}+=\\${2}"\ } # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ func_append_quoted ()\ {\ \ func_quote_for_eval "${2}"\ \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ } # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 $as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} fi mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ;; "default-1":C) case "$CONFIG_FILES" in *po/Makefile.in*) sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile esac ;; 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 echo " Build optional packages: libinfgtk: $with_infgtk libinftextgtk: $with_inftextgtk infinoted: $with_infinoted Enable support for: avahi: $use_avahi libdaemon: $use_libdaemon pam: $use_pam " # vim:set et: libinfinity-0.5.5/po/0000755000175000017500000000000012264766271011475 500000000000000libinfinity-0.5.5/po/libinfinity-0.5.pot0000644000175000017500000011724212264766271014770 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" "product=glib&keywords=I18N+L10N&component=general\n" "POT-Creation-Date: 2014-01-13 14:40+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" #: ../infinoted/infinoted-autosave.c:154 #, c-format msgid "" "Failed to auto-save session \"%s\": %s\n" "\n" "Will retry in %u seconds." msgstr "" #: ../infinoted/infinoted-dh-params.c:75 msgid "Generating 2048 bit Diffie-Hellman parameters..." msgstr "" #: ../infinoted/infinoted-directory-sync.c:167 #, c-format msgid "" "Failed to create directory for path \"%s\": %s\n" "\n" msgstr "" #: ../infinoted/infinoted-directory-sync.c:186 #, c-format msgid "" "Failed to write session for path \"%s\": %s\n" "\n" "Will retry in %u seconds." msgstr "" #: ../infinoted/infinoted-directory-sync.c:245 #, c-format msgid "Node \"%s\" contains invalid characters" msgstr "" #: ../infinoted/infinoted-directory-sync.c:354 #: ../infinoted/infinoted-directory-sync.c:420 #, c-format msgid "Failed to synchronize session \"%s\" to disk: %s" msgstr "" #. Translators: fork as in "fork into the background" #: ../infinoted/infinoted-main.c:74 msgid "Failed to fork" msgstr "" #: ../infinoted/infinoted-main.c:90 msgid "Failed to wait for daemonized child's return value" msgstr "" #: ../infinoted/infinoted-main.c:99 ../infinoted/infinoted-main.c:117 msgid "Failed to create PID file" msgstr "" #: ../infinoted/infinoted-note-plugin.c:137 #, c-format msgid "" "Failed to load plugin \"%s\": Note type \"%s\" is already handled by another " "plugin" msgstr "" #: ../infinoted/infinoted-note-plugin.c:148 #, c-format msgid "Failed to load plugin \"%s\": Storage type \"%s\" does not match" msgstr "" #: ../infinoted/infinoted-note-plugin.c:157 #, c-format msgid "Loaded plugin \"%s\" (%s)" msgstr "" #: ../infinoted/infinoted-note-plugin.c:177 #, c-format msgid "Path \"%s\" does not contain any note plugins" msgstr "" #: ../infinoted/infinoted-options.c:93 #, c-format msgid "" "\"%s\" is not a valid security policy. Allowed values are \"no-tls\", " "\"allow-tls\" or \"require-tls\"" msgstr "" #: ../infinoted/infinoted-options.c:123 msgid "Interval must not be negative" msgstr "" #: ../infinoted/infinoted-options.c:144 #, c-format msgid "\"%d\" is not a valid port number. Port numbers range from 1 to 65535" msgstr "" #: ../infinoted/infinoted-options.c:474 msgid "Cannot use both server password and system authentication." msgstr "" #: ../infinoted/infinoted-options.c:488 msgid "Need a pam service to authenticate users." msgstr "" #: ../infinoted/infinoted-options.c:503 msgid "Requiring password through unencrypted connection." msgstr "" #: ../infinoted/infinoted-options.c:513 msgid "" "Creating a new private key also requires creating a new certificate signed " "with it." msgstr "" #: ../infinoted/infinoted-options.c:527 msgid "" "No private key file given. If you don't have a suitable key file, either " "create one using the --create-key command line argument, or disable TLS by " "setting the security policy to \"no-tls\"." msgstr "" #: ../infinoted/infinoted-options.c:542 msgid "" "No certificate file given. If you don't have a suitable certificate file, " "either create one using the --create-certificate command line agument, or " "disable TLS via by setting the security policy to \"no-tls\"." msgstr "" #: ../infinoted/infinoted-options.c:557 msgid "" "A synchronization directory is given, but synchronization interval is not " "set. Please either set a nonzero synchronization interval or unset the " "synchronization directory using the --sync-directory and sync-interval " "command line or config file options." msgstr "" #: ../infinoted/infinoted-options.c:572 msgid "" "A synchronization interval is given, but the synchronization directory is " "not set. Please either set a valid synchronization directory, or set the " "synchronization interval to zero using --sync-directory and sync-interval " "command line or config file options." msgstr "" #: ../infinoted/infinoted-options.c:612 msgid "The server's private key" msgstr "" #: ../infinoted/infinoted-options.c:612 msgid "KEY-FILE" msgstr "" #: ../infinoted/infinoted-options.c:615 msgid "The server's certificate" msgstr "" #: ../infinoted/infinoted-options.c:615 msgid "CERTIFICATE-FILE" msgstr "" #: ../infinoted/infinoted-options.c:618 msgid "The certificates chain down to the root certificate" msgstr "" #: ../infinoted/infinoted-options.c:621 msgid "Creates a new random private key" msgstr "" #: ../infinoted/infinoted-options.c:624 msgid "Creates a new self-signed certificate using the given key" msgstr "" #: ../infinoted/infinoted-options.c:627 msgid "The port number to listen on" msgstr "" #: ../infinoted/infinoted-options.c:627 msgid "PORT" msgstr "" #: ../infinoted/infinoted-options.c:630 msgid "How to decide whether to use TLS" msgstr "" #: ../infinoted/infinoted-options.c:633 msgid "The directory to store documents into" msgstr "" #: ../infinoted/infinoted-options.c:633 ../infinoted/infinoted-options.c:658 msgid "DIRECTORY" msgstr "" #: ../infinoted/infinoted-options.c:636 msgid "" "Interval within which to save documents, in seconds, or 0 to disable autosave" msgstr "" #: ../infinoted/infinoted-options.c:637 ../infinoted/infinoted-options.c:664 msgid "INTERVAL" msgstr "" #: ../infinoted/infinoted-options.c:640 msgid "Require given password on connections" msgstr "" #: ../infinoted/infinoted-options.c:640 msgid "PASSWORD" msgstr "" #: ../infinoted/infinoted-options.c:644 msgid "Authenticate clients against given pam service on connection" msgstr "" #: ../infinoted/infinoted-options.c:645 msgid "SERVICE" msgstr "" #: ../infinoted/infinoted-options.c:648 msgid "User allowed to connect after pam authentication" msgstr "" #: ../infinoted/infinoted-options.c:649 msgid "USER" msgstr "" #: ../infinoted/infinoted-options.c:652 msgid "Group allowed to connect after pam authentication" msgstr "" #: ../infinoted/infinoted-options.c:653 msgid "GROUP" msgstr "" #: ../infinoted/infinoted-options.c:657 msgid "" "A directory into which to periodically store a copy of the document tree" msgstr "" #: ../infinoted/infinoted-options.c:661 msgid "" "Interval within which to store documents to the specified sync-directory, in " "seconds, or 0 to disable directory synchronization" msgstr "" #: ../infinoted/infinoted-options.c:668 msgid "Daemonize the server" msgstr "" #: ../infinoted/infinoted-options.c:671 msgid "Kill a running daemon" msgstr "" #: ../infinoted/infinoted-options.c:675 msgid "Display version information and exit" msgstr "" #: ../infinoted/infinoted-options.c:730 msgid "infinote dedicated server" msgstr "" #: ../infinoted/infinoted-options.c:760 msgid "Could not kill daemon" msgstr "" #: ../infinoted/infinoted-record.c:45 #, c-format msgid "Error while writing record for session \"%s\" into \"%s\": %s" msgstr "" #: ../infinoted/infinoted-record.c:86 #, c-format msgid "" "Could not create record file for session \"%s\": Could not generate unused " "record file in directory \"%s\"" msgstr "" #: ../infinoted/infinoted-record.c:98 #, c-format msgid "Could not create record file directory \"%s\": %s" msgstr "" #: ../infinoted/infinoted-run.c:348 #, c-format msgid "Failed to generate Diffie-Hellman parameters: %s" msgstr "" #: ../infinoted/infinoted-run.c:363 #, c-format msgid "IPv6 Server running on port %u" msgstr "" #: ../infinoted/infinoted-run.c:381 #, c-format msgid "IPv4 Server running on port %u" msgstr "" #: ../infinoted/infinoted-run.c:398 #, c-format msgid "Failed to start server: %s" msgstr "" #: ../infinoted/infinoted-signal.c:55 msgid "" "Error on signal handler connection; signal handlers have been removed from " "now on" msgstr "" #: ../infinoted/infinoted-signal.c:71 #, c-format msgid "Config reload failed: %s" msgstr "" #: ../infinoted/infinoted-signal.c:77 msgid "Config reloaded" msgstr "" #. We don't reload the config file here since the signal handler could be #. * called from anywhere in the code. #: ../infinoted/infinoted-signal.c:130 msgid "" "For config reloading to work libinfinity needs to be compiled with libdaemon " "support" msgstr "" #. TODO: Open the key file beforehand #: ../infinoted/infinoted-startup.c:61 msgid "Generating 2048 bit RSA private key..." msgstr "" #: ../infinoted/infinoted-startup.c:99 msgid "Generating self-signed certificate..." msgstr "" #: ../infinoted/infinoted-util.c:127 #, c-format msgid "Could not create directory \"%s\": %s" msgstr "" #: ../libinfgtk/inf-gtk-browser-store.c:632 msgid "Disconnected" msgstr "" #: ../libinfgtk/inf-gtk-browser-view.c:2076 msgid "Exploring..." msgstr "" #: ../libinfgtk/inf-gtk-browser-view.c:2110 msgid "Synchronizing..." msgstr "" #: ../libinfgtk/inf-gtk-browser-view.c:2184 msgid "Not connected" msgstr "" #: ../libinfgtk/inf-gtk-browser-view.c:2195 msgid "Connecting..." msgstr "" #: ../libinfgtk/inf-gtk-browser-view.c:2205 msgid "Connected" msgstr "" #: ../libinfgtk/inf-gtk-certificate-dialog.c:87 #, c-format msgid "The connection to host \"%s\" is not considered secure" msgstr "" #: ../libinfgtk/inf-gtk-certificate-dialog.c:117 msgid "The certificate of the host has changed!" msgstr "" #: ../libinfgtk/inf-gtk-certificate-dialog.c:129 msgid "The previous certificate of the server has expired." msgstr "" #: ../libinfgtk/inf-gtk-certificate-dialog.c:139 msgid "" "It is possible that the connection to the server is being hijacked. It is " "also possible that the host just has got a new certificate. However, please " "only continue the connection if you expected this warning." msgstr "" #: ../libinfgtk/inf-gtk-certificate-dialog.c:155 msgid "The certificate issuer is not trusted." msgstr "" #: ../libinfgtk/inf-gtk-certificate-dialog.c:161 msgid "The certificate is self-signed." msgstr "" #: ../libinfgtk/inf-gtk-certificate-dialog.c:171 msgid "The certificate is invalid!" msgstr "" #: ../libinfgtk/inf-gtk-certificate-dialog.c:187 #, c-format msgid "" "The hostname of the server, \"%s\", does not match the hostname the " "certificate is issued to, \"%s\"." msgstr "" #: ../libinfgtk/inf-gtk-certificate-dialog.c:206 #, c-format msgid "The certificate has expired. The expiration date was %s" msgstr "" #: ../libinfgtk/inf-gtk-certificate-dialog.c:223 #, c-format msgid "The certificate has not yet been activated. Activation date is %s" msgstr "" #: ../libinfgtk/inf-gtk-certificate-dialog.c:389 msgid "" msgstr "" #: ../libinfgtk/inf-gtk-certificate-dialog.c:445 msgid "Certificate Chain" msgstr "" #: ../libinfgtk/inf-gtk-certificate-dialog.c:555 msgid "_View Certificate" msgstr "" #: ../libinfgtk/inf-gtk-certificate-dialog.c:592 msgid "Connection not secure" msgstr "" #: ../libinfgtk/inf-gtk-certificate-manager.c:284 #: ../libinfgtk/inf-gtk-certificate-manager.c:301 #, c-format msgid "Failed to save known hosts file: %s\n" msgstr "" #: ../libinfgtk/inf-gtk-certificate-manager.c:362 #, c-format msgid "Could not load trust file: %s" msgstr "" #: ../libinfgtk/inf-gtk-certificate-manager.c:392 #, c-format msgid "Could not load known hosts file: %s" msgstr "" #: ../libinfgtk/inf-gtk-certificate-manager.c:435 #, c-format msgid "Could not verify certificate: %s" msgstr "" #: ../libinfgtk/inf-gtk-certificate-manager.c:557 msgid "_Cancel connection" msgstr "" #: ../libinfgtk/inf-gtk-certificate-manager.c:568 msgid "C_ontinue connection" msgstr "" #: ../libinfgtk/inf-gtk-certificate-manager.c:577 #, c-format msgid "Do you want to continue the connection to host %s?" msgstr "" #: ../libinfgtk/inf-gtk-certificate-manager.c:596 #, c-format msgid "Trust the certificate of host %s in the future" msgstr "" #: ../libinfgtk/inf-gtk-certificate-view.c:73 msgid "" msgstr "" #: ../libinfgtk/inf-gtk-certificate-view.c:221 msgid "Issued To" msgstr "" #: ../libinfgtk/inf-gtk-certificate-view.c:222 #: ../libinfgtk/inf-gtk-certificate-view.c:233 msgid "Common Name:" msgstr "" #: ../libinfgtk/inf-gtk-certificate-view.c:223 #: ../libinfgtk/inf-gtk-certificate-view.c:234 msgid "Organization:" msgstr "" #: ../libinfgtk/inf-gtk-certificate-view.c:224 #: ../libinfgtk/inf-gtk-certificate-view.c:235 msgid "Organizational Unit:" msgstr "" #: ../libinfgtk/inf-gtk-certificate-view.c:225 msgid "Serial Number:" msgstr "" #: ../libinfgtk/inf-gtk-certificate-view.c:232 msgid "Issued By" msgstr "" #: ../libinfgtk/inf-gtk-certificate-view.c:242 msgid "Validity" msgstr "" #: ../libinfgtk/inf-gtk-certificate-view.c:243 msgid "Issued On:" msgstr "" #: ../libinfgtk/inf-gtk-certificate-view.c:244 msgid "Expires On:" msgstr "" #: ../libinfgtk/inf-gtk-certificate-view.c:251 msgid "Fingerprints" msgstr "" #: ../libinfgtk/inf-gtk-certificate-view.c:252 msgid "SHA1 Fingerprint:" msgstr "" #: ../libinfgtk/inf-gtk-certificate-view.c:253 msgid "MD5 Fingerprint:" msgstr "" #: ../libinfgtk/inf-gtk-certificate-view.c:272 msgid "General" msgstr "" #: ../libinfgtk/inf-gtk-chat.c:199 #, c-format msgid "%s has joined" msgstr "" #: ../libinfgtk/inf-gtk-chat.c:206 #, c-format msgid "%s has left" msgstr "" #: ../libinfgtk/inf-gtk-chat.c:765 msgid "Send" msgstr "" #: ../libinfinity/adopted/inf-adopted-concurrency-warning.c:29 #, c-format msgid "" "%s was called for %s. This means that you hit an unforseen situation in " "libinfinity. The session could become inconsistent because of this. If you " "were using Gobby, please notify me (Armin Burgmeier, armin@arbur.net) about " "this, and attach the contents of the ~/.infinote-records folder, or just the " "record of the session that triggered this error if you know which one. I " "hope I can fix this problem with that information in future versions." msgstr "" #: ../libinfinity/adopted/inf-adopted-session.c:148 #, c-format msgid "Request has index '%u', but index '%u' was expected" msgstr "" #: ../libinfinity/adopted/inf-adopted-session.c:170 msgid "Undo received, but no previous request found" msgstr "" #: ../libinfinity/adopted/inf-adopted-session.c:187 msgid "Redo received, but no previous request found" msgstr "" #: ../libinfinity/adopted/inf-adopted-session.c:228 #, c-format msgid "No such user with user ID '%u'" msgstr "" #: ../libinfinity/adopted/inf-adopted-session.c:975 #: ../libinfinity/common/inf-chat-session.c:468 #: ../libinfinity/common/inf-session.c:786 #: ../libinftext/inf-text-session.c:993 msgid "User did not join from this connection" msgstr "" #: ../libinfinity/adopted/inf-adopted-session.c:1164 msgid "'time' attribute in user message is missing" msgstr "" #: ../libinfinity/adopted/inf-adopted-session.c:1556 msgid "Operation for request missing" msgstr "" #. Error writing record `': #: ../libinfinity/adopted/inf-adopted-session-record.c:92 #, c-format msgid "Error writing record \"%s\": %s" msgstr "" #: ../libinfinity/adopted/inf-adopted-state-vector.c:746 msgid "Expected ':' after ID" msgstr "" #: ../libinfinity/adopted/inf-adopted-state-vector.c:760 #, c-format msgid "ID '%u' already occured before" msgstr "" #: ../libinfinity/adopted/inf-adopted-state-vector.c:777 #, c-format msgid "Expected ';' or end of string after component of ID '%u'" msgstr "" #: ../libinfinity/client/infc-browser.c:665 msgid "The node to subscribe to has been removed" msgstr "" #: ../libinfinity/client/infc-browser.c:691 #: ../libinfinity/client/infc-browser.c:718 msgid "" "The subdirectory into which the new node should have been created has been " "removed" msgstr "" #: ../libinfinity/client/infc-browser.c:835 msgid "" "The server did not send an initial welcome message. This means that the " "server is running a lower version of the software which is incompatible to " "the client. Consider downgrading the client, or ask the server maintainers " "to upgrade their software." msgstr "" #: ../libinfinity/client/infc-browser.c:1082 #, c-format msgid "" "This session requires communication method `%s' which is not installed for " "network `%s'" msgstr "" #: ../libinfinity/client/infc-browser.c:1946 #, c-format msgid "" "The request contains a sequence number refering to a request of type '%s', " "but a request of either 'explore' or 'add-node' was expected." msgstr "" #: ../libinfinity/client/infc-browser.c:2160 msgid "" "The server uses an older version of the protocol which is no longer " "supported by this client. Consider using an earlier version of it, or ask " "the server maintainers to upgrade their software." msgstr "" #: ../libinfinity/client/infc-browser.c:2174 msgid "The server uses a newer version. Consider upgrading your client." msgstr "" #: ../libinfinity/client/infc-browser.c:2244 msgid "Node to explore does no longer exist" msgstr "" #: ../libinfinity/client/infc-browser.c:2256 msgid "Node to explore is not a subdirectory" msgstr "" #: ../libinfinity/client/infc-browser.c:2268 msgid "Node to explore is already explored" msgstr "" #: ../libinfinity/client/infc-browser.c:2346 #: ../libinfinity/client/infc-browser.c:2545 #, c-format msgid "Node with ID \"%u\" exists already" msgstr "" #: ../libinfinity/client/infc-browser.c:2424 msgid "Explored nodes cannot be initially be subscribed to" msgstr "" #: ../libinfinity/client/infc-browser.c:2439 #, c-format msgid "Note type \"%s\" not known" msgstr "" #: ../libinfinity/client/infc-browser.c:2590 msgid "Received sync-in without having requested one" msgstr "" #: ../libinfinity/client/infc-browser.c:2612 #, c-format msgid "Expected note type \"%s\" for sync-in, but received \"%s\"" msgstr "" #: ../libinfinity/client/infc-browser.c:2747 #, c-format msgid "Note type '%s' is not supported" msgstr "" #: ../libinfinity/client/infc-browser.c:2762 msgid "Already subscribed to this session" msgstr "" #: ../libinfinity/client/infc-browser.c:2827 msgid "Already subscribed to the chat session" msgstr "" #: ../libinfinity/client/infc-browser.c:3013 #: ../libinfinity/client/infc-session-proxy.c:483 #, c-format msgid "Error comes from unknown error domain '%s' (code %u)" msgstr "" #: ../libinfinity/client/infc-browser.c:3189 #: ../libinfinity/client/infc-session-proxy.c:935 #, c-format msgid "Server reply could not be processed: %s" msgstr "" #: ../libinfinity/client/infc-request-manager.c:102 msgid "Sequence identifier causes overflow" msgstr "" #: ../libinfinity/client/infc-request-manager.c:115 msgid "Sequence components are not separated by '/'" msgstr "" #: ../libinfinity/client/infc-request-manager.c:130 msgid "Sequence number causes overflow" msgstr "" #: ../libinfinity/client/infc-request-manager.c:143 msgid "Trailing characters after sequence number" msgstr "" #: ../libinfinity/client/infc-request-manager.c:679 msgid "The request contains an unknown sequence number" msgstr "" #: ../libinfinity/client/infc-request-manager.c:691 #, c-format msgid "" "The request contains a sequence number refering to a request of type '%s', " "but a request of type '%s' was expected" msgstr "" #: ../libinfinity/client/infc-request-manager.c:744 msgid "The request does not contain a sequence number, but one is required" msgstr "" #: ../libinfinity/client/infc-session-proxy.c:612 msgid "Request does not contain required attribute 'id'" msgstr "" #: ../libinfinity/client/infc-session-proxy.c:630 #: ../libinfinity/common/inf-session.c:771 #, c-format msgid "No such user with ID %u" msgstr "" #: ../libinfinity/common/inf-chat-session.c:89 msgid "An invalid message type was sent" msgstr "" #: ../libinfinity/common/inf-chat-session.c:91 msgid "A user with the requested ID does not exist" msgstr "" #: ../libinfinity/common/inf-chat-session.c:93 msgid "An unknown chat session error has occured" msgstr "" #: ../libinfinity/common/inf-chat-session.c:95 #: ../libinfinity/common/inf-error.c:80 ../libinfinity/common/inf-error.c:127 #: ../libinfinity/common/inf-session.c:202 msgid "An error with unknown error code occured" msgstr "" #: ../libinfinity/common/inf-chat-session.c:268 #, c-format msgid "No such user with ID \"%u\"" msgstr "" #: ../libinfinity/common/inf-chat-session.c:359 #, c-format msgid "%s --- %s has joined\n" msgstr "" #: ../libinfinity/common/inf-chat-session.c:362 #, c-format msgid "%s --- %s has left\n" msgstr "" #: ../libinfinity/common/inf-chat-session.c:420 #, c-format msgid "%s --- %u users total\n" msgstr "" #: ../libinfinity/common/inf-chat-session.c:1293 #, c-format msgid "%s --- Log closed\n" msgstr "" #: ../libinfinity/common/inf-chat-session.c:1307 #, c-format msgid "%s --- Log opened\n" msgstr "" #: ../libinfinity/common/inf-discovery-avahi.c:527 #, c-format msgid "" "Avahi service browser is in failure state. Services of type '%s' are no " "longer discovered.\n" "\n" "The failure was: %s\n" msgstr "" #: ../libinfinity/common/inf-discovery-avahi.c:595 #, c-format msgid "" "Avahi entry group is in failure state. The service '%s' of type '%s' is no " "longer published.\n" "\n" "The failure was: %s\n" msgstr "" #: ../libinfinity/common/inf-discovery-avahi.c:805 #, c-format msgid "" "Failed to start Avahi client. Service discovery or publishing will not be " "possible.\n" "\n" "The occurred failure was: %s" msgstr "" #: ../libinfinity/common/inf-discovery-avahi.c:848 #, c-format msgid "" "Avahi client is in failure state. Service discovery or publishing is no " "longer possible.\n" "\n" "The occured failure was: %s\n" msgstr "" #. Translators: This is " (via on #. *
)", for example "ck (via eth0 on IPv4)". #: ../libinfinity/common/inf-discovery-avahi.c:1427 #, c-format msgid "%s (via %s on IPv4)" msgstr "" #: ../libinfinity/common/inf-discovery-avahi.c:1428 #, c-format msgid "%s (via %s on IPv6)" msgstr "" #: ../libinfinity/common/inf-error.c:68 msgid "Received error from an unknown domain" msgstr "" #: ../libinfinity/common/inf-error.c:70 msgid "Failed to process server reply" msgstr "" #: ../libinfinity/common/inf-error.c:72 msgid "Server reply contains invalid sequence number" msgstr "" #: ../libinfinity/common/inf-error.c:74 msgid "A required attribute was not set in request" msgstr "" #: ../libinfinity/common/inf-error.c:76 msgid "An attribute contained an invalid number" msgstr "" #: ../libinfinity/common/inf-error.c:78 msgid "An unknown request error occured" msgstr "" #: ../libinfinity/common/inf-error.c:113 msgid "Name is already in use" msgstr "" #: ../libinfinity/common/inf-error.c:115 msgid "'id' attribute provided in request" msgstr "" #: ../libinfinity/common/inf-error.c:117 msgid "There is no user with the given ID" msgstr "" #: ../libinfinity/common/inf-error.c:119 msgid "'status' attribute is 'unavailable' in join or rejoin request" msgstr "" #: ../libinfinity/common/inf-error.c:121 msgid "User did not join via this connection" msgstr "" #: ../libinfinity/common/inf-error.c:123 msgid "'status' attribute has invalid value" msgstr "" #: ../libinfinity/common/inf-error.c:125 msgid "An unknown user error occured" msgstr "" #: ../libinfinity/common/inf-error.c:160 msgid "Server did not send an initial welcome message" msgstr "" #: ../libinfinity/common/inf-error.c:162 msgid "The server and client use different protocol versions" msgstr "" #: ../libinfinity/common/inf-error.c:164 msgid "A node with this name exists already" msgstr "" #: ../libinfinity/common/inf-error.c:166 msgid "Invalid node name" msgstr "" #: ../libinfinity/common/inf-error.c:168 msgid "Node does not exist" msgstr "" #: ../libinfinity/common/inf-error.c:170 msgid "No previous subscription request present" msgstr "" #: ../libinfinity/common/inf-error.c:172 msgid "The chat is disabled on the server side" msgstr "" #: ../libinfinity/common/inf-error.c:174 msgid "Node is not a subdirectory" msgstr "" #: ../libinfinity/common/inf-error.c:176 msgid "Node is not a note" msgstr "" #: ../libinfinity/common/inf-error.c:178 #: ../libinfinity/server/infd-directory.c:2813 msgid "The root node cannot be removed" msgstr "" #: ../libinfinity/common/inf-error.c:180 msgid "Subdirectory has already been explored" msgstr "" #: ../libinfinity/common/inf-error.c:182 msgid "Note type is not supported" msgstr "" #: ../libinfinity/common/inf-error.c:184 msgid "Connection is already subscribed to this session" msgstr "" #: ../libinfinity/common/inf-error.c:186 #: ../libinfinity/server/infd-directory.c:2955 msgid "The requesting connection is not subscribed to the session" msgstr "" #: ../libinfinity/common/inf-error.c:188 msgid "Server sent more explored nodes then announced" msgstr "" #: ../libinfinity/common/inf-error.c:190 msgid "Server sent not as much explored nodes as announced" msgstr "" #: ../libinfinity/common/inf-error.c:192 msgid "" "The session does not support the network through which the connection " "attempt is being made." msgstr "" #: ../libinfinity/common/inf-error.c:195 msgid "The session uses an unsupported communication method" msgstr "" #: ../libinfinity/common/inf-error.c:197 msgid "Received sync-in message without having requested a sync-in" msgstr "" #: ../libinfinity/common/inf-error.c:199 msgid "Unexpected XML message" msgstr "" #: ../libinfinity/common/inf-error.c:201 msgid "Server does not have a background storage" msgstr "" #: ../libinfinity/common/inf-error.c:203 msgid "An unknown directory error has occured" msgstr "" #: ../libinfinity/common/inf-error.c:205 ../libinfinity/common/inf-error.c:248 msgid "An error with unknown code has occured" msgstr "" #: ../libinfinity/common/inf-error.c:239 msgid "User did not provide valid credentials." msgstr "" #: ../libinfinity/common/inf-error.c:241 msgid "User is not permitted to connect to this server." msgstr "" #: ../libinfinity/common/inf-error.c:243 msgid "Authentication was temporarily interrupted on the server side." msgstr "" #: ../libinfinity/common/inf-error.c:246 msgid "An error cocured while checking user permissions." msgstr "" #: ../libinfinity/common/inf-protocol.c:86 msgid "Major part of version number causes overflow" msgstr "" #: ../libinfinity/common/inf-protocol.c:99 msgid "Version number parts are not separated by '.'" msgstr "" #: ../libinfinity/common/inf-protocol.c:114 msgid "Minor part of version number causes overflow" msgstr "" #: ../libinfinity/common/inf-protocol.c:127 msgid "Trailing characters after version number" msgstr "" #: ../libinfinity/common/inf-session.c:167 msgid "Unexpectedly got an XML message in presync" msgstr "" #: ../libinfinity/common/inf-session.c:169 msgid "Got unexpected XML node during synchronization" msgstr "" #: ../libinfinity/common/inf-session.c:171 msgid "'id' attribute in user message is missing" msgstr "" #: ../libinfinity/common/inf-session.c:173 msgid "User ID is already in use" msgstr "" #: ../libinfinity/common/inf-session.c:175 msgid "'name' attribute in user message is missing" msgstr "" #: ../libinfinity/common/inf-session.c:177 msgid "User Name is already in use" msgstr "" #: ../libinfinity/common/inf-session.c:179 msgid "The connection was closed unexpectedly" msgstr "" #: ../libinfinity/common/inf-session.c:181 msgid "The sender cancelled the synchronization" msgstr "" #: ../libinfinity/common/inf-session.c:183 msgid "The receiver cancelled the synchronization" msgstr "" #: ../libinfinity/common/inf-session.c:185 msgid "Got begin-of-sync message, but synchronization is already in progress" msgstr "" #: ../libinfinity/common/inf-session.c:188 msgid "begin-of-sync message does not contain the number of messages to expect" msgstr "" #: ../libinfinity/common/inf-session.c:191 msgid "Got end-of-sync message, but synchronization is still in progress" msgstr "" #: ../libinfinity/common/inf-session.c:194 msgid "Expected begin-of-sync message as first message during synchronization" msgstr "" #: ../libinfinity/common/inf-session.c:197 msgid "Expected end-of-sync message as last message during synchronization" msgstr "" #: ../libinfinity/common/inf-session.c:200 msgid "An unknown synchronization error has occured" msgstr "" #. TODO: Add a possibilty for sub classes to register their error domains #. * that can occur in process_xml_sync. Maybe via a translate_error_sync #. * vfunc. #: ../libinfinity/common/inf-session.c:216 msgid "An error with unknown error domain occured" msgstr "" #: ../libinfinity/common/inf-session.c:942 #, c-format msgid "Received unhandled XML message '%s'" msgstr "" #: ../libinfinity/common/inf-session.c:1480 #, c-format msgid "Unexpectedly received XML message \"%s\" in presync" msgstr "" #: ../libinfinity/common/inf-session.c:1579 #, c-format msgid "Received unexpected XML message \"%s\" while synchronizing" msgstr "" #: ../libinfinity/common/inf-tcp-connection.c:601 #, c-format msgid "Interface `%s' does not exist" msgstr "" #: ../libinfinity/common/inf-tcp-connection.c:656 #, c-format msgid "Failed to retrieve local address: %s" msgstr "" #: ../libinfinity/common/inf-tcp-connection.c:674 #, c-format msgid "Failed to retrieve local port: %s" msgstr "" #. TODO: We can probably implement this using GetInterfaceInfo() #: ../libinfinity/common/inf-tcp-connection.c:690 msgid "The device-name property is not implemented on Win32" msgstr "" #. Failed to get name for device : #: ../libinfinity/common/inf-tcp-connection.c:703 #, c-format msgid "Failed to get name for device %u: %s" msgstr "" #: ../libinfinity/common/inf-user.c:544 #, c-format msgid "Invalid user status: '%s'" msgstr "" #: ../libinfinity/common/inf-xml-util.c:60 #: ../libinfinity/common/inf-xml-util.c:117 #: ../libinfinity/common/inf-xml-util.c:236 #, c-format msgid "Attribute '%s' does not contain a valid number" msgstr "" #: ../libinfinity/common/inf-xml-util.c:72 #: ../libinfinity/common/inf-xml-util.c:129 #: ../libinfinity/common/inf-xml-util.c:160 #: ../libinfinity/common/inf-xml-util.c:204 #: ../libinfinity/common/inf-xml-util.c:249 #, c-format msgid "Attribute '%s' causes overflow (%s)" msgstr "" #: ../libinfinity/common/inf-xml-util.c:85 #: ../libinfinity/common/inf-xml-util.c:173 #: ../libinfinity/common/inf-xml-util.c:262 #, c-format msgid "Attribute '%s' causes underflow (%s)" msgstr "" #: ../libinfinity/common/inf-xml-util.c:452 #, c-format msgid "Request '%s' does not contain required attribute '%s'" msgstr "" #: ../libinfinity/common/inf-xmpp-connection.c:333 msgid "The entity has sent XML that cannot be processed" msgstr "" #: ../libinfinity/common/inf-xmpp-connection.c:335 msgid "" "The entity has sent a namespace prefix that is unsupported, or has sent no " "namespace prefix on an element that requires such a prefix" msgstr "" #: ../libinfinity/common/inf-xmpp-connection.c:339 msgid "" "The server is closing the active stream for this entity because a new stream " "has been initiated that conflicts with the existing stream" msgstr "" #: ../libinfinity/common/inf-xmpp-connection.c:343 msgid "" "The entity has not generated any traffic over the stream for some period of " "time" msgstr "" #: ../libinfinity/common/inf-xmpp-connection.c:346 msgid "" "The value of the 'to' attribute provided by the initiating entity in the " "stream header corresponds to a hostname that is no longer hosted by the " "server" msgstr "" #: ../libinfinity/common/inf-xmpp-connection.c:350 msgid "" "The value of the 'to' attribute provided by the initiating entity in the " "stream header does not correspond to a hostname that is hosted by the server" msgstr "" #: ../libinfinity/common/inf-xmpp-connection.c:354 msgid "A stanza sent between two servers lacks a 'to' or 'from'attribute" msgstr "" #: ../libinfinity/common/inf-xmpp-connection.c:357 msgid "" "The server has experienced a misconfiguration or an otherwise-undefined " "internal error that prevents it from servicing the stream" msgstr "" #: ../libinfinity/common/inf-xmpp-connection.c:361 msgid "" "The JID or hostname provided in a 'from' address does not match an " "authorized JID or validated domain negotiated between servers via SASL or " "dialback, or between a client and a server via authentication and resource " "binding" msgstr "" #: ../libinfinity/common/inf-xmpp-connection.c:366 msgid "" "The stream ID or dialback ID is invalid or does not match an ID previously " "provided" msgstr "" #: ../libinfinity/common/inf-xmpp-connection.c:369 msgid "" "The streams namespace is something other than \"http://etherx.jabber.org/" "streams\" or the dialback namespace name is something other than \"jabber:" "server:dialback\"" msgstr "" #: ../libinfinity/common/inf-xmpp-connection.c:373 msgid "" "The entity has sent invalid XML over the stream to a server that performs " "validation" msgstr "" #: ../libinfinity/common/inf-xmpp-connection.c:376 msgid "" "The entity has attempted to send data before the stream has been " "authenticated, or otherwise is not authorized to perform an action related " "to stream negotiation" msgstr "" #: ../libinfinity/common/inf-xmpp-connection.c:380 msgid "The entity has violated some local service policy" msgstr "" #: ../libinfinity/common/inf-xmpp-connection.c:382 msgid "" "The server is unable to property connect to a remote entity that is required " "for authentication or authorization" msgstr "" #: ../libinfinity/common/inf-xmpp-connection.c:385 msgid "The server lacks the system resources necessary to service the stream" msgstr "" #: ../libinfinity/common/inf-xmpp-connection.c:388 msgid "The entity has attempted to send restricted XML features" msgstr "" #: ../libinfinity/common/inf-xmpp-connection.c:390 msgid "" "The server will not provide service to the initiating entity but is " "redirecting traffic to another host" msgstr "" #: ../libinfinity/common/inf-xmpp-connection.c:393 msgid "The server is being shut down and all active streams are being closed" msgstr "" #: ../libinfinity/common/inf-xmpp-connection.c:397 msgid "The error condition is not one of those defined by the other conditions" msgstr "" #: ../libinfinity/common/inf-xmpp-connection.c:400 msgid "" "The initiating entity has encoded the stream in an encoding that is not " "supported by the server" msgstr "" #: ../libinfinity/common/inf-xmpp-connection.c:403 msgid "" "The initiating entity has sent a first-level child of the stream that is not " "supported by the server." msgstr "" #: ../libinfinity/common/inf-xmpp-connection.c:406 msgid "" "The value of the 'version' attribute provided by the initiating entity in " "the stream header specifies a version of XMPP that is not supported by the " "server" msgstr "" #: ../libinfinity/common/inf-xmpp-connection.c:410 msgid "The initiating entity has sent XML that is not well-formed" msgstr "" #: ../libinfinity/common/inf-xmpp-connection.c:455 msgid "" "The receiving entity acknowledged an element sent by the initiating " "entity" msgstr "" #: ../libinfinity/common/inf-xmpp-connection.c:458 msgid "" "The data provided by the initiating entity could not be processed because " "the Base64 encoding is incorrect" msgstr "" #: ../libinfinity/common/inf-xmpp-connection.c:461 msgid "" "The authzid provided by the initiating entity is invalid, either because it " "is incorrectly formatted or because the initiating entity does not have " "permissions to authorize that ID" msgstr "" #: ../libinfinity/common/inf-xmpp-connection.c:466 msgid "" "The initiating entity did not provide a mechanism or requested a mechanism " "that is not supported by the receiving entity" msgstr "" #: ../libinfinity/common/inf-xmpp-connection.c:469 msgid "" "The mechanism requsted by the initiating entity is weaker than server policy " "permits for that initiating entity" msgstr "" #: ../libinfinity/common/inf-xmpp-connection.c:472 msgid "" "The authentication failed because the initiating entity did not provide " "valid credentials" msgstr "" #: ../libinfinity/common/inf-xmpp-connection.c:475 msgid "" "The authentication failed because of a temporary error condition within the " "receiving entity" msgstr "" #: ../libinfinity/common/inf-xmpp-connection.c:478 msgid "An unknown authentication error has occured" msgstr "" #: ../libinfinity/common/inf-xmpp-connection.c:1092 msgid "The server did not provide a certificate" msgstr "" #: ../libinfinity/common/inf-xmpp-connection.c:1935 msgid "Stream is not yet secured with TLS" msgstr "" #: ../libinfinity/common/inf-xmpp-connection.c:2002 msgid "Stream is not yet authorized" msgstr "" #: ../libinfinity/common/inf-xmpp-connection.c:2130 msgid "The server does not offer a suitable authentication mechanism" msgstr "" #: ../libinfinity/common/inf-xmpp-connection.c:2175 msgid "The server does not support transport layer security (TLS)" msgstr "" #: ../libinfinity/common/inf-xmpp-connection.c:2198 msgid "The server requires transport layer security (TLS)" msgstr "" #: ../libinfinity/common/inf-xmpp-connection.c:2232 msgid "The server does not provide any authentication mechanism" msgstr "" #: ../libinfinity/common/inf-xmpp-connection.c:2290 msgid "The server cannot perform the TLS handshake" msgstr "" #. XML Warning from : #: ../libinfinity/common/inf-xmpp-connection.c:2769 #, c-format msgid "XML warning from %s: %s\n" msgstr "" #. The server sent something which is not XML #: ../libinfinity/common/inf-xmpp-connection.c:2813 msgid "Remote site is not an XMPP server" msgstr "" #: ../libinfinity/common/inf-xmpp-connection.c:4299 msgid "The server certificate is not trusted" msgstr "" #: ../libinfinity/server/infd-directory.c:358 #, c-format msgid "" "Failed to save note \"%s\": %s\n" "\n" "Keeping it in memory. Another save attempt will be made when the server is " "shut down." msgstr "" #: ../libinfinity/server/infd-directory.c:743 #, c-format msgid "" "Could not write session \"%s\" to storage: %s\n" "\n" "All changes since the document das been saved are lost." msgstr "" #: ../libinfinity/server/infd-directory.c:1344 #, c-format msgid "" "Session \"%s\" could not be saved: %s\n" "Another attempt will be made when the session is unused for a while or the " "server is shut down." msgstr "" #: ../libinfinity/server/infd-directory.c:1748 #, c-format msgid "Name \"%s\" is an invalid name: contains non-printable characters" msgstr "" #: ../libinfinity/server/infd-directory.c:1766 #, c-format msgid "Name \"%s\" is an invalid name: contains only space characters" msgstr "" #: ../libinfinity/server/infd-directory.c:1779 #, c-format msgid "Name \"%s\" is an invalid name: contains \"/\"" msgstr "" #: ../libinfinity/server/infd-directory.c:1794 #, c-format msgid "A node with name \"%s\" exists already" msgstr "" #: ../libinfinity/server/infd-directory.c:2456 msgid "No subscription request for the server chat" msgstr "" #: ../libinfinity/server/infd-directory.c:2475 #, c-format msgid "No subscription request with ID %u" msgstr "" #: ../libinfinity/server/infd-directory.c:2929 #: ../libinfinity/server/infd-directory.c:5040 msgid "No background storage available" msgstr "" #: ../libinfinity/server/infd-directory.c:3041 msgid "The chat is disabled" msgstr "" #: ../libinfinity/server/infd-filesystem-storage.c:77 msgid "The path contains invalid components" msgstr "" #: ../libinfinity/server/infd-filesystem-storage.c:107 #, c-format msgid "Failed to convert root directory to filename encoding: %s" msgstr "" #: ../libinfinity/server/infd-filesystem-storage.c:119 #, c-format msgid "" "Failed to create root directory: %s\n" "Subsequent storage operations will most likely fail\n" msgstr "" #: ../libinfinity/server/infd-session-proxy.c:247 msgid "Request does not contain required attribute 'name'" msgstr "" #: ../libinfinity/server/infd-session-proxy.c:265 #, c-format msgid "Name '%s' already in use" msgstr "" #: ../libinfinity/server/infd-session-proxy.c:309 msgid "'status' attribute is 'unavailable' in user join request" msgstr "" #: ../libinftext/inf-text-session.c:978 ../libinftext/inf-text-session.c:1123 #, c-format msgid "No such user with ID '%u'" msgstr "" #: ../libinftext/inf-text-session.c:1007 #, c-format msgid "Invalid hue value: '%g'" msgstr "" #: ../libinftext/inf-text-session.c:1328 msgid "'caret' attribute in user message is missing" msgstr "" libinfinity-0.5.5/po/ChangeLog0000644000175000017500000000134112264763732013165 000000000000002009-12-19 Armin Burgmeier * libinfinity-0.5.pot: Moved from libinfinity-0.4.pot after release. 2009-12-19 Armin Burgmeier * ca.po: * de.po: Update from Launchpad. 2009-12-19 Armin Burgmeier * libinfinity-0.4.pot: Added, to allow synchronization with launchpad. * POTFILES.in: Updated. 2008-10-16 Armin Burgmeier * POTFILES.in: Updated. 2008-09-18 Armin Burgmeier * POTFILES.in: Updated. 2008-09-17 Armin Burgmeier * de.po: Initial German translation with a single string translated... only used to test gettext usage in infinote. * POTFILES.in: List all files containing translatable strings. libinfinity-0.5.5/po/ca.gmo0000644000175000017500000000353212041012755012467 00000000000000Þ•ì%¼PQ c m { … ’?ž Þëó ü  " 0>S+X„–›ª»Øá’ó† œ¦ ¼ Æ ÓTÝ 2<D M W a o|‹¡0¦×æìÿ7@    Certificate ChainConnectedConnecting...DIRECTORYDisconnectedExpires On:Failed to auto-save session "%s": %s Will retry in %u seconds.FingerprintsGeneralINTERVALIssued ByIssued On:MD5 Fingerprint:Not connectedOrganization:Organizational Unit:PORTPath "%s" does not contain any note pluginsSHA1 Fingerprint:SendSerial Number:Synchronizing...The port number to listen onValidity_View CertificateProject-Id-Version: libinfinity Report-Msgid-Bugs-To: POT-Creation-Date: 2009-12-19 23:05+0100 PO-Revision-Date: 2009-12-10 07:26+0000 Last-Translator: David Planella Language-Team: Catalan Language: ca MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Launchpad-Export-Date: 2009-12-19 18:32+0000 X-Generator: Launchpad (build Unknown) Cadena de certificatsConnectatS'està connectant...DIRECTORIDesconnectatVenç el:Ha fallat el desament de la sessió «%s»: %s Es tornarà a intentar en %u segons.EmpremtesGeneralINTERVALEmès perEmès el:Empremta MD5:No connectatOrganització:Unitat organitzativa:PORTEl camí «%s» no conté cap connector de notesEmpremta SHA1:EnviaNúmero de sèrie:S'està sincronitzant...El número de port on escoltarValidesa_Visualitza el certificatlibinfinity-0.5.5/po/LINGUAS0000644000175000017500000000006511335077516012436 00000000000000# Please keep this list sorted alphabetically. ca de libinfinity-0.5.5/po/ca.po0000644000175000017500000011166012041011626012321 00000000000000# Catalan translation for libinfinity # Copyright (c) 2009 Rosetta Contributors and Canonical Ltd 2009 # This file is distributed under the same license as the libinfinity package. # FIRST AUTHOR , 2009. # msgid "" msgstr "" "Project-Id-Version: libinfinity\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2009-12-19 23:05+0100\n" "PO-Revision-Date: 2009-12-10 07:26+0000\n" "Last-Translator: David Planella \n" "Language-Team: Catalan \n" "Language: ca\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Launchpad-Export-Date: 2009-12-19 18:32+0000\n" "X-Generator: Launchpad (build Unknown)\n" #: infinoted/infinoted-autosave.c:154 #, c-format msgid "" "Failed to auto-save session \"%s\": %s\n" "\n" "Will retry in %u seconds." msgstr "" "Ha fallat el desament de la sessió «%s»: %s\n" "\n" "Es tornarà a intentar en %u segons." #: infinoted/infinoted-dh-params.c:75 msgid "Generating 2048 bit Diffie-Hellman parameters..." msgstr "" #: infinoted/infinoted-directory-sync.c:167 #, c-format msgid "" "Failed to create directory for path \"%s\": %s\n" "\n" msgstr "" #: infinoted/infinoted-directory-sync.c:186 #, c-format msgid "" "Failed to write session for path \"%s\": %s\n" "\n" "Will retry in %u seconds." msgstr "" #: infinoted/infinoted-directory-sync.c:245 #, c-format msgid "Node \"%s\" contains invalid characters" msgstr "" #: infinoted/infinoted-directory-sync.c:347 #: infinoted/infinoted-directory-sync.c:413 #, c-format msgid "Failed to synchronize session \"%s\" to disk: %s" msgstr "" #. Translators: fork as in "fork into the background" #: infinoted/infinoted-main.c:72 msgid "Failed to fork" msgstr "" #: infinoted/infinoted-main.c:88 msgid "Failed to wait for daemonized child's return value" msgstr "" #: infinoted/infinoted-main.c:97 infinoted/infinoted-main.c:115 #: infinoted/infinoted-util.c:257 msgid "Failed to create PID file" msgstr "" #: infinoted/infinoted-note-plugin.c:137 #, c-format msgid "" "Failed to load plugin \"%s\": Note type \"%s\" is already handled by another " "plugin" msgstr "" #: infinoted/infinoted-note-plugin.c:148 #, c-format msgid "Failed to load plugin \"%s\": Storage type \"%s\" does not match" msgstr "" #: infinoted/infinoted-note-plugin.c:157 #, c-format msgid "Loaded plugin \"%s\" (%s)" msgstr "" #: infinoted/infinoted-note-plugin.c:177 #, c-format msgid "Path \"%s\" does not contain any note plugins" msgstr "El camí «%s» no conté cap connector de notes" #: infinoted/infinoted-options.c:91 #, c-format msgid "" "\"%s\" is not a valid security policy. Allowed values are \"no-tls\", " "\"allow-tls\" or \"require-tls\"" msgstr "" #: infinoted/infinoted-options.c:121 msgid "Interval must not be negative" msgstr "" #: infinoted/infinoted-options.c:142 #, c-format msgid "\"%d\" is not a valid port number. Port numbers range from 1 to 65535" msgstr "" #: infinoted/infinoted-options.c:407 msgid "Requiring password through unencrypted connection." msgstr "" #: infinoted/infinoted-options.c:418 msgid "" "Creating a new private key also requires creating a new certificate signed " "with it." msgstr "" #: infinoted/infinoted-options.c:432 msgid "" "No private key file given. If you don't have a suitable key file, either " "create one using the --create-key command line argument, or disable TLS by " "setting the security policy to \"no-tls\"." msgstr "" #: infinoted/infinoted-options.c:447 msgid "" "No certificate file given. If you don't have a suitable certificate file, " "either create one using the --create-certificate command line agument, or " "disable TLS via by setting the security policy to \"no-tls\"." msgstr "" #: infinoted/infinoted-options.c:462 msgid "" "A synchronization directory is given, but synchronization interval is not " "set. Please either set a nonzero synchronization interval or unset the " "synchronization directory using the --sync-directory and sync-interval " "command line or config file options." msgstr "" #: infinoted/infinoted-options.c:477 msgid "" "A synchronization interval is given, but the synchronization directory is " "not set. Please either set a valid synchronization directory, or set the " "synchronization interval to zero using --sync-directory and sync-interval " "command line or config file options." msgstr "" #: infinoted/infinoted-options.c:517 msgid "The server's private key" msgstr "" #: infinoted/infinoted-options.c:517 msgid "KEY-FILE" msgstr "" #: infinoted/infinoted-options.c:520 msgid "The server's certificate" msgstr "" #: infinoted/infinoted-options.c:520 msgid "CERTIFICATE-FILE" msgstr "" #: infinoted/infinoted-options.c:523 msgid "The certificates chain down to the root certificate" msgstr "" #: infinoted/infinoted-options.c:526 msgid "Creates a new random private key" msgstr "" #: infinoted/infinoted-options.c:529 msgid "Creates a new self-signed certificate using the given key" msgstr "" #: infinoted/infinoted-options.c:532 msgid "The port number to listen on" msgstr "El número de port on escoltar" #: infinoted/infinoted-options.c:532 msgid "PORT" msgstr "PORT" #: infinoted/infinoted-options.c:535 msgid "How to decide whether to use TLS" msgstr "" #: infinoted/infinoted-options.c:538 msgid "The directory to store documents into" msgstr "" #: infinoted/infinoted-options.c:538 infinoted/infinoted-options.c:549 msgid "DIRECTORY" msgstr "DIRECTORI" #: infinoted/infinoted-options.c:541 msgid "" "Interval within which to save documents, in seconds, or 0 to disable autosave" msgstr "" #: infinoted/infinoted-options.c:542 infinoted/infinoted-options.c:554 msgid "INTERVAL" msgstr "INTERVAL" #: infinoted/infinoted-options.c:545 msgid "Require given password on connections" msgstr "" #: infinoted/infinoted-options.c:545 msgid "PASSWORD" msgstr "" #: infinoted/infinoted-options.c:548 msgid "" "A directory into which to periodically store a copy of the document tree" msgstr "" #: infinoted/infinoted-options.c:552 msgid "" "Interval within which to store documents to the specified sync-directory, or " "0 to disable directory synchronization" msgstr "" #: infinoted/infinoted-options.c:558 msgid "Daemonize the server" msgstr "" #: infinoted/infinoted-options.c:561 msgid "Kill a running daemon" msgstr "" #: infinoted/infinoted-options.c:565 msgid "Display version information and exit" msgstr "" #: infinoted/infinoted-options.c:615 msgid "infinote dedicated server" msgstr "" #: infinoted/infinoted-options.c:648 msgid "Could not kill daemon" msgstr "" #: infinoted/infinoted-record.c:45 #, c-format msgid "Error while writing record for session \"%s\" into \"%s\": %s" msgstr "" #: infinoted/infinoted-record.c:86 #, c-format msgid "" "Could not create record file for session \"%s\": Could not generate unused " "record file in directory \"%s\"" msgstr "" #: infinoted/infinoted-record.c:98 #, c-format msgid "Could not create record file directory \"%s\": %s" msgstr "" #: infinoted/infinoted-run.c:338 #, c-format msgid "Failed to generate Diffie-Hellman parameters: %s" msgstr "" #: infinoted/infinoted-run.c:353 #, c-format msgid "IPv6 Server running on port %u" msgstr "" #: infinoted/infinoted-run.c:358 #, c-format msgid "Failed to start IPv6 server: %s" msgstr "" #: infinoted/infinoted-run.c:377 #, c-format msgid "IPv4 Server running on port %u" msgstr "" #: infinoted/infinoted-run.c:382 #, c-format msgid "Failed to start IPv4 server: %s" msgstr "" #: infinoted/infinoted-signal.c:54 msgid "" "Error on signal handler connection; signal handlers have been removed from " "now on" msgstr "" #: infinoted/infinoted-signal.c:70 #, c-format msgid "Config reload failed: %s" msgstr "" #: infinoted/infinoted-signal.c:76 msgid "Config reloaded" msgstr "" #. We don't reload the config file here since the signal handler could be #. * called from anywhere in the code. #: infinoted/infinoted-signal.c:129 msgid "" "For config reloading to work libinfinity needs to be compiled with libdaemon " "support" msgstr "" #. TODO: Open the key file beforehand #: infinoted/infinoted-startup.c:57 msgid "Generating 2048 bit RSA private key..." msgstr "" #: infinoted/infinoted-startup.c:95 msgid "Generating self-signed certificate..." msgstr "" #: infinoted/infinoted-util.c:127 #, c-format msgid "Could not create directory \"%s\": %s" msgstr "" #: libinfgtk/inf-gtk-browser-store.c:625 msgid "Disconnected" msgstr "Desconnectat" #: libinfgtk/inf-gtk-browser-view.c:2074 msgid "Exploring..." msgstr "" #: libinfgtk/inf-gtk-browser-view.c:2108 msgid "Synchronizing..." msgstr "S'està sincronitzant..." #: libinfgtk/inf-gtk-browser-view.c:2181 msgid "Not connected" msgstr "No connectat" #: libinfgtk/inf-gtk-browser-view.c:2192 msgid "Connecting..." msgstr "S'està connectant..." #: libinfgtk/inf-gtk-browser-view.c:2202 msgid "Connected" msgstr "Connectat" #: libinfgtk/inf-gtk-certificate-dialog.c:87 #, c-format msgid "The connection to host \"%s\" is not considered secure" msgstr "" #: libinfgtk/inf-gtk-certificate-dialog.c:116 msgid "The certificate of the host has changed!" msgstr "" #: libinfgtk/inf-gtk-certificate-dialog.c:128 msgid "The previous certificate of the server has expired." msgstr "" #: libinfgtk/inf-gtk-certificate-dialog.c:138 msgid "" "It is possible that the connection to the server is being hijacked. It is " "also possible that the host just has got a new certificate. However, please " "only continue the connection if you expected this warning." msgstr "" #: libinfgtk/inf-gtk-certificate-dialog.c:154 msgid "The certificate issuer is not trusted." msgstr "" #: libinfgtk/inf-gtk-certificate-dialog.c:160 msgid "The certificate is self-signed." msgstr "" #: libinfgtk/inf-gtk-certificate-dialog.c:170 msgid "The certificate is invalid!" msgstr "" #: libinfgtk/inf-gtk-certificate-dialog.c:186 #, c-format msgid "" "The hostname of the server, \"%s\", does not match the hostname the " "certificate is issued to, \"%s\"." msgstr "" #: libinfgtk/inf-gtk-certificate-dialog.c:205 #, c-format msgid "The certificate has expired. The expiration date was %s" msgstr "" #: libinfgtk/inf-gtk-certificate-dialog.c:222 #, c-format msgid "The certificate has not yet been activated. Activation date is %s" msgstr "" #: libinfgtk/inf-gtk-certificate-dialog.c:388 msgid "" msgstr "" #: libinfgtk/inf-gtk-certificate-dialog.c:443 msgid "Certificate Chain" msgstr "Cadena de certificats" #: libinfgtk/inf-gtk-certificate-dialog.c:553 msgid "_View Certificate" msgstr "_Visualitza el certificat" #: libinfgtk/inf-gtk-certificate-dialog.c:590 msgid "Connection not secure" msgstr "" #: libinfgtk/inf-gtk-certificate-manager.c:284 #: libinfgtk/inf-gtk-certificate-manager.c:301 #, c-format msgid "Failed to save known hosts file: %s\n" msgstr "" #: libinfgtk/inf-gtk-certificate-manager.c:361 #, c-format msgid "Could not load trust file: %s" msgstr "" #: libinfgtk/inf-gtk-certificate-manager.c:391 #, c-format msgid "Could not load known hosts file: %s" msgstr "" #: libinfgtk/inf-gtk-certificate-manager.c:434 #, c-format msgid "Could not verify certificate: %s" msgstr "" #: libinfgtk/inf-gtk-certificate-manager.c:552 msgid "_Cancel connection" msgstr "" #: libinfgtk/inf-gtk-certificate-manager.c:563 msgid "C_ontinue connection" msgstr "" #: libinfgtk/inf-gtk-certificate-manager.c:572 #, c-format msgid "Do you want to continue the connection to host %s?" msgstr "" #: libinfgtk/inf-gtk-certificate-manager.c:590 #, c-format msgid "Trust the certificate of host %s in the future" msgstr "" #: libinfgtk/inf-gtk-certificate-view.c:73 msgid "" msgstr "" #: libinfgtk/inf-gtk-certificate-view.c:221 msgid "Issued To" msgstr "" #: libinfgtk/inf-gtk-certificate-view.c:222 #: libinfgtk/inf-gtk-certificate-view.c:233 msgid "Common Name:" msgstr "" #: libinfgtk/inf-gtk-certificate-view.c:223 #: libinfgtk/inf-gtk-certificate-view.c:234 msgid "Organization:" msgstr "Organització:" #: libinfgtk/inf-gtk-certificate-view.c:224 #: libinfgtk/inf-gtk-certificate-view.c:235 msgid "Organizational Unit:" msgstr "Unitat organitzativa:" #: libinfgtk/inf-gtk-certificate-view.c:225 msgid "Serial Number:" msgstr "Número de sèrie:" #: libinfgtk/inf-gtk-certificate-view.c:232 msgid "Issued By" msgstr "Emès per" #: libinfgtk/inf-gtk-certificate-view.c:242 msgid "Validity" msgstr "Validesa" #: libinfgtk/inf-gtk-certificate-view.c:243 msgid "Issued On:" msgstr "Emès el:" #: libinfgtk/inf-gtk-certificate-view.c:244 msgid "Expires On:" msgstr "Venç el:" #: libinfgtk/inf-gtk-certificate-view.c:251 msgid "Fingerprints" msgstr "Empremtes" #: libinfgtk/inf-gtk-certificate-view.c:252 msgid "SHA1 Fingerprint:" msgstr "Empremta SHA1:" #: libinfgtk/inf-gtk-certificate-view.c:253 msgid "MD5 Fingerprint:" msgstr "Empremta MD5:" #: libinfgtk/inf-gtk-certificate-view.c:271 msgid "General" msgstr "General" #: libinfgtk/inf-gtk-chat.c:199 #, c-format msgid "%s has joined" msgstr "" #: libinfgtk/inf-gtk-chat.c:206 #, c-format msgid "%s has left" msgstr "" #: libinfgtk/inf-gtk-chat.c:759 msgid "Send" msgstr "Envia" #: libinfinity/adopted/inf-adopted-concurrency-warning.c:29 #, c-format msgid "" "%s was called for %s. This means that you hit an unforseen situation in " "libinfinity. The session could become inconsistent because of this. If you " "were using Gobby, please notify me (Armin Burgmeier, armin@arbur.net) about " "this, and attach the contents of the ~/.infinote-records folder, or just the " "record of the session that triggered this error if you know which one. I " "hope I can fix this problem with that information in future versions." msgstr "" #: libinfinity/adopted/inf-adopted-session.c:148 #, c-format msgid "Request has index '%u', but index '%u' was expected" msgstr "" #: libinfinity/adopted/inf-adopted-session.c:170 msgid "Undo received, but no previous request found" msgstr "" #: libinfinity/adopted/inf-adopted-session.c:187 msgid "Redo received, but no previous request found" msgstr "" #: libinfinity/adopted/inf-adopted-session.c:228 #, c-format msgid "No such user with user ID '%u'" msgstr "" #: libinfinity/adopted/inf-adopted-session.c:975 #: libinfinity/common/inf-chat-session.c:463 #: libinfinity/common/inf-session.c:796 libinftext/inf-text-session.c:1030 msgid "User did not join from this connection" msgstr "" #: libinfinity/adopted/inf-adopted-session.c:1164 msgid "'time' attribute in user message is missing" msgstr "" #: libinfinity/adopted/inf-adopted-session.c:1555 msgid "Operation for request missing" msgstr "" #. Error writing record `': #: libinfinity/adopted/inf-adopted-session-record.c:92 #, c-format msgid "Error writing record `%s': %s" msgstr "" #: libinfinity/adopted/inf-adopted-state-vector.c:746 msgid "Expected ':' after ID" msgstr "" #: libinfinity/adopted/inf-adopted-state-vector.c:760 #, c-format msgid "ID '%u' already occured before" msgstr "" #: libinfinity/adopted/inf-adopted-state-vector.c:777 #, c-format msgid "Expected ';' or end of string after component of ID '%u'" msgstr "" #: libinfinity/client/infc-browser.c:665 msgid "The node to subscribe to has been removed" msgstr "" #: libinfinity/client/infc-browser.c:691 libinfinity/client/infc-browser.c:718 msgid "" "The subdirectory into which the new node should have been created has been " "removed" msgstr "" #: libinfinity/client/infc-browser.c:829 msgid "" "The server did not send an initial welcome message. This means that the " "server is running a lower version of the software which is incompatible to " "the client. Consider downgrading the client, or ask the server maintainers " "to upgrade their software." msgstr "" #: libinfinity/client/infc-browser.c:1059 #, c-format msgid "" "This session requires communication method `%s' which is not installed for " "network `%s'" msgstr "" #: libinfinity/client/infc-browser.c:1923 #, c-format msgid "" "The request contains a sequence number refering to a request of type '%s', " "but a request of either 'explore' or 'add-node' was expected." msgstr "" #: libinfinity/client/infc-browser.c:2137 msgid "" "The server uses an older version of the protocol which is no longer " "supported by this client. Consider using an earlier version of it, or ask " "the server maintainers to upgrade their software." msgstr "" #: libinfinity/client/infc-browser.c:2151 msgid "The server uses a newer version. Consider upgrading your client." msgstr "" #: libinfinity/client/infc-browser.c:2221 msgid "Node to explore does no longer exist" msgstr "" #: libinfinity/client/infc-browser.c:2233 msgid "Node to explore is not a subdirectory" msgstr "" #: libinfinity/client/infc-browser.c:2245 msgid "Node to explore is already explored" msgstr "" #: libinfinity/client/infc-browser.c:2323 #: libinfinity/client/infc-browser.c:2522 #, c-format msgid "Node with ID \"%u\" exists already" msgstr "" #: libinfinity/client/infc-browser.c:2401 msgid "Explored nodes cannot be initially be subscribed to" msgstr "" #: libinfinity/client/infc-browser.c:2416 #, c-format msgid "Note type \"%s\" not known" msgstr "" #: libinfinity/client/infc-browser.c:2567 msgid "Received sync-in without having requested one" msgstr "" #: libinfinity/client/infc-browser.c:2589 #, c-format msgid "Expected note type \"%s\" for sync-in, but received \"%s\"" msgstr "" #: libinfinity/client/infc-browser.c:2724 #, c-format msgid "Note type '%s' is not supported" msgstr "" #: libinfinity/client/infc-browser.c:2739 msgid "Already subscribed to this session" msgstr "" #: libinfinity/client/infc-browser.c:2804 msgid "Already subscribed to the chat session" msgstr "" #: libinfinity/client/infc-browser.c:2990 #: libinfinity/client/infc-session-proxy.c:474 #, c-format msgid "Error comes from unknown error domain '%s' (code %u)" msgstr "" #: libinfinity/client/infc-browser.c:3166 #: libinfinity/client/infc-session-proxy.c:926 #, c-format msgid "Server reply could not be processed: %s" msgstr "" #: libinfinity/client/infc-request-manager.c:102 msgid "Sequence identifier causes overflow" msgstr "" #: libinfinity/client/infc-request-manager.c:115 msgid "Sequence components are not separated by '/'" msgstr "" #: libinfinity/client/infc-request-manager.c:130 msgid "Sequence number causes overflow" msgstr "" #: libinfinity/client/infc-request-manager.c:143 msgid "Trailing characters after sequence number" msgstr "" #: libinfinity/client/infc-request-manager.c:679 msgid "The request contains an unknown sequence number" msgstr "" #: libinfinity/client/infc-request-manager.c:691 #, c-format msgid "" "The request contains a sequence number refering to a request of type '%s', " "but a request of type '%s' was expected" msgstr "" #: libinfinity/client/infc-request-manager.c:744 msgid "The request does not contain a sequence number, but one is required" msgstr "" #: libinfinity/client/infc-session-proxy.c:603 msgid "Request does not contain required attribute 'id'" msgstr "" #: libinfinity/client/infc-session-proxy.c:621 #: libinfinity/common/inf-session.c:781 #, c-format msgid "No such user with ID %u" msgstr "" #: libinfinity/common/inf-chat-session.c:89 msgid "An invalid message type was sent" msgstr "" #: libinfinity/common/inf-chat-session.c:91 msgid "A user with the requested ID does not exist" msgstr "" #: libinfinity/common/inf-chat-session.c:93 msgid "An unknown chat session error has occured" msgstr "" #: libinfinity/common/inf-chat-session.c:95 libinfinity/common/inf-error.c:79 #: libinfinity/common/inf-error.c:126 libinfinity/common/inf-session.c:202 msgid "An error with unknown error code occured" msgstr "" #: libinfinity/common/inf-chat-session.c:264 #, c-format msgid "No such user with ID \"%u\"" msgstr "" #: libinfinity/common/inf-chat-session.c:354 #, c-format msgid "%s --- %s has joined\n" msgstr "" #: libinfinity/common/inf-chat-session.c:357 #, c-format msgid "%s --- %s has left\n" msgstr "" #: libinfinity/common/inf-chat-session.c:415 #, c-format msgid "%s --- %u users total\n" msgstr "" #: libinfinity/common/inf-chat-session.c:1282 #, c-format msgid "%s --- Log closed\n" msgstr "" #: libinfinity/common/inf-chat-session.c:1296 #, c-format msgid "%s --- Log opened\n" msgstr "" #: libinfinity/common/inf-discovery-avahi.c:526 #, c-format msgid "" "Avahi service browser is in failure state. Services of type '%s' are no " "longer discovered.\n" "\n" "The failure was: %s\n" msgstr "" #: libinfinity/common/inf-discovery-avahi.c:594 #, c-format msgid "" "Avahi entry group is in failure state. The service '%s' of type '%s' is no " "longer published.\n" "\n" "The failure was: %s\n" msgstr "" #: libinfinity/common/inf-discovery-avahi.c:804 #, c-format msgid "" "Failed to start Avahi client. Service discovery or publishing will not be " "possible.\n" "\n" "The occurred failure was: %s" msgstr "" #: libinfinity/common/inf-discovery-avahi.c:847 #, c-format msgid "" "Avahi client is in failure state. Service discovery or publishing is no " "longer possible.\n" "\n" "The occured failure was: %s\n" msgstr "" #. Translators: This is " (via on #. *
)", for example "ck (via eth0 on IPv4)". #: libinfinity/common/inf-discovery-avahi.c:1431 #, c-format msgid "%s (via %s on IPv4)" msgstr "" #: libinfinity/common/inf-discovery-avahi.c:1432 #, c-format msgid "%s (via %s on IPv6)" msgstr "" #: libinfinity/common/inf-error.c:67 msgid "Received error from an unknown domain" msgstr "" #: libinfinity/common/inf-error.c:69 msgid "Failed to process server reply" msgstr "" #: libinfinity/common/inf-error.c:71 msgid "Server reply contains invalid sequence number" msgstr "" #: libinfinity/common/inf-error.c:73 msgid "A required attribute was not set in request" msgstr "" #: libinfinity/common/inf-error.c:75 msgid "An attribute contained an invalid number" msgstr "" #: libinfinity/common/inf-error.c:77 msgid "An unknown request error occured" msgstr "" #: libinfinity/common/inf-error.c:112 msgid "Name is already in use" msgstr "" #: libinfinity/common/inf-error.c:114 msgid "'id' attribute provided in request" msgstr "" #: libinfinity/common/inf-error.c:116 msgid "There is no user with the given ID" msgstr "" #: libinfinity/common/inf-error.c:118 msgid "'status' attribute is 'unavailable' in join or rejoin request" msgstr "" #: libinfinity/common/inf-error.c:120 msgid "User did not join via this connection" msgstr "" #: libinfinity/common/inf-error.c:122 msgid "'status' attribute has invalid value" msgstr "" #: libinfinity/common/inf-error.c:124 msgid "An unknown user error occured" msgstr "" #: libinfinity/common/inf-error.c:159 msgid "Server did not send an initial welcome message" msgstr "" #: libinfinity/common/inf-error.c:161 msgid "The server and client use different protocol versions" msgstr "" #: libinfinity/common/inf-error.c:163 msgid "A node with this name exists already" msgstr "" #: libinfinity/common/inf-error.c:165 msgid "Invalid node name" msgstr "" #: libinfinity/common/inf-error.c:167 msgid "Node does not exist" msgstr "" #: libinfinity/common/inf-error.c:169 msgid "No previous subscription request present" msgstr "" #: libinfinity/common/inf-error.c:171 msgid "The chat is disabled on the server side" msgstr "" #: libinfinity/common/inf-error.c:173 msgid "Node is not a subdirectory" msgstr "" #: libinfinity/common/inf-error.c:175 msgid "Node is not a note" msgstr "" #: libinfinity/common/inf-error.c:177 libinfinity/server/infd-directory.c:2739 msgid "The root node cannot be removed" msgstr "" #: libinfinity/common/inf-error.c:179 msgid "Subdirectory has already been explored" msgstr "" #: libinfinity/common/inf-error.c:181 msgid "Note type is not supported" msgstr "" #: libinfinity/common/inf-error.c:183 msgid "Connection is already subscribed to this session" msgstr "" #: libinfinity/common/inf-error.c:185 libinfinity/server/infd-directory.c:2870 msgid "The requesting connection is not subscribed to the session" msgstr "" #: libinfinity/common/inf-error.c:187 msgid "Server sent more explored nodes then announced" msgstr "" #: libinfinity/common/inf-error.c:189 msgid "Server sent not as much explored nodes as announced" msgstr "" #: libinfinity/common/inf-error.c:191 msgid "" "The session does not support the network through which the connection " "attempt is being made." msgstr "" #: libinfinity/common/inf-error.c:194 msgid "The session uses an unsupported communication method" msgstr "" #: libinfinity/common/inf-error.c:196 msgid "Received sync-in message without having requested a sync-in" msgstr "" #: libinfinity/common/inf-error.c:198 msgid "Unexpected XML message" msgstr "" #: libinfinity/common/inf-error.c:200 msgid "An unknown directory error has occured" msgstr "" #: libinfinity/common/inf-error.c:202 msgid "An error with unknown code has occured" msgstr "" #: libinfinity/common/inf-protocol.c:86 msgid "Major part of version number causes overflow" msgstr "" #: libinfinity/common/inf-protocol.c:99 msgid "Version number parts are not separated by '.'" msgstr "" #: libinfinity/common/inf-protocol.c:114 msgid "Minor part of version number causes overflow" msgstr "" #: libinfinity/common/inf-protocol.c:127 msgid "Trailing characters after version number" msgstr "" #: libinfinity/common/inf-session.c:167 msgid "Unexpectedly got an XML message in presync" msgstr "" #: libinfinity/common/inf-session.c:169 msgid "Got unexpected XML node during synchronization" msgstr "" #: libinfinity/common/inf-session.c:171 msgid "'id' attribute in user message is missing" msgstr "" #: libinfinity/common/inf-session.c:173 msgid "User ID is already in use" msgstr "" #: libinfinity/common/inf-session.c:175 msgid "'name' attribute in user message is missing" msgstr "" #: libinfinity/common/inf-session.c:177 msgid "User Name is already in use" msgstr "" #: libinfinity/common/inf-session.c:179 msgid "The connection was closed unexpectedly" msgstr "" #: libinfinity/common/inf-session.c:181 msgid "The sender cancelled the synchronization" msgstr "" #: libinfinity/common/inf-session.c:183 msgid "The receiver cancelled the synchronization" msgstr "" #: libinfinity/common/inf-session.c:185 msgid "Got begin-of-sync message, but synchronization is already in progress" msgstr "" #: libinfinity/common/inf-session.c:188 msgid "begin-of-sync message does not contain the number of messages to expect" msgstr "" #: libinfinity/common/inf-session.c:191 msgid "Got end-of-sync message, but synchronization is still in progress" msgstr "" #: libinfinity/common/inf-session.c:194 msgid "Expected begin-of-sync message as first message during synchronization" msgstr "" #: libinfinity/common/inf-session.c:197 msgid "Expected end-of-sync message as last message during synchronization" msgstr "" #: libinfinity/common/inf-session.c:200 msgid "An unknown synchronization error has occured" msgstr "" #. TODO: Add a possibilty for sub classes to register their error domains #. * that can occur in process_xml_sync. Maybe via a translate_error_sync #. * vfunc. #: libinfinity/common/inf-session.c:216 msgid "An error with unknown error domain occured" msgstr "" #: libinfinity/common/inf-session.c:952 #, c-format msgid "Received unhandled XML message '%s'" msgstr "" #: libinfinity/common/inf-session.c:1493 #, c-format msgid "Unexpectedly received XML message \"%s\" in presync" msgstr "" #: libinfinity/common/inf-session.c:1599 #, c-format msgid "Received unexpected XML message \"%s\" while synchronizing" msgstr "" #: libinfinity/common/inf-tcp-connection.c:578 #, c-format msgid "Interface `%s' does not exist" msgstr "" #. Failed to get name for device : #: libinfinity/common/inf-tcp-connection.c:653 #, c-format msgid "Failed to get name for device %u: %s" msgstr "" #: libinfinity/common/inf-user.c:544 #, c-format msgid "Invalid user status: '%s'" msgstr "" #: libinfinity/common/inf-xml-util.c:60 libinfinity/common/inf-xml-util.c:117 #: libinfinity/common/inf-xml-util.c:236 #, c-format msgid "Attribute '%s' does not contain a valid number" msgstr "" #: libinfinity/common/inf-xml-util.c:72 libinfinity/common/inf-xml-util.c:129 #: libinfinity/common/inf-xml-util.c:160 libinfinity/common/inf-xml-util.c:204 #: libinfinity/common/inf-xml-util.c:249 #, c-format msgid "Attribute '%s' causes overflow (%s)" msgstr "" #: libinfinity/common/inf-xml-util.c:85 libinfinity/common/inf-xml-util.c:173 #: libinfinity/common/inf-xml-util.c:262 #, c-format msgid "Attribute '%s' causes underflow (%s)" msgstr "" #: libinfinity/common/inf-xml-util.c:452 #, c-format msgid "Request '%s' does not contain required attribute '%s'" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:328 msgid "The entity has sent XML that cannot be processed" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:330 msgid "" "The entity has sent a namespace prefix that is unsupported, or has sent no " "namespace prefix on an element that requires such a prefix" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:334 msgid "" "The server is closing the active stream for this entity because a new stream " "has been initiated that conflicts with the existing stream" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:338 msgid "" "The entity has not generated any traffic over the stream for some period of " "time" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:341 msgid "" "The value of the 'to' attribute provided by the initiating entity in the " "stream header corresponds to a hostname that is no longer hosted by the " "server" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:345 msgid "" "The value of the 'to' attribute provided by the initiating entity in the " "stream header does not correspond to a hostname that is hosted by the server" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:349 msgid "A stanza sent between two servers lacks a 'to' or 'from'attribute" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:352 msgid "" "The server has experienced a misconfiguration or an otherwise-undefined " "internal error that prevents it from servicing the stream" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:356 msgid "" "The JID or hostname provided in a 'from' address does not match an " "authorized JID or validated domain negotiated between servers via SASL or " "dialback, or between a client and a server via authentication and resource " "binding" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:361 msgid "" "The stream ID or dialback ID is invalid or does not match an ID previously " "provided" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:364 msgid "" "The streams namespace is something other than \"http://etherx.jabber.org/" "streams\" or the dialback namespace name is something other than \"jabber:" "server:dialback\"" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:368 msgid "" "The entity has sent invalid XML over the stream to a server that performs " "validation" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:371 msgid "" "The entity has attempted to send data before the stream has been " "authenticated, or otherwise is not authorized to perform an action related " "to stream negotiation" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:375 msgid "The entity has violated some local service policy" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:377 msgid "" "The server is unable to property connect to a remote entity that is required " "for authentication or authorization" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:380 msgid "The server lacks the system resources necessary to service the stream" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:383 msgid "The entity has attempted to send restricted XML features" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:385 msgid "" "The server will not provide service to the initiating entity but is " "redirecting traffic to another host" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:388 msgid "The server is being shut down and all active streams are being closed" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:392 msgid "The error condition is not one of those defined by the other conditions" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:395 msgid "" "The initiating entity has encoded the stream in an encoding that is not " "supported by the server" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:398 msgid "" "The initiating entity has sent a first-level child of the stream that is not " "supported by the server." msgstr "" #: libinfinity/common/inf-xmpp-connection.c:401 msgid "" "The value of the 'version' attribute provided by the initiating entity in " "the stream header specifies a version of XMPP that is not supported by the " "server" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:405 msgid "The initiating entity has sent XML that is not well-formed" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:450 msgid "" "The receiving entity acknowledged an element sent by the initiating " "entity" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:453 msgid "" "The data provided by the initiating entity could not be processed because " "the Base64 encoding is incorrect" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:456 msgid "" "The authzid provided by the initiating entity is invalid, either because it " "is incorrectly formatted or because the initiating entity does not have " "permissions to authorize that ID" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:461 msgid "" "The initiating entity did not provide a mechanism or requested a mechanism " "that is not supported by the receiving entity" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:464 msgid "" "The mechanism requsted by the initiating entity is weaker than server policy " "permits for that initiating entity" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:467 msgid "" "The authentication failed because the initiating entity did not provide " "valid credentials" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:470 msgid "" "The authentication failed because of a temporary error condition within the " "receiving entity" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:473 msgid "An unknown authentication error has occured" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:1007 msgid "The server did not provide a certificate" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:1754 msgid "Stream is not yet secured with TLS" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:1797 msgid "Stream is not yet authorized" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:1845 msgid "The server does not support transport layer security (TLS)" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:1868 msgid "The server requires transport layer security (TLS)" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:1902 msgid "The server does not provide any authentication mechanism" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:1984 msgid "The server does not offer a suitable authentication mechanism" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:2026 msgid "The server cannot perform the TLS handshake" msgstr "" #. XML Warning from : #: libinfinity/common/inf-xmpp-connection.c:2436 #, c-format msgid "XML warning from %s: %s\n" msgstr "" #. The server sent something which is not XML #: libinfinity/common/inf-xmpp-connection.c:2475 msgid "Remote site is not an XMPP server" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:3879 msgid "The server certificate is not trusted" msgstr "" #: libinfinity/server/infd-directory.c:358 #, c-format msgid "" "Failed to save note \"%s\": %s\n" "\n" "Keeping it in memory. Another save attempt will be made when the server is " "shut down." msgstr "" #: libinfinity/server/infd-directory.c:729 #, c-format msgid "" "Could not write session \"%s\" to storage: %s\n" "\n" "All changes since the document das been saved are lost." msgstr "" #: libinfinity/server/infd-directory.c:1322 #, c-format msgid "" "Session \"%s\" could not be saved: %s\n" "Another attempt will be made when the session is unused for a while or the " "server is shut down." msgstr "" #: libinfinity/server/infd-directory.c:2382 msgid "No subscription request for the server chat" msgstr "" #: libinfinity/server/infd-directory.c:2401 #, c-format msgid "No subscription request with ID %u" msgstr "" #: libinfinity/server/infd-directory.c:2956 msgid "The chat is disabled" msgstr "" #: libinfinity/server/infd-filesystem-storage.c:80 msgid "The path contains invalid components" msgstr "" #: libinfinity/server/infd-filesystem-storage.c:110 #, c-format msgid "Failed to convert root directory to filename encoding: %s" msgstr "" #: libinfinity/server/infd-filesystem-storage.c:122 #, c-format msgid "" "Failed to create root directory: %s\n" "Subsequent storage operations will most likely fail\n" msgstr "" #: libinfinity/server/infd-session-proxy.c:247 msgid "Request does not contain required attribute 'name'" msgstr "" #: libinfinity/server/infd-session-proxy.c:265 #, c-format msgid "Name '%s' already in use" msgstr "" #: libinfinity/server/infd-session-proxy.c:309 msgid "'status' attribute is 'unavailable' in user join request" msgstr "" #: libinftext/inf-text-session.c:1015 libinftext/inf-text-session.c:1160 #, c-format msgid "No such user with ID '%u'" msgstr "" #: libinftext/inf-text-session.c:1044 #, c-format msgid "Invalid hue value: '%g'" msgstr "" #: libinftext/inf-text-session.c:1365 msgid "'caret' attribute in user message is missing" msgstr "" libinfinity-0.5.5/po/de.gmo0000644000175000017500000001705012041012755012474 00000000000000Þ•B,Y< C¡^å D R^{Œ¡ ³ À ÊØ#î/fB ©9ÊS X b2o9¢ Ü è?õ 5 B 0J &{ %¢ È Ñ ð M ] g r Ð| M V n Ï ¼O  ( = B T c 7t A¬ î  &*(Q4z%¯aÕ37k„¦¹šËVft½2E#UyŠ¡ ² ¿Éé7þP6•‡4RR|¥ ".+BJn ¹ ÅyÐJ Z,f9“*Í ø&&)xPÉÙéóøìüê/ò  +AF Zh5zG°ø"390m5ž>Ôe4y®'É ñý 5%" *4.'1@B &- ;=036?/)8(#,A7 > !:<$92+"%d" is not a valid port number. Port numbers range from 1 to 65535"%s" is not a valid security policy. Allowed values are "no-tls", "allow-tls" or "require-tls"%s has joined%s has leftCERTIFICATE-FILEC_ontinue connectionCertificate ChainCommon Name:ConnectedConnecting...Connection not secureCould not create directory "%s": %sCould not create record file directory "%s": %sCould not create record file for session "%s": Could not generate unused record file in directory "%s"Creates a new random private keyCreates a new self-signed certificate using the given keyCreating a new private key also requires creating a new certificate signed with it.DIRECTORYDisconnectedDo you want to continue the connection to host %s?Error while writing record for session "%s" into "%s": %sExpires On:Exploring...Failed to auto-save session "%s": %s Will retry in %u seconds.FingerprintsGeneralGenerating 2048 bit Diffie-Hellman parameters...Generating 2048 bit RSA private key...Generating self-signed certificate...INTERVALIPv4 Server running on port %uIPv6 Server running on port %uInterval within which to save documents, in seconds, or 0 to disable autosaveIssued ByIssued On:Issued ToIt is possible that the connection to the server is being hijacked. It is also possible that the host just has got a new certificate. However, please only continue the connection if you expected this warning.KEY-FILELoaded plugin "%s" (%s)MD5 Fingerprint:No certificate file given. If you don't have a suitable certificate file, either create one using the --create-certificate command line agument, or disable TLS via by setting the security policy to "no-tls".No private key file given. If you don't have a suitable key file, either create one using the --create-key command line argument, or disable TLS by setting the security policy to "no-tls".Not connectedOrganization:Organizational Unit:PORTSHA1 Fingerprint:Serial Number:Synchronizing...The certificate has expired. The expiration date was %sThe certificate has not yet been activated. Activation date is %sThe certificate is invalid!The certificate is self-signed.The certificate issuer is not trusted.The certificate of the host has changed!The connection to host "%s" is not considered secureThe directory to store documents intoThe hostname of the server, "%s", does not match the hostname the certificate is issued to, "%s".The previous certificate of the server has expired.The server's certificateThe server's private keyValidity_Cancel connection_View CertificateProject-Id-Version: libinfinity Report-Msgid-Bugs-To: POT-Creation-Date: 2009-12-19 23:05+0100 PO-Revision-Date: 2009-11-28 11:36+0000 Last-Translator: Armin Burgmeier Language-Team: German Language: de MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Launchpad-Export-Date: 2009-12-19 18:32+0000 X-Generator: Launchpad (build Unknown) »%d« ist keine gültige Portnummer. Gültige Portnummern liegen zwischen 1 und 65535»%s« ist keine gültige Sicherheitsrichtlinie. Mögliche Werte sind »no-tls«, »allow-tls« oder »require-tls«%s ist beigetreten%s ist gegangenZERTIFIKATSDATEIVerbindung f_ortsetzenZertifikatsketteCommon-Name:VerbundenVerbindung wird hergestellt ...Unsichere VerbindungDas Verzeichnis »%s« konnte nicht erstellt werden: %sDas Verzeichnis für die Aufnahmedateien »%s« konnte nicht erstellt werden: %sDie Aufnahmedatei für die Sitzung »%s« konnte nicht erstellt werden, da keine unbenutzte Aufnahmedatei im Verzeichnis »%s« erzeugt werden konnteErstellt einen neuen zufälligen privaten SchlüsselErstellt ein neues selbstsigniertes Zertifikat mit Hilfe des angegeben SchlüsselsEinen neuen privaten Schlüssel zu erstellen erfordert auch ein zugehöriges Zertifikat zu erstellen das damit signiert ist.VERZEICHNISVerbindung getrenntWollen Sie die Verbindung zu %s fortsetzen?Fehler beim Speichern der Aufnahme für die Sitzung »%s« nach »%s«: %sLäuft aus:Erkunde…Die Sitzung »%s« konnte nicht automatisch gespeichert werden: %s In %u Sekunden wird ein erneuter Versuch unternommen.FingerabdrückeAllgemeinesErzeuge 2048-bit Diffie-Hellman-Parameter…Erzeuge einen 2048-bit starken privaten RSA-Schlüssel…Erzeuge ein selbstsigniertes Zertifikat…INTERVALLDer IPv4-Server läuft auf dem Port %uDer IPv6-Server läuft auf dem Port %uZeitabstand in Sekunden in dem Dokumente automatisch gespeichert werden, oder 0 um automatische Speicherung abzuschaltenAusgestellt vonAusgestellt am:Ausgestellt anEs ist möglich dass die Verbindung zum Server abgehört oder manipuliert wird. Es kann aber auch sein dass der Server einfach ein neues Zertifikat installiert hat. Fahren Sie in jedem Fall bitte nur fort wenn Sie diese Warnung erwartet haben.SCHLÜSSELDATEIErweiterung »%s« (%s) geladenMD5-Fingerabdruck:Keine Zertifikatsdatei angegeben. Wenn keine passende Datei vorliegt können Sie entweder eine mit dem Kommandozeilen-Argument --create-certificate erstellen oder TLS durch Setzen der Sicherheitsrichtlinie auf »no-tls« deaktivieren.Es wurde keine private Schlüsseldatei angegeben. Wenn keine passende Datei vorliegt können Sie entweder eine mit dem Kommandozeilen-Argument --create-key erstellen oder TLS durch Setzen der Sicherheitsrichtlinie auf »no-tls« deaktivieren.Nicht verbundenOrganisation:Organisationseinheit:PORTSHA1-Fingerabdruck:Seriennummer:Synchronisiere…Das Zertifikat ist abgelaufen. Das Ablaufdatum war %sDas Zertifikat wurde noch nicht aktiviert. Das Aktivierungsdatum ist %sDas Zertifikat ist ungültig!Das Zertifikat ist selbstsigniert.Dem Aussteller des Zertifikats wird nicht vertraut.Das SZertifikats des Servers hat sich geändert!Die Verbindung zu »%s« wird als unsicher eingestuftDas Verzeichnis in dem die Dokumente gespeichert werden sollenDer Name des Servers, »%s«, passt nicht zu dem Namen »%s« auf den das Zertifikat ausgestellt ist.Das vorherige Zertifikat des Servers ist abgelaufen.Das Zertifikat des ServersDie private Schlüsseldatei des ServersGültigkeitVerbindung abbre_chen_Zertifikat anzeigenlibinfinity-0.5.5/po/Makefile.in.in0000644000175000017500000001760412264766060014073 00000000000000# Makefile for program source directory in GNU NLS utilities package. # Copyright (C) 1995, 1996, 1997 by Ulrich Drepper # # This file file be copied and used freely without restrictions. It can # be used in projects which are not available under the GNU Public License # but which still want to provide support for the GNU gettext functionality. # Please note that the actual code is *not* freely available. # # - Modified by Owen Taylor to use GETTEXT_PACKAGE # instead of PACKAGE and to look for po2tbl in ./ not in intl/ # # - Modified by jacob berkman to install # Makefile.in.in and po2tbl.sed.in for use with glib-gettextize GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ PACKAGE = @PACKAGE@ VERSION = @VERSION@ SHELL = @SHELL@ @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ datarootdir = @datarootdir@ datadir = @datadir@ libdir = @libdir@ localedir = $(libdir)/locale gnulocaledir = $(datadir)/locale gettextsrcdir = $(datadir)/glib-2.0/gettext/po subdir = po INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ MKINSTALLDIRS = mkdir -p CC = @CC@ GENCAT = @GENCAT@ GMSGFMT = @GMSGFMT@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ XGETTEXT = @XGETTEXT@ MSGMERGE = msgmerge DEFS = @DEFS@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ INCLUDES = -I.. -I$(top_srcdir)/intl COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) SOURCES = POFILES = @POFILES@ GMOFILES = @GMOFILES@ DISTFILES = LINGUAS ChangeLog Makefile.in.in POTFILES.in $(GETTEXT_PACKAGE).pot \ $(POFILES) $(GMOFILES) $(SOURCES) POTFILES = \ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ INSTOBJEXT = @INSTOBJEXT@ .SUFFIXES: .SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat .c.o: $(COMPILE) $< .po.pox: $(MAKE) $(GETTEXT_PACKAGE).pot $(MSGMERGE) $< $(srcdir)/$(GETTEXT_PACKAGE).pot -o $*.pox .po.mo: $(MSGFMT) -o $@ $< .po.gmo: $(AM_V_GEN) file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \ && rm -f $$file && $(GMSGFMT) $(MSGFMT_OPTS) -o $$file $< .po.cat: sed -f ../intl/po2msg.sed < $< > $*.msg \ && rm -f $@ && $(GENCAT) $@ $*.msg all: all-@USE_NLS@ all-yes: $(CATALOGS) all-no: $(srcdir)/$(GETTEXT_PACKAGE).pot: $(POTFILES) $(XGETTEXT) --default-domain=$(GETTEXT_PACKAGE) \ --msgid-bugs-address='http://bugzilla.gnome.org/enter_bug.cgi?product=glib&keywords=I18N+L10N&component=general' \ --add-comments --keyword=_ --keyword=N_ \ --keyword=C_:1c,2 \ --keyword=NC_:1c,2 \ --keyword=g_dcgettext:2 \ --keyword=g_dngettext:2,3 \ --keyword=g_dpgettext2:2c,3 \ --flag=N_:1:pass-c-format \ --flag=C_:2:pass-c-format \ --flag=NC_:2:pass-c-format \ --flag=g_dngettext:2:pass-c-format \ --flag=g_strdup_printf:1:c-format \ --flag=g_string_printf:2:c-format \ --flag=g_string_append_printf:2:c-format \ --flag=g_error_new:3:c-format \ --flag=g_set_error:4:c-format \ --flag=g_markup_printf_escaped:1:c-format \ --flag=g_log:3:c-format \ --flag=g_print:1:c-format \ --flag=g_printerr:1:c-format \ --flag=g_printf:1:c-format \ --flag=g_fprintf:2:c-format \ --flag=g_sprintf:2:c-format \ --flag=g_snprintf:3:c-format \ --flag=g_scanner_error:2:c-format \ --flag=g_scanner_warn:2:c-format \ $(POTFILES) \ && test ! -f $(GETTEXT_PACKAGE).po \ || ( rm -f $(srcdir)/$(GETTEXT_PACKAGE).pot \ && mv $(GETTEXT_PACKAGE).po $(srcdir)/$(GETTEXT_PACKAGE).pot ) install: install-exec install-data install-exec: install-data: install-data-@USE_NLS@ install-data-no: all install-data-yes: all $(MKINSTALLDIRS) $(DESTDIR)$(datadir); \ catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ case "$$cat" in \ *.gmo) destdir=$(gnulocaledir);; \ *) destdir=$(localedir);; \ esac; \ lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ dir=$(DESTDIR)$$destdir/$$lang/LC_MESSAGES; \ $(MKINSTALLDIRS) $$dir; \ if test -r $$cat; then \ $(INSTALL_DATA) $$cat $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \ echo "installing $$cat as $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT)"; \ else \ $(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \ echo "installing $(srcdir)/$$cat as" \ "$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT)"; \ fi; \ if test -r $$cat.m; then \ $(INSTALL_DATA) $$cat.m $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \ echo "installing $$cat.m as $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m"; \ else \ if test -r $(srcdir)/$$cat.m ; then \ $(INSTALL_DATA) $(srcdir)/$$cat.m \ $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \ echo "installing $(srcdir)/$$cat as" \ "$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m"; \ else \ true; \ fi; \ fi; \ done if test "$(PACKAGE)" = "glib"; then \ $(MKINSTALLDIRS) $(DESTDIR)$(gettextsrcdir); \ $(INSTALL_DATA) $(srcdir)/Makefile.in.in \ $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \ else \ : ; \ fi # Define this as empty until I found a useful application. installcheck: uninstall: catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \ rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \ rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \ rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \ done if test "$(PACKAGE)" = "glib"; then \ rm -f $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \ fi check: all dvi info tags TAGS ID: mostlyclean: rm -f core core.* *.pox $(GETTEXT_PACKAGE).po *.old.po cat-id-tbl.tmp rm -fr *.o clean: mostlyclean distclean: clean rm -f Makefile Makefile.in POTFILES *.mo *.msg *.cat *.cat.m maintainer-clean: distclean @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." rm -f $(GMOFILES) distdir = ../$(GETTEXT_PACKAGE)-$(VERSION)/$(subdir) dist distdir: $(DISTFILES) dists="$(DISTFILES)"; \ for file in $$dists; do \ ln $(srcdir)/$$file $(distdir) 2> /dev/null \ || cp -p $(srcdir)/$$file $(distdir); \ done update-po: Makefile $(MAKE) $(GETTEXT_PACKAGE).pot tmpdir=`pwd`; \ cd $(srcdir); \ catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ echo "$$lang:"; \ if $(MSGMERGE) $$lang.po $(GETTEXT_PACKAGE).pot -o $$tmpdir/$$lang.new.po; then \ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ :; \ else \ echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ rm -f $$tmpdir/$$lang.new.po; \ exit 1; \ fi; \ fi; \ else \ echo "msgmerge for $$cat failed!"; \ rm -f $$tmpdir/$$lang.new.po; \ fi; \ done # POTFILES is created from POTFILES.in by stripping comments, empty lines # and Intltool tags (enclosed in square brackets), and appending a full # relative path to them POTFILES: POTFILES.in ( if test 'x$(srcdir)' != 'x.'; then \ posrcprefix='$(top_srcdir)/'; \ else \ posrcprefix="../"; \ fi; \ rm -f $@-t $@ \ && (sed -e '/^#/d' \ -e "s/^\[.*\] +//" \ -e '/^[ ]*$$/d' \ -e "s@.*@ $$posrcprefix& \\\\@" < $(srcdir)/$@.in \ | sed -e '$$s/\\$$//') > $@-t \ && chmod a-w $@-t \ && mv $@-t $@ ) Makefile: Makefile.in.in ../config.status POTFILES cd .. \ && $(SHELL) ./config.status $(subdir)/$@.in # Tell versions [3.59,3.63) of GNU make not to export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libinfinity-0.5.5/po/POTFILES.in0000644000175000017500000000250011335077516013162 00000000000000infinoted/infinoted-autosave.c infinoted/infinoted-dh-params.c infinoted/infinoted-directory-sync.c infinoted/infinoted-main.c infinoted/infinoted-note-plugin.c infinoted/infinoted-options.c infinoted/infinoted-record.c infinoted/infinoted-run.c infinoted/infinoted-signal.c infinoted/infinoted-startup.c infinoted/infinoted-util.c libinfgtk/inf-gtk-browser-store.c libinfgtk/inf-gtk-browser-view.c libinfgtk/inf-gtk-certificate-dialog.c libinfgtk/inf-gtk-certificate-manager.c libinfgtk/inf-gtk-certificate-view.c libinfgtk/inf-gtk-chat.c libinfinity/adopted/inf-adopted-concurrency-warning.c libinfinity/adopted/inf-adopted-session.c libinfinity/adopted/inf-adopted-session-record.c libinfinity/adopted/inf-adopted-state-vector.c libinfinity/client/infc-browser.c libinfinity/client/infc-request-manager.c libinfinity/client/infc-session-proxy.c libinfinity/common/inf-chat-session.c libinfinity/common/inf-discovery-avahi.c libinfinity/common/inf-error.c libinfinity/common/inf-protocol.c libinfinity/common/inf-session.c libinfinity/common/inf-tcp-connection.c libinfinity/common/inf-user.c libinfinity/common/inf-xml-util.c libinfinity/common/inf-xmpp-connection.c libinfinity/inf-i18n.h libinfinity/server/infd-directory.c libinfinity/server/infd-filesystem-storage.c libinfinity/server/infd-session-proxy.c libinftext/inf-text-session.c libinfinity-0.5.5/po/de.po0000644000175000017500000011732112041011626012326 00000000000000# German translation for libinfinity # Copyright (c) 2009 Rosetta Contributors and Canonical Ltd 2009 # This file is distributed under the same license as the libinfinity package. # FIRST AUTHOR , 2009. # msgid "" msgstr "" "Project-Id-Version: libinfinity\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2009-12-19 23:05+0100\n" "PO-Revision-Date: 2009-11-28 11:36+0000\n" "Last-Translator: Armin Burgmeier \n" "Language-Team: German \n" "Language: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Launchpad-Export-Date: 2009-12-19 18:32+0000\n" "X-Generator: Launchpad (build Unknown)\n" #: infinoted/infinoted-autosave.c:154 #, c-format msgid "" "Failed to auto-save session \"%s\": %s\n" "\n" "Will retry in %u seconds." msgstr "" "Die Sitzung »%s« konnte nicht automatisch gespeichert werden: %s\n" "\n" "In %u Sekunden wird ein erneuter Versuch unternommen." #: infinoted/infinoted-dh-params.c:75 msgid "Generating 2048 bit Diffie-Hellman parameters..." msgstr "Erzeuge 2048-bit Diffie-Hellman-Parameter…" #: infinoted/infinoted-directory-sync.c:167 #, c-format msgid "" "Failed to create directory for path \"%s\": %s\n" "\n" msgstr "" #: infinoted/infinoted-directory-sync.c:186 #, c-format msgid "" "Failed to write session for path \"%s\": %s\n" "\n" "Will retry in %u seconds." msgstr "" #: infinoted/infinoted-directory-sync.c:245 #, c-format msgid "Node \"%s\" contains invalid characters" msgstr "" #: infinoted/infinoted-directory-sync.c:347 #: infinoted/infinoted-directory-sync.c:413 #, c-format msgid "Failed to synchronize session \"%s\" to disk: %s" msgstr "" #. Translators: fork as in "fork into the background" #: infinoted/infinoted-main.c:72 msgid "Failed to fork" msgstr "" #: infinoted/infinoted-main.c:88 msgid "Failed to wait for daemonized child's return value" msgstr "" #: infinoted/infinoted-main.c:97 infinoted/infinoted-main.c:115 #: infinoted/infinoted-util.c:257 msgid "Failed to create PID file" msgstr "" #: infinoted/infinoted-note-plugin.c:137 #, c-format msgid "" "Failed to load plugin \"%s\": Note type \"%s\" is already handled by another " "plugin" msgstr "" #: infinoted/infinoted-note-plugin.c:148 #, c-format msgid "Failed to load plugin \"%s\": Storage type \"%s\" does not match" msgstr "" #: infinoted/infinoted-note-plugin.c:157 #, c-format msgid "Loaded plugin \"%s\" (%s)" msgstr "Erweiterung »%s« (%s) geladen" #: infinoted/infinoted-note-plugin.c:177 #, c-format msgid "Path \"%s\" does not contain any note plugins" msgstr "" #: infinoted/infinoted-options.c:91 #, c-format msgid "" "\"%s\" is not a valid security policy. Allowed values are \"no-tls\", " "\"allow-tls\" or \"require-tls\"" msgstr "" "»%s« ist keine gültige Sicherheitsrichtlinie. Mögliche Werte sind »no-tls«, " "»allow-tls« oder »require-tls«" #: infinoted/infinoted-options.c:121 msgid "Interval must not be negative" msgstr "" #: infinoted/infinoted-options.c:142 #, c-format msgid "\"%d\" is not a valid port number. Port numbers range from 1 to 65535" msgstr "" "»%d« ist keine gültige Portnummer. Gültige Portnummern liegen zwischen 1 und " "65535" #: infinoted/infinoted-options.c:407 msgid "Requiring password through unencrypted connection." msgstr "" #: infinoted/infinoted-options.c:418 msgid "" "Creating a new private key also requires creating a new certificate signed " "with it." msgstr "" "Einen neuen privaten Schlüssel zu erstellen erfordert auch ein zugehöriges " "Zertifikat zu erstellen das damit signiert ist." #: infinoted/infinoted-options.c:432 msgid "" "No private key file given. If you don't have a suitable key file, either " "create one using the --create-key command line argument, or disable TLS by " "setting the security policy to \"no-tls\"." msgstr "" "Es wurde keine private Schlüsseldatei angegeben. Wenn keine passende Datei " "vorliegt können Sie entweder eine mit dem Kommandozeilen-Argument --create-" "key erstellen oder TLS durch Setzen der Sicherheitsrichtlinie auf »no-tls« " "deaktivieren." #: infinoted/infinoted-options.c:447 msgid "" "No certificate file given. If you don't have a suitable certificate file, " "either create one using the --create-certificate command line agument, or " "disable TLS via by setting the security policy to \"no-tls\"." msgstr "" "Keine Zertifikatsdatei angegeben. Wenn keine passende Datei vorliegt können " "Sie entweder eine mit dem Kommandozeilen-Argument --create-certificate " "erstellen oder TLS durch Setzen der Sicherheitsrichtlinie auf »no-tls« " "deaktivieren." #: infinoted/infinoted-options.c:462 msgid "" "A synchronization directory is given, but synchronization interval is not " "set. Please either set a nonzero synchronization interval or unset the " "synchronization directory using the --sync-directory and sync-interval " "command line or config file options." msgstr "" #: infinoted/infinoted-options.c:477 msgid "" "A synchronization interval is given, but the synchronization directory is " "not set. Please either set a valid synchronization directory, or set the " "synchronization interval to zero using --sync-directory and sync-interval " "command line or config file options." msgstr "" #: infinoted/infinoted-options.c:517 msgid "The server's private key" msgstr "Die private Schlüsseldatei des Servers" #: infinoted/infinoted-options.c:517 msgid "KEY-FILE" msgstr "SCHLÜSSELDATEI" #: infinoted/infinoted-options.c:520 msgid "The server's certificate" msgstr "Das Zertifikat des Servers" #: infinoted/infinoted-options.c:520 msgid "CERTIFICATE-FILE" msgstr "ZERTIFIKATSDATEI" #: infinoted/infinoted-options.c:523 msgid "The certificates chain down to the root certificate" msgstr "" #: infinoted/infinoted-options.c:526 msgid "Creates a new random private key" msgstr "Erstellt einen neuen zufälligen privaten Schlüssel" #: infinoted/infinoted-options.c:529 msgid "Creates a new self-signed certificate using the given key" msgstr "" "Erstellt ein neues selbstsigniertes Zertifikat mit Hilfe des angegeben " "Schlüssels" #: infinoted/infinoted-options.c:532 msgid "The port number to listen on" msgstr "" #: infinoted/infinoted-options.c:532 msgid "PORT" msgstr "PORT" #: infinoted/infinoted-options.c:535 msgid "How to decide whether to use TLS" msgstr "" #: infinoted/infinoted-options.c:538 msgid "The directory to store documents into" msgstr "Das Verzeichnis in dem die Dokumente gespeichert werden sollen" #: infinoted/infinoted-options.c:538 infinoted/infinoted-options.c:549 msgid "DIRECTORY" msgstr "VERZEICHNIS" #: infinoted/infinoted-options.c:541 msgid "" "Interval within which to save documents, in seconds, or 0 to disable autosave" msgstr "" "Zeitabstand in Sekunden in dem Dokumente automatisch gespeichert werden, " "oder 0 um automatische Speicherung abzuschalten" #: infinoted/infinoted-options.c:542 infinoted/infinoted-options.c:554 msgid "INTERVAL" msgstr "INTERVALL" #: infinoted/infinoted-options.c:545 msgid "Require given password on connections" msgstr "" #: infinoted/infinoted-options.c:545 msgid "PASSWORD" msgstr "" #: infinoted/infinoted-options.c:548 msgid "" "A directory into which to periodically store a copy of the document tree" msgstr "" #: infinoted/infinoted-options.c:552 msgid "" "Interval within which to store documents to the specified sync-directory, or " "0 to disable directory synchronization" msgstr "" #: infinoted/infinoted-options.c:558 msgid "Daemonize the server" msgstr "" #: infinoted/infinoted-options.c:561 msgid "Kill a running daemon" msgstr "" #: infinoted/infinoted-options.c:565 msgid "Display version information and exit" msgstr "" #: infinoted/infinoted-options.c:615 msgid "infinote dedicated server" msgstr "" #: infinoted/infinoted-options.c:648 msgid "Could not kill daemon" msgstr "" #: infinoted/infinoted-record.c:45 #, c-format msgid "Error while writing record for session \"%s\" into \"%s\": %s" msgstr "Fehler beim Speichern der Aufnahme für die Sitzung »%s« nach »%s«: %s" #: infinoted/infinoted-record.c:86 #, c-format msgid "" "Could not create record file for session \"%s\": Could not generate unused " "record file in directory \"%s\"" msgstr "" "Die Aufnahmedatei für die Sitzung »%s« konnte nicht erstellt werden, da " "keine unbenutzte Aufnahmedatei im Verzeichnis »%s« erzeugt werden konnte" #: infinoted/infinoted-record.c:98 #, c-format msgid "Could not create record file directory \"%s\": %s" msgstr "" "Das Verzeichnis für die Aufnahmedateien »%s« konnte nicht erstellt werden: %s" #: infinoted/infinoted-run.c:338 #, c-format msgid "Failed to generate Diffie-Hellman parameters: %s" msgstr "" #: infinoted/infinoted-run.c:353 #, c-format msgid "IPv6 Server running on port %u" msgstr "Der IPv6-Server läuft auf dem Port %u" #: infinoted/infinoted-run.c:358 #, c-format msgid "Failed to start IPv6 server: %s" msgstr "" #: infinoted/infinoted-run.c:377 #, c-format msgid "IPv4 Server running on port %u" msgstr "Der IPv4-Server läuft auf dem Port %u" #: infinoted/infinoted-run.c:382 #, c-format msgid "Failed to start IPv4 server: %s" msgstr "" #: infinoted/infinoted-signal.c:54 msgid "" "Error on signal handler connection; signal handlers have been removed from " "now on" msgstr "" #: infinoted/infinoted-signal.c:70 #, c-format msgid "Config reload failed: %s" msgstr "" #: infinoted/infinoted-signal.c:76 msgid "Config reloaded" msgstr "" #. We don't reload the config file here since the signal handler could be #. * called from anywhere in the code. #: infinoted/infinoted-signal.c:129 msgid "" "For config reloading to work libinfinity needs to be compiled with libdaemon " "support" msgstr "" #. TODO: Open the key file beforehand #: infinoted/infinoted-startup.c:57 msgid "Generating 2048 bit RSA private key..." msgstr "Erzeuge einen 2048-bit starken privaten RSA-Schlüssel…" #: infinoted/infinoted-startup.c:95 msgid "Generating self-signed certificate..." msgstr "Erzeuge ein selbstsigniertes Zertifikat…" #: infinoted/infinoted-util.c:127 #, c-format msgid "Could not create directory \"%s\": %s" msgstr "Das Verzeichnis »%s« konnte nicht erstellt werden: %s" #: libinfgtk/inf-gtk-browser-store.c:625 msgid "Disconnected" msgstr "Verbindung getrennt" #: libinfgtk/inf-gtk-browser-view.c:2074 msgid "Exploring..." msgstr "Erkunde…" #: libinfgtk/inf-gtk-browser-view.c:2108 msgid "Synchronizing..." msgstr "Synchronisiere…" #: libinfgtk/inf-gtk-browser-view.c:2181 msgid "Not connected" msgstr "Nicht verbunden" #: libinfgtk/inf-gtk-browser-view.c:2192 msgid "Connecting..." msgstr "Verbindung wird hergestellt ..." #: libinfgtk/inf-gtk-browser-view.c:2202 msgid "Connected" msgstr "Verbunden" #: libinfgtk/inf-gtk-certificate-dialog.c:87 #, c-format msgid "The connection to host \"%s\" is not considered secure" msgstr "Die Verbindung zu »%s« wird als unsicher eingestuft" #: libinfgtk/inf-gtk-certificate-dialog.c:116 msgid "The certificate of the host has changed!" msgstr "Das SZertifikats des Servers hat sich geändert!" #: libinfgtk/inf-gtk-certificate-dialog.c:128 msgid "The previous certificate of the server has expired." msgstr "Das vorherige Zertifikat des Servers ist abgelaufen." #: libinfgtk/inf-gtk-certificate-dialog.c:138 msgid "" "It is possible that the connection to the server is being hijacked. It is " "also possible that the host just has got a new certificate. However, please " "only continue the connection if you expected this warning." msgstr "" "Es ist möglich dass die Verbindung zum Server abgehört oder manipuliert " "wird. Es kann aber auch sein dass der Server einfach ein neues Zertifikat " "installiert hat. Fahren Sie in jedem Fall bitte nur fort wenn Sie diese " "Warnung erwartet haben." #: libinfgtk/inf-gtk-certificate-dialog.c:154 msgid "The certificate issuer is not trusted." msgstr "Dem Aussteller des Zertifikats wird nicht vertraut." #: libinfgtk/inf-gtk-certificate-dialog.c:160 msgid "The certificate is self-signed." msgstr "Das Zertifikat ist selbstsigniert." #: libinfgtk/inf-gtk-certificate-dialog.c:170 msgid "The certificate is invalid!" msgstr "Das Zertifikat ist ungültig!" #: libinfgtk/inf-gtk-certificate-dialog.c:186 #, c-format msgid "" "The hostname of the server, \"%s\", does not match the hostname the " "certificate is issued to, \"%s\"." msgstr "" "Der Name des Servers, »%s«, passt nicht zu dem Namen »%s« auf den das " "Zertifikat ausgestellt ist." #: libinfgtk/inf-gtk-certificate-dialog.c:205 #, c-format msgid "The certificate has expired. The expiration date was %s" msgstr "Das Zertifikat ist abgelaufen. Das Ablaufdatum war %s" #: libinfgtk/inf-gtk-certificate-dialog.c:222 #, c-format msgid "The certificate has not yet been activated. Activation date is %s" msgstr "" "Das Zertifikat wurde noch nicht aktiviert. Das Aktivierungsdatum ist %s" #: libinfgtk/inf-gtk-certificate-dialog.c:388 msgid "" msgstr "" #: libinfgtk/inf-gtk-certificate-dialog.c:443 msgid "Certificate Chain" msgstr "Zertifikatskette" #: libinfgtk/inf-gtk-certificate-dialog.c:553 msgid "_View Certificate" msgstr "_Zertifikat anzeigen" #: libinfgtk/inf-gtk-certificate-dialog.c:590 msgid "Connection not secure" msgstr "Unsichere Verbindung" #: libinfgtk/inf-gtk-certificate-manager.c:284 #: libinfgtk/inf-gtk-certificate-manager.c:301 #, c-format msgid "Failed to save known hosts file: %s\n" msgstr "" #: libinfgtk/inf-gtk-certificate-manager.c:361 #, c-format msgid "Could not load trust file: %s" msgstr "" #: libinfgtk/inf-gtk-certificate-manager.c:391 #, c-format msgid "Could not load known hosts file: %s" msgstr "" #: libinfgtk/inf-gtk-certificate-manager.c:434 #, c-format msgid "Could not verify certificate: %s" msgstr "" #: libinfgtk/inf-gtk-certificate-manager.c:552 msgid "_Cancel connection" msgstr "Verbindung abbre_chen" #: libinfgtk/inf-gtk-certificate-manager.c:563 msgid "C_ontinue connection" msgstr "Verbindung f_ortsetzen" #: libinfgtk/inf-gtk-certificate-manager.c:572 #, c-format msgid "Do you want to continue the connection to host %s?" msgstr "Wollen Sie die Verbindung zu %s fortsetzen?" #: libinfgtk/inf-gtk-certificate-manager.c:590 #, c-format msgid "Trust the certificate of host %s in the future" msgstr "" #: libinfgtk/inf-gtk-certificate-view.c:73 msgid "" msgstr "" #: libinfgtk/inf-gtk-certificate-view.c:221 msgid "Issued To" msgstr "Ausgestellt an" #: libinfgtk/inf-gtk-certificate-view.c:222 #: libinfgtk/inf-gtk-certificate-view.c:233 msgid "Common Name:" msgstr "Common-Name:" #: libinfgtk/inf-gtk-certificate-view.c:223 #: libinfgtk/inf-gtk-certificate-view.c:234 msgid "Organization:" msgstr "Organisation:" #: libinfgtk/inf-gtk-certificate-view.c:224 #: libinfgtk/inf-gtk-certificate-view.c:235 msgid "Organizational Unit:" msgstr "Organisationseinheit:" #: libinfgtk/inf-gtk-certificate-view.c:225 msgid "Serial Number:" msgstr "Seriennummer:" #: libinfgtk/inf-gtk-certificate-view.c:232 msgid "Issued By" msgstr "Ausgestellt von" #: libinfgtk/inf-gtk-certificate-view.c:242 msgid "Validity" msgstr "Gültigkeit" #: libinfgtk/inf-gtk-certificate-view.c:243 msgid "Issued On:" msgstr "Ausgestellt am:" #: libinfgtk/inf-gtk-certificate-view.c:244 msgid "Expires On:" msgstr "Läuft aus:" #: libinfgtk/inf-gtk-certificate-view.c:251 msgid "Fingerprints" msgstr "Fingerabdrücke" #: libinfgtk/inf-gtk-certificate-view.c:252 msgid "SHA1 Fingerprint:" msgstr "SHA1-Fingerabdruck:" #: libinfgtk/inf-gtk-certificate-view.c:253 msgid "MD5 Fingerprint:" msgstr "MD5-Fingerabdruck:" #: libinfgtk/inf-gtk-certificate-view.c:271 msgid "General" msgstr "Allgemeines" #: libinfgtk/inf-gtk-chat.c:199 #, c-format msgid "%s has joined" msgstr "%s ist beigetreten" #: libinfgtk/inf-gtk-chat.c:206 #, c-format msgid "%s has left" msgstr "%s ist gegangen" #: libinfgtk/inf-gtk-chat.c:759 msgid "Send" msgstr "" #: libinfinity/adopted/inf-adopted-concurrency-warning.c:29 #, c-format msgid "" "%s was called for %s. This means that you hit an unforseen situation in " "libinfinity. The session could become inconsistent because of this. If you " "were using Gobby, please notify me (Armin Burgmeier, armin@arbur.net) about " "this, and attach the contents of the ~/.infinote-records folder, or just the " "record of the session that triggered this error if you know which one. I " "hope I can fix this problem with that information in future versions." msgstr "" #: libinfinity/adopted/inf-adopted-session.c:148 #, c-format msgid "Request has index '%u', but index '%u' was expected" msgstr "" #: libinfinity/adopted/inf-adopted-session.c:170 msgid "Undo received, but no previous request found" msgstr "" #: libinfinity/adopted/inf-adopted-session.c:187 msgid "Redo received, but no previous request found" msgstr "" #: libinfinity/adopted/inf-adopted-session.c:228 #, c-format msgid "No such user with user ID '%u'" msgstr "" #: libinfinity/adopted/inf-adopted-session.c:975 #: libinfinity/common/inf-chat-session.c:463 #: libinfinity/common/inf-session.c:796 libinftext/inf-text-session.c:1030 msgid "User did not join from this connection" msgstr "" #: libinfinity/adopted/inf-adopted-session.c:1164 msgid "'time' attribute in user message is missing" msgstr "" #: libinfinity/adopted/inf-adopted-session.c:1555 msgid "Operation for request missing" msgstr "" #. Error writing record `': #: libinfinity/adopted/inf-adopted-session-record.c:92 #, c-format msgid "Error writing record `%s': %s" msgstr "" #: libinfinity/adopted/inf-adopted-state-vector.c:746 msgid "Expected ':' after ID" msgstr "" #: libinfinity/adopted/inf-adopted-state-vector.c:760 #, c-format msgid "ID '%u' already occured before" msgstr "" #: libinfinity/adopted/inf-adopted-state-vector.c:777 #, c-format msgid "Expected ';' or end of string after component of ID '%u'" msgstr "" #: libinfinity/client/infc-browser.c:665 msgid "The node to subscribe to has been removed" msgstr "" #: libinfinity/client/infc-browser.c:691 libinfinity/client/infc-browser.c:718 msgid "" "The subdirectory into which the new node should have been created has been " "removed" msgstr "" #: libinfinity/client/infc-browser.c:829 msgid "" "The server did not send an initial welcome message. This means that the " "server is running a lower version of the software which is incompatible to " "the client. Consider downgrading the client, or ask the server maintainers " "to upgrade their software." msgstr "" #: libinfinity/client/infc-browser.c:1059 #, c-format msgid "" "This session requires communication method `%s' which is not installed for " "network `%s'" msgstr "" #: libinfinity/client/infc-browser.c:1923 #, c-format msgid "" "The request contains a sequence number refering to a request of type '%s', " "but a request of either 'explore' or 'add-node' was expected." msgstr "" #: libinfinity/client/infc-browser.c:2137 msgid "" "The server uses an older version of the protocol which is no longer " "supported by this client. Consider using an earlier version of it, or ask " "the server maintainers to upgrade their software." msgstr "" #: libinfinity/client/infc-browser.c:2151 msgid "The server uses a newer version. Consider upgrading your client." msgstr "" #: libinfinity/client/infc-browser.c:2221 msgid "Node to explore does no longer exist" msgstr "" #: libinfinity/client/infc-browser.c:2233 msgid "Node to explore is not a subdirectory" msgstr "" #: libinfinity/client/infc-browser.c:2245 msgid "Node to explore is already explored" msgstr "" #: libinfinity/client/infc-browser.c:2323 #: libinfinity/client/infc-browser.c:2522 #, c-format msgid "Node with ID \"%u\" exists already" msgstr "" #: libinfinity/client/infc-browser.c:2401 msgid "Explored nodes cannot be initially be subscribed to" msgstr "" #: libinfinity/client/infc-browser.c:2416 #, c-format msgid "Note type \"%s\" not known" msgstr "" #: libinfinity/client/infc-browser.c:2567 msgid "Received sync-in without having requested one" msgstr "" #: libinfinity/client/infc-browser.c:2589 #, c-format msgid "Expected note type \"%s\" for sync-in, but received \"%s\"" msgstr "" #: libinfinity/client/infc-browser.c:2724 #, c-format msgid "Note type '%s' is not supported" msgstr "" #: libinfinity/client/infc-browser.c:2739 msgid "Already subscribed to this session" msgstr "" #: libinfinity/client/infc-browser.c:2804 msgid "Already subscribed to the chat session" msgstr "" #: libinfinity/client/infc-browser.c:2990 #: libinfinity/client/infc-session-proxy.c:474 #, c-format msgid "Error comes from unknown error domain '%s' (code %u)" msgstr "" #: libinfinity/client/infc-browser.c:3166 #: libinfinity/client/infc-session-proxy.c:926 #, c-format msgid "Server reply could not be processed: %s" msgstr "" #: libinfinity/client/infc-request-manager.c:102 msgid "Sequence identifier causes overflow" msgstr "" #: libinfinity/client/infc-request-manager.c:115 msgid "Sequence components are not separated by '/'" msgstr "" #: libinfinity/client/infc-request-manager.c:130 msgid "Sequence number causes overflow" msgstr "" #: libinfinity/client/infc-request-manager.c:143 msgid "Trailing characters after sequence number" msgstr "" #: libinfinity/client/infc-request-manager.c:679 msgid "The request contains an unknown sequence number" msgstr "" #: libinfinity/client/infc-request-manager.c:691 #, c-format msgid "" "The request contains a sequence number refering to a request of type '%s', " "but a request of type '%s' was expected" msgstr "" #: libinfinity/client/infc-request-manager.c:744 msgid "The request does not contain a sequence number, but one is required" msgstr "" #: libinfinity/client/infc-session-proxy.c:603 msgid "Request does not contain required attribute 'id'" msgstr "" #: libinfinity/client/infc-session-proxy.c:621 #: libinfinity/common/inf-session.c:781 #, c-format msgid "No such user with ID %u" msgstr "" #: libinfinity/common/inf-chat-session.c:89 msgid "An invalid message type was sent" msgstr "" #: libinfinity/common/inf-chat-session.c:91 msgid "A user with the requested ID does not exist" msgstr "" #: libinfinity/common/inf-chat-session.c:93 msgid "An unknown chat session error has occured" msgstr "" #: libinfinity/common/inf-chat-session.c:95 libinfinity/common/inf-error.c:79 #: libinfinity/common/inf-error.c:126 libinfinity/common/inf-session.c:202 msgid "An error with unknown error code occured" msgstr "" #: libinfinity/common/inf-chat-session.c:264 #, c-format msgid "No such user with ID \"%u\"" msgstr "" #: libinfinity/common/inf-chat-session.c:354 #, c-format msgid "%s --- %s has joined\n" msgstr "" #: libinfinity/common/inf-chat-session.c:357 #, c-format msgid "%s --- %s has left\n" msgstr "" #: libinfinity/common/inf-chat-session.c:415 #, c-format msgid "%s --- %u users total\n" msgstr "" #: libinfinity/common/inf-chat-session.c:1282 #, c-format msgid "%s --- Log closed\n" msgstr "" #: libinfinity/common/inf-chat-session.c:1296 #, c-format msgid "%s --- Log opened\n" msgstr "" #: libinfinity/common/inf-discovery-avahi.c:526 #, c-format msgid "" "Avahi service browser is in failure state. Services of type '%s' are no " "longer discovered.\n" "\n" "The failure was: %s\n" msgstr "" #: libinfinity/common/inf-discovery-avahi.c:594 #, c-format msgid "" "Avahi entry group is in failure state. The service '%s' of type '%s' is no " "longer published.\n" "\n" "The failure was: %s\n" msgstr "" #: libinfinity/common/inf-discovery-avahi.c:804 #, c-format msgid "" "Failed to start Avahi client. Service discovery or publishing will not be " "possible.\n" "\n" "The occurred failure was: %s" msgstr "" #: libinfinity/common/inf-discovery-avahi.c:847 #, c-format msgid "" "Avahi client is in failure state. Service discovery or publishing is no " "longer possible.\n" "\n" "The occured failure was: %s\n" msgstr "" #. Translators: This is " (via on #. *
)", for example "ck (via eth0 on IPv4)". #: libinfinity/common/inf-discovery-avahi.c:1431 #, c-format msgid "%s (via %s on IPv4)" msgstr "" #: libinfinity/common/inf-discovery-avahi.c:1432 #, c-format msgid "%s (via %s on IPv6)" msgstr "" #: libinfinity/common/inf-error.c:67 msgid "Received error from an unknown domain" msgstr "" #: libinfinity/common/inf-error.c:69 msgid "Failed to process server reply" msgstr "" #: libinfinity/common/inf-error.c:71 msgid "Server reply contains invalid sequence number" msgstr "" #: libinfinity/common/inf-error.c:73 msgid "A required attribute was not set in request" msgstr "" #: libinfinity/common/inf-error.c:75 msgid "An attribute contained an invalid number" msgstr "" #: libinfinity/common/inf-error.c:77 msgid "An unknown request error occured" msgstr "" #: libinfinity/common/inf-error.c:112 msgid "Name is already in use" msgstr "" #: libinfinity/common/inf-error.c:114 msgid "'id' attribute provided in request" msgstr "" #: libinfinity/common/inf-error.c:116 msgid "There is no user with the given ID" msgstr "" #: libinfinity/common/inf-error.c:118 msgid "'status' attribute is 'unavailable' in join or rejoin request" msgstr "" #: libinfinity/common/inf-error.c:120 msgid "User did not join via this connection" msgstr "" #: libinfinity/common/inf-error.c:122 msgid "'status' attribute has invalid value" msgstr "" #: libinfinity/common/inf-error.c:124 msgid "An unknown user error occured" msgstr "" #: libinfinity/common/inf-error.c:159 msgid "Server did not send an initial welcome message" msgstr "" #: libinfinity/common/inf-error.c:161 msgid "The server and client use different protocol versions" msgstr "" #: libinfinity/common/inf-error.c:163 msgid "A node with this name exists already" msgstr "" #: libinfinity/common/inf-error.c:165 msgid "Invalid node name" msgstr "" #: libinfinity/common/inf-error.c:167 msgid "Node does not exist" msgstr "" #: libinfinity/common/inf-error.c:169 msgid "No previous subscription request present" msgstr "" #: libinfinity/common/inf-error.c:171 msgid "The chat is disabled on the server side" msgstr "" #: libinfinity/common/inf-error.c:173 msgid "Node is not a subdirectory" msgstr "" #: libinfinity/common/inf-error.c:175 msgid "Node is not a note" msgstr "" #: libinfinity/common/inf-error.c:177 libinfinity/server/infd-directory.c:2739 msgid "The root node cannot be removed" msgstr "" #: libinfinity/common/inf-error.c:179 msgid "Subdirectory has already been explored" msgstr "" #: libinfinity/common/inf-error.c:181 msgid "Note type is not supported" msgstr "" #: libinfinity/common/inf-error.c:183 msgid "Connection is already subscribed to this session" msgstr "" #: libinfinity/common/inf-error.c:185 libinfinity/server/infd-directory.c:2870 msgid "The requesting connection is not subscribed to the session" msgstr "" #: libinfinity/common/inf-error.c:187 msgid "Server sent more explored nodes then announced" msgstr "" #: libinfinity/common/inf-error.c:189 msgid "Server sent not as much explored nodes as announced" msgstr "" #: libinfinity/common/inf-error.c:191 msgid "" "The session does not support the network through which the connection " "attempt is being made." msgstr "" #: libinfinity/common/inf-error.c:194 msgid "The session uses an unsupported communication method" msgstr "" #: libinfinity/common/inf-error.c:196 msgid "Received sync-in message without having requested a sync-in" msgstr "" #: libinfinity/common/inf-error.c:198 msgid "Unexpected XML message" msgstr "" #: libinfinity/common/inf-error.c:200 msgid "An unknown directory error has occured" msgstr "" #: libinfinity/common/inf-error.c:202 msgid "An error with unknown code has occured" msgstr "" #: libinfinity/common/inf-protocol.c:86 msgid "Major part of version number causes overflow" msgstr "" #: libinfinity/common/inf-protocol.c:99 msgid "Version number parts are not separated by '.'" msgstr "" #: libinfinity/common/inf-protocol.c:114 msgid "Minor part of version number causes overflow" msgstr "" #: libinfinity/common/inf-protocol.c:127 msgid "Trailing characters after version number" msgstr "" #: libinfinity/common/inf-session.c:167 msgid "Unexpectedly got an XML message in presync" msgstr "" #: libinfinity/common/inf-session.c:169 msgid "Got unexpected XML node during synchronization" msgstr "" #: libinfinity/common/inf-session.c:171 msgid "'id' attribute in user message is missing" msgstr "" #: libinfinity/common/inf-session.c:173 msgid "User ID is already in use" msgstr "" #: libinfinity/common/inf-session.c:175 msgid "'name' attribute in user message is missing" msgstr "" #: libinfinity/common/inf-session.c:177 msgid "User Name is already in use" msgstr "" #: libinfinity/common/inf-session.c:179 msgid "The connection was closed unexpectedly" msgstr "" #: libinfinity/common/inf-session.c:181 msgid "The sender cancelled the synchronization" msgstr "" #: libinfinity/common/inf-session.c:183 msgid "The receiver cancelled the synchronization" msgstr "" #: libinfinity/common/inf-session.c:185 msgid "Got begin-of-sync message, but synchronization is already in progress" msgstr "" #: libinfinity/common/inf-session.c:188 msgid "begin-of-sync message does not contain the number of messages to expect" msgstr "" #: libinfinity/common/inf-session.c:191 msgid "Got end-of-sync message, but synchronization is still in progress" msgstr "" #: libinfinity/common/inf-session.c:194 msgid "Expected begin-of-sync message as first message during synchronization" msgstr "" #: libinfinity/common/inf-session.c:197 msgid "Expected end-of-sync message as last message during synchronization" msgstr "" #: libinfinity/common/inf-session.c:200 msgid "An unknown synchronization error has occured" msgstr "" #. TODO: Add a possibilty for sub classes to register their error domains #. * that can occur in process_xml_sync. Maybe via a translate_error_sync #. * vfunc. #: libinfinity/common/inf-session.c:216 msgid "An error with unknown error domain occured" msgstr "" #: libinfinity/common/inf-session.c:952 #, c-format msgid "Received unhandled XML message '%s'" msgstr "" #: libinfinity/common/inf-session.c:1493 #, c-format msgid "Unexpectedly received XML message \"%s\" in presync" msgstr "" #: libinfinity/common/inf-session.c:1599 #, c-format msgid "Received unexpected XML message \"%s\" while synchronizing" msgstr "" #: libinfinity/common/inf-tcp-connection.c:578 #, c-format msgid "Interface `%s' does not exist" msgstr "" #. Failed to get name for device : #: libinfinity/common/inf-tcp-connection.c:653 #, c-format msgid "Failed to get name for device %u: %s" msgstr "" #: libinfinity/common/inf-user.c:544 #, c-format msgid "Invalid user status: '%s'" msgstr "" #: libinfinity/common/inf-xml-util.c:60 libinfinity/common/inf-xml-util.c:117 #: libinfinity/common/inf-xml-util.c:236 #, c-format msgid "Attribute '%s' does not contain a valid number" msgstr "" #: libinfinity/common/inf-xml-util.c:72 libinfinity/common/inf-xml-util.c:129 #: libinfinity/common/inf-xml-util.c:160 libinfinity/common/inf-xml-util.c:204 #: libinfinity/common/inf-xml-util.c:249 #, c-format msgid "Attribute '%s' causes overflow (%s)" msgstr "" #: libinfinity/common/inf-xml-util.c:85 libinfinity/common/inf-xml-util.c:173 #: libinfinity/common/inf-xml-util.c:262 #, c-format msgid "Attribute '%s' causes underflow (%s)" msgstr "" #: libinfinity/common/inf-xml-util.c:452 #, c-format msgid "Request '%s' does not contain required attribute '%s'" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:328 msgid "The entity has sent XML that cannot be processed" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:330 msgid "" "The entity has sent a namespace prefix that is unsupported, or has sent no " "namespace prefix on an element that requires such a prefix" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:334 msgid "" "The server is closing the active stream for this entity because a new stream " "has been initiated that conflicts with the existing stream" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:338 msgid "" "The entity has not generated any traffic over the stream for some period of " "time" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:341 msgid "" "The value of the 'to' attribute provided by the initiating entity in the " "stream header corresponds to a hostname that is no longer hosted by the " "server" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:345 msgid "" "The value of the 'to' attribute provided by the initiating entity in the " "stream header does not correspond to a hostname that is hosted by the server" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:349 msgid "A stanza sent between two servers lacks a 'to' or 'from'attribute" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:352 msgid "" "The server has experienced a misconfiguration or an otherwise-undefined " "internal error that prevents it from servicing the stream" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:356 msgid "" "The JID or hostname provided in a 'from' address does not match an " "authorized JID or validated domain negotiated between servers via SASL or " "dialback, or between a client and a server via authentication and resource " "binding" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:361 msgid "" "The stream ID or dialback ID is invalid or does not match an ID previously " "provided" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:364 msgid "" "The streams namespace is something other than \"http://etherx.jabber.org/" "streams\" or the dialback namespace name is something other than \"jabber:" "server:dialback\"" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:368 msgid "" "The entity has sent invalid XML over the stream to a server that performs " "validation" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:371 msgid "" "The entity has attempted to send data before the stream has been " "authenticated, or otherwise is not authorized to perform an action related " "to stream negotiation" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:375 msgid "The entity has violated some local service policy" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:377 msgid "" "The server is unable to property connect to a remote entity that is required " "for authentication or authorization" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:380 msgid "The server lacks the system resources necessary to service the stream" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:383 msgid "The entity has attempted to send restricted XML features" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:385 msgid "" "The server will not provide service to the initiating entity but is " "redirecting traffic to another host" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:388 msgid "The server is being shut down and all active streams are being closed" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:392 msgid "The error condition is not one of those defined by the other conditions" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:395 msgid "" "The initiating entity has encoded the stream in an encoding that is not " "supported by the server" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:398 msgid "" "The initiating entity has sent a first-level child of the stream that is not " "supported by the server." msgstr "" #: libinfinity/common/inf-xmpp-connection.c:401 msgid "" "The value of the 'version' attribute provided by the initiating entity in " "the stream header specifies a version of XMPP that is not supported by the " "server" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:405 msgid "The initiating entity has sent XML that is not well-formed" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:450 msgid "" "The receiving entity acknowledged an element sent by the initiating " "entity" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:453 msgid "" "The data provided by the initiating entity could not be processed because " "the Base64 encoding is incorrect" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:456 msgid "" "The authzid provided by the initiating entity is invalid, either because it " "is incorrectly formatted or because the initiating entity does not have " "permissions to authorize that ID" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:461 msgid "" "The initiating entity did not provide a mechanism or requested a mechanism " "that is not supported by the receiving entity" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:464 msgid "" "The mechanism requsted by the initiating entity is weaker than server policy " "permits for that initiating entity" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:467 msgid "" "The authentication failed because the initiating entity did not provide " "valid credentials" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:470 msgid "" "The authentication failed because of a temporary error condition within the " "receiving entity" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:473 msgid "An unknown authentication error has occured" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:1007 msgid "The server did not provide a certificate" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:1754 msgid "Stream is not yet secured with TLS" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:1797 msgid "Stream is not yet authorized" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:1845 msgid "The server does not support transport layer security (TLS)" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:1868 msgid "The server requires transport layer security (TLS)" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:1902 msgid "The server does not provide any authentication mechanism" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:1984 msgid "The server does not offer a suitable authentication mechanism" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:2026 msgid "The server cannot perform the TLS handshake" msgstr "" #. XML Warning from : #: libinfinity/common/inf-xmpp-connection.c:2436 #, c-format msgid "XML warning from %s: %s\n" msgstr "" #. The server sent something which is not XML #: libinfinity/common/inf-xmpp-connection.c:2475 msgid "Remote site is not an XMPP server" msgstr "" #: libinfinity/common/inf-xmpp-connection.c:3879 msgid "The server certificate is not trusted" msgstr "" #: libinfinity/server/infd-directory.c:358 #, c-format msgid "" "Failed to save note \"%s\": %s\n" "\n" "Keeping it in memory. Another save attempt will be made when the server is " "shut down." msgstr "" #: libinfinity/server/infd-directory.c:729 #, c-format msgid "" "Could not write session \"%s\" to storage: %s\n" "\n" "All changes since the document das been saved are lost." msgstr "" #: libinfinity/server/infd-directory.c:1322 #, c-format msgid "" "Session \"%s\" could not be saved: %s\n" "Another attempt will be made when the session is unused for a while or the " "server is shut down." msgstr "" #: libinfinity/server/infd-directory.c:2382 msgid "No subscription request for the server chat" msgstr "" #: libinfinity/server/infd-directory.c:2401 #, c-format msgid "No subscription request with ID %u" msgstr "" #: libinfinity/server/infd-directory.c:2956 msgid "The chat is disabled" msgstr "" #: libinfinity/server/infd-filesystem-storage.c:80 msgid "The path contains invalid components" msgstr "" #: libinfinity/server/infd-filesystem-storage.c:110 #, c-format msgid "Failed to convert root directory to filename encoding: %s" msgstr "" #: libinfinity/server/infd-filesystem-storage.c:122 #, c-format msgid "" "Failed to create root directory: %s\n" "Subsequent storage operations will most likely fail\n" msgstr "" #: libinfinity/server/infd-session-proxy.c:247 msgid "Request does not contain required attribute 'name'" msgstr "" #: libinfinity/server/infd-session-proxy.c:265 #, c-format msgid "Name '%s' already in use" msgstr "" #: libinfinity/server/infd-session-proxy.c:309 msgid "'status' attribute is 'unavailable' in user join request" msgstr "" #: libinftext/inf-text-session.c:1015 libinftext/inf-text-session.c:1160 #, c-format msgid "No such user with ID '%u'" msgstr "" #: libinftext/inf-text-session.c:1044 #, c-format msgid "Invalid hue value: '%g'" msgstr "" #: libinftext/inf-text-session.c:1365 msgid "'caret' attribute in user message is missing" msgstr "" libinfinity-0.5.5/AUTHORS0000644000175000017500000000114712264763732012051 00000000000000infinote ======== This program and associated libraries are licensed under the GNU Lesser General Public License (LGPL) version 2.1 or any later version. A copy of the license is included in the distribution. 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. Copyright (C) 2007, 2008 Armin Burgmeier Authors: * Armin Burgmeier Artists: * Benjamin Herr libinfinity-0.5.5/Makefile.in0000644000175000017500000007266412264766065013064 00000000000000# Makefile.in generated by automake 1.13.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @WITH_INFGTK_TRUE@am__append_1 = libinfgtk @WITH_INFGTK_TRUE@am__append_2 = libinfgtk-$(LIBINFINITY_API_VERSION).pc @WITH_INFTEXTGTK_TRUE@am__append_3 = libinftextgtk @WITH_INFTEXTGTK_TRUE@am__append_4 = libinftextgtk-$(LIBINFINITY_API_VERSION).pc @WITH_INFINOTED_TRUE@am__append_5 = infinoted subdir = . DIST_COMMON = INSTALL NEWS README AUTHORS ChangeLog \ $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/configure $(am__configure_deps) \ $(srcdir)/config.h.in mkinstalldirs \ $(srcdir)/libinfinity.pc.in $(srcdir)/libinftext.pc.in \ $(srcdir)/libinfgtk.pc.in $(srcdir)/libinftextgtk.pc.in \ COPYING TODO ar-lib compile config.guess config.sub depcomp \ install-sh missing ltmain.sh ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(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 = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = config.h $(top_builddir)/libinfinity/inf-config.h CONFIG_CLEAN_FILES = libinfinity-0.5.pc libinftext-0.5.pc \ libinfgtk-0.5.pc libinftextgtk-0.5.pc CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(pkgconfigdir)" DATA = $(pkgconfig_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ $(LISP)config.h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags CSCOPE = cscope DIST_SUBDIRS = libinfinity libinftext libinfgtk libinftextgtk \ infinoted pixmaps test docs po DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2 GZIP_ENV = --best DIST_TARGETS = dist-bzip2 dist-gzip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBINFINITY_API_VERSION = @LIBINFINITY_API_VERSION@ LIBINFINITY_LIBTOOL_VERSION = @LIBINFINITY_LIBTOOL_VERSION@ LIBINFINITY_VERSION = @LIBINFINITY_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ avahi_CFLAGS = @avahi_CFLAGS@ avahi_LIBS = @avahi_LIBS@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gtk_requirement = @gtk_requirement@ gtk_version = @gtk_version@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infgtk_CFLAGS = @infgtk_CFLAGS@ infgtk_LIBS = @infgtk_LIBS@ infinity_CFLAGS = @infinity_CFLAGS@ infinity_LIBS = @infinity_LIBS@ infinoted_CFLAGS = @infinoted_CFLAGS@ infinoted_LIBS = @infinoted_LIBS@ infodir = @infodir@ inftext_CFLAGS = @inftext_CFLAGS@ inftext_LIBS = @inftext_LIBS@ inftextgtk_CFLAGS = @inftextgtk_CFLAGS@ inftextgtk_LIBS = @inftextgtk_LIBS@ install_sh = @install_sh@ libdaemon_CFLAGS = @libdaemon_CFLAGS@ libdaemon_LIBS = @libdaemon_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = libinfinity libinftext $(am__append_1) $(am__append_3) \ $(am__append_5) pixmaps test docs po pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libinfinity-$(LIBINFINITY_API_VERSION).pc \ libinftext-$(LIBINFINITY_API_VERSION).pc $(am__append_2) \ $(am__append_4) DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @if test ! -f $@; then rm -f stamp-h1; else :; fi @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 libinfinity-0.5.pc: $(top_builddir)/config.status $(srcdir)/libinfinity.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ libinftext-0.5.pc: $(top_builddir)/config.status $(srcdir)/libinftext.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ libinfgtk-0.5.pc: $(top_builddir)/config.status $(srcdir)/libinfgtk.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ libinftextgtk-0.5.pc: $(top_builddir)/config.status $(srcdir)/libinftextgtk.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ done uninstall-pkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(DISTFILES) @case `sed 15q $(srcdir)/NEWS` in \ *"$(VERSION)"*) : ;; \ *) \ echo "NEWS not updated; not releasing" 1>&2; \ exit 1;; \ esac $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_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" \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(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__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile $(DATA) config.h installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(pkgconfigdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr \ distclean-libtool distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-pkgconfigDATA install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-pkgconfigDATA .MAKE: $(am__recursive_targets) all install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--refresh check check-am clean clean-cscope clean-generic \ clean-libtool cscope cscopelist-am ctags ctags-am dist \ dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \ dist-xz dist-zip distcheck distclean distclean-generic \ distclean-hdr distclean-libtool distclean-tags distcleancheck \ distdir distuninstallcheck dvi dvi-am html html-am info \ info-am install install-am install-data install-data-am \ install-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-info install-info-am \ install-man install-pdf install-pdf-am install-pkgconfigDATA \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-pkgconfigDATA # 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: libinfinity-0.5.5/gtk-doc.make0000644000175000017500000002277312264766060013175 00000000000000# -*- mode: makefile -*- #################################### # Everything below here is generic # #################################### if GTK_DOC_USE_LIBTOOL GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) GTKDOC_RUN = $(LIBTOOL) --mode=execute else GTKDOC_CC = $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) GTKDOC_LD = $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) GTKDOC_RUN = endif # We set GPATH here; this gives us semantics for GNU make # which are more like other make's VPATH, when it comes to # whether a source that is a target of one rule is then # searched for in VPATH/GPATH. # GPATH = $(srcdir) TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE) SETUP_FILES = \ $(content_files) \ $(DOC_MAIN_SGML_FILE) \ $(DOC_MODULE)-sections.txt \ $(DOC_MODULE)-overrides.txt EXTRA_DIST = \ $(HTML_IMAGES) \ $(SETUP_FILES) DOC_STAMPS=setup-build.stamp scan-build.stamp tmpl-build.stamp sgml-build.stamp \ html-build.stamp pdf-build.stamp \ tmpl.stamp sgml.stamp html.stamp pdf.stamp SCANOBJ_FILES = \ $(DOC_MODULE).args \ $(DOC_MODULE).hierarchy \ $(DOC_MODULE).interfaces \ $(DOC_MODULE).prerequisites \ $(DOC_MODULE).signals REPORT_FILES = \ $(DOC_MODULE)-undocumented.txt \ $(DOC_MODULE)-undeclared.txt \ $(DOC_MODULE)-unused.txt CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) if ENABLE_GTK_DOC if GTK_DOC_BUILD_HTML HTML_BUILD_STAMP=html-build.stamp else HTML_BUILD_STAMP= endif if GTK_DOC_BUILD_PDF PDF_BUILD_STAMP=pdf-build.stamp else PDF_BUILD_STAMP= endif all-local: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) else all-local: endif docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) $(REPORT_FILES): sgml-build.stamp #### setup #### GTK_DOC_V_SETUP=$(GTK_DOC_V_SETUP_$(V)) GTK_DOC_V_SETUP_=$(GTK_DOC_V_SETUP_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_SETUP_0=@echo " DOC Preparing build"; setup-build.stamp: -$(GTK_DOC_V_SETUP)if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ files=`echo $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types`; \ if test "x$$files" != "x" ; then \ for file in $$files ; do \ test -f $(abs_srcdir)/$$file && \ cp -pu $(abs_srcdir)/$$file $(abs_builddir)/$$file || true; \ done; \ fi; \ test -d $(abs_srcdir)/tmpl && \ { cp -rp $(abs_srcdir)/tmpl $(abs_builddir)/; \ chmod -R u+w $(abs_builddir)/tmpl; } \ fi $(AM_V_at)touch setup-build.stamp #### scan #### GTK_DOC_V_SCAN=$(GTK_DOC_V_SCAN_$(V)) GTK_DOC_V_SCAN_=$(GTK_DOC_V_SCAN_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_SCAN_0=@echo " DOC Scanning header files"; GTK_DOC_V_INTROSPECT=$(GTK_DOC_V_INTROSPECT_$(V)) GTK_DOC_V_INTROSPECT_=$(GTK_DOC_V_INTROSPECT_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_INTROSPECT_0=@echo " DOC Introspecting gobjects"; scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB) $(GTK_DOC_V_SCAN)_source_dir='' ; \ for i in $(DOC_SOURCE_DIR) ; do \ _source_dir="$${_source_dir} --source-dir=$$i" ; \ done ; \ gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES) $(GTK_DOC_V_INTROSPECT)if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null 2>&1 ; then \ scanobj_options=""; \ gtkdoc-scangobj 2>&1 --help | grep >/dev/null "\-\-verbose"; \ if test "$(?)" = "0"; then \ if test "x$(V)" = "x1"; then \ scanobj_options="--verbose"; \ fi; \ fi; \ CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \ gtkdoc-scangobj $(SCANGOBJ_OPTIONS) $$scanobj_options --module=$(DOC_MODULE); \ else \ for i in $(SCANOBJ_FILES) ; do \ test -f $$i || touch $$i ; \ done \ fi $(AM_V_at)touch scan-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp @true #### templates #### GTK_DOC_V_TMPL=$(GTK_DOC_V_TMPL_$(V)) GTK_DOC_V_TMPL_=$(GTK_DOC_V_TMPL_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_TMPL_0=@echo " DOC Rebuilding template files"; tmpl-build.stamp: setup-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt $(GTK_DOC_V_TMPL)gtkdoc-mktmpl --module=$(DOC_MODULE) $(MKTMPL_OPTIONS) $(AM_V_at)if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ if test -w $(abs_srcdir) ; then \ cp -rp $(abs_builddir)/tmpl $(abs_srcdir)/; \ fi \ fi $(AM_V_at)touch tmpl-build.stamp tmpl.stamp: tmpl-build.stamp @true $(srcdir)/tmpl/*.sgml: @true #### xml #### GTK_DOC_V_XML=$(GTK_DOC_V_XML_$(V)) GTK_DOC_V_XML_=$(GTK_DOC_V_XML_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_XML_0=@echo " DOC Building XML"; sgml-build.stamp: tmpl.stamp $(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml $(expand_content_files) $(GTK_DOC_V_XML)-chmod -R u+w $(srcdir) && _source_dir='' ; \ for i in $(DOC_SOURCE_DIR) ; do \ _source_dir="$${_source_dir} --source-dir=$$i" ; \ done ; \ gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $${_source_dir} $(MKDB_OPTIONS) $(AM_V_at)touch sgml-build.stamp sgml.stamp: sgml-build.stamp @true #### html #### GTK_DOC_V_HTML=$(GTK_DOC_V_HTML_$(V)) GTK_DOC_V_HTML_=$(GTK_DOC_V_HTML_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_HTML_0=@echo " DOC Building HTML"; GTK_DOC_V_XREF=$(GTK_DOC_V_XREF_$(V)) GTK_DOC_V_XREF_=$(GTK_DOC_V_XREF_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_XREF_0=@echo " DOC Fixing cross-references"; html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) $(GTK_DOC_V_HTML)rm -rf html && mkdir html && \ mkhtml_options=""; \ gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-verbose"; \ if test "$(?)" = "0"; then \ if test "x$(V)" = "x1"; then \ mkhtml_options="$$mkhtml_options --verbose"; \ fi; \ fi; \ gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \ if test "$(?)" = "0"; then \ mkhtml_options="$$mkhtml_options --path=\"$(abs_srcdir)\""; \ fi; \ cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) -@test "x$(HTML_IMAGES)" = "x" || \ for file in $(HTML_IMAGES) ; do \ if test -f $(abs_srcdir)/$$file ; then \ cp $(abs_srcdir)/$$file $(abs_builddir)/html; \ fi; \ if test -f $(abs_builddir)/$$file ; then \ cp $(abs_builddir)/$$file $(abs_builddir)/html; \ fi; \ done; $(GTK_DOC_V_XREF)gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) $(AM_V_at)touch html-build.stamp #### pdf #### GTK_DOC_V_PDF=$(GTK_DOC_V_PDF_$(V)) GTK_DOC_V_PDF_=$(GTK_DOC_V_PDF_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_PDF_0=@echo " DOC Building PDF"; pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) $(GTK_DOC_V_PDF)rm -f $(DOC_MODULE).pdf && \ mkpdf_options=""; \ gtkdoc-mkpdf 2>&1 --help | grep >/dev/null "\-\-verbose"; \ if test "$(?)" = "0"; then \ if test "x$(V)" = "x1"; then \ mkpdf_options="$$mkpdf_options --verbose"; \ fi; \ fi; \ if test "x$(HTML_IMAGES)" != "x"; then \ for img in $(HTML_IMAGES); do \ part=`dirname $$img`; \ echo $$mkpdf_options | grep >/dev/null "\-\-imgdir=$$part "; \ if test $$? != 0; then \ mkpdf_options="$$mkpdf_options --imgdir=$$part"; \ fi; \ done; \ fi; \ gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_options $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS) $(AM_V_at)touch pdf-build.stamp ############## clean-local: @rm -f *~ *.bak @rm -rf .libs distclean-local: @rm -rf xml html $(REPORT_FILES) $(DOC_MODULE).pdf \ $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ rm -f $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types; \ rm -rf tmpl; \ fi maintainer-clean-local: @rm -rf xml html install-data-local: @installfiles=`echo $(builddir)/html/*`; \ if test "$$installfiles" = '$(builddir)/html/*'; \ then echo 1>&2 'Nothing to install' ; \ else \ if test -n "$(DOC_MODULE_VERSION)"; then \ installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ else \ installdir="$(DESTDIR)$(TARGET_DIR)"; \ fi; \ $(mkinstalldirs) $${installdir} ; \ for i in $$installfiles; do \ echo ' $(INSTALL_DATA) '$$i ; \ $(INSTALL_DATA) $$i $${installdir}; \ done; \ if test -n "$(DOC_MODULE_VERSION)"; then \ mv -f $${installdir}/$(DOC_MODULE).devhelp2 \ $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \ fi; \ $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir}; \ fi uninstall-local: @if test -n "$(DOC_MODULE_VERSION)"; then \ installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ else \ installdir="$(DESTDIR)$(TARGET_DIR)"; \ fi; \ rm -rf $${installdir} # # Require gtk-doc when making dist # if ENABLE_GTK_DOC dist-check-gtkdoc: docs else dist-check-gtkdoc: @echo "*** gtk-doc must be installed and enabled in order to make dist" @false endif dist-hook: dist-check-gtkdoc dist-hook-local @mkdir $(distdir)/tmpl @mkdir $(distdir)/html @-cp ./tmpl/*.sgml $(distdir)/tmpl @cp ./html/* $(distdir)/html @-cp ./$(DOC_MODULE).pdf $(distdir)/ @-cp ./$(DOC_MODULE).types $(distdir)/ @-cp ./$(DOC_MODULE)-sections.txt $(distdir)/ @cd $(distdir) && rm -f $(DISTCLEANFILES) @$(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html .PHONY : dist-hook-local docs libinfinity-0.5.5/missing0000755000175000017500000002415212202130661012356 00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2012-01-06.13; # UTC # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, # 2008, 2009, 2010, 2011, 2012 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 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. ;; *) 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 ;; *) 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: libinfinity-0.5.5/install-sh0000755000175000017500000003325612202130661012770 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2011-01-19.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 # Protect names problematic for `test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac 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 # Protect names problematic for `test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for `test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -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 X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && 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: libinfinity-0.5.5/INSTALL0000644000175000017500000003660012202130664012014 00000000000000Installation Instructions ************************* Copyright (C) 1994-1996, 1999-2002, 2004-2011 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. HP-UX `make' updates targets which have the same time stamps as their prerequisites, which makes it generally unusable when shipped generated files such as `configure' are involved. Use GNU `make' instead. 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. libinfinity-0.5.5/libinfgtk/0000755000175000017500000000000012264766267013035 500000000000000libinfinity-0.5.5/libinfgtk/inf-gtk-browser-view.c0000644000175000017500000021664512264763732017121 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include #include #include #include #include #define INF_GTK_BROWSER_VIEW_INITIAL_EXPANSION \ "inf-gtk-browser-view-initial-exploration" #define INF_GTK_BROWSER_VIEW_ERROR_COLOR "#db1515" typedef struct _InfGtkBrowserViewBrowser InfGtkBrowserViewBrowser; struct _InfGtkBrowserViewBrowser { InfGtkBrowserView* view; InfcBrowser* browser; GtkTreeRowReference* reference; GSList* explores; GSList* syncs; /* Whether we expand the root node automatically */ gboolean initial_root_expansion; }; typedef struct _InfGtkBrowserViewExplore InfGtkBrowserViewExplore; struct _InfGtkBrowserViewExplore { InfGtkBrowserViewBrowser* view_browser; GtkTreeRowReference* reference; InfcExploreRequest* request; }; typedef struct _InfGtkBrowserViewSync InfGtkBrowserViewSync; struct _InfGtkBrowserViewSync { InfGtkBrowserViewBrowser* view_browser; GtkTreeRowReference* reference; InfcSessionProxy* proxy; }; typedef struct _InfGtkBrowserViewPrivate InfGtkBrowserViewPrivate; struct _InfGtkBrowserViewPrivate { GtkTreeViewColumn* column; /* Note that progress and status_text are never visible at the same time */ GtkCellRenderer* renderer_icon; GtkCellRenderer* renderer_status_icon; /* toplevel only */ GtkCellRenderer* renderer_name; GtkCellRenderer* renderer_progress; GtkCellRenderer* renderer_status; /* This is just bookkeeping because we connect to their signals, and need * to disconnect when the view is disposed, or a browser removed. */ GSList* browsers; /* Pending discovery info resolves */ GSList* info_resolvs; }; enum { PROP_0, PROP_MODEL }; enum { ACTIVATE, SELECTION_CHANGED, POPULATE_POPUP, LAST_SIGNAL }; #define INF_GTK_BROWSER_VIEW_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), INF_GTK_TYPE_BROWSER_VIEW, InfGtkBrowserViewPrivate)) /* We do some rather complex stuff here because we don't get the iter when * a row is deleted. This would be nice to disconnect browser signals for * example (we need the iter to access the browser to disconnect the signals), * but it is not possible. * * Instead, we keep an array of browsers in the model including * TreeRowReferences where they are in the tree. When a row is removed, we * check which TreeRowReferences got invalid and delete the corresponding * browsers from our array. The same holds for explore requests and * session synchronizations. */ static GObjectClass* parent_class; static guint view_signals[LAST_SIGNAL]; /* * Utility functions */ static InfGtkBrowserViewBrowser* inf_gtk_browser_view_find_view_browser(InfGtkBrowserView* view, InfcBrowser* browser) { InfGtkBrowserViewPrivate* priv; GSList* item; InfGtkBrowserViewBrowser* view_browser; priv = INF_GTK_BROWSER_VIEW_PRIVATE(view); for(item = priv->browsers; item != NULL; item = item->next) { view_browser = (InfGtkBrowserViewBrowser*)item->data; if(view_browser->browser == browser) return view_browser; } return NULL; } static InfGtkBrowserViewExplore* inf_gtk_browser_view_find_explore(InfGtkBrowserView* view, InfGtkBrowserViewBrowser* view_browser, InfcExploreRequest* request) { GSList* item; InfGtkBrowserViewExplore* explore; for(item = view_browser->explores; item != NULL; item = item->next) { explore = (InfGtkBrowserViewExplore*)item->data; if(explore->request == request) return explore; } return NULL; } static InfGtkBrowserViewSync* inf_gtk_browser_view_find_sync(InfGtkBrowserView* view, InfGtkBrowserViewBrowser* view_browser, InfcSessionProxy* proxy) { GSList* item; InfGtkBrowserViewSync* sync; for(item = view_browser->syncs; item != NULL; item = item->next) { sync = (InfGtkBrowserViewSync*)item->data; if(sync->proxy == proxy) return sync; } return NULL; } /*gint inf_gtk_browser_view_session_find(InfGtkBrowserView* view, InfSession* session) { InfGtkBrowserViewPrivate* priv; InfGtkBrowserViewObject* object; InfcSessionProxy* proxy; guint i; priv = INF_GTK_BROWSER_VIEW_PRIVATE(view); for(i = 0; i < priv->sessions->len; ++ i) { object = &g_array_index(priv->sessions, InfGtkBrowserViewObject, i); proxy = INFC_SESSION_PROXY(object->object); if(infc_session_proxy_get_session(proxy) == session) return i; } return -1; }*/ static void inf_gtk_browser_view_redraw_row(InfGtkBrowserView* view, GtkTreePath* path, GtkTreeIter* iter) { InfGtkBrowserViewPrivate* priv; GdkRectangle cell_area; /* The actual data in the model has not been changed, otherwise the model * would have emitted the row-changed signal and the treeview would redraw * itself automatically. What actually has changed is just what we * display, for example the progress bar of the exploration of a node. This * does not belong to the model because the model does not care about * exploration progress, but we want to show it to the user nevertheless. * I am not sure whether this is a problem in our design or a limitation * in the GTK+ treeview and friends. */ priv = INF_GTK_BROWSER_VIEW_PRIVATE(view); #if GTK_CHECK_VERSION(2,20,0) if(gtk_widget_get_realized(GTK_WIDGET(view))) #else if(GTK_WIDGET_REALIZED(GTK_WIDGET(view))) #endif { gtk_tree_view_get_cell_area( GTK_TREE_VIEW(view), path, priv->column, &cell_area ); if(cell_area.height != 0) { gtk_widget_queue_draw_area( GTK_WIDGET(view), cell_area.x, cell_area.y, cell_area.width, cell_area.height ); } } } static void inf_gtk_browser_view_redraw_for_reference(InfGtkBrowserView* view, GtkTreeRowReference* reference) { InfGtkBrowserViewPrivate* priv; GtkTreeModel* model; GtkTreePath* path; GtkTreeIter iter; priv = INF_GTK_BROWSER_VIEW_PRIVATE(view); path = gtk_tree_row_reference_get_path(reference); g_assert(path != NULL); model = gtk_tree_view_get_model(GTK_TREE_VIEW(view)); gtk_tree_model_get_iter(model, &iter, path); inf_gtk_browser_view_redraw_row(view, path, &iter); gtk_tree_path_free(path); } /* * Callbacks from InfGtkBrowserViewObjects */ /* Required by inf_gtk_browser_view_session_synchronization_complete_cb */ static void inf_gtk_browser_view_sync_removed(InfGtkBrowserView* view, InfGtkBrowserViewSync* sync); /* Required by inf_gtk_browser_view_explore_request_finished_cb */ static void inf_gtk_browser_view_explore_removed(InfGtkBrowserView* view, InfGtkBrowserViewExplore* expl); static void inf_gtk_browser_view_session_synchronization_progress_cb(InfSession* session, InfXmlConnection* c, gdouble percentage, gpointer user_data) { InfGtkBrowserViewSync* sync; sync = (InfGtkBrowserViewSync*)user_data; inf_gtk_browser_view_redraw_for_reference( sync->view_browser->view, sync->reference ); } static void inf_gtk_browser_view_session_synchronization_complete_cb(InfSession* session, InfXmlConnection* c, gpointer user_data) { InfGtkBrowserViewSync* sync; sync = (InfGtkBrowserViewSync*)user_data; inf_gtk_browser_view_sync_removed(sync->view_browser->view, sync); } static void inf_gtk_browser_view_session_synchronization_failed_cb(InfSession* session, InfXmlConnection* c, const GError* error, gpointer user_data) { /* TODO: Show the error in the view. I am not completely sure how to * achieve this. Probably, InfGtkBrowserModel needs to handle this signal * and set the error column. */ InfGtkBrowserViewSync* sync; sync = (InfGtkBrowserViewSync*)user_data; inf_gtk_browser_view_sync_removed(sync->view_browser->view, sync); } static void inf_gtk_browser_view_explore_request_initiated_cb(InfcExploreRequest* request, guint total, gpointer user_data) { InfGtkBrowserViewExplore* explore; explore = (InfGtkBrowserViewExplore*)user_data; inf_gtk_browser_view_redraw_for_reference( explore->view_browser->view, explore->reference ); } static void inf_gtk_browser_view_explore_request_progress_cb(InfcExploreRequest* request, guint current, guint total, gpointer user_data) { InfGtkBrowserViewExplore* explore; InfGtkBrowserView* view; GtkTreeModel* model; GtkTreePath* path; GtkTreeIter iter; gpointer initial_expansion; explore = (InfGtkBrowserViewExplore*)user_data; view = explore->view_browser->view; model = gtk_tree_view_get_model(GTK_TREE_VIEW(view)); path = gtk_tree_row_reference_get_path(explore->reference); g_assert(path != NULL); gtk_tree_model_get_iter(model, &iter, path); inf_gtk_browser_view_redraw_row(view, path, &iter); initial_expansion = g_object_get_data( G_OBJECT(explore->request), INF_GTK_BROWSER_VIEW_INITIAL_EXPANSION ); /*printf("progress-cb on view %p, initial expansion %p\n", explore->view_browser->view, initial_expansion);*/ /* Expand initial exploration of the root node if we are told to * do so. This is the case if we issued the discovery resolv. */ /* The model might be a filter model in which case the first discovered * node might not be contained in the model. We expand as soon as we have * any children. If we don't have any, then we can't expand of course. The * extra g_object_set_data does not need to be undone since the request * most likely vanishes anyway after exploration. */ if(initial_expansion == view && gtk_tree_model_iter_has_child(model, &iter)) { g_object_set_data( G_OBJECT(explore->request), INF_GTK_BROWSER_VIEW_INITIAL_EXPANSION, NULL ); gtk_tree_view_expand_row(GTK_TREE_VIEW(view), path, FALSE); } gtk_tree_path_free(path); } static void inf_gtk_browser_view_explore_request_finished_cb(InfcExploreRequest* request, gpointer user_data) { InfGtkBrowserViewExplore* explore; explore = (InfGtkBrowserViewExplore*)user_data; inf_gtk_browser_view_explore_removed(explore->view_browser->view, explore); } /* * InfGtkBrowserViewSync, InfGtkBrowserViewExplore */ static void inf_gtk_browser_view_sync_added(InfGtkBrowserView* view, InfcBrowser* browser, InfcSessionProxy* proxy, GtkTreePath* path, GtkTreeIter* iter) { InfGtkBrowserViewPrivate* priv; InfGtkBrowserViewBrowser* view_browser; InfSession* session; InfGtkBrowserViewSync* sync; priv = INF_GTK_BROWSER_VIEW_PRIVATE(view); session = infc_session_proxy_get_session(proxy); view_browser = inf_gtk_browser_view_find_view_browser(view, browser); g_assert(view_browser != NULL); g_assert(inf_gtk_browser_view_find_sync(view, view_browser, proxy) == NULL); g_assert( inf_session_get_synchronization_status( session, infc_browser_get_connection(browser) ) != INF_SESSION_SYNC_NONE ); sync = g_slice_new(InfGtkBrowserViewSync); sync->view_browser = view_browser; sync->proxy = proxy; g_object_ref(proxy); sync->reference = gtk_tree_row_reference_new_proxy( G_OBJECT(priv->column), gtk_tree_view_get_model(GTK_TREE_VIEW(view)), path ); g_assert(sync->reference != NULL); view_browser->syncs = g_slist_prepend(view_browser->syncs, sync); g_signal_connect_after( G_OBJECT(session), "synchronization-progress", G_CALLBACK(inf_gtk_browser_view_session_synchronization_progress_cb), sync ); g_signal_connect_after( G_OBJECT(session), "synchronization-complete", G_CALLBACK(inf_gtk_browser_view_session_synchronization_complete_cb), sync ); g_signal_connect_after( G_OBJECT(session), "synchronization-failed", G_CALLBACK(inf_gtk_browser_view_session_synchronization_failed_cb), sync ); inf_gtk_browser_view_redraw_row(view, path, iter); } static void inf_gtk_browser_view_sync_removed(InfGtkBrowserView* view, InfGtkBrowserViewSync* sync) { InfGtkBrowserViewPrivate* priv; GtkTreePath* path; GtkTreeModel* model; GtkTreeIter iter; priv = INF_GTK_BROWSER_VIEW_PRIVATE(view); /* Redraw if the reference is still valid. Note that if the node is removed * while the corresponding session is synchronized, then the reference is * not valid at this point. */ path = gtk_tree_row_reference_get_path(sync->reference); if(path != NULL) { model = gtk_tree_view_get_model(GTK_TREE_VIEW(view)); gtk_tree_model_get_iter(model, &iter, path); inf_gtk_browser_view_redraw_row(view, path, &iter); gtk_tree_path_free(path); } inf_signal_handlers_disconnect_by_func( G_OBJECT(infc_session_proxy_get_session(sync->proxy)), G_CALLBACK(inf_gtk_browser_view_session_synchronization_progress_cb), sync ); inf_signal_handlers_disconnect_by_func( G_OBJECT(infc_session_proxy_get_session(sync->proxy)), G_CALLBACK(inf_gtk_browser_view_session_synchronization_complete_cb), sync ); inf_signal_handlers_disconnect_by_func( G_OBJECT(infc_session_proxy_get_session(sync->proxy)), G_CALLBACK(inf_gtk_browser_view_session_synchronization_failed_cb), sync ); gtk_tree_row_reference_free(sync->reference); g_object_unref(sync->proxy); sync->view_browser->syncs = g_slist_remove(sync->view_browser->syncs, sync); g_slice_free(InfGtkBrowserViewSync, sync); } static void inf_gtk_browser_view_explore_added(InfGtkBrowserView* view, InfcBrowser* browser, InfcExploreRequest* request, GtkTreePath* path, GtkTreeIter* iter) { InfGtkBrowserViewPrivate* priv; InfGtkBrowserViewBrowser* view_browser; InfGtkBrowserViewExplore* explore; priv = INF_GTK_BROWSER_VIEW_PRIVATE(view); view_browser = inf_gtk_browser_view_find_view_browser(view, browser); g_assert(view_browser != NULL); g_assert( inf_gtk_browser_view_find_explore(view, view_browser, request) == NULL ); explore = g_slice_new(InfGtkBrowserViewExplore); explore->view_browser = view_browser; explore->request = request; g_object_ref(request); explore->reference = gtk_tree_row_reference_new_proxy( G_OBJECT(priv->column), gtk_tree_view_get_model(GTK_TREE_VIEW(view)), path ); g_assert(explore->reference != NULL); view_browser->explores = g_slist_prepend(view_browser->explores, explore); g_signal_connect_after( G_OBJECT(request), "initiated", G_CALLBACK(inf_gtk_browser_view_explore_request_initiated_cb), explore ); g_signal_connect_after( G_OBJECT(request), "progress", G_CALLBACK(inf_gtk_browser_view_explore_request_progress_cb), explore ); g_signal_connect_after( G_OBJECT(request), "finished", G_CALLBACK(inf_gtk_browser_view_explore_request_finished_cb), explore ); /* TODO: Watch failed? */ inf_gtk_browser_view_redraw_row(view, path, iter); } static void inf_gtk_browser_view_explore_removed(InfGtkBrowserView* view, InfGtkBrowserViewExplore* expl) { InfGtkBrowserViewPrivate* priv; GtkTreePath* path; GtkTreeModel* model; GtkTreeIter iter; priv = INF_GTK_BROWSER_VIEW_PRIVATE(view); /* Redraw if the reference is still valid. Note that if the node is removed * while being explored, then the reference is not valid at this point. */ path = gtk_tree_row_reference_get_path(expl->reference); if(path != NULL) { model = gtk_tree_view_get_model(GTK_TREE_VIEW(view)); gtk_tree_model_get_iter(model, &iter, path); inf_gtk_browser_view_redraw_row(view, path, &iter); gtk_tree_path_free(path); } inf_signal_handlers_disconnect_by_func( G_OBJECT(expl->request), G_CALLBACK(inf_gtk_browser_view_explore_request_initiated_cb), expl ); inf_signal_handlers_disconnect_by_func( G_OBJECT(expl->request), G_CALLBACK(inf_gtk_browser_view_explore_request_progress_cb), expl ); inf_signal_handlers_disconnect_by_func( G_OBJECT(expl->request), G_CALLBACK(inf_gtk_browser_view_explore_request_finished_cb), expl ); gtk_tree_row_reference_free(expl->reference); g_object_unref(expl->request); expl->view_browser->explores = g_slist_remove(expl->view_browser->explores, expl); g_slice_free(InfGtkBrowserViewExplore, expl); } /* * Callbacks from browser */ static void inf_gtk_browser_view_begin_explore_cb(InfcBrowser* browser, InfcBrowserIter* iter, InfcExploreRequest* request, gpointer user_data) { InfGtkBrowserViewBrowser* view_browser; InfGtkBrowserView* view; GtkTreeModel* model; GtkTreeIter tree_iter; GtkTreePath* path; gboolean result; view_browser = (InfGtkBrowserViewBrowser*)user_data; view = view_browser->view; model = gtk_tree_view_get_model(GTK_TREE_VIEW(view)); result = inf_gtk_browser_model_browser_iter_to_tree_iter( INF_GTK_BROWSER_MODEL(model), browser, iter, &tree_iter ); /*printf("Begin-explore cb for view %p, result %d\n", view_browser->view, result);*/ /* The model might be a filter model that does not contain the node * being explored, so do not assert here. */ if(result == TRUE) { path = gtk_tree_model_get_path(model, &tree_iter); inf_gtk_browser_view_explore_added( view, browser, request, path, &tree_iter ); gtk_tree_path_free(path); } } static void inf_gtk_browser_view_session_subscribe_cb(InfcBrowser* browser, InfcBrowserIter* iter, InfcSessionProxy* proxy, gpointer user_data) { InfGtkBrowserViewBrowser* view_browser; InfGtkBrowserView* view; InfSession* session; GtkTreeModel* model; GtkTreeIter tree_iter; GtkTreePath* path; gboolean result; view_browser = (InfGtkBrowserViewBrowser*)user_data; view = view_browser->view; model = gtk_tree_view_get_model(GTK_TREE_VIEW(view)); session = infc_session_proxy_get_session(proxy); /* Note that we do not check sync-ins here. This is because sync-ins can * only be created along with new nodes, in which case we already add the * synchronization in row_inserted_cb(). Perhaps we could still * double-check here, just to be sure, though... */ if(iter != NULL && inf_session_get_status(session) == INF_SESSION_SYNCHRONIZING) { result = inf_gtk_browser_model_browser_iter_to_tree_iter( INF_GTK_BROWSER_MODEL(model), browser, iter, &tree_iter ); /* The model might be a filter model that does not contain the session * being synchronized, so do not assert here. */ if(result == TRUE) { path = gtk_tree_model_get_path(model, &tree_iter); inf_gtk_browser_view_sync_added( view, browser, proxy, path, &tree_iter ); gtk_tree_path_free(path); } } } /* * Browser management */ /* This function recursively walks down iter and all its children and * inserts running explore requests and synchronizations into the view. */ static void inf_gtk_browser_view_walk_requests(InfGtkBrowserView* view, InfcBrowser* browser, InfcBrowserIter* iter) { InfGtkBrowserViewPrivate* priv; InfcExploreRequest* request; InfcSessionProxy* proxy; InfSession* session; GtkTreeModel* model; GtkTreeIter tree_iter; GtkTreePath* path; InfcBrowserIter child_iter; InfXmlConnection* connection; gboolean result; priv = INF_GTK_BROWSER_VIEW_PRIVATE(view); /* TODO: Carry both path and iter through the recursion, so we do not need * to make expensive gtk_tree_model_get_path calls */ /* Hm. Perhaps this isn't a good idea after all, since normally there are * not too much ongoing syncs/explores. */ if(infc_browser_iter_is_subdirectory(browser, iter)) { if(infc_browser_iter_get_explored(browser, iter)) { child_iter = *iter; if(infc_browser_iter_get_child(browser, &child_iter)) { do { inf_gtk_browser_view_walk_requests(view, browser, &child_iter); } while(infc_browser_iter_get_next(browser, &child_iter)); } } request = infc_browser_iter_get_explore_request(browser, iter); if(request != NULL) { model = gtk_tree_view_get_model(GTK_TREE_VIEW(view)); result = inf_gtk_browser_model_browser_iter_to_tree_iter( INF_GTK_BROWSER_MODEL(model), browser, iter, &tree_iter ); /* The model might be a filter model that does not contain the node * being explored, so do not assert here. */ if(result == TRUE) { path = gtk_tree_model_get_path(model, &tree_iter); inf_gtk_browser_view_explore_added( view, browser, request, path, &tree_iter ); gtk_tree_path_free(path); } } } else { proxy = infc_browser_iter_get_sync_in(browser, iter); if(!proxy) proxy = infc_browser_iter_get_session(browser, iter); if(proxy != NULL) { session = infc_session_proxy_get_session(proxy); connection = infc_browser_get_connection(browser); g_assert(connection != NULL); if(inf_session_get_synchronization_status(session, connection) != INF_SESSION_SYNC_NONE) { model = gtk_tree_view_get_model(GTK_TREE_VIEW(view)); result = inf_gtk_browser_model_browser_iter_to_tree_iter( INF_GTK_BROWSER_MODEL(model), browser, iter, &tree_iter ); /* The model might be a filter model that does not contain the session * being synchronized, so do not assert here. */ if(result == TRUE) { path = gtk_tree_model_get_path(model, &tree_iter); inf_gtk_browser_view_sync_added( view, browser, proxy, path, &tree_iter ); gtk_tree_path_free(path); } } } } } static void inf_gtk_browser_view_initial_root_explore(InfGtkBrowserView* view, GtkTreePath* path, GtkTreeIter* iter) { InfGtkBrowserViewPrivate* priv; InfcExploreRequest* request; InfGtkBrowserViewBrowser* view_browser; GtkTreeModel* model; InfcBrowser* browser; InfcBrowserIter* browser_iter; priv = INF_GTK_BROWSER_VIEW_PRIVATE(view); model = gtk_tree_view_get_model(GTK_TREE_VIEW(view)); gtk_tree_model_get( model, iter, INF_GTK_BROWSER_MODEL_COL_BROWSER, &browser, INF_GTK_BROWSER_MODEL_COL_NODE, &browser_iter, -1 ); view_browser = inf_gtk_browser_view_find_view_browser(view, browser); g_assert(view_browser != NULL); if(infc_browser_get_status(browser) == INFC_BROWSER_CONNECTED) { if(infc_browser_iter_get_explored(browser, browser_iter) == FALSE) { request = infc_browser_iter_get_explore_request(browser, browser_iter); /* Explore root node if it is not already explored */ if(request == NULL) request = infc_browser_iter_explore(browser, browser_iter); if(view_browser->initial_root_expansion == TRUE) { /* There should always only be one view to do initial root expansion * because only one view can have issued the resolv. */ g_assert( g_object_get_data( G_OBJECT(request), INF_GTK_BROWSER_VIEW_INITIAL_EXPANSION ) == NULL ); /* Remember to do initial root expansion when the node has been * explored. */ /*printf("Initial root exansion was set, set on request for view %p\n", view);*/ g_object_set_data( G_OBJECT(request), INF_GTK_BROWSER_VIEW_INITIAL_EXPANSION, view ); /* Handled expansion flag, so unset, could otherwise lead to another * try of expanding the root node. */ view_browser->initial_root_expansion = FALSE; } } else { if(view_browser->initial_root_expansion == TRUE) { /*printf("Direct expansion for view %p\n", view);*/ gtk_tree_view_expand_row(GTK_TREE_VIEW(view), path, FALSE); /* Handled expansion flag, so unset, could otherwise lead to another * try of expanding the root node. */ view_browser->initial_root_expansion = FALSE; } } } infc_browser_iter_free(browser_iter); g_object_unref(browser); } static void inf_gtk_browser_view_browser_added(InfGtkBrowserView* view, InfcBrowser* browser, GtkTreePath* path, GtkTreeIter* iter) { InfGtkBrowserViewPrivate* priv; InfGtkBrowserViewBrowser* view_browser; GtkTreeModel* model; InfcBrowserIter* browser_iter; InfDiscoveryInfo* info; priv = INF_GTK_BROWSER_VIEW_PRIVATE(view); model = gtk_tree_view_get_model(GTK_TREE_VIEW(view)); view_browser = g_slice_new(InfGtkBrowserViewBrowser); view_browser->view = view; view_browser->browser = browser; g_object_ref(browser); view_browser->explores = NULL; view_browser->syncs = NULL; view_browser->initial_root_expansion = FALSE; view_browser->reference = gtk_tree_row_reference_new_proxy( G_OBJECT(priv->column), model, path ); priv->browsers = g_slist_prepend(priv->browsers, view_browser); g_signal_connect( G_OBJECT(browser), "begin-explore", G_CALLBACK(inf_gtk_browser_view_begin_explore_cb), view_browser ); g_signal_connect_after( G_OBJECT(browser), "subscribe-session", G_CALLBACK(inf_gtk_browser_view_session_subscribe_cb), view_browser ); /* TODO: Watch a signal to be notified when a sync-in begins. */ gtk_tree_model_get( model, iter, INF_GTK_BROWSER_MODEL_COL_DISCOVERY_INFO, &info, -1 ); /* Initially expand the root node in this view if we resolved it. */ if(info != NULL && g_slist_find(priv->info_resolvs, info) != NULL) { /*printf("Set initial root expansion for view %p\n", view);*/ /* TODO: Remember to unset the flag when an error happens or the * corresponding browser is disconnected for another reason before we * actually get to explore anything. */ view_browser->initial_root_expansion = TRUE; priv->info_resolvs = g_slist_remove(priv->info_resolvs, info); } /*connection = infc_browser_get_connection(browser); g_object_get(G_OBJECT(connection), "status", &status, NULL);*/ /* Initial explore if connection is already open */ if(infc_browser_get_status(browser) == INFC_BROWSER_CONNECTED) { gtk_tree_model_get( model, iter, INF_GTK_BROWSER_MODEL_COL_NODE, &browser_iter, -1 ); /* Look for running explore requests, insert into array of running * explore requests to show their progress. */ /* TODO: We do not need this anymore when we get insertion callbacks * from the model for each node in the newly added browser. See * inf_gtk_browser_store_set_browser_impl() in inf-gtk-browser-store.c. */ inf_gtk_browser_view_walk_requests(view, browser, browser_iter); /* Explore root node initially if not already explored */ inf_gtk_browser_view_initial_root_explore(view, path, iter); infc_browser_iter_free(browser_iter); } } static void inf_gtk_browser_view_browser_removed(InfGtkBrowserView* view, InfGtkBrowserViewBrowser* view_browser) { InfGtkBrowserViewPrivate* priv; priv = INF_GTK_BROWSER_VIEW_PRIVATE(view); while(view_browser->explores != NULL) inf_gtk_browser_view_explore_removed(view, view_browser->explores->data); while(view_browser->syncs != NULL) inf_gtk_browser_view_sync_removed(view, view_browser->syncs->data); inf_signal_handlers_disconnect_by_func( G_OBJECT(view_browser->browser), G_CALLBACK(inf_gtk_browser_view_begin_explore_cb), view_browser ); inf_signal_handlers_disconnect_by_func( G_OBJECT(view_browser->browser), G_CALLBACK(inf_gtk_browser_view_session_subscribe_cb), view_browser ); gtk_tree_row_reference_free(view_browser->reference); g_object_unref(view_browser->browser); priv->browsers = g_slist_remove(priv->browsers, view_browser); g_slice_free(InfGtkBrowserViewBrowser, view_browser); } /* * TreeModel callbacks */ static void inf_gtk_browser_view_set_browser_cb_before(InfGtkBrowserModel* model, GtkTreePath* path, GtkTreeIter* iter, InfcBrowser* new_browser, gpointer user_data) { InfGtkBrowserView* view; InfGtkBrowserViewPrivate* priv; InfcBrowser* browser; InfGtkBrowserViewBrowser* view_browser; view = INF_GTK_BROWSER_VIEW(user_data); priv = INF_GTK_BROWSER_VIEW_PRIVATE(view); gtk_tree_model_get( GTK_TREE_MODEL(model), iter, INF_GTK_BROWSER_MODEL_COL_BROWSER, &browser, -1 ); /* Old browser was removed */ if(browser != NULL) { view_browser = inf_gtk_browser_view_find_view_browser(view, browser); g_assert(view_browser != NULL); inf_gtk_browser_view_browser_removed(view, view_browser); } } static void inf_gtk_browser_view_set_browser_cb_after(InfGtkBrowserModel* model, GtkTreePath* path, GtkTreeIter* iter, InfcBrowser* new_browser, gpointer user_data) { InfGtkBrowserView* view; view = INF_GTK_BROWSER_VIEW(user_data); if(new_browser != NULL) inf_gtk_browser_view_browser_added(view, new_browser, path, iter); } static void inf_gtk_browser_view_row_inserted_cb(GtkTreeModel* model, GtkTreePath* path, GtkTreeIter* iter, gpointer user_data) { InfGtkBrowserView* view; InfGtkBrowserViewPrivate* priv; GtkTreeIter parent_iter; InfcBrowser* browser; InfcBrowserIter* browser_iter; InfcExploreRequest* explore_request; InfGtkBrowserViewBrowser* view_browser; InfGtkBrowserViewExplore* explore; GtkTreePath* parent_path; InfcSessionProxy* proxy; InfSession* session; InfXmlConnection* connection; view = INF_GTK_BROWSER_VIEW(user_data); priv = INF_GTK_BROWSER_VIEW_PRIVATE(view); gtk_tree_row_reference_inserted(G_OBJECT(priv->column), path); if(gtk_tree_model_iter_parent(model, &parent_iter, iter) == TRUE) { /* Inner node. Explore if the parent node is expanded. */ gtk_tree_model_get( model, iter, INF_GTK_BROWSER_MODEL_COL_BROWSER, &browser, INF_GTK_BROWSER_MODEL_COL_NODE, &browser_iter, -1 ); g_assert(browser != NULL); if(infc_browser_iter_is_subdirectory(browser, browser_iter)) { /* Perhaps some other code already explored this. */ explore_request = infc_browser_iter_get_explore_request(browser, browser_iter); if(explore_request == NULL) { if(infc_browser_iter_get_explored(browser, browser_iter) == FALSE) { parent_path = gtk_tree_path_copy(path); gtk_tree_path_up(parent_path); if(gtk_tree_view_row_expanded(GTK_TREE_VIEW(view), parent_path)) infc_browser_iter_explore(browser, browser_iter); gtk_tree_path_free(parent_path); } } else { view_browser = inf_gtk_browser_view_find_view_browser(view, browser); g_assert(view_browser != NULL); explore = inf_gtk_browser_view_find_explore( view, view_browser, explore_request ); /* TODO: The correct way to do this would probably be to ignore * the begin-explore signal of the browser if row-inserted for the * row being explored has not yet been received by the view. We * could then omit this nasty check. */ if(explore == NULL) { inf_gtk_browser_view_explore_added( view, browser, explore_request, path, iter ); } } } else { proxy = infc_browser_iter_get_sync_in(browser, browser_iter); if(!proxy) proxy = infc_browser_iter_get_session(browser, browser_iter); if(proxy != NULL) { session = infc_session_proxy_get_session(proxy); connection = infc_browser_get_connection(browser); g_assert(connection != NULL); if(inf_session_get_synchronization_status(session, connection) != INF_SESSION_SYNC_NONE) { inf_gtk_browser_view_sync_added(view, browser, proxy, path, iter); } } } infc_browser_iter_free(browser_iter); g_object_unref(G_OBJECT(browser)); } } static void inf_gtk_browser_view_row_changed_cb(GtkTreeModel* model, GtkTreePath* path, GtkTreeIter* iter, gpointer user_data) { InfGtkBrowserView* view; InfGtkBrowserViewPrivate* priv; GtkTreeIter parent_iter; InfGtkBrowserModelStatus status; InfDiscoveryInfo* info; view = INF_GTK_BROWSER_VIEW(user_data); priv = INF_GTK_BROWSER_VIEW_PRIVATE(view); if(gtk_tree_model_iter_parent(model, &parent_iter, iter) == FALSE) { gtk_tree_model_get( model, iter, INF_GTK_BROWSER_MODEL_COL_STATUS, &status, INF_GTK_BROWSER_MODEL_COL_DISCOVERY_INFO, &info, -1 ); /* Explore root node as soon as the connection is ready */ if(status == INF_GTK_BROWSER_MODEL_CONNECTED) { inf_gtk_browser_view_initial_root_explore(view, path, iter); } /* Remove pending resolv when there was an error while resolving. On * success, a browser will be created and we remove the pending resolve * in the set-browser signal handler. */ if(info != NULL && status == INF_GTK_BROWSER_MODEL_ERROR) priv->info_resolvs = g_slist_remove(priv->info_resolvs, info); } } static void inf_gtk_browser_view_row_deleted_cb(GtkTreeModel* model, GtkTreePath* path, gpointer user_data) { InfGtkBrowserView* view; InfGtkBrowserViewPrivate* priv; GSList* top_item; InfGtkBrowserViewBrowser* view_browser; GtkTreePath* browser_path; GSList* item; InfGtkBrowserViewExplore* explore; InfGtkBrowserViewSync* sync; view = INF_GTK_BROWSER_VIEW(user_data); priv = INF_GTK_BROWSER_VIEW_PRIVATE(view); gtk_tree_row_reference_deleted(G_OBJECT(priv->column), path); for(top_item = priv->browsers; top_item != NULL; ) { view_browser = (InfGtkBrowserViewBrowser*)top_item->data; top_item = top_item->next; if(gtk_tree_row_reference_valid(view_browser->reference) == FALSE) { inf_gtk_browser_view_browser_removed(view, view_browser); } else { /* If a child of this browser was removed, then explores and syncs * of that browser might be affected. */ browser_path = gtk_tree_row_reference_get_path(view_browser->reference); g_assert(browser_path != NULL); if(gtk_tree_path_is_descendant(path, browser_path)) { for(item = view_browser->explores; item != NULL; ) { explore = (InfGtkBrowserViewExplore*)item->data; item = item->next; if(gtk_tree_row_reference_valid(explore->reference) == FALSE) inf_gtk_browser_view_explore_removed(view, explore); } for(item = view_browser->syncs; item != NULL; ) { sync = (InfGtkBrowserViewSync*)item->data; item = item->next; if(gtk_tree_row_reference_valid(sync->reference) == FALSE) inf_gtk_browser_view_sync_removed(view, sync); } } gtk_tree_path_free(browser_path); } } } static void inf_gtk_browser_view_rows_reordered_cb(GtkTreeModel* model, GtkTreePath* path, GtkTreeIter* iter, gint* new_order, gpointer user_data) { InfGtkBrowserView* view; InfGtkBrowserViewPrivate* priv; view = INF_GTK_BROWSER_VIEW(user_data); priv = INF_GTK_BROWSER_VIEW_PRIVATE(view); gtk_tree_row_reference_reordered( G_OBJECT(priv->column), path, iter, new_order ); } /* * TreeModel management */ static void inf_gtk_browser_view_set_model(InfGtkBrowserView* view, InfGtkBrowserModel* model) { InfGtkBrowserViewPrivate* priv; GtkTreeModel* current_model; GtkTreeIter iter; InfcBrowser* browser; GtkTreePath* path; priv = INF_GTK_BROWSER_VIEW_PRIVATE(view); current_model = gtk_tree_view_get_model(GTK_TREE_VIEW(view)); if(current_model != NULL) { while(priv->browsers != NULL) inf_gtk_browser_view_browser_removed(view, priv->browsers->data); /* We are no longer waiting for resolvs from that model */ g_slist_free(priv->info_resolvs); priv->info_resolvs = NULL; inf_signal_handlers_disconnect_by_func( G_OBJECT(current_model), G_CALLBACK(inf_gtk_browser_view_row_inserted_cb), view ); inf_signal_handlers_disconnect_by_func( G_OBJECT(current_model), G_CALLBACK(inf_gtk_browser_view_row_deleted_cb), view ); inf_signal_handlers_disconnect_by_func( G_OBJECT(current_model), G_CALLBACK(inf_gtk_browser_view_row_changed_cb), view ); inf_signal_handlers_disconnect_by_func( G_OBJECT(current_model), G_CALLBACK(inf_gtk_browser_view_rows_reordered_cb), view ); inf_signal_handlers_disconnect_by_func( G_OBJECT(current_model), G_CALLBACK(inf_gtk_browser_view_set_browser_cb_before), view ); inf_signal_handlers_disconnect_by_func( G_OBJECT(current_model), G_CALLBACK(inf_gtk_browser_view_set_browser_cb_after), view ); } gtk_tree_view_set_model( GTK_TREE_VIEW(view), GTK_TREE_MODEL(model) ); if(model != NULL) { gtk_tree_view_set_search_column( GTK_TREE_VIEW(view), INF_GTK_BROWSER_MODEL_COL_NAME ); /* Add initial browsers */ if(gtk_tree_model_get_iter_first(GTK_TREE_MODEL(model), &iter) == TRUE) { path = gtk_tree_path_new_first(); do { gtk_tree_model_get( GTK_TREE_MODEL(model), &iter, INF_GTK_BROWSER_MODEL_COL_BROWSER, &browser, -1 ); if(browser != NULL) { inf_gtk_browser_view_browser_added(view, browser, path, &iter); g_object_unref(browser); } gtk_tree_path_next(path); } while(gtk_tree_model_iter_next(GTK_TREE_MODEL(model), &iter) == TRUE); } g_signal_connect( G_OBJECT(model), "row-inserted", G_CALLBACK(inf_gtk_browser_view_row_inserted_cb), view ); g_signal_connect( G_OBJECT(model), "row-deleted", G_CALLBACK(inf_gtk_browser_view_row_deleted_cb), view ); g_signal_connect( G_OBJECT(model), "row-changed", G_CALLBACK(inf_gtk_browser_view_row_changed_cb), view ); g_signal_connect( G_OBJECT(model), "rows-reordered", G_CALLBACK(inf_gtk_browser_view_rows_reordered_cb), view ); g_signal_connect( G_OBJECT(model), "set-browser", G_CALLBACK(inf_gtk_browser_view_set_browser_cb_before), view ); g_signal_connect_after( G_OBJECT(model), "set-browser", G_CALLBACK(inf_gtk_browser_view_set_browser_cb_after), view ); } } /* * TreeView callbacks */ static void inf_gtk_browser_view_row_expanded(GtkTreeView* tree_view, GtkTreeIter* iter, GtkTreePath* path) { GtkTreeModel* model; InfcBrowser* browser; InfcBrowserIter* browser_iter; model = gtk_tree_view_get_model(tree_view); gtk_tree_model_get( model, iter, INF_GTK_BROWSER_MODEL_COL_BROWSER, &browser, INF_GTK_BROWSER_MODEL_COL_NODE, &browser_iter, -1 ); g_assert(browser != NULL); /* Explore all child nodes that are not yet explored */ if(infc_browser_iter_get_child(browser, browser_iter)) { do { if(infc_browser_iter_is_subdirectory(browser, browser_iter) == TRUE && infc_browser_iter_get_explored(browser, browser_iter) == FALSE && infc_browser_iter_get_explore_request(browser, browser_iter) == NULL) { infc_browser_iter_explore(browser, browser_iter); } } while(infc_browser_iter_get_next(browser, browser_iter)); } infc_browser_iter_free(browser_iter); g_object_unref(G_OBJECT(browser)); if(GTK_TREE_VIEW_CLASS(parent_class)->row_expanded != NULL) GTK_TREE_VIEW_CLASS(parent_class)->row_expanded(tree_view, iter, path); } static void inf_gtk_browser_view_row_activated(GtkTreeView* tree_view, GtkTreePath* path, GtkTreeViewColumn* column) { InfGtkBrowserView* view; InfGtkBrowserViewPrivate* priv; GtkTreeModel* model; InfGtkBrowserModelStatus status; InfDiscovery* discovery; InfDiscoveryInfo* info; GtkTreeIter iter; InfcBrowser* browser; InfcBrowserIter* browser_iter; InfXmlConnection* connection; InfXmlConnectionStatus xml_status; GError* error; InfGtkBrowserViewBrowser* view_browser; view = INF_GTK_BROWSER_VIEW(tree_view); priv = INF_GTK_BROWSER_VIEW_PRIVATE(view); /* Connect to host, if not already */ if(gtk_tree_path_get_depth(path) == 1) { model = gtk_tree_view_get_model(tree_view); gtk_tree_model_get_iter(model, &iter, path); gtk_tree_model_get( model, &iter, INF_GTK_BROWSER_MODEL_COL_STATUS, &status, INF_GTK_BROWSER_MODEL_COL_DISCOVERY, &discovery, INF_GTK_BROWSER_MODEL_COL_DISCOVERY_INFO, &info, INF_GTK_BROWSER_MODEL_COL_BROWSER, &browser, -1 ); if(browser != NULL) { g_assert(infc_browser_get_connection(browser) != NULL); if(infc_browser_get_status(browser) == INFC_BROWSER_DISCONNECTED) { connection = infc_browser_get_connection(browser); g_assert(connection != NULL); g_object_get(G_OBJECT(connection), "status", &xml_status, NULL); if(xml_status == INF_XML_CONNECTION_CLOSED) { error = NULL; if(!inf_xml_connection_open(connection, &error)) { /* TODO: We can't properly report error here. Actually, we should * not do this, but just emit signal activate here, for others * to open the connection if necessary. */ g_warning("Failed to reconnect: %s\n", error->message); g_error_free(error); } view_browser = inf_gtk_browser_view_find_view_browser(view, browser); g_assert(view_browser != NULL); view_browser->initial_root_expansion = TRUE; } } } else if(discovery != NULL) { if(status == INF_GTK_BROWSER_MODEL_DISCOVERED || status == INF_GTK_BROWSER_MODEL_ERROR) { /* TODO: This method should not exist. Instead, we should just * emit ACTIVATE and make others resolve stuff there. */ inf_gtk_browser_model_resolve( INF_GTK_BROWSER_MODEL(model), discovery, info ); /* Remember that we resolved that info, to do the initial root node * expansion. */ priv->info_resolvs = g_slist_prepend(priv->info_resolvs, info); /*printf("Add info %p to info resolvs of view %p\n", info, view);*/ } } if(discovery != NULL) g_object_unref(G_OBJECT(discovery)); if(browser != NULL) g_object_unref(browser); } else { model = gtk_tree_view_get_model(tree_view); gtk_tree_model_get_iter(model, &iter, path); gtk_tree_model_get( model, &iter, INF_GTK_BROWSER_MODEL_COL_BROWSER, &browser, INF_GTK_BROWSER_MODEL_COL_NODE, &browser_iter, -1 ); if(infc_browser_iter_is_subdirectory(browser, browser_iter)) { gtk_tree_view_expand_row(tree_view, path, FALSE); } else { /* Notify */ g_signal_emit( G_OBJECT(view), view_signals[ACTIVATE], 0, &iter ); } infc_browser_iter_free(browser_iter); g_object_unref(G_OBJECT(browser)); } if(GTK_TREE_VIEW_CLASS(parent_class)->row_activated != NULL) GTK_TREE_VIEW_CLASS(parent_class)->row_activated(tree_view, path, column); } static void inf_gtk_browser_view_selection_changed_cb(GtkTreeSelection* selection, gpointer user_data) { InfGtkBrowserView* view; GtkTreeIter selected_iter; view = INF_GTK_BROWSER_VIEW(user_data); if(gtk_tree_selection_get_selected(selection, NULL, &selected_iter)) g_signal_emit(view, view_signals[SELECTION_CHANGED], 0, &selected_iter); else g_signal_emit(view, view_signals[SELECTION_CHANGED], 0, NULL); } /* * Popup menu */ static void inf_gtk_browser_view_popup_menu_detach_func(GtkWidget* attach_widget, GtkMenu* menu) { } static void inf_gtk_browser_view_popup_menu_position_func(GtkMenu* menu, gint* x, gint* y, gboolean* push_in, gpointer user_data) { InfGtkBrowserView* view; InfGtkBrowserViewPrivate* priv; GdkWindow* bin_window; GdkScreen* screen; GtkRequisition menu_req; GdkRectangle monitor; gint monitor_num; gint orig_x; gint orig_y; gint height; GtkTreeSelection* selection; GtkTreeModel* model; GtkTreeIter selected_iter; GtkTreePath* selected_path; GdkRectangle cell_area; view = INF_GTK_BROWSER_VIEW(user_data); priv = INF_GTK_BROWSER_VIEW_PRIVATE(view); /* Place menu below currently selected row */ bin_window = gtk_tree_view_get_bin_window(GTK_TREE_VIEW(view)); gdk_window_get_origin(bin_window, &orig_x, &orig_y); screen = gtk_widget_get_screen(GTK_WIDGET(view)); monitor_num = gdk_screen_get_monitor_at_window(screen, bin_window); if(monitor_num < 0) monitor_num = 0; gtk_menu_set_monitor(menu, monitor_num); gdk_screen_get_monitor_geometry(screen, monitor_num, &monitor); gtk_widget_size_request(GTK_WIDGET(menu), &menu_req); #if GTK_CHECK_VERSION(2, 91, 0) height = gdk_window_get_height(bin_window); #else gdk_drawable_get_size(GDK_DRAWABLE(bin_window), NULL, &height); #endif selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(view)); gtk_tree_selection_get_selected(selection, &model, &selected_iter); selected_path = gtk_tree_model_get_path(model, &selected_iter); gtk_tree_view_get_cell_area( GTK_TREE_VIEW(view), selected_path, priv->column, &cell_area ); gtk_tree_path_free(selected_path); g_assert(cell_area.height > 0); if(gtk_widget_get_direction(GTK_WIDGET(view)) == GTK_TEXT_DIR_LTR) *x = orig_x + cell_area.x + cell_area.width - menu_req.width; else *x = orig_x + cell_area.x; *y = orig_y + cell_area.y + cell_area.height; /* Keep within widget */ if(*y < orig_y) *y = orig_y; if(*y > orig_y + height) *y = orig_y + height; /* Keep on screen */ if(*y + menu_req.height > monitor.y + monitor.height) *y = monitor.y + monitor.height - menu_req.height; if(*y < monitor.y) *y = monitor.y; *push_in = FALSE; } static gboolean inf_gtk_browser_view_show_popup(InfGtkBrowserView* view, guint button, /* 0 if triggered by keyboard */ guint32 time) { GtkWidget* menu; GList* children; gboolean result; menu = gtk_menu_new(); gtk_menu_attach_to_widget( GTK_MENU(menu), GTK_WIDGET(view), inf_gtk_browser_view_popup_menu_detach_func ); g_signal_emit(view, view_signals[POPULATE_POPUP], 0, menu); /* Only show menu if items have been added to it */ children = gtk_container_get_children(GTK_CONTAINER(menu)); if(children != NULL) { result = TRUE; if(button) { gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL, button, time); } else { gtk_menu_popup( GTK_MENU(menu), NULL, NULL, inf_gtk_browser_view_popup_menu_position_func, view, button, time ); gtk_menu_shell_select_first(GTK_MENU_SHELL(menu), FALSE); } } else { result = FALSE; gtk_widget_destroy(menu); } g_list_free(children); return result; } static gboolean inf_gtk_browser_view_button_press_event(GtkWidget* treeview, GdkEventButton* event) { GtkTreePath* path; gboolean has_path; if(event->button == 3 && event->window == gtk_tree_view_get_bin_window(GTK_TREE_VIEW(treeview))) { has_path = gtk_tree_view_get_path_at_pos( GTK_TREE_VIEW(treeview), event->x, event->y, &path, NULL, NULL, NULL ); if(has_path) { gtk_tree_selection_select_path( gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview)), path ); gtk_tree_path_free(path); return inf_gtk_browser_view_show_popup( INF_GTK_BROWSER_VIEW(treeview), event->button, event->time ); } } return GTK_WIDGET_CLASS(parent_class)->button_press_event(treeview, event); } static gboolean inf_gtk_browser_view_key_press_event(GtkWidget* treeview, GdkEventKey* event) { GtkTreeSelection* selection; GtkTreeIter iter; #if GTK_CHECK_VERSION(2,90,7) if(event->keyval == GDK_KEY_Menu) #else if(event->keyval == GDK_Menu) #endif { selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview)); if(gtk_tree_selection_get_selected(selection, NULL, &iter)) { return inf_gtk_browser_view_show_popup( INF_GTK_BROWSER_VIEW(treeview), 0, event->time ); } } return GTK_WIDGET_CLASS(parent_class)->key_press_event(treeview, event); } /* * CellDataFuncs */ static void inf_gtk_browser_view_icon_data_func(GtkTreeViewColumn* column, GtkCellRenderer* renderer, GtkTreeModel* model, GtkTreeIter* iter, gpointer user_data) { GtkTreeIter iter_parent; InfDiscovery* discovery; InfcBrowser* browser; InfcBrowserIter* browser_iter; if(gtk_tree_model_iter_parent(model, &iter_parent, iter)) { /* Inner node */ gtk_tree_model_get( model, iter, INF_GTK_BROWSER_MODEL_COL_BROWSER, &browser, INF_GTK_BROWSER_MODEL_COL_NODE, &browser_iter, -1 ); /* TODO: Set error icon if an error occured? */ /* TODO: Set icon depending on note type, perhaps also on whether * we are subscribed or not. */ if(infc_browser_iter_is_subdirectory(browser, browser_iter)) g_object_set(G_OBJECT(renderer), "stock-id", GTK_STOCK_DIRECTORY, NULL); else g_object_set(G_OBJECT(renderer), "stock-id", GTK_STOCK_FILE, NULL); infc_browser_iter_free(browser_iter); g_object_unref(G_OBJECT(browser)); } else { gtk_tree_model_get( model, iter, INF_GTK_BROWSER_MODEL_COL_DISCOVERY, &discovery, INF_GTK_BROWSER_MODEL_COL_BROWSER, &browser, -1 ); /* TODO: Set icon depending on discovery type (LAN, jabber, direct) */ g_object_set(G_OBJECT(renderer), "stock-id", GTK_STOCK_NETWORK, NULL); if(discovery != NULL) g_object_unref(G_OBJECT(discovery)); if(browser != NULL) g_object_unref(G_OBJECT(browser)); } } static void inf_gtk_browser_view_status_icon_data_func(GtkTreeViewColumn* column, GtkCellRenderer* renderer, GtkTreeModel* model, GtkTreeIter* iter, gpointer user_data) { GtkTreeIter iter_parent; InfGtkBrowserModelStatus status; const gchar* stock_id; if(gtk_tree_model_iter_parent(model, &iter_parent, iter)) { /* inner node, ignore */ g_object_set(G_OBJECT(renderer), "visible", FALSE, NULL); } else { /* toplevel */ gtk_tree_model_get( model, iter, INF_GTK_BROWSER_MODEL_COL_STATUS, &status, -1 ); switch(status) { case INF_GTK_BROWSER_MODEL_DISCONNECTED: case INF_GTK_BROWSER_MODEL_DISCOVERED: case INF_GTK_BROWSER_MODEL_RESOLVING: case INF_GTK_BROWSER_MODEL_CONNECTING: stock_id = GTK_STOCK_DISCONNECT; break; case INF_GTK_BROWSER_MODEL_CONNECTED: stock_id = GTK_STOCK_CONNECT; break; case INF_GTK_BROWSER_MODEL_ERROR: stock_id = GTK_STOCK_DIALOG_ERROR; break; default: g_assert_not_reached(); break; } g_object_set( G_OBJECT(renderer), "visible", TRUE, "stock-id", stock_id, NULL ); } } static void inf_gtk_browser_view_name_data_func(GtkTreeViewColumn* column, GtkCellRenderer* renderer, GtkTreeModel* model, GtkTreeIter* iter, gpointer user_data) { GtkTreeIter iter_parent; InfcBrowser* browser; InfcBrowserIter* browser_iter; const gchar* name; gchar* top_name; if(gtk_tree_model_iter_parent(model, &iter_parent, iter)) { /* Inner node */ gtk_tree_model_get( model, iter, INF_GTK_BROWSER_MODEL_COL_BROWSER, &browser, INF_GTK_BROWSER_MODEL_COL_NODE, &browser_iter, -1 ); /* TODO: Use another foreground color (or even background color?) when * we are subscribed or have sent a subscription request. */ name = infc_browser_iter_get_name(browser, browser_iter); g_object_set(G_OBJECT(renderer), "text", name, NULL); infc_browser_iter_free(browser_iter); g_object_unref(G_OBJECT(browser)); } else { /* Toplevel */ gtk_tree_model_get( model, iter, INF_GTK_BROWSER_MODEL_COL_NAME, &top_name, -1 ); g_object_set(G_OBJECT(renderer), "text", top_name, NULL); g_free(top_name); } } static void inf_gtk_browser_view_progress_data_func(GtkTreeViewColumn* column, GtkCellRenderer* renderer, GtkTreeModel* model, GtkTreeIter* iter, gpointer user_data) { InfcBrowser* browser; InfcBrowserIter* browser_iter; InfcExploreRequest* request; InfcSessionProxy* proxy; InfSession* session; InfXmlConnection* connection; guint current; guint total; gdouble progress; gboolean progress_set; progress_set = FALSE; gtk_tree_model_get( model, iter, INF_GTK_BROWSER_MODEL_COL_BROWSER, &browser, -1 ); if(browser != NULL) { gtk_tree_model_get( model, iter, INF_GTK_BROWSER_MODEL_COL_NODE, &browser_iter, -1 ); if(infc_browser_iter_is_subdirectory(browser, browser_iter)) { request = infc_browser_iter_get_explore_request(browser, browser_iter); if(request != NULL) { if(infc_explore_request_get_finished(request) == FALSE) { if(infc_explore_request_get_initiated(request) == FALSE) { current = 0; total = 1; } else { g_object_get( G_OBJECT(request), "current", ¤t, "total", &total, NULL ); } /* It is possible that the exploration request has been initiated, * but not yet finished, and the total number of items in the * folder is zero. */ if(total == 0) progress = 1.0; else progress = (gdouble)current / (gdouble)total; g_object_set( G_OBJECT(renderer), "visible", TRUE, "value", (gint)(progress * 100 + 0.5), "text", _("Exploring..."), NULL ); progress_set = TRUE; } } } else { /* Show progress of either sync-in or synchronization * due to subscription. */ proxy = infc_browser_iter_get_sync_in(browser, browser_iter); if(proxy == NULL) proxy = infc_browser_iter_get_session(browser, browser_iter); if(proxy != NULL) { connection = infc_browser_get_connection(browser); g_assert(connection != NULL); session = infc_session_proxy_get_session(proxy); if(inf_session_get_synchronization_status(session, connection) != INF_SESSION_SYNC_NONE) { progress = inf_session_get_synchronization_progress( session, connection ); g_object_set( G_OBJECT(renderer), "visible", TRUE, "value", (gint)(progress * 100 + 0.5), "text", _("Synchronizing..."), NULL ); progress_set = TRUE; } } } infc_browser_iter_free(browser_iter); g_object_unref(G_OBJECT(browser)); } if(!progress_set) { g_object_set( G_OBJECT(renderer), "visible", FALSE, NULL ); } } static void inf_gtk_browser_view_status_data_func(GtkTreeViewColumn* column, GtkCellRenderer* renderer, GtkTreeModel* model, GtkTreeIter* iter, gpointer user_data) { GtkTreeIter iter_parent; InfGtkBrowserModelStatus status; GError* error; if(gtk_tree_model_iter_parent(model, &iter_parent, iter)) { gtk_tree_model_get( model, iter, INF_GTK_BROWSER_MODEL_COL_ERROR, &error, -1 ); if(error != NULL) { g_object_set( G_OBJECT(renderer), "text", error->message, "foreground", INF_GTK_BROWSER_VIEW_ERROR_COLOR, "visible", TRUE, NULL ); } else { g_object_set(G_OBJECT(renderer), "visible", FALSE, NULL); } } else { gtk_tree_model_get( model, iter, INF_GTK_BROWSER_MODEL_COL_STATUS, &status, INF_GTK_BROWSER_MODEL_COL_ERROR, &error, -1 ); switch(status) { case INF_GTK_BROWSER_MODEL_DISCOVERED: case INF_GTK_BROWSER_MODEL_DISCONNECTED: g_object_set( G_OBJECT(renderer), "text", _("Not connected"), "foreground", "black", "visible", FALSE, /* Don't show */ NULL ); break; case INF_GTK_BROWSER_MODEL_RESOLVING: case INF_GTK_BROWSER_MODEL_CONNECTING: g_object_set( G_OBJECT(renderer), "text", _("Connecting..."), "foreground", "black", "visible", TRUE, NULL ); break; case INF_GTK_BROWSER_MODEL_CONNECTED: g_object_set( G_OBJECT(renderer), "text", _("Connected"), "foreground", "black", "visible", FALSE, /* Don't show */ NULL ); break; case INF_GTK_BROWSER_MODEL_ERROR: g_assert(error != NULL); g_object_set( G_OBJECT(renderer), "text", error->message, "foreground", INF_GTK_BROWSER_VIEW_ERROR_COLOR, "visible", TRUE, NULL ); break; default: g_assert_not_reached(); break; } } } /* * GObject overrides */ static void inf_gtk_browser_view_init(GTypeInstance* instance, gpointer g_class) { InfGtkBrowserView* view; InfGtkBrowserViewPrivate* priv; GtkTreeSelection* selection; view = INF_GTK_BROWSER_VIEW(instance); priv = INF_GTK_BROWSER_VIEW_PRIVATE(view); priv->column = gtk_tree_view_column_new(); selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(view)); priv->renderer_icon = gtk_cell_renderer_pixbuf_new(); priv->renderer_status_icon = gtk_cell_renderer_pixbuf_new(); priv->renderer_name = gtk_cell_renderer_text_new(); priv->renderer_progress = gtk_cell_renderer_progress_new(); priv->renderer_status = gtk_cell_renderer_text_new(); priv->browsers = NULL; priv->info_resolvs = NULL; g_object_set(G_OBJECT(priv->renderer_status), "xpad", 10, NULL); g_object_set(G_OBJECT(priv->renderer_status_icon), "xpad", 5, NULL); gtk_tree_view_column_pack_start(priv->column, priv->renderer_icon, FALSE); gtk_tree_view_column_pack_start( priv->column, priv->renderer_status_icon, FALSE ); gtk_tree_view_column_pack_start(priv->column, priv->renderer_name, FALSE); gtk_tree_view_column_pack_start( priv->column, priv->renderer_progress, FALSE ); gtk_tree_view_column_pack_start(priv->column, priv->renderer_status, TRUE); gtk_tree_view_column_set_cell_data_func( priv->column, priv->renderer_icon, inf_gtk_browser_view_icon_data_func, NULL, NULL ); gtk_tree_view_column_set_cell_data_func( priv->column, priv->renderer_status_icon, inf_gtk_browser_view_status_icon_data_func, NULL, NULL ); gtk_tree_view_column_set_cell_data_func( priv->column, priv->renderer_name, inf_gtk_browser_view_name_data_func, NULL, NULL ); gtk_tree_view_column_set_cell_data_func( priv->column, priv->renderer_progress, inf_gtk_browser_view_progress_data_func, NULL, NULL ); gtk_tree_view_column_set_cell_data_func( priv->column, priv->renderer_status, inf_gtk_browser_view_status_data_func, NULL, NULL ); g_signal_connect( selection, "changed", G_CALLBACK(inf_gtk_browser_view_selection_changed_cb), view ); gtk_tree_view_append_column(GTK_TREE_VIEW(view), priv->column); gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(view), FALSE); } static void inf_gtk_browser_view_dispose(GObject* object) { InfGtkBrowserView* view; InfGtkBrowserViewPrivate* priv; view = INF_GTK_BROWSER_VIEW(object); priv = INF_GTK_BROWSER_VIEW_PRIVATE(view); inf_gtk_browser_view_set_model(view, NULL); G_OBJECT_CLASS(parent_class)->dispose(object); } static void inf_gtk_browser_view_finalize(GObject* object) { InfGtkBrowserView* view; InfGtkBrowserViewPrivate* priv; view = INF_GTK_BROWSER_VIEW(object); priv = INF_GTK_BROWSER_VIEW_PRIVATE(view); g_assert(priv->browsers == NULL); G_OBJECT_CLASS(parent_class)->finalize(object); } static void inf_gtk_browser_view_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec) { InfGtkBrowserView* view; view = INF_GTK_BROWSER_VIEW(object); switch(prop_id) { case PROP_MODEL: if (g_value_get_object(value) != NULL) g_assert(INF_GTK_IS_BROWSER_MODEL(g_value_get_object(value))); inf_gtk_browser_view_set_model( view, INF_GTK_BROWSER_MODEL(g_value_get_object(value)) ); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void inf_gtk_browser_view_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec) { InfGtkBrowserView* view; view = INF_GTK_BROWSER_VIEW(object); switch(prop_id) { case PROP_MODEL: g_value_set_object( value, G_OBJECT(gtk_tree_view_get_model(GTK_TREE_VIEW(view))) ); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } /* * GtkObject / GtkWidget overrides */ static void #if GTK_CHECK_VERSION(2, 91, 0) inf_gtk_browser_view_destroy(GtkWidget* object) #else inf_gtk_browser_view_destroy(GtkObject* object) #endif { InfGtkBrowserView* view; InfGtkBrowserViewPrivate* priv; view = INF_GTK_BROWSER_VIEW(object); priv = INF_GTK_BROWSER_VIEW_PRIVATE(view); inf_gtk_browser_view_set_model(view, NULL); #if GTK_CHECK_VERSION(2, 91, 0) if(GTK_WIDGET_CLASS(parent_class)->destroy) GTK_WIDGET_CLASS(parent_class)->destroy(object); #else if(GTK_OBJECT_CLASS(parent_class)->destroy) GTK_OBJECT_CLASS(parent_class)->destroy(object); #endif } /* * GType registration */ static void inf_gtk_browser_view_class_init(gpointer g_class, gpointer class_data) { GObjectClass* object_class; GtkWidgetClass* widget_class; InfGtkBrowserViewClass* view_class; GtkTreeViewClass* tree_class; #if ! GTK_CHECK_VERSION(2, 91, 0) GtkObjectClass *gtk_object_class; #endif object_class = G_OBJECT_CLASS(g_class); widget_class = GTK_WIDGET_CLASS(g_class); view_class = INF_GTK_BROWSER_VIEW_CLASS(g_class); tree_class = GTK_TREE_VIEW_CLASS(g_class); #if ! GTK_CHECK_VERSION(2, 91, 0) gtk_object_class = GTK_OBJECT_CLASS(g_class); gtk_object_class->destroy = inf_gtk_browser_view_destroy; #else widget_class->destroy = inf_gtk_browser_view_destroy; #endif parent_class = G_OBJECT_CLASS(g_type_class_peek_parent(g_class)); g_type_class_add_private(g_class, sizeof(InfGtkBrowserViewPrivate)); object_class->dispose = inf_gtk_browser_view_dispose; object_class->finalize = inf_gtk_browser_view_finalize; object_class->set_property = inf_gtk_browser_view_set_property; object_class->get_property = inf_gtk_browser_view_get_property; tree_class->row_expanded = inf_gtk_browser_view_row_expanded; tree_class->row_activated = inf_gtk_browser_view_row_activated; widget_class->button_press_event = inf_gtk_browser_view_button_press_event; widget_class->key_press_event = inf_gtk_browser_view_key_press_event; view_class->activate = NULL; view_class->selection_changed = NULL; view_class->populate_popup = NULL; g_object_class_override_property(object_class, PROP_MODEL, "model"); view_signals[ACTIVATE] = g_signal_new( "activate", G_TYPE_FROM_CLASS(object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(InfGtkBrowserViewClass, activate), NULL, NULL, inf_marshal_VOID__BOXED, G_TYPE_NONE, 1, GTK_TYPE_TREE_ITER | G_SIGNAL_TYPE_STATIC_SCOPE ); view_signals[SELECTION_CHANGED] = g_signal_new( "selection-changed", G_TYPE_FROM_CLASS(object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(InfGtkBrowserViewClass, selection_changed), NULL, NULL, inf_marshal_VOID__BOXED, G_TYPE_NONE, 1, GTK_TYPE_TREE_ITER | G_SIGNAL_TYPE_STATIC_SCOPE ); view_signals[POPULATE_POPUP] = g_signal_new( "populate-popup", G_TYPE_FROM_CLASS(object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(InfGtkBrowserViewClass, populate_popup), NULL, NULL, inf_marshal_VOID__OBJECT, G_TYPE_NONE, 1, GTK_TYPE_MENU ); } GType inf_gtk_browser_view_get_type(void) { static GType browser_view_type = 0; if(!browser_view_type) { static const GTypeInfo browser_view_type_info = { sizeof(InfGtkBrowserViewClass), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ inf_gtk_browser_view_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InfGtkBrowserView), /* instance_size */ 0, /* n_preallocs */ inf_gtk_browser_view_init, /* instance_init */ NULL /* value_table */ }; browser_view_type = g_type_register_static( GTK_TYPE_TREE_VIEW, "InfGtkBrowserView", &browser_view_type_info, 0 ); } return browser_view_type; } /* * Public API. */ /** * inf_gtk_browser_view_new: * * Creates a new #InfGtkBrowserView. * * Return Value: A new #InfGtkBrowserView. **/ GtkWidget* inf_gtk_browser_view_new(void) { GObject* object; object = g_object_new(INF_GTK_TYPE_BROWSER_VIEW, NULL); return GTK_WIDGET(object); } /** * inf_gtk_browser_view_new_with_model: * @model: A #InfGtkBrowserModel. * * Creates a new #InfGtkBrowserView showing @model. * * Return Value: A new #InfGtkBrowserView. **/ GtkWidget* inf_gtk_browser_view_new_with_model(InfGtkBrowserModel* model) { GObject* object; object = g_object_new(INF_GTK_TYPE_BROWSER_VIEW, "model", model, NULL); return GTK_WIDGET(object); } /** * inf_gtk_browser_view_get_selected: * @view: A #InfGtkBrowserView. * @iter: An uninitialized #GtkTreeIter. * * Sets @iter to point to the currently selected row in the browser view. If * no row is selected, @iter is left untouched and %FALSE is returned. * * Returns: Whether @iter was set. **/ gboolean inf_gtk_browser_view_get_selected(InfGtkBrowserView* view, GtkTreeIter* iter) { GtkTreeSelection* selection; g_return_val_if_fail(INF_GTK_IS_BROWSER_VIEW(view), FALSE); selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(view)); return gtk_tree_selection_get_selected(selection, NULL, iter); } /** * inf_gtk_browser_view_set_selected: * @view: A #InfGtkBrowserView. * @iter: A #GtkTreeIter pointing to a row in @view. * * Sets the currently selected row to be @iter. If necessary, rows will be * expanded so that @iter is visible. */ void inf_gtk_browser_view_set_selected(InfGtkBrowserView* view, GtkTreeIter* iter) { GtkTreeSelection* selection; GtkTreePath* path; g_return_if_fail(INF_GTK_IS_BROWSER_VIEW(view)); g_return_if_fail(iter != NULL); selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(view)); path = gtk_tree_model_get_path( gtk_tree_view_get_model(GTK_TREE_VIEW(view)), iter ); g_assert(path != NULL); gtk_tree_view_expand_to_path(GTK_TREE_VIEW(view), path); gtk_tree_view_scroll_to_cell(GTK_TREE_VIEW(view), path, NULL, FALSE, 0.0f, 0.0f); gtk_tree_path_free(path); gtk_tree_selection_select_iter(selection, iter); } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfgtk/inf-gtk-browser-model-sort.c0000644000175000017500000002227612264763732020227 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include static GObjectClass* parent_class; typedef struct _InfGtkBrowserModelSortPrivate InfGtkBrowserModelSortPrivate; struct _InfGtkBrowserModelSortPrivate { InfGtkBrowserModel* child_model; }; #define INF_GTK_BROWSER_MODEL_SORT_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), INF_GTK_TYPE_BROWSER_MODEL_SORT, InfGtkBrowserModelSortPrivate)) static void inf_gtk_browser_model_sort_set_browser_cb(InfGtkBrowserModel* model, GtkTreePath* path, GtkTreeIter* iter, InfcBrowser* browser, gpointer user_data) { GtkTreeModelSort* model_sort; GtkTreePath* own_path; GtkTreeIter own_iter; model_sort = GTK_TREE_MODEL_SORT(user_data); own_path = gtk_tree_model_sort_convert_child_path_to_path(model_sort, path); gtk_tree_model_sort_convert_child_iter_to_iter(model_sort, &own_iter, iter); inf_gtk_browser_model_set_browser( INF_GTK_BROWSER_MODEL(user_data), own_path, &own_iter, browser ); gtk_tree_path_free(own_path); } static void inf_gtk_browser_model_sort_sync_child_model(InfGtkBrowserModelSort* model, InfGtkBrowserModel* child_model) { InfGtkBrowserModelSortPrivate* priv; priv = INF_GTK_BROWSER_MODEL_SORT_PRIVATE(model); if(priv->child_model != NULL) { inf_signal_handlers_disconnect_by_func( priv->child_model, G_CALLBACK(inf_gtk_browser_model_sort_set_browser_cb), model ); g_object_unref(priv->child_model); } priv->child_model = child_model; if(child_model != NULL) { g_object_ref(child_model); g_signal_connect( G_OBJECT(child_model), "set-browser", G_CALLBACK(inf_gtk_browser_model_sort_set_browser_cb), model ); } } static void inf_gtk_browser_model_sort_notify_model_cb(GObject* object, GParamSpec* pspec, gpointer user_data) { GtkTreeModel* child_model; child_model = gtk_tree_model_sort_get_model( GTK_TREE_MODEL_SORT(object) ); inf_gtk_browser_model_sort_sync_child_model( INF_GTK_BROWSER_MODEL_SORT(object), INF_GTK_BROWSER_MODEL(child_model) ); } /* * GObject overrides */ static void inf_gtk_browser_model_sort_init(GTypeInstance* instance, gpointer g_class) { InfGtkBrowserModelSort* model_sort; InfGtkBrowserModelSortPrivate* priv; model_sort = INF_GTK_BROWSER_MODEL_SORT(instance); priv = INF_GTK_BROWSER_MODEL_SORT_PRIVATE(model_sort); /* Keep child model in sync with the one from GtkTreeModelSort */ g_signal_connect( instance, "notify::model", G_CALLBACK(inf_gtk_browser_model_sort_notify_model_cb), NULL ); } static GObject* inf_gtk_browser_model_sort_constructor(GType type, guint n_construct_properties, GObjectConstructParam* properties) { GObject* object; object = G_OBJECT_CLASS(parent_class)->constructor( type, n_construct_properties, properties ); /* Set initial model, we do not get notified for this */ inf_gtk_browser_model_sort_sync_child_model( INF_GTK_BROWSER_MODEL_SORT(object), INF_GTK_BROWSER_MODEL( gtk_tree_model_sort_get_model(GTK_TREE_MODEL_SORT(object)) ) ); return object; } static void inf_gtk_browser_model_sort_dispose(GObject* object) { InfGtkBrowserModelSort* model_sort; InfGtkBrowserModelSortPrivate* priv; model_sort = INF_GTK_BROWSER_MODEL_SORT(object); priv = INF_GTK_BROWSER_MODEL_SORT_PRIVATE(model_sort); /* Release own child model, since we won't get notified anymore when the * parent's dispose runs. We disconnect the signal handler before chaining * up. */ inf_gtk_browser_model_sort_sync_child_model(model_sort, NULL); inf_signal_handlers_disconnect_by_func( object, G_CALLBACK(inf_gtk_browser_model_sort_notify_model_cb), NULL ); G_OBJECT_CLASS(parent_class)->dispose(object); } /* * InfGtkBrowserModel implementation. */ static void inf_gtk_browser_model_sort_resolve(InfGtkBrowserModel* model, InfDiscovery* discovery, InfDiscoveryInfo* info) { GtkTreeModel* child_model; child_model = gtk_tree_model_sort_get_model(GTK_TREE_MODEL_SORT(model)); inf_gtk_browser_model_resolve( INF_GTK_BROWSER_MODEL(child_model), discovery, info ); } static gboolean inf_gtk_browser_model_sort_browser_iter_to_tree_iter(InfGtkBrowserModel* mdl, InfcBrowser* browser, InfcBrowserIter* iter, GtkTreeIter* tree_iter) { GtkTreeModel* child_model; GtkTreeIter child_iter; gboolean result; child_model = gtk_tree_model_sort_get_model(GTK_TREE_MODEL_SORT(mdl)); result = inf_gtk_browser_model_browser_iter_to_tree_iter( INF_GTK_BROWSER_MODEL(child_model), browser, iter, &child_iter ); if(result == TRUE) { gtk_tree_model_sort_convert_child_iter_to_iter( GTK_TREE_MODEL_SORT(mdl), tree_iter, &child_iter ); return TRUE; } else { return FALSE; } } /* * GType registration */ static void inf_gtk_browser_model_sort_class_init(gpointer g_class, gpointer class_data) { GObjectClass* object_class; InfGtkBrowserModelSortClass* browser_model_sort_class; object_class = G_OBJECT_CLASS(g_class); browser_model_sort_class = INF_GTK_BROWSER_MODEL_SORT_CLASS(g_class); parent_class = G_OBJECT_CLASS(g_type_class_peek_parent(g_class)); g_type_class_add_private(g_class, sizeof(InfGtkBrowserModelSortPrivate)); object_class->constructor = inf_gtk_browser_model_sort_constructor; object_class->dispose = inf_gtk_browser_model_sort_dispose; } static void inf_gtk_browser_model_sort_browser_model_init(gpointer g_iface, gpointer iface_data) { InfGtkBrowserModelIface* iface; iface = (InfGtkBrowserModelIface*)g_iface; iface->set_browser = NULL; iface->resolve = inf_gtk_browser_model_sort_resolve; /* inf_gtk_browser_model_sort_browser_model_browser_iter_to_tree_iter would * be consistent, but a _bit_ too long to fit properly into 80 chars ;) */ iface->browser_iter_to_tree_iter = inf_gtk_browser_model_sort_browser_iter_to_tree_iter; } GType inf_gtk_browser_model_sort_get_type(void) { static GType browser_model_sort_type = 0; if(!browser_model_sort_type) { static const GTypeInfo browser_model_sort_type_info = { sizeof(InfGtkBrowserModelSortClass), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ inf_gtk_browser_model_sort_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InfGtkBrowserModelSort), /* instance_size */ 0, /* n_preallocs */ inf_gtk_browser_model_sort_init, /* instance_init */ NULL /* value_table */ }; static const GInterfaceInfo browser_model_info = { inf_gtk_browser_model_sort_browser_model_init, NULL, NULL }; browser_model_sort_type = g_type_register_static( GTK_TYPE_TREE_MODEL_SORT, "InfGtkBrowserModelSort", &browser_model_sort_type_info, 0 ); g_type_add_interface_static( browser_model_sort_type, INF_GTK_TYPE_BROWSER_MODEL, &browser_model_info ); } return browser_model_sort_type; } /* * Public API. */ /** * inf_gtk_browser_model_sort_new: * @child_model: A #InfGtkBrowserModel. * * Creates a new #InfGtkBrowserModelSort, sorting @child_model. * * Return Value: A new #InfGtkBrowserModelSort. **/ InfGtkBrowserModelSort* inf_gtk_browser_model_sort_new(InfGtkBrowserModel* child_model) { GObject* object; object = g_object_new( INF_GTK_TYPE_BROWSER_MODEL_SORT, "model", child_model, NULL ); return INF_GTK_BROWSER_MODEL_SORT(object); } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfgtk/inf-gtk-certificate-view.h0000644000175000017500000000514412264763732017713 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_GTK_CERTIFICATE_VIEW_H__ #define __INF_GTK_CERTIFICATE_VIEW_H__ #include #include #include /* Get ssize_t on MSVC, required by gnutls.h */ #include G_BEGIN_DECLS #define INF_GTK_TYPE_CERTIFICATE_VIEW (inf_gtk_certificate_view_get_type()) #define INF_GTK_CERTIFICATE_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INF_GTK_TYPE_CERTIFICATE_VIEW, InfGtkCertificateView)) #define INF_GTK_CERTIFICATE_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INF_GTK_TYPE_CERTIFICATE_VIEW, InfGtkCertificateViewClass)) #define INF_GTK_IS_CERTIFICATE_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INF_GTK_TYPE_CERTIFICATE_VIEW)) #define INF_GTK_IS_CERTIFICATE_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INF_GTK_TYPE_CERTIFICATE_VIEW)) #define INF_GTK_CERTIFICATE_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), INF_GTK_TYPE_CERTIFICATE_VIEW, InfGtkCertificateViewClass)) #define INF_GTK_TYPE_CERTIFICATE_VIEW_FLAGS (inf_gtk_certificate_view_flags_get_type()) typedef struct _InfGtkCertificateView InfGtkCertificateView; typedef struct _InfGtkCertificateViewClass InfGtkCertificateViewClass; struct _InfGtkCertificateViewClass { GtkNotebookClass parent_class; }; struct _InfGtkCertificateView { GtkNotebook parent; }; GType inf_gtk_certificate_view_get_type(void) G_GNUC_CONST; GtkWidget* inf_gtk_certificate_view_new(void); GtkWidget* inf_gtk_certificate_view_new_with_certificate(gnutls_x509_crt_t cert); void inf_gtk_certificate_view_set_certificate(InfGtkCertificateView* view, gnutls_x509_crt_t cert); G_END_DECLS #endif /* __INF_GTK_CERTIFICATE_VIEW_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfgtk/inf-gtk-browser-model.c0000644000175000017500000001661512264763732017242 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include enum { SET_BROWSER, LAST_SIGNAL }; static guint browser_model_signals[LAST_SIGNAL]; static void inf_gtk_browser_model_base_init(gpointer g_class) { static gboolean initialized = FALSE; if(!initialized) { /** * InfGtkBrowserModel::set-browser: * @model: The #InfGtkBrowserModel emitting the signal. * @path: A #GtkTreePath pointing to the newly created browser. * @iter: A #GtkTreeIter pointing to the newly created browser. * @browser: The newly created #InfcBrowser. * * This signal is emitted every time a new browser is inserted to the * model. This means either that a completely new item was inserted, or * that an item providing only a discovery has been resolved (see * inf_gtk_browser_model_resolve()). */ browser_model_signals[SET_BROWSER] = g_signal_new( "set-browser", INF_GTK_TYPE_BROWSER_MODEL, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(InfGtkBrowserModelIface, set_browser), NULL, NULL, inf_marshal_VOID__BOXED_BOXED_OBJECT, G_TYPE_NONE, 3, GTK_TYPE_TREE_PATH | G_SIGNAL_TYPE_STATIC_SCOPE, GTK_TYPE_TREE_ITER | G_SIGNAL_TYPE_STATIC_SCOPE, INFC_TYPE_BROWSER ); initialized = TRUE; } } GType inf_gtk_browser_model_status_get_type(void) { static GType browser_model_status_type = 0; if(!browser_model_status_type) { static const GEnumValue browser_model_status_values[] = { { INF_GTK_BROWSER_MODEL_DISCOVERED, "INF_GTK_BROWSER_MODEL_DISCOVERED", "discovered" }, { INF_GTK_BROWSER_MODEL_RESOLVING, "INF_GTK_BROWSER_MODEL_RESOLVING", "resolving" }, { INF_GTK_BROWSER_MODEL_CONNECTING, "INF_GTK_BROWSER_MODEL_CONNECTING", "connecting" }, { INF_GTK_BROWSER_MODEL_CONNECTED, "INF_GTK_BROWSER_MODEL_CONNECTED", "connected" }, { INF_GTK_BROWSER_MODEL_ERROR, "INF_GTK_BROWSER_MODEL_ERROR", "error" }, { 0, NULL, NULL } }; browser_model_status_type = g_enum_register_static( "InfGtkBrowserModelStatus", browser_model_status_values ); } return browser_model_status_type; } GType inf_gtk_browser_model_get_type() { static GType browser_model_type = 0; if(!browser_model_type) { static const GTypeInfo browser_model_info = { sizeof(InfGtkBrowserModelIface), /* class_size */ inf_gtk_browser_model_base_init, /* base_init */ NULL, /* base_finalize */ NULL, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ 0, /* instance_size */ 0, /* n_preallocs */ NULL, /* instance_init */ NULL /* value_table */ }; browser_model_type = g_type_register_static( G_TYPE_INTERFACE, "InfGtkBrowserModel", &browser_model_info, 0 ); g_type_interface_add_prerequisite( browser_model_type, GTK_TYPE_TREE_MODEL ); } return browser_model_type; } /** * inf_gtk_browser_model_set_browser: * @model: A #InfGtkBrowserModel. * @path: A #GtkTreePath to a top-level row. * @iter: A #GtkTreeIter pointing to the same row. * @browser: The new #InfcBrowser to set. * * Emits the #InfGtkBrowserModel::set-browser signal. This is supposed to only * be called by implementations of #InfGtkBrowserModel whenever they set or * unset a browser on a row. **/ void inf_gtk_browser_model_set_browser(InfGtkBrowserModel* model, GtkTreePath* path, GtkTreeIter* iter, InfcBrowser* browser) { g_return_if_fail(INF_GTK_IS_BROWSER_MODEL(model)); g_return_if_fail(path != NULL); g_return_if_fail(iter != NULL); g_return_if_fail(browser == NULL || INFC_IS_BROWSER(browser)); g_signal_emit( G_OBJECT(model), browser_model_signals[SET_BROWSER], 0, path, iter, browser ); } /** * inf_gtk_browser_model_resolve: * @model: A #InfGtkBrowserModel. * @discovery: A #InfDiscovery added to @store. * @info: A #InfDiscoveryInfo discovered by @discovery. * * Resolves @info and adds the resulting connection to the model. If that * connection is already contained, the original (newly resolved) entry * is removed in favor of the existing entry whose browser might already * have explored (parts of) the server's directory. */ void inf_gtk_browser_model_resolve(InfGtkBrowserModel* model, InfDiscovery* discovery, InfDiscoveryInfo* info) { InfGtkBrowserModelIface* iface; g_return_if_fail(INF_GTK_IS_BROWSER_MODEL(model)); g_return_if_fail(INF_IS_DISCOVERY(discovery)); g_return_if_fail(info != NULL); iface = INF_GTK_BROWSER_MODEL_GET_IFACE(model); g_return_if_fail(iface->resolve != NULL); iface->resolve(model, discovery, info); } /** * inf_gtk_browser_model_browser_iter_to_tree_iter: * @model: A #InfGtkBrowserModel. * @browser: A #InfcBrowser. * @browser_iter: A #InfcBrowserIter pointing into @browser. * @tree_iter: A #GtkTreeIter that will be set by this function. * * Sets @tree_iter to point to the same node @browser_iter refers to * within the model. If @browser is not known to @model, i.e. its connection * was never added to @model, then the function returns %FALSE and * @tree_iter is left untouched. * * Return Value: Whether @tree_iter was set. **/ gboolean inf_gtk_browser_model_browser_iter_to_tree_iter(InfGtkBrowserModel* model, InfcBrowser* browser, InfcBrowserIter* browser_iter, GtkTreeIter* tree_iter) { InfGtkBrowserModelIface* iface; g_return_val_if_fail(INF_GTK_IS_BROWSER_MODEL(model), FALSE); g_return_val_if_fail(INFC_IS_BROWSER(browser), FALSE); g_return_val_if_fail(browser_iter != NULL, FALSE); g_return_val_if_fail(tree_iter != NULL, FALSE); iface = INF_GTK_BROWSER_MODEL_GET_IFACE(model); g_return_val_if_fail(iface->browser_iter_to_tree_iter != NULL, FALSE); return iface->browser_iter_to_tree_iter( model, browser, browser_iter, tree_iter ); } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfgtk/Makefile.am0000644000175000017500000000213212264763732015001 00000000000000# TODO: Find a way to have the version number set automatically. lib_LTLIBRARIES = libinfgtk-0.5.la libinfgtk_0_5_la_CPPFLAGS = \ -I$(top_srcdir) \ $(infgtk_CFLAGS) \ $(infinity_CFLAGS) libinfgtk_0_5_la_LDFLAGS = \ -no-undefined \ -version-info $(LIBINFINITY_LIBTOOL_VERSION) libinfgtk_0_5_la_LIBADD = \ ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ $(infgtk_LIBS) \ $(infinity_LIBS) libinfgtk_0_5_ladir = \ $(includedir)/libinfgtk-$(LIBINFINITY_API_VERSION)/libinfgtk libinfgtk_0_5_la_HEADERS = \ inf-gtk-browser-model.h \ inf-gtk-browser-model-filter.h \ inf-gtk-browser-model-sort.h \ inf-gtk-browser-store.h \ inf-gtk-browser-view.h \ inf-gtk-certificate-dialog.h \ inf-gtk-certificate-manager.h \ inf-gtk-certificate-view.h \ inf-gtk-chat.h \ inf-gtk-io.h libinfgtk_0_5_la_SOURCES = \ inf-gtk-browser-model.c \ inf-gtk-browser-model-filter.c \ inf-gtk-browser-model-sort.c \ inf-gtk-browser-store.c \ inf-gtk-browser-view.c \ inf-gtk-certificate-dialog.c \ inf-gtk-certificate-manager.c \ inf-gtk-certificate-view.c \ inf-gtk-chat.c \ inf-gtk-io.c libinfinity-0.5.5/libinfgtk/inf-gtk-browser-store.c0000644000175000017500000020427712264763732017301 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include #include #include #include #include /* The three pointers in GtkTreeIter are used as follows: * * user_data holds a pointer to the GtkTreeModelItem the iter points to. * user_data2 holds the node_id field of the InfcBrowserIter, or 0 if the * iter points to the toplevel node. * user_data3 holds the node field of the InfcBrowser, or NULL if the iter * points to the toplevel node. Note that it does not hold the root node of * the item's browser (if present) because the iter should remain valid when * the browser is removed (we set GTK_TREE_MODEL_ITERS_PERSIST). */ typedef struct _InfGtkBrowserStoreItem InfGtkBrowserStoreItem; struct _InfGtkBrowserStoreItem { gchar* name; InfDiscovery* discovery; InfDiscoveryInfo* info; InfcBrowser* browser; /* Browser node which is currently to be removed. This is required since * when node-removed is emitted in InfcBrowser the node is still present, * but we need to make sure that the GtkTreeModel functions do as if it * wasn't present anymore. */ gpointer missing; /* Running requests */ GSList* requests; /* Saved node errors (during exploration/subscription) */ GHashTable* node_errors; /* TODO: Determine status at run-time? */ InfGtkBrowserModelStatus status; /* Error on toplevel item */ GError* error; /* Link */ InfGtkBrowserStoreItem* next; }; typedef struct _InfGtkBrowserStoreRequestData InfGtkBrowserStoreRequestData; struct _InfGtkBrowserStoreRequestData { InfGtkBrowserStore* store; InfGtkBrowserStoreItem* item; }; typedef struct _InfGtkBrowserStorePrivate InfGtkBrowserStorePrivate; struct _InfGtkBrowserStorePrivate { gint stamp; InfIo* io; InfCommunicationManager* communication_manager; GSList* discoveries; InfGtkBrowserStoreItem* first_item; InfGtkBrowserStoreItem* last_item; }; enum { PROP_0, PROP_IO, PROP_COMMUNICATION_MANAGER }; #define INF_GTK_BROWSER_STORE_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), INF_GTK_TYPE_BROWSER_STORE, InfGtkBrowserStorePrivate)) static GObjectClass* parent_class; /* * Utility functions */ static InfGtkBrowserStoreItem* inf_gtk_browser_store_find_item_by_connection(InfGtkBrowserStore* store, InfXmlConnection* connection) { InfGtkBrowserStorePrivate* priv; InfGtkBrowserStoreItem* item; priv = INF_GTK_BROWSER_STORE_PRIVATE(store); for(item = priv->first_item; item != NULL; item = item->next) if(item->browser != NULL) if(infc_browser_get_connection(item->browser) == connection) return item; return NULL; } static InfGtkBrowserStoreItem* inf_gtk_browser_store_find_item_by_browser(InfGtkBrowserStore* store, InfcBrowser* browser) { InfGtkBrowserStorePrivate* priv; InfGtkBrowserStoreItem* item; priv = INF_GTK_BROWSER_STORE_PRIVATE(store); for(item = priv->first_item; item != NULL; item = item->next) if(item->browser != NULL) if(item->browser == browser) return item; return NULL; } static InfGtkBrowserStoreItem* inf_gtk_browser_store_find_item_by_discovery_info(InfGtkBrowserStore* store, InfDiscoveryInfo* info) { InfGtkBrowserStorePrivate* priv; InfGtkBrowserStoreItem* item; priv = INF_GTK_BROWSER_STORE_PRIVATE(store); for(item = priv->first_item; item != NULL; item = item->next) if(item->info != NULL) if(item->info == info) return item; return NULL; } /* * Callback declarations */ static void inf_gtk_browser_store_browser_notify_status_cb(GObject* object, GParamSpec* pspec, gpointer user_data); static void inf_gtk_browser_store_browser_error_cb(InfcBrowser* browser, const GError* error, gpointer user_data); static void inf_gtk_browser_store_node_added_cb(InfcBrowser* browser, InfcBrowserIter* iter, gpointer user_data); static void inf_gtk_browser_store_node_removed_cb(InfcBrowser* browser, InfcBrowserIter* iter, gpointer user_data); static void inf_gtk_browser_store_begin_explore_cb(InfcBrowser* browser, InfcBrowserIter* iter, InfcExploreRequest* request, gpointer user_data); static void inf_gtk_browser_store_begin_subscribe_cb(InfcBrowser* browser, InfcBrowserIter* iter, InfcNodeRequest* request, gpointer user_data); static void inf_gtk_browser_store_request_failed_cb(InfcRequest* request, const GError* error, gpointer user_data); static void inf_gtk_browser_store_request_unrefed_func(gpointer data, GObject* where_the_object_was); /* * InfGtkBrowserStoreItem handling */ static void inf_gtk_browser_store_request_data_free(gpointer data, GClosure* closure) { g_slice_free(InfGtkBrowserStoreRequestData, data); } static void inf_gtk_browser_store_item_request_remove(InfGtkBrowserStoreItem* item, InfcRequest* request) { g_object_weak_unref( G_OBJECT(request), inf_gtk_browser_store_request_unrefed_func, item ); inf_signal_handlers_disconnect_by_func( G_OBJECT(request), G_CALLBACK(inf_gtk_browser_store_request_failed_cb), item ); item->requests = g_slist_remove(item->requests, request); } static void inf_gtk_browser_store_item_request_add(InfGtkBrowserStore* store, InfGtkBrowserStoreItem* item, InfcRequest* request) { InfGtkBrowserStoreRequestData* data; g_assert(g_slist_find(item->requests, request) == NULL); item->requests = g_slist_prepend(item->requests, request); data = g_slice_new(InfGtkBrowserStoreRequestData); data->store = store; data->item = item; g_signal_connect_data( G_OBJECT(request), "failed", G_CALLBACK(inf_gtk_browser_store_request_failed_cb), data, inf_gtk_browser_store_request_data_free, 0 ); g_object_weak_ref( G_OBJECT(request), inf_gtk_browser_store_request_unrefed_func, item ); } static void inf_gtk_browser_store_request_failed_cb(InfcRequest* request, const GError* error, gpointer user_data) { InfGtkBrowserStoreRequestData* data; InfGtkBrowserStorePrivate* priv; InfcBrowserIter iter; gboolean node_exists; GtkTreeIter tree_iter; GtkTreePath* path; data = (InfGtkBrowserStoreRequestData*)user_data; priv = INF_GTK_BROWSER_STORE_PRIVATE(data->store); g_assert(g_slist_find(data->item->requests, request) != NULL); g_assert(data->item->browser != NULL); /* TODO: Let explore request derive from node request */ g_assert(INFC_IS_EXPLORE_REQUEST(request) || INFC_IS_NODE_REQUEST(request)); if(INFC_IS_EXPLORE_REQUEST(request)) { node_exists = infc_browser_iter_from_explore_request( data->item->browser, INFC_EXPLORE_REQUEST(request), &iter ); } else { node_exists = infc_browser_iter_from_node_request( data->item->browser, INFC_NODE_REQUEST(request), &iter ); } inf_gtk_browser_store_item_request_remove(data->item, request); /* Ignore if node has been removed in the meanwhile */ if(G_LIKELY(node_exists)) { /* Replace previous error */ g_hash_table_insert( data->item->node_errors, GUINT_TO_POINTER(iter.node_id), g_error_copy(error) ); tree_iter.stamp = priv->stamp; tree_iter.user_data = data->item; tree_iter.user_data2 = GUINT_TO_POINTER(iter.node_id); /* Set NULL for root node because it also refers to the store item as * such if no browser is set. */ if(iter.node_id == 0) tree_iter.user_data3 = NULL; else tree_iter.user_data3 = iter.node; path = gtk_tree_model_get_path(GTK_TREE_MODEL(data->store), &tree_iter); gtk_tree_model_row_changed(GTK_TREE_MODEL(data->store), path, &tree_iter); gtk_tree_path_free(path); } } static void inf_gtk_browser_store_request_unrefed_func(gpointer data, GObject* where_the_object_was) { InfGtkBrowserStoreItem* item; item = (InfGtkBrowserStoreItem*)data; /* No need to further unregister */ item->requests = g_slist_remove(item->requests, where_the_object_was); } static void inf_gtk_browser_store_item_set_browser(InfGtkBrowserStore* store, InfGtkBrowserStoreItem* item, GtkTreePath* path, InfcBrowser* browser) { GtkTreeIter tree_iter; InfGtkBrowserStorePrivate* priv; priv = INF_GTK_BROWSER_STORE_PRIVATE(store); tree_iter.stamp = priv->stamp; tree_iter.user_data = item; tree_iter.user_data2 = GUINT_TO_POINTER(0); tree_iter.user_data3 = NULL; /* The default signal handler sets the browser in the item and makes the * necessary TreeModel notifications. See * inf_gtk_browser_store_browser_model_set_browser(). */ inf_gtk_browser_model_set_browser( INF_GTK_BROWSER_MODEL(store), path, &tree_iter, browser ); } /* takes ownership of name */ static InfGtkBrowserStoreItem* inf_gtk_browser_store_add_item(InfGtkBrowserStore* store, InfDiscovery* discovery, InfDiscoveryInfo* info, InfXmlConnection* connection, gchar* name) { InfGtkBrowserStorePrivate* priv; InfGtkBrowserStoreItem* item; InfGtkBrowserStoreItem* cur; GtkTreePath* path; GtkTreeIter iter; guint index; InfcBrowser* browser; g_assert( connection == NULL || inf_gtk_browser_store_find_item_by_connection(store, connection) == NULL ); priv = INF_GTK_BROWSER_STORE_PRIVATE(store); item = g_slice_new(InfGtkBrowserStoreItem); item->name = name; item->discovery = discovery; item->info = info; item->status = INF_GTK_BROWSER_MODEL_DISCONNECTED; if(discovery != NULL && info != NULL) item->status = INF_GTK_BROWSER_MODEL_DISCOVERED; item->browser = NULL; item->missing = NULL; item->node_errors = g_hash_table_new_full( NULL, NULL, NULL, (GDestroyNotify)g_error_free ); item->requests = NULL; item->error = NULL; item->next = NULL; index = 0; for(cur = priv->first_item; cur != NULL; cur = cur->next) ++ index; /* Link */ if(priv->first_item == NULL) { priv->first_item = item; priv->last_item = item; } else { priv->last_item->next = item; priv->last_item = item; } path = gtk_tree_path_new_from_indices(index, -1); iter.stamp = priv->stamp; iter.user_data = item; iter.user_data2 = GUINT_TO_POINTER(0); iter.user_data3 = NULL; gtk_tree_model_row_inserted(GTK_TREE_MODEL(store), path, &iter); if(connection != NULL) { browser = infc_browser_new( priv->io, priv->communication_manager, connection ); /* The connection is not set if the browser could not find a "central" * method for the connection's network. */ /* TODO: Set error */ if(infc_browser_get_connection(browser) != NULL) inf_gtk_browser_store_item_set_browser(store, item, path, browser); g_object_unref(G_OBJECT(browser)); } gtk_tree_path_free(path); return item; } static void inf_gtk_browser_store_remove_item(InfGtkBrowserStore* store, InfGtkBrowserStoreItem* item) { InfGtkBrowserStorePrivate* priv; InfGtkBrowserStoreItem* prev; InfGtkBrowserStoreItem* cur; GtkTreePath* path; guint index; priv = INF_GTK_BROWSER_STORE_PRIVATE(store); /* Determine index of item, to build a tree path to it */ prev = NULL; index = 0; for(cur = priv->first_item; cur != NULL; cur = cur->next) { if(cur == item) break; prev = cur; ++ index; } /* Item was present in list */ g_assert(cur != NULL); path = gtk_tree_path_new_from_indices(index, -1); /* Note we need to reset the browser before we unlink because * inf_gtk_browser_store_item_set_browser() requires item still being * linked for change notifications. */ if(item->browser != NULL) { inf_gtk_browser_store_item_set_browser(store, item, path, NULL); g_assert(item->browser == NULL); /* Default handler must run */ } /* Unlink */ if(prev == NULL) priv->first_item = item->next; else prev->next = item->next; if(item->next == NULL) priv->last_item = prev; g_assert(cur != NULL); gtk_tree_model_row_deleted(GTK_TREE_MODEL(store), path); gtk_tree_path_free(path); if(item->error != NULL) g_error_free(item->error); g_hash_table_unref(item->node_errors); g_free(item->name); g_slice_free(InfGtkBrowserStoreItem, item); } /* * Callbacks and signal handlers */ static void inf_gtk_browser_store_discovered_cb(InfDiscovery* discovery, InfDiscoveryInfo* info, gpointer user_data) { inf_gtk_browser_store_add_item( INF_GTK_BROWSER_STORE(user_data), discovery, info, NULL, inf_discovery_info_get_service_name(discovery, info) ); } static void inf_gtk_browser_store_undiscovered_cb(InfDiscovery* discovery, InfDiscoveryInfo* info, gpointer user_data) { InfGtkBrowserStore* store; InfGtkBrowserStoreItem* item; store = INF_GTK_BROWSER_STORE(user_data); item = inf_gtk_browser_store_find_item_by_discovery_info(store, info); /* If, after a discovery resove we see that there is already an item for * that connection, then we remove the discovery item, and use the other * item instead. In that case, item can be NULL here. */ if(item != NULL) { if(item->browser == NULL) { inf_gtk_browser_store_remove_item(store, item); } else { g_assert(item->status != INF_GTK_BROWSER_MODEL_DISCOVERED && item->status != INF_GTK_BROWSER_MODEL_RESOLVING); item->discovery = NULL; item->info = NULL; } } } static void inf_gtk_browser_store_browser_error_cb(InfcBrowser* browser, const GError* error, gpointer user_data) { InfGtkBrowserStore* store; InfGtkBrowserStoreItem* item; InfGtkBrowserStorePrivate* priv; GtkTreeIter iter; GtkTreePath* path; store = INF_GTK_BROWSER_STORE(user_data); priv = INF_GTK_BROWSER_STORE_PRIVATE(store); item = inf_gtk_browser_store_find_item_by_browser(store, browser); g_assert(item != NULL); /* Overwrite previous error */ if(item->error != NULL) g_error_free(item->error); item->error = g_error_copy(error); /* Don't set error state, this could be a non-fatal error */ /* Notify */ iter.stamp = priv->stamp; iter.user_data = item; iter.user_data2 = GUINT_TO_POINTER(0); iter.user_data3 = NULL; path = gtk_tree_model_get_path(GTK_TREE_MODEL(store), &iter); gtk_tree_model_row_changed(GTK_TREE_MODEL(store), path, &iter); gtk_tree_path_free(path); } static void inf_gtk_browser_store_browser_notify_status_cb(GObject* object, GParamSpec* pspec, gpointer user_data) { InfGtkBrowserStore* store; InfGtkBrowserStorePrivate* priv; InfcBrowser* browser; InfGtkBrowserStoreItem* item; GtkTreeIter iter; GtkTreePath* path; store = INF_GTK_BROWSER_STORE(user_data); priv = INF_GTK_BROWSER_STORE_PRIVATE(user_data); browser = INFC_BROWSER(object); item = inf_gtk_browser_store_find_item_by_browser(store, browser); g_assert(item != NULL); iter.stamp = priv->stamp; iter.user_data = item; iter.user_data2 = GUINT_TO_POINTER(0); iter.user_data3 = NULL; path = gtk_tree_model_get_path(GTK_TREE_MODEL(store), &iter); switch(infc_browser_get_status(browser)) { case INFC_BROWSER_DISCONNECTED: /* TODO: Do we want to go to disconnected state when error is not set? */ item->status = INF_GTK_BROWSER_MODEL_ERROR; /* Set a "Disconnected" error if there is not already one set by * inf_gtk_browser_store_connection_error_cb() that has a more * meaningful error message. */ if(item->error == NULL) { item->error = g_error_new_literal( g_quark_from_static_string("INF_GTK_BROWSER_STORE_ERROR"), 0, _("Disconnected") ); } gtk_tree_model_row_changed(GTK_TREE_MODEL(store), path, &iter); break; case INFC_BROWSER_CONNECTING: if(item->error != NULL) g_error_free(item->error); item->error = NULL; item->status = INF_GTK_BROWSER_MODEL_CONNECTING; gtk_tree_model_row_changed(GTK_TREE_MODEL(store), path, &iter); break; case INFC_BROWSER_CONNECTED: if(item->error != NULL) g_error_free(item->error); item->error = NULL; item->status = INF_GTK_BROWSER_MODEL_CONNECTED; gtk_tree_model_row_changed(GTK_TREE_MODEL(store), path, &iter); break; default: g_assert_not_reached(); break; } gtk_tree_path_free(path); } static void inf_gtk_browser_store_node_added_cb(InfcBrowser* browser, InfcBrowserIter* iter, gpointer user_data) { InfGtkBrowserStore* store; InfGtkBrowserStorePrivate* priv; InfGtkBrowserStoreItem* item; GtkTreeIter tree_iter; GtkTreePath* path; InfcBrowserIter test_iter; gboolean test_result; store = INF_GTK_BROWSER_STORE(user_data); priv = INF_GTK_BROWSER_STORE_PRIVATE(store); item = inf_gtk_browser_store_find_item_by_browser(store, browser); tree_iter.stamp = priv->stamp; tree_iter.user_data = item; tree_iter.user_data2 = GUINT_TO_POINTER(iter->node_id); tree_iter.user_data3 = iter->node; path = gtk_tree_model_get_path(GTK_TREE_MODEL(store), &tree_iter); gtk_tree_model_row_inserted(GTK_TREE_MODEL(store), path, &tree_iter); /* If iter is the only node within its parent, we need to emit the * row-has-child-toggled signal. */ test_iter = *iter; test_result = infc_browser_iter_get_parent(browser, &test_iter); g_assert(test_result == TRUE); /* Let tree_iter point to parent row for possible notification */ tree_iter.user_data2 = GUINT_TO_POINTER(test_iter.node_id); /* Also adjust path */ gtk_tree_path_up(path); if(test_iter.node_id == 0) tree_iter.user_data3 = NULL; else tree_iter.user_data3 = test_iter.node; test_result = infc_browser_iter_get_child(browser, &test_iter); g_assert(test_result == TRUE); if(infc_browser_iter_get_next(browser, &test_iter) == FALSE) { gtk_tree_model_row_has_child_toggled( GTK_TREE_MODEL(store), path, &tree_iter ); } gtk_tree_path_free(path); } static void inf_gtk_browser_store_node_removed_cb(InfcBrowser* browser, InfcBrowserIter* iter, gpointer user_data) { InfGtkBrowserStore* store; InfGtkBrowserStorePrivate* priv; InfGtkBrowserStoreItem* item; GtkTreeIter tree_iter; GtkTreePath* path; InfcBrowserIter test_iter; gboolean test_result; store = INF_GTK_BROWSER_STORE(user_data); priv = INF_GTK_BROWSER_STORE_PRIVATE(store); item = inf_gtk_browser_store_find_item_by_browser(store, browser); g_assert(item->missing == NULL); tree_iter.stamp = priv->stamp; tree_iter.user_data = item; tree_iter.user_data2 = GUINT_TO_POINTER(iter->node_id); tree_iter.user_data3 = iter->node; path = gtk_tree_model_get_path(GTK_TREE_MODEL(store), &tree_iter); /* This is a small hack to have the item removed from the tree * model before it is removed from the InfcBrowser. */ item->missing = iter->node; gtk_tree_model_row_deleted(GTK_TREE_MODEL(store), path); /* TODO: Remove requests and node errors from nodes below the removed one */ /* Note that at this point removed node is still in the browser. We have * to emit row-has-child-toggled if it is the only one in its * subdirectory. */ test_iter = *iter; test_result = infc_browser_iter_get_parent(browser, &test_iter); g_assert(test_result == TRUE); /* Let tree_iter point to parent row for possible notification */ tree_iter.user_data2 = GUINT_TO_POINTER(test_iter.node_id); /* Also adjust path */ gtk_tree_path_up(path); if(test_iter.node_id == 0) tree_iter.user_data3 = NULL; else tree_iter.user_data3 = test_iter.node; test_result = infc_browser_iter_get_child(browser, &test_iter); g_assert(test_result == TRUE); if(infc_browser_iter_get_next(browser, &test_iter) == FALSE) { gtk_tree_model_row_has_child_toggled( GTK_TREE_MODEL(store), path, &tree_iter ); } gtk_tree_path_free(path); item->missing = NULL; } static void inf_gtk_browser_store_begin_explore_cb(InfcBrowser* browser, InfcBrowserIter* iter, InfcExploreRequest* request, gpointer user_data) { InfGtkBrowserStore* store; InfGtkBrowserStoreItem* item; store = INF_GTK_BROWSER_STORE(user_data); item = inf_gtk_browser_store_find_item_by_browser(store, browser); inf_gtk_browser_store_item_request_add(store, item, INFC_REQUEST(request)); } static void inf_gtk_browser_store_begin_subscribe_cb(InfcBrowser* browser, InfcBrowserIter* iter, InfcNodeRequest* request, gpointer user_data) { InfGtkBrowserStore* store; InfGtkBrowserStoreItem* item; store = INF_GTK_BROWSER_STORE(user_data); /* Ignore chat subscriptions */ if(iter != NULL) { item = inf_gtk_browser_store_find_item_by_browser(store, browser); inf_gtk_browser_store_item_request_add( store, item, INFC_REQUEST(request) ); } } static void inf_gtk_browser_store_resolv_complete_func(InfDiscoveryInfo* info, InfXmlConnection* connection, gpointer user_data) { InfGtkBrowserStore* store; InfGtkBrowserStorePrivate* priv; InfGtkBrowserStoreItem* new_item; InfGtkBrowserStoreItem* old_item; GtkTreeIter tree_iter; GtkTreePath* path; InfcBrowser* browser; InfGtkBrowserStoreItem* cur; InfGtkBrowserStoreItem* prev; InfGtkBrowserStoreItem* prev_new; InfGtkBrowserStoreItem* prev_old; gint* order; guint count; guint new_pos; guint old_pos; guint i; store = INF_GTK_BROWSER_STORE(user_data); priv = INF_GTK_BROWSER_STORE_PRIVATE(store); new_item = inf_gtk_browser_store_find_item_by_discovery_info(store, info); old_item = inf_gtk_browser_store_find_item_by_connection(store, connection); g_assert(new_item != NULL); g_assert(new_item->status == INF_GTK_BROWSER_MODEL_RESOLVING); tree_iter.stamp = priv->stamp; tree_iter.user_data = new_item; tree_iter.user_data2 = GUINT_TO_POINTER(0); tree_iter.user_data3 = NULL; if(old_item != NULL) { g_assert(old_item != new_item); /* There is already an item with the same connection. This is perhaps from * another discovery or was inserted directly. We remove the current item * and move the existing one to the place of it. */ count = 0; prev = NULL; for(cur = priv->first_item; cur != NULL; cur = cur->next) { if(cur == old_item) { old_pos = count; prev_old = prev; } if(cur == new_item) { new_pos = count; prev_new = prev; } ++ count; prev = cur; } inf_gtk_browser_store_remove_item(store, new_item); if(old_pos > new_pos) -- old_pos; else -- new_pos; -- count; /* Reorder list if the two items were not adjacent */ if(new_pos != old_pos) { /* old item is last element, but it is moved elsewhere */ if(old_item->next == NULL) priv->last_item = prev_old; /* Unlink old_item */ if(prev_old != NULL) prev_old->next = old_item->next; else priv->first_item = old_item->next; /* Relink */ old_item->next = prev_new->next; if(prev_new != NULL) prev_new->next = old_item; else priv->first_item = old_item; /* old_item has been moved to end of list */ if(old_item->next == NULL) priv->last_item = old_item; order = g_malloc(sizeof(gint) * count); if(new_pos < old_pos) { for(i = 0; i < new_pos; ++ i) order[i] = i; order[new_pos] = old_pos; for(i = new_pos + 1; i <= old_pos; ++ i) order[i] = i - 1; for(i = old_pos + 1; i < count; ++ i) order[i] = i; } else { for(i = 0; i < old_pos; ++ i) order[i] = i; for(i = old_pos; i < new_pos; ++ i) order[i] = i + 1; order[new_pos] = old_pos; for(i = new_pos + 1; i < count; ++ i) order[i] = i; } path = gtk_tree_path_new(); gtk_tree_model_rows_reordered(GTK_TREE_MODEL(store), path, NULL, order); gtk_tree_path_free(path); /* TODO: Perhaps we should emit a signal so that the view can * highlight and scroll to the existing item. And also so that it can * over initial root exploration. */ g_free(order); } } else { path = gtk_tree_model_get_path(GTK_TREE_MODEL(store), &tree_iter); browser = infc_browser_new( priv->io, priv->communication_manager, connection ); /* The connection is not set if the browser could not find a "central" * method for the connection's network. */ /* TODO: Set error */ if(infc_browser_get_connection(browser) != NULL) inf_gtk_browser_store_item_set_browser(store, new_item, path, browser); g_object_unref(G_OBJECT(browser)); gtk_tree_path_free(path); } } static void inf_gtk_browser_store_resolv_error_func(InfDiscoveryInfo* info, const GError* error, gpointer user_data) { InfGtkBrowserStore* store; InfGtkBrowserStorePrivate* priv; InfGtkBrowserStoreItem* item; GtkTreeIter tree_iter; GtkTreePath* path; store = INF_GTK_BROWSER_STORE(user_data); priv = INF_GTK_BROWSER_STORE_PRIVATE(store); item = inf_gtk_browser_store_find_item_by_discovery_info(store, info); g_assert(item != NULL); g_assert(item->status == INF_GTK_BROWSER_MODEL_RESOLVING); item->status = INF_GTK_BROWSER_MODEL_ERROR; item->error = g_error_copy(error); tree_iter.stamp = priv->stamp; tree_iter.user_data = item; tree_iter.user_data2 = GUINT_TO_POINTER(0); tree_iter.user_data3 = NULL; path = gtk_tree_model_get_path(GTK_TREE_MODEL(store), &tree_iter); gtk_tree_model_row_changed(GTK_TREE_MODEL(store), path, &tree_iter); gtk_tree_path_free(path); } /* * GObject overrides */ static void inf_gtk_browser_store_init(GTypeInstance* instance, gpointer g_class) { InfGtkBrowserStore* store; InfGtkBrowserStorePrivate* priv; store = INF_GTK_BROWSER_STORE(instance); priv = INF_GTK_BROWSER_STORE_PRIVATE(store); priv->stamp = g_random_int(); priv->io = NULL; priv->communication_manager = NULL; priv->discoveries = NULL; priv->first_item = NULL; priv->last_item = NULL; } static void inf_gtk_browser_store_dispose(GObject* object) { InfGtkBrowserStore* store; InfGtkBrowserStorePrivate* priv; GSList* item; store = INF_GTK_BROWSER_STORE(object); priv = INF_GTK_BROWSER_STORE_PRIVATE(store); while(priv->first_item != NULL) inf_gtk_browser_store_remove_item(store, priv->first_item); g_assert(priv->last_item == NULL); for(item = priv->discoveries; item != NULL; item = g_slist_next(item)) { inf_signal_handlers_disconnect_by_func( G_OBJECT(item->data), G_CALLBACK(inf_gtk_browser_store_discovered_cb), store ); inf_signal_handlers_disconnect_by_func( G_OBJECT(item->data), G_CALLBACK(inf_gtk_browser_store_undiscovered_cb), store ); g_object_unref(G_OBJECT(item->data)); } g_slist_free(priv->discoveries); priv->discoveries = NULL; if(priv->communication_manager != NULL) { g_object_unref(priv->communication_manager); priv->communication_manager = NULL; } if(priv->io != NULL) { g_object_unref(G_OBJECT(priv->io)); priv->io = NULL; } G_OBJECT_CLASS(parent_class)->dispose(object); } static void inf_gtk_browser_store_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec) { InfGtkBrowserStore* store; InfGtkBrowserStorePrivate* priv; store = INF_GTK_BROWSER_STORE(object); priv = INF_GTK_BROWSER_STORE_PRIVATE(store); switch(prop_id) { case PROP_IO: g_assert(priv->io == NULL); /* construct only */ priv->io = INF_IO(g_value_dup_object(value)); break; case PROP_COMMUNICATION_MANAGER: g_assert(priv->communication_manager == NULL); /* construct only */ priv->communication_manager = INF_COMMUNICATION_MANAGER(g_value_dup_object(value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void inf_gtk_browser_store_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec) { InfGtkBrowserStore* store; InfGtkBrowserStorePrivate* priv; store = INF_GTK_BROWSER_STORE(object); priv = INF_GTK_BROWSER_STORE_PRIVATE(store); switch(prop_id) { case PROP_IO: g_value_set_object(value, priv->io); break; case PROP_COMMUNICATION_MANAGER: g_value_set_object(value, priv->communication_manager); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } /* * GtkTreeModel implementation */ static GtkTreeModelFlags inf_gtk_browser_store_tree_model_get_flags(GtkTreeModel* model) { return GTK_TREE_MODEL_ITERS_PERSIST; } static gint inf_gtk_browser_store_tree_model_get_n_columns(GtkTreeModel* model) { return INF_GTK_BROWSER_MODEL_NUM_COLS; } static GType inf_gtk_browser_store_tree_model_get_column_type(GtkTreeModel* model, gint index) { switch(index) { case INF_GTK_BROWSER_MODEL_COL_DISCOVERY_INFO: return G_TYPE_POINTER; case INF_GTK_BROWSER_MODEL_COL_DISCOVERY: return INF_TYPE_DISCOVERY; case INF_GTK_BROWSER_MODEL_COL_BROWSER: return INFC_TYPE_BROWSER; case INF_GTK_BROWSER_MODEL_COL_STATUS: return INF_GTK_TYPE_BROWSER_MODEL_STATUS; case INF_GTK_BROWSER_MODEL_COL_NAME: return G_TYPE_STRING; case INF_GTK_BROWSER_MODEL_COL_ERROR: return G_TYPE_POINTER; case INF_GTK_BROWSER_MODEL_COL_NODE: return INFC_TYPE_BROWSER_ITER; default: g_assert_not_reached(); return G_TYPE_INVALID; } } static gboolean inf_gtk_browser_store_tree_model_get_iter(GtkTreeModel* model, GtkTreeIter* iter, GtkTreePath* path) { InfGtkBrowserStorePrivate* priv; InfGtkBrowserStoreItem* item; InfcBrowserIter browser_iter; gint* indices; guint i; guint n; priv = INF_GTK_BROWSER_STORE_PRIVATE(model); if(gtk_tree_path_get_depth(path) == 0) return FALSE; indices = gtk_tree_path_get_indices(path); n = indices[0]; i = 0; for(item = priv->first_item; item != NULL && i < n; item = item->next) ++i; if(item == NULL) return FALSE; /* Depth 1 */ if(gtk_tree_path_get_depth(path) == 1) { iter->stamp = priv->stamp; iter->user_data = item; iter->user_data2 = GUINT_TO_POINTER(0); iter->user_data3 = NULL; return TRUE; } if(item->browser == NULL) return FALSE; infc_browser_iter_get_root(item->browser, &browser_iter); for(n = 1; n < (guint)gtk_tree_path_get_depth(path); ++ n) { if(infc_browser_iter_get_explored(item->browser, &browser_iter) == FALSE) return FALSE; if(infc_browser_iter_get_child(item->browser, &browser_iter) == FALSE) return FALSE; /* skip missing */ if(browser_iter.node == item->missing) ++indices[n]; for(i = 0; i < (guint)indices[n]; ++ i) { if(infc_browser_iter_get_next(item->browser, &browser_iter) == FALSE) return FALSE; /* skip missing */ if(browser_iter.node == item->missing) ++indices[n]; } } iter->stamp = priv->stamp; iter->user_data = item; iter->user_data2 = GUINT_TO_POINTER(browser_iter.node_id); iter->user_data3 = browser_iter.node; return TRUE; } /* TODO: We can also use gtk_tree_path_prepend_index and do tail * recursion. We should find out which is faster. */ static void inf_gtk_browser_store_tree_model_get_path_impl(InfGtkBrowserStore* store, InfGtkBrowserStoreItem* item, InfcBrowserIter* iter, GtkTreePath* path) { InfGtkBrowserStorePrivate* priv; InfcBrowserIter cur_iter; InfGtkBrowserStoreItem* cur; gboolean result; guint n; cur_iter = *iter; if(infc_browser_iter_get_parent(item->browser, &cur_iter) == FALSE) { priv = INF_GTK_BROWSER_STORE_PRIVATE(store); /* We are on top level, but still need to find the item index */ n = 0; for(cur = priv->first_item; cur != item; cur = cur->next) ++n; gtk_tree_path_append_index(path, n); } else { inf_gtk_browser_store_tree_model_get_path_impl( store, item, &cur_iter, path ); result = infc_browser_iter_get_child(item->browser, &cur_iter); g_assert(result == TRUE); /* skip missing */ if(cur_iter.node == item->missing) { result = infc_browser_iter_get_next(item->browser, &cur_iter); g_assert(result == TRUE); } n = 0; while(cur_iter.node_id != iter->node_id) { result = infc_browser_iter_get_next(item->browser, &cur_iter); g_assert(result == TRUE); /* skip missing */ if(cur_iter.node == item->missing) { result = infc_browser_iter_get_next(item->browser, &cur_iter); g_assert(result == TRUE); } ++n; } gtk_tree_path_append_index(path, n); } } static GtkTreePath* inf_gtk_browser_store_tree_model_get_path(GtkTreeModel* model, GtkTreeIter* iter) { InfGtkBrowserStorePrivate* priv; InfGtkBrowserStoreItem* item; InfGtkBrowserStoreItem* cur; GtkTreePath* path; InfcBrowserIter browser_iter; guint n; priv = INF_GTK_BROWSER_STORE_PRIVATE(model); g_assert(iter->stamp == priv->stamp); g_assert(iter->user_data != NULL); item = (InfGtkBrowserStoreItem*)iter->user_data; path = gtk_tree_path_new(); browser_iter.node_id = GPOINTER_TO_UINT(iter->user_data2); browser_iter.node = iter->user_data3; if(browser_iter.node != NULL) { g_assert(item->browser != NULL); inf_gtk_browser_store_tree_model_get_path_impl( INF_GTK_BROWSER_STORE(model), item, &browser_iter, path ); } else { /* toplevel */ n = 0; for(cur = priv->first_item; cur != item; cur = cur->next) ++n; gtk_tree_path_append_index(path, n); } return path; } static void inf_gtk_browser_store_tree_model_get_value(GtkTreeModel* model, GtkTreeIter* iter, gint column, GValue* value) { InfGtkBrowserStorePrivate* priv; InfGtkBrowserStoreItem* item; InfcBrowserIter browser_iter; GError* error; priv = INF_GTK_BROWSER_STORE_PRIVATE(model); g_assert(iter->stamp == priv->stamp); item = (InfGtkBrowserStoreItem*)iter->user_data; browser_iter.node_id = GPOINTER_TO_UINT(iter->user_data2); browser_iter.node = iter->user_data3; g_assert(item->missing == NULL || browser_iter.node != item->missing); switch(column) { case INF_GTK_BROWSER_MODEL_COL_DISCOVERY_INFO: g_value_init(value, G_TYPE_POINTER); g_value_set_pointer(value, item->info); break; case INF_GTK_BROWSER_MODEL_COL_DISCOVERY: g_value_init(value, G_TYPE_OBJECT); g_value_set_object(value, item->discovery); break; case INF_GTK_BROWSER_MODEL_COL_BROWSER: g_value_init(value, INFC_TYPE_BROWSER); g_value_set_object(value, G_OBJECT(item->browser)); break; case INF_GTK_BROWSER_MODEL_COL_STATUS: g_assert(browser_iter.node == NULL); /* only toplevel */ g_value_init(value, INF_GTK_TYPE_BROWSER_MODEL_STATUS); g_value_set_enum(value, item->status); break; case INF_GTK_BROWSER_MODEL_COL_NAME: g_value_init(value, G_TYPE_STRING); if(browser_iter.node == NULL) { g_value_set_string(value, item->name); } else { g_value_set_string( value, infc_browser_iter_get_name(item->browser, &browser_iter) ); } break; case INF_GTK_BROWSER_MODEL_COL_ERROR: if(browser_iter.node == NULL) { /* toplevel */ if(item->error != NULL) { /* not a node related error, perhaps connection error */ error = item->error; } else if(item->browser != NULL) { /* error on root node */ infc_browser_iter_get_root(item->browser, &browser_iter); error = g_hash_table_lookup( item->node_errors, GUINT_TO_POINTER(browser_iter.node_id) ); } else { /* Neither error nor browser set: no error */ error = NULL; } } else { g_assert(item->browser != NULL); error = g_hash_table_lookup( item->node_errors, GUINT_TO_POINTER(browser_iter.node_id) ); } g_value_init(value, G_TYPE_POINTER); g_value_set_pointer(value, error); break; case INF_GTK_BROWSER_MODEL_COL_NODE: if(browser_iter.node == NULL) { /* get root node, if available */ g_assert(item->browser != NULL); infc_browser_iter_get_root(item->browser, &browser_iter); } g_value_init(value, INFC_TYPE_BROWSER_ITER); g_value_set_boxed(value, &browser_iter); break; default: g_assert_not_reached(); break; } } static gboolean inf_gtk_browser_store_tree_model_iter_next(GtkTreeModel* model, GtkTreeIter* iter) { InfGtkBrowserStorePrivate* priv; InfGtkBrowserStoreItem* item; InfcBrowserIter browser_iter; priv = INF_GTK_BROWSER_STORE_PRIVATE(model); g_assert(iter->stamp == priv->stamp); item = (InfGtkBrowserStoreItem*)iter->user_data; browser_iter.node_id = GPOINTER_TO_UINT(iter->user_data2); browser_iter.node = iter->user_data3; if(browser_iter.node == NULL) { if(item->next == NULL) return FALSE; iter->user_data = item->next; return TRUE; } else { g_assert(browser_iter.node != item->missing); if(infc_browser_iter_get_next(item->browser, &browser_iter) == FALSE) return FALSE; /* skip missing */ if(browser_iter.node == item->missing) if(infc_browser_iter_get_next(item->browser, &browser_iter) == FALSE) return FALSE; iter->user_data2 = GUINT_TO_POINTER(browser_iter.node_id); iter->user_data3 = browser_iter.node; return TRUE; } } static gboolean inf_gtk_browser_store_tree_model_iter_children(GtkTreeModel* model, GtkTreeIter* iter, GtkTreeIter* parent) { InfGtkBrowserStorePrivate* priv; InfGtkBrowserStoreItem* item; InfcBrowserIter browser_iter; priv = INF_GTK_BROWSER_STORE_PRIVATE(model); if(parent == NULL) { if(priv->first_item == NULL) return FALSE; iter->stamp = priv->stamp; iter->user_data = priv->first_item; iter->user_data2 = GUINT_TO_POINTER(0); iter->user_data3 = NULL; return TRUE; } else { g_assert(parent->stamp == priv->stamp); item = (InfGtkBrowserStoreItem*)parent->user_data; if(item->browser == NULL) return FALSE; browser_iter.node_id = GPOINTER_TO_UINT(parent->user_data2); if(browser_iter.node_id == 0) infc_browser_iter_get_root(item->browser, &browser_iter); else browser_iter.node = parent->user_data3; g_assert(item->missing == NULL || browser_iter.node != item->missing); if(!infc_browser_iter_is_subdirectory(item->browser, &browser_iter)) return FALSE; if(!infc_browser_iter_get_explored(item->browser, &browser_iter)) return FALSE; if(!infc_browser_iter_get_child(item->browser, &browser_iter)) return FALSE; if(browser_iter.node == item->missing) if(!infc_browser_iter_get_next(item->browser, &browser_iter)) return FALSE; iter->stamp = priv->stamp; iter->user_data = item; iter->user_data2 = GUINT_TO_POINTER(browser_iter.node_id); iter->user_data3 = browser_iter.node; return TRUE; } } static gboolean inf_gtk_browser_store_tree_model_iter_has_child(GtkTreeModel* model, GtkTreeIter* iter) { InfGtkBrowserStorePrivate* priv; InfGtkBrowserStoreItem* item; InfcBrowserIter browser_iter; priv = INF_GTK_BROWSER_STORE_PRIVATE(model); g_assert(iter->stamp == priv->stamp); item = (InfGtkBrowserStoreItem*)iter->user_data; if(item->browser == NULL) return FALSE; browser_iter.node_id = GPOINTER_TO_UINT(iter->user_data2); browser_iter.node = iter->user_data3; g_assert(item->missing == NULL || browser_iter.node != item->missing); if(browser_iter.node == NULL) infc_browser_iter_get_root(item->browser, &browser_iter); if(infc_browser_iter_is_subdirectory(item->browser, &browser_iter) == FALSE) return FALSE; if(infc_browser_iter_get_explored(item->browser, &browser_iter) == FALSE) return FALSE; if(!infc_browser_iter_get_child(item->browser, &browser_iter)) return FALSE; if(browser_iter.node == item->missing) if(!infc_browser_iter_get_next(item->browser, &browser_iter)) return FALSE; return TRUE; } static gint inf_gtk_browser_store_tree_model_iter_n_children(GtkTreeModel* model, GtkTreeIter* iter) { InfGtkBrowserStorePrivate* priv; InfGtkBrowserStoreItem* item; InfGtkBrowserStoreItem* cur; InfcBrowserIter browser_iter; gboolean result; guint n; priv = INF_GTK_BROWSER_STORE_PRIVATE(model); g_assert(iter == NULL || iter->stamp == priv->stamp); if(iter == NULL) { n = 0; for(cur = priv->first_item; cur != NULL; cur = cur->next) ++n; return n; } else { item = (InfGtkBrowserStoreItem*)iter->user_data; browser_iter.node_id = GPOINTER_TO_UINT(iter->user_data2); browser_iter.node = iter->user_data3; g_assert(item->missing == NULL || browser_iter.node != item->missing); if(browser_iter.node == NULL) infc_browser_iter_get_root(item->browser, &browser_iter); if(infc_browser_iter_get_explored(item->browser, &browser_iter) == FALSE) return 0; n = 0; for(result = infc_browser_iter_get_child(item->browser, &browser_iter); result == TRUE; result = infc_browser_iter_get_next(item->browser, &browser_iter)) { if(browser_iter.node != item->missing) ++n; } return n; } } static gboolean inf_gtk_browser_store_tree_model_iter_nth_child(GtkTreeModel* model, GtkTreeIter* iter, GtkTreeIter* parent, gint n) { InfGtkBrowserStorePrivate* priv; InfGtkBrowserStoreItem* item; InfGtkBrowserStoreItem* cur; InfcBrowserIter browser_iter; guint i; priv = INF_GTK_BROWSER_STORE_PRIVATE(model); if(parent == NULL) { cur = priv->first_item; if(cur == NULL) return FALSE; for(i = 0; i < (guint)n; ++ i) { cur = cur->next; if(cur == NULL) return FALSE; } iter->stamp = priv->stamp; iter->user_data = cur; iter->user_data2 = GUINT_TO_POINTER(0); iter->user_data3 = NULL; return TRUE; } else { g_assert(parent->stamp == priv->stamp); item = (InfGtkBrowserStoreItem*)parent->user_data; browser_iter.node_id = GPOINTER_TO_UINT(parent->user_data2); if(browser_iter.node_id == 0) infc_browser_iter_get_root(item->browser, &browser_iter); else browser_iter.node = parent->user_data3; g_assert(item->missing == NULL || browser_iter.node != item->missing); if(infc_browser_iter_get_explored(item->browser, &browser_iter) == FALSE) return FALSE; if(infc_browser_iter_get_child(item->browser, &browser_iter) == FALSE) return FALSE; /* skip missing */ if(browser_iter.node == item->missing) ++n; for(i = 0; i < (guint)n; ++ i) { if(infc_browser_iter_get_next(item->browser, &browser_iter) == FALSE) return FALSE; if(browser_iter.node == item->missing) ++n; } iter->stamp = priv->stamp; iter->user_data = item; iter->user_data2 = GUINT_TO_POINTER(browser_iter.node_id); iter->user_data3 = browser_iter.node; return TRUE; } } static gboolean inf_gtk_browser_store_tree_model_iter_parent(GtkTreeModel* model, GtkTreeIter* iter, GtkTreeIter* child) { InfGtkBrowserStorePrivate* priv; InfGtkBrowserStoreItem* item; InfcBrowserIter browser_iter; gboolean result; priv = INF_GTK_BROWSER_STORE_PRIVATE(model); g_assert(child->stamp == priv->stamp); item = (InfGtkBrowserStoreItem*)child->user_data; browser_iter.node_id = GPOINTER_TO_UINT(child->user_data2); browser_iter.node = child->user_data3; if(browser_iter.node == NULL) return FALSE; g_assert(browser_iter.node != item->missing); result = infc_browser_iter_get_parent(item->browser, &browser_iter); g_assert(result == TRUE); g_assert(browser_iter.node != item->missing); iter->stamp = priv->stamp; iter->user_data = item; iter->user_data2 = GUINT_TO_POINTER(browser_iter.node_id); iter->user_data3 = browser_iter.node; /* Root node */ if(browser_iter.node_id == 0) iter->user_data3 = NULL; return TRUE; } /* * InfGtkBrowserModel implementation. */ static void inf_gtk_browser_store_browser_model_set_browser(InfGtkBrowserModel* model, GtkTreePath* path, GtkTreeIter* tree_iter, InfcBrowser* browser) { InfGtkBrowserStorePrivate* priv; InfGtkBrowserStoreItem* item; InfcBrowserIter iter; guint n; gboolean had_children; priv = INF_GTK_BROWSER_STORE_PRIVATE(model); had_children = FALSE; item = (InfGtkBrowserStoreItem*)tree_iter->user_data; /* cannot set browser in non-toplevel entries */ g_assert(tree_iter->user_data3 == NULL); if(item->browser != NULL) { /* Notify about deleted rows. Notify in reverse order so that indexing * continues to work. Remember whether we had children to emit * row-has-child-toggled later. */ infc_browser_iter_get_root(item->browser, &iter); if(infc_browser_iter_get_explored(item->browser, &iter) && infc_browser_iter_get_child(item->browser, &iter)) { n = 1; while(infc_browser_iter_get_next(item->browser, &iter)) ++ n; gtk_tree_path_append_index(path, n); for(; n > 0; -- n) { had_children = TRUE; gtk_tree_path_prev(path); gtk_tree_model_row_deleted(GTK_TREE_MODEL(model), path); } gtk_tree_path_up(path); } while(item->requests != NULL) { inf_gtk_browser_store_item_request_remove( item, INFC_REQUEST(item->requests->data) ); } g_hash_table_remove_all(item->node_errors); inf_signal_handlers_disconnect_by_func( G_OBJECT(item->browser), G_CALLBACK(inf_gtk_browser_store_browser_error_cb), model ); inf_signal_handlers_disconnect_by_func( G_OBJECT(item->browser), G_CALLBACK(inf_gtk_browser_store_browser_notify_status_cb), model ); inf_signal_handlers_disconnect_by_func( G_OBJECT(item->browser), G_CALLBACK(inf_gtk_browser_store_node_added_cb), model ); inf_signal_handlers_disconnect_by_func( G_OBJECT(item->browser), G_CALLBACK(inf_gtk_browser_store_node_removed_cb), model ); inf_signal_handlers_disconnect_by_func( G_OBJECT(item->browser), G_CALLBACK(inf_gtk_browser_store_begin_explore_cb), model ); inf_signal_handlers_disconnect_by_func( G_OBJECT(item->browser), G_CALLBACK(inf_gtk_browser_store_begin_subscribe_cb), model ); g_object_unref(G_OBJECT(item->browser)); } /* Reset browser for emitting row-has-child-toggled */ item->browser = NULL; if(had_children) { gtk_tree_model_row_has_child_toggled( GTK_TREE_MODEL(model), path, tree_iter ); } /* Set up new browser */ item->browser = browser; if(browser != NULL) { g_object_ref(browser); g_signal_connect( G_OBJECT(item->browser), "error", G_CALLBACK(inf_gtk_browser_store_browser_error_cb), model ); g_signal_connect( G_OBJECT(item->browser), "notify::status", G_CALLBACK(inf_gtk_browser_store_browser_notify_status_cb), model ); g_signal_connect_after( G_OBJECT(item->browser), "node-added", G_CALLBACK(inf_gtk_browser_store_node_added_cb), model ); g_signal_connect_after( G_OBJECT(item->browser), "node-removed", G_CALLBACK(inf_gtk_browser_store_node_removed_cb), model ); g_signal_connect_after( G_OBJECT(item->browser), "begin-explore", G_CALLBACK(inf_gtk_browser_store_begin_explore_cb), model ); g_signal_connect_after( G_OBJECT(item->browser), "begin-subscribe", G_CALLBACK(inf_gtk_browser_store_begin_subscribe_cb), model ); /* TODO: Walk browser for requests */ } /* Set status to invalid if there aren't any connection information anymore. * Keep the item if an error is set, so it can be displayed. */ if(item->browser == NULL && item->info == NULL && item->error == NULL) { item->status = INF_GTK_BROWSER_MODEL_INVALID; /* TODO: What's up with this? Can this happen? Can we assert() here? */ } else if(item->status != INF_GTK_BROWSER_MODEL_ERROR) { /* Set item status according to browser status if there is no * error set. */ if(item->browser != NULL) { switch(infc_browser_get_status(item->browser)) { case INFC_BROWSER_DISCONNECTED: item->status = INF_GTK_BROWSER_MODEL_DISCONNECTED; break; case INFC_BROWSER_CONNECTING: item->status = INF_GTK_BROWSER_MODEL_CONNECTING; break; case INFC_BROWSER_CONNECTED: item->status = INF_GTK_BROWSER_MODEL_CONNECTED; break; default: g_assert_not_reached(); break; } } else { /* No browser available. Discovery needs to be set now, otherwise * we would have set the status to invalid above. */ g_assert(item->info != NULL); item->status = INF_GTK_BROWSER_MODEL_DISCOVERED; } } else { /* Error needs to be set in error status */ g_assert(item->error != NULL); } /* TODO: Emit row_inserted for the whole tree in browser, and * row-has-child-toggled where appropriate. */ gtk_tree_model_row_changed(GTK_TREE_MODEL(model), path, tree_iter); } static void inf_gtk_browser_store_browser_model_resolve(InfGtkBrowserModel* model, InfDiscovery* discovery, InfDiscoveryInfo* info) { InfGtkBrowserStorePrivate* priv; InfGtkBrowserStoreItem* item; GtkTreeIter tree_iter; GtkTreePath* path; g_assert(INF_GTK_IS_BROWSER_STORE(model)); priv = INF_GTK_BROWSER_STORE_PRIVATE(model); item = inf_gtk_browser_store_find_item_by_discovery_info( INF_GTK_BROWSER_STORE(model), info ); g_assert(item != NULL); g_assert( item->status == INF_GTK_BROWSER_MODEL_DISCOVERED || item->status == INF_GTK_BROWSER_MODEL_ERROR ); if(item->status == INF_GTK_BROWSER_MODEL_ERROR) { g_assert(item->error != NULL); g_error_free(item->error); item->error = NULL; item->status = INF_GTK_BROWSER_MODEL_RESOLVING; } else { item->status = INF_GTK_BROWSER_MODEL_RESOLVING; } tree_iter.stamp = priv->stamp; tree_iter.user_data = item; tree_iter.user_data2 = GUINT_TO_POINTER(0); tree_iter.user_data3 = NULL; path = gtk_tree_model_get_path(GTK_TREE_MODEL(model), &tree_iter); gtk_tree_model_row_changed(GTK_TREE_MODEL(model), path, &tree_iter); gtk_tree_path_free(path); inf_discovery_resolve( discovery, info, inf_gtk_browser_store_resolv_complete_func, inf_gtk_browser_store_resolv_error_func, model ); } static gboolean inf_gtk_browser_store_browser_iter_to_tree_iter(InfGtkBrowserModel* model, InfcBrowser* browser, InfcBrowserIter* browser_iter, GtkTreeIter* tree_iter) { InfGtkBrowserStorePrivate* priv; InfGtkBrowserStoreItem* item; g_assert(INF_GTK_IS_BROWSER_STORE(model)); priv = INF_GTK_BROWSER_STORE_PRIVATE(model); item = inf_gtk_browser_store_find_item_by_browser( INF_GTK_BROWSER_STORE(model), browser ); if(item == NULL || item->missing == browser_iter->node) return FALSE; tree_iter->stamp = priv->stamp; tree_iter->user_data = item; tree_iter->user_data2 = GUINT_TO_POINTER(browser_iter->node_id); tree_iter->user_data3 = browser_iter->node; /* Root node */ if(browser_iter->node_id == 0) tree_iter->user_data3 = NULL; return TRUE; } /* * GType registration */ static void inf_gtk_browser_store_class_init(gpointer g_class, gpointer class_data) { GObjectClass* object_class; InfGtkBrowserStoreClass* browser_store_class; object_class = G_OBJECT_CLASS(g_class); browser_store_class = INF_GTK_BROWSER_STORE_CLASS(g_class); parent_class = G_OBJECT_CLASS(g_type_class_peek_parent(g_class)); g_type_class_add_private(g_class, sizeof(InfGtkBrowserStorePrivate)); object_class->dispose = inf_gtk_browser_store_dispose; object_class->set_property = inf_gtk_browser_store_set_property; object_class->get_property = inf_gtk_browser_store_get_property; g_object_class_install_property( object_class, PROP_IO, g_param_spec_object( "io", "IO", "The IO object used for the created browsers to schedule timeouts", INF_TYPE_IO, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); g_object_class_install_property( object_class, PROP_COMMUNICATION_MANAGER, g_param_spec_object( "communication-manager", "Communication manager", "The communication manager used for browsing remote directories", INF_COMMUNICATION_TYPE_MANAGER, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); } static void inf_gtk_browser_store_tree_model_init(gpointer g_iface, gpointer iface_data) { GtkTreeModelIface* iface; iface = (GtkTreeModelIface*)g_iface; iface->get_flags = inf_gtk_browser_store_tree_model_get_flags; iface->get_n_columns = inf_gtk_browser_store_tree_model_get_n_columns; iface->get_column_type = inf_gtk_browser_store_tree_model_get_column_type; iface->get_iter = inf_gtk_browser_store_tree_model_get_iter; iface->get_path = inf_gtk_browser_store_tree_model_get_path; iface->get_value = inf_gtk_browser_store_tree_model_get_value; iface->iter_next = inf_gtk_browser_store_tree_model_iter_next; iface->iter_children = inf_gtk_browser_store_tree_model_iter_children; iface->iter_has_child = inf_gtk_browser_store_tree_model_iter_has_child; iface->iter_n_children = inf_gtk_browser_store_tree_model_iter_n_children; iface->iter_nth_child = inf_gtk_browser_store_tree_model_iter_nth_child; iface->iter_parent = inf_gtk_browser_store_tree_model_iter_parent; } static void inf_gtk_browser_store_browser_model_init(gpointer g_iface, gpointer iface_data) { InfGtkBrowserModelIface* iface; iface = (InfGtkBrowserModelIface*)g_iface; iface->set_browser = inf_gtk_browser_store_browser_model_set_browser; iface->resolve = inf_gtk_browser_store_browser_model_resolve; /* inf_gtk_browser_store_browser_model_browser_iter_to_tree_iter would be * consistent, but a _bit_ too long to fit properly into 80 chars ;) */ iface->browser_iter_to_tree_iter = inf_gtk_browser_store_browser_iter_to_tree_iter; } GType inf_gtk_browser_store_get_type(void) { static GType browser_store_type = 0; if(!browser_store_type) { static const GTypeInfo browser_store_type_info = { sizeof(InfGtkBrowserStoreClass), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ inf_gtk_browser_store_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InfGtkBrowserStore), /* instance_size */ 0, /* n_preallocs */ inf_gtk_browser_store_init, /* instance_init */ NULL /* value_table */ }; static const GInterfaceInfo tree_model_info = { inf_gtk_browser_store_tree_model_init, NULL, NULL }; static const GInterfaceInfo browser_model_info = { inf_gtk_browser_store_browser_model_init, NULL, NULL }; browser_store_type = g_type_register_static( G_TYPE_OBJECT, "InfGtkBrowserStore", &browser_store_type_info, 0 ); g_type_add_interface_static( browser_store_type, GTK_TYPE_TREE_MODEL, &tree_model_info ); g_type_add_interface_static( browser_store_type, INF_GTK_TYPE_BROWSER_MODEL, &browser_model_info ); } return browser_store_type; } /* * Public API. */ /** * inf_gtk_browser_store_new: * @io: A #InfIo object for the created #InfcBrowser to schedule timeouts. * @comm_manager: The #InfCommunicationManager with which to explore * remote directories. * * Creates a new #InfGtkBrowserStore. * * Return Value: A new #InfGtkBrowserStore. **/ InfGtkBrowserStore* inf_gtk_browser_store_new(InfIo* io, InfCommunicationManager* comm_manager) { GObject* object; object = g_object_new( INF_GTK_TYPE_BROWSER_STORE, "io", io, "communication-manager", comm_manager, NULL ); return INF_GTK_BROWSER_STORE(object); } /** * inf_gtk_browser_store_add_discovery: * @store: A #InfGtkBrowserStore. * @discovery: A #InfDiscovery not yet added to @model. * * Adds @discovery to @model. The model will then show up discovered * servers. **/ void inf_gtk_browser_store_add_discovery(InfGtkBrowserStore* store, InfDiscovery* discovery) { InfGtkBrowserStorePrivate* priv; GSList* discovered; GSList* item; InfDiscoveryInfo* info; g_return_if_fail(INF_GTK_IS_BROWSER_STORE(store)); g_return_if_fail(INF_IS_DISCOVERY(discovery)); priv = INF_GTK_BROWSER_STORE_PRIVATE(store); g_return_if_fail(g_slist_find(priv->discoveries, discovery) == NULL); g_object_ref(G_OBJECT(discovery)); priv->discoveries = g_slist_prepend(priv->discoveries, discovery); g_signal_connect( G_OBJECT(discovery), "discovered", G_CALLBACK(inf_gtk_browser_store_discovered_cb), store ); g_signal_connect( G_OBJECT(discovery), "undiscovered", G_CALLBACK(inf_gtk_browser_store_undiscovered_cb), store ); discovered = inf_discovery_get_discovered(discovery, "_infinote._tcp"); for(item = discovered; item != NULL; item = g_slist_next(item)) { info = (InfDiscoveryInfo*)item->data; inf_gtk_browser_store_add_item( store, discovery, info, NULL, inf_discovery_info_get_service_name(discovery, info) ); } g_slist_free(discovered); inf_discovery_discover(discovery, "_infinote._tcp"); } /** * inf_gtk_browser_store_add_connection: * @store: A #InfGtkBrowserStore. * @connection: A #InfXmlConnection. * @name: Name for the item, or %NULL. * * This function adds a connection to the @store. @store will show up * an item for the connection if there is not already one. This allows to * browse the explored parts of the directory of the remote site. If @name * is %NULL, then the #InfXmlConnection:remote-id of the connection will be * used. **/ void inf_gtk_browser_store_add_connection(InfGtkBrowserStore* store, InfXmlConnection* connection, const gchar* name) { InfGtkBrowserStorePrivate* priv; InfGtkBrowserStoreItem* item; InfXmlConnectionStatus status; gchar* remote_id; g_return_if_fail(INF_GTK_IS_BROWSER_STORE(store)); g_return_if_fail(INF_IS_XML_CONNECTION(connection)); g_object_get(G_OBJECT(connection), "status", &status, NULL); priv = INF_GTK_BROWSER_STORE_PRIVATE(store); item = inf_gtk_browser_store_find_item_by_connection(store, connection); if(item == NULL) { if(name == NULL) { g_object_get(G_OBJECT(connection), "remote-id", &remote_id, NULL); inf_gtk_browser_store_add_item( store, NULL, NULL, connection, remote_id ); } else { inf_gtk_browser_store_add_item( store, NULL, NULL, connection, g_strdup(name) ); } } } /** * inf_gtk_browser_store_remove_connection: * @store: A #InfGtkBrowserStore. * @connection: A #InfXmlConnection contained in @store. * * This function removes the entry for the given connection from @store. */ void inf_gtk_browser_store_remove_connection(InfGtkBrowserStore* store, InfXmlConnection* connection) { InfGtkBrowserStoreItem* item; g_return_if_fail(INF_GTK_IS_BROWSER_STORE(store)); g_return_if_fail(INF_IS_XML_CONNECTION(connection)); item = inf_gtk_browser_store_find_item_by_connection(store, connection); g_return_if_fail(item != NULL); inf_gtk_browser_store_remove_item (store, item); } /** * inf_gtk_browser_store_clear_connection_error: * @store: A #InfGtkBrowserStore. * @connection: A #InfXmlConnection contained in @store. * * This function clears the error for the entry which belongs to the given * connection. */ void inf_gtk_browser_store_clear_connection_error(InfGtkBrowserStore* store, InfXmlConnection* connection) { InfGtkBrowserStoreItem* item; GtkTreeIter iter; GtkTreePath* path; g_return_if_fail(INF_GTK_IS_BROWSER_STORE(store)); g_return_if_fail(INF_IS_XML_CONNECTION(connection)); item = inf_gtk_browser_store_find_item_by_connection(store, connection); g_return_if_fail(item != NULL); if(item->status == INF_GTK_BROWSER_MODEL_ERROR) { g_assert(item->error != NULL); g_error_free(item->error); item->error = NULL; if(item->browser != NULL) { switch(infc_browser_get_status(item->browser)) { case INFC_BROWSER_DISCONNECTED: item->status = INF_GTK_BROWSER_MODEL_DISCONNECTED; break; case INFC_BROWSER_CONNECTING: item->status = INF_GTK_BROWSER_MODEL_CONNECTING; break; case INFC_BROWSER_CONNECTED: item->status = INF_GTK_BROWSER_MODEL_CONNECTED; break; default: g_assert_not_reached(); break; } } else if(item->info != NULL) { item->status = INF_GTK_BROWSER_MODEL_DISCOVERED; } else { g_assert_not_reached(); } iter.stamp = INF_GTK_BROWSER_STORE_PRIVATE(store)->stamp; iter.user_data = item; iter.user_data2 = GUINT_TO_POINTER(0); iter.user_data3 = NULL; path = gtk_tree_model_get_path(GTK_TREE_MODEL(store), &iter); gtk_tree_model_row_changed(GTK_TREE_MODEL(store), path, &iter); gtk_tree_path_free (path); } } /** * inf_gtk_browser_store_set_connection_name: * @store: A #InfGtkBrowserStore. * @connection: A #InfXmlConnection contained in @store. * @name: The new name to set for the connection. * * This function sets the name of @connection. **/ void inf_gtk_browser_store_set_connection_name(InfGtkBrowserStore* store, InfXmlConnection* connection, const gchar* name) { InfGtkBrowserStoreItem* item; GtkTreeIter iter; GtkTreePath* path; g_return_if_fail(INF_GTK_IS_BROWSER_STORE(store)); g_return_if_fail(INF_IS_XML_CONNECTION(connection)); g_return_if_fail(name != NULL); item = inf_gtk_browser_store_find_item_by_connection(store, connection); g_return_if_fail(item != NULL); g_free (item->name); item->name = g_strdup(name); iter.stamp = INF_GTK_BROWSER_STORE_PRIVATE(store)->stamp; iter.user_data = item; iter.user_data2 = GUINT_TO_POINTER(0); iter.user_data3 = NULL; path = gtk_tree_model_get_path(GTK_TREE_MODEL(store), &iter); gtk_tree_model_row_changed(GTK_TREE_MODEL(store), path, &iter); gtk_tree_path_free(path); } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfgtk/inf-gtk-browser-model-filter.h0000644000175000017500000000460412264763732020525 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_GTK_BROWSER_MODEL_FILTER_H__ #define __INF_GTK_BROWSER_MODEL_FILTER_H__ #include #include #include G_BEGIN_DECLS #define INF_GTK_TYPE_BROWSER_MODEL_FILTER (inf_gtk_browser_model_filter_get_type()) #define INF_GTK_BROWSER_MODEL_FILTER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INF_GTK_TYPE_BROWSER_MODEL_FILTER, InfGtkBrowserModelFilter)) #define INF_GTK_BROWSER_MODEL_FILTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INF_GTK_TYPE_BROWSER_MODEL_FILTER, InfGtkBrowserModelFilterClass)) #define INF_GTK_IS_BROWSER_MODEL_FILTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INF_GTK_TYPE_BROWSER_MODEL_FILTER)) #define INF_GTK_IS_BROWSER_MODEL_FILTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INF_GTK_TYPE_BROWSER_MODEL_FILTER)) #define INF_GTK_BROWSER_MODEL_FILTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), INF_GTK_TYPE_BROWSER_MODEL_FILTER, InfGtkBrowserModelFilterClass)) typedef struct _InfGtkBrowserModelFilter InfGtkBrowserModelFilter; typedef struct _InfGtkBrowserModelFilterClass InfGtkBrowserModelFilterClass; struct _InfGtkBrowserModelFilterClass { GtkTreeModelFilterClass parent_class; }; struct _InfGtkBrowserModelFilter { GtkTreeModelFilter parent; }; GType inf_gtk_browser_model_filter_get_type(void) G_GNUC_CONST; InfGtkBrowserModelFilter* inf_gtk_browser_model_filter_new(InfGtkBrowserModel* child_model); G_END_DECLS #endif /* __INF_GTK_BROWSER_MODEL_FILTER_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfgtk/inf-gtk-certificate-dialog.h0000644000175000017500000000645512264763732020206 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_GTK_CERTIFICATE_DIALOG_H__ #define __INF_GTK_CERTIFICATE_DIALOG_H__ #include #include #include G_BEGIN_DECLS #define INF_GTK_TYPE_CERTIFICATE_DIALOG (inf_gtk_certificate_dialog_get_type()) #define INF_GTK_CERTIFICATE_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INF_GTK_TYPE_CERTIFICATE_DIALOG, InfGtkCertificateDialog)) #define INF_GTK_CERTIFICATE_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INF_GTK_TYPE_CERTIFICATE_DIALOG, InfGtkCertificateDialogClass)) #define INF_GTK_IS_CERTIFICATE_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INF_GTK_TYPE_CERTIFICATE_DIALOG)) #define INF_GTK_IS_CERTIFICATE_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INF_GTK_TYPE_CERTIFICATE_DIALOG)) #define INF_GTK_CERTIFICATE_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), INF_GTK_TYPE_CERTIFICATE_DIALOG, InfGtkCertificateDialogClass)) #define INF_GTK_TYPE_CERTIFICATE_DIALOG_FLAGS (inf_gtk_certificate_dialog_flags_get_type()) typedef struct _InfGtkCertificateDialog InfGtkCertificateDialog; typedef struct _InfGtkCertificateDialogClass InfGtkCertificateDialogClass; struct _InfGtkCertificateDialogClass { GtkDialogClass parent_class; }; struct _InfGtkCertificateDialog { GtkDialog parent; }; typedef enum _InfGtkCertificateDialogFlags { INF_GTK_CERTIFICATE_DIALOG_CERT_NOT_ACTIVATED = 1 << 0, INF_GTK_CERTIFICATE_DIALOG_CERT_EXPIRED = 1 << 1, INF_GTK_CERTIFICATE_DIALOG_CERT_HOSTNAME_MISMATCH = 1 << 2, INF_GTK_CERTIFICATE_DIALOG_CERT_INVALID = 1 << 3, INF_GTK_CERTIFICATE_DIALOG_CERT_ISSUER_NOT_TRUSTED = 1 << 4, INF_GTK_CERTIFICATE_DIALOG_CERT_CHANGED = 1 << 5, /* only valid when CERT_CHANGED is also set */ INF_GTK_CERTIFICATE_DIALOG_CERT_OLD_EXPIRED = 1 << 6 } InfGtkCertificateDialogFlags; GType inf_gtk_certificate_dialog_flags_get_type(void) G_GNUC_CONST; GType inf_gtk_certificate_dialog_get_type(void) G_GNUC_CONST; InfGtkCertificateDialog* inf_gtk_certificate_dialog_new(GtkWindow* parent, GtkDialogFlags dialog_flags, InfGtkCertificateDialogFlags certificate_flags, const gchar* hostname, InfCertificateChain* certificate_chain); G_END_DECLS #endif /* __INF_GTK_CERTIFICATE_DIALOG_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfgtk/Makefile.in0000644000175000017500000011251512264766065015023 00000000000000# Makefile.in generated by automake 1.13.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = libinfgtk DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/mkinstalldirs $(top_srcdir)/depcomp \ $(libinfgtk_0_5_la_HEADERS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/libinfinity/inf-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" \ "$(DESTDIR)$(libinfgtk_0_5_ladir)" LTLIBRARIES = $(lib_LTLIBRARIES) am__DEPENDENCIES_1 = libinfgtk_0_5_la_DEPENDENCIES = ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_libinfgtk_0_5_la_OBJECTS = \ libinfgtk_0_5_la-inf-gtk-browser-model.lo \ libinfgtk_0_5_la-inf-gtk-browser-model-filter.lo \ libinfgtk_0_5_la-inf-gtk-browser-model-sort.lo \ libinfgtk_0_5_la-inf-gtk-browser-store.lo \ libinfgtk_0_5_la-inf-gtk-browser-view.lo \ libinfgtk_0_5_la-inf-gtk-certificate-dialog.lo \ libinfgtk_0_5_la-inf-gtk-certificate-manager.lo \ libinfgtk_0_5_la-inf-gtk-certificate-view.lo \ libinfgtk_0_5_la-inf-gtk-chat.lo \ libinfgtk_0_5_la-inf-gtk-io.lo libinfgtk_0_5_la_OBJECTS = $(am_libinfgtk_0_5_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libinfgtk_0_5_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(libinfgtk_0_5_la_LDFLAGS) $(LDFLAGS) \ -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -I$(top_builddir)/libinfinity 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) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libinfgtk_0_5_la_SOURCES) DIST_SOURCES = $(libinfgtk_0_5_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(libinfgtk_0_5_la_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBINFINITY_API_VERSION = @LIBINFINITY_API_VERSION@ LIBINFINITY_LIBTOOL_VERSION = @LIBINFINITY_LIBTOOL_VERSION@ LIBINFINITY_VERSION = @LIBINFINITY_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ avahi_CFLAGS = @avahi_CFLAGS@ avahi_LIBS = @avahi_LIBS@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gtk_requirement = @gtk_requirement@ gtk_version = @gtk_version@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infgtk_CFLAGS = @infgtk_CFLAGS@ infgtk_LIBS = @infgtk_LIBS@ infinity_CFLAGS = @infinity_CFLAGS@ infinity_LIBS = @infinity_LIBS@ infinoted_CFLAGS = @infinoted_CFLAGS@ infinoted_LIBS = @infinoted_LIBS@ infodir = @infodir@ inftext_CFLAGS = @inftext_CFLAGS@ inftext_LIBS = @inftext_LIBS@ inftextgtk_CFLAGS = @inftextgtk_CFLAGS@ inftextgtk_LIBS = @inftextgtk_LIBS@ install_sh = @install_sh@ libdaemon_CFLAGS = @libdaemon_CFLAGS@ libdaemon_LIBS = @libdaemon_LIBS@ 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@ # TODO: Find a way to have the version number set automatically. lib_LTLIBRARIES = libinfgtk-0.5.la libinfgtk_0_5_la_CPPFLAGS = \ -I$(top_srcdir) \ $(infgtk_CFLAGS) \ $(infinity_CFLAGS) libinfgtk_0_5_la_LDFLAGS = \ -no-undefined \ -version-info $(LIBINFINITY_LIBTOOL_VERSION) libinfgtk_0_5_la_LIBADD = \ ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ $(infgtk_LIBS) \ $(infinity_LIBS) libinfgtk_0_5_ladir = \ $(includedir)/libinfgtk-$(LIBINFINITY_API_VERSION)/libinfgtk libinfgtk_0_5_la_HEADERS = \ inf-gtk-browser-model.h \ inf-gtk-browser-model-filter.h \ inf-gtk-browser-model-sort.h \ inf-gtk-browser-store.h \ inf-gtk-browser-view.h \ inf-gtk-certificate-dialog.h \ inf-gtk-certificate-manager.h \ inf-gtk-certificate-view.h \ inf-gtk-chat.h \ inf-gtk-io.h libinfgtk_0_5_la_SOURCES = \ inf-gtk-browser-model.c \ inf-gtk-browser-model-filter.c \ inf-gtk-browser-model-sort.c \ inf-gtk-browser-store.c \ inf-gtk-browser-view.c \ inf-gtk-certificate-dialog.c \ inf-gtk-certificate-manager.c \ inf-gtk-certificate-view.c \ inf-gtk-chat.c \ inf-gtk-io.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libinfgtk/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu libinfgtk/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libinfgtk-0.5.la: $(libinfgtk_0_5_la_OBJECTS) $(libinfgtk_0_5_la_DEPENDENCIES) $(EXTRA_libinfgtk_0_5_la_DEPENDENCIES) $(AM_V_CCLD)$(libinfgtk_0_5_la_LINK) -rpath $(libdir) $(libinfgtk_0_5_la_OBJECTS) $(libinfgtk_0_5_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfgtk_0_5_la-inf-gtk-browser-model-filter.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfgtk_0_5_la-inf-gtk-browser-model-sort.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfgtk_0_5_la-inf-gtk-browser-model.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfgtk_0_5_la-inf-gtk-browser-store.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfgtk_0_5_la-inf-gtk-browser-view.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfgtk_0_5_la-inf-gtk-certificate-dialog.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfgtk_0_5_la-inf-gtk-certificate-manager.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfgtk_0_5_la-inf-gtk-certificate-view.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfgtk_0_5_la-inf-gtk-chat.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfgtk_0_5_la-inf-gtk-io.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< libinfgtk_0_5_la-inf-gtk-browser-model.lo: inf-gtk-browser-model.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfgtk_0_5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfgtk_0_5_la-inf-gtk-browser-model.lo -MD -MP -MF $(DEPDIR)/libinfgtk_0_5_la-inf-gtk-browser-model.Tpo -c -o libinfgtk_0_5_la-inf-gtk-browser-model.lo `test -f 'inf-gtk-browser-model.c' || echo '$(srcdir)/'`inf-gtk-browser-model.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfgtk_0_5_la-inf-gtk-browser-model.Tpo $(DEPDIR)/libinfgtk_0_5_la-inf-gtk-browser-model.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-gtk-browser-model.c' object='libinfgtk_0_5_la-inf-gtk-browser-model.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfgtk_0_5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfgtk_0_5_la-inf-gtk-browser-model.lo `test -f 'inf-gtk-browser-model.c' || echo '$(srcdir)/'`inf-gtk-browser-model.c libinfgtk_0_5_la-inf-gtk-browser-model-filter.lo: inf-gtk-browser-model-filter.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfgtk_0_5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfgtk_0_5_la-inf-gtk-browser-model-filter.lo -MD -MP -MF $(DEPDIR)/libinfgtk_0_5_la-inf-gtk-browser-model-filter.Tpo -c -o libinfgtk_0_5_la-inf-gtk-browser-model-filter.lo `test -f 'inf-gtk-browser-model-filter.c' || echo '$(srcdir)/'`inf-gtk-browser-model-filter.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfgtk_0_5_la-inf-gtk-browser-model-filter.Tpo $(DEPDIR)/libinfgtk_0_5_la-inf-gtk-browser-model-filter.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-gtk-browser-model-filter.c' object='libinfgtk_0_5_la-inf-gtk-browser-model-filter.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfgtk_0_5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfgtk_0_5_la-inf-gtk-browser-model-filter.lo `test -f 'inf-gtk-browser-model-filter.c' || echo '$(srcdir)/'`inf-gtk-browser-model-filter.c libinfgtk_0_5_la-inf-gtk-browser-model-sort.lo: inf-gtk-browser-model-sort.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfgtk_0_5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfgtk_0_5_la-inf-gtk-browser-model-sort.lo -MD -MP -MF $(DEPDIR)/libinfgtk_0_5_la-inf-gtk-browser-model-sort.Tpo -c -o libinfgtk_0_5_la-inf-gtk-browser-model-sort.lo `test -f 'inf-gtk-browser-model-sort.c' || echo '$(srcdir)/'`inf-gtk-browser-model-sort.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfgtk_0_5_la-inf-gtk-browser-model-sort.Tpo $(DEPDIR)/libinfgtk_0_5_la-inf-gtk-browser-model-sort.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-gtk-browser-model-sort.c' object='libinfgtk_0_5_la-inf-gtk-browser-model-sort.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfgtk_0_5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfgtk_0_5_la-inf-gtk-browser-model-sort.lo `test -f 'inf-gtk-browser-model-sort.c' || echo '$(srcdir)/'`inf-gtk-browser-model-sort.c libinfgtk_0_5_la-inf-gtk-browser-store.lo: inf-gtk-browser-store.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfgtk_0_5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfgtk_0_5_la-inf-gtk-browser-store.lo -MD -MP -MF $(DEPDIR)/libinfgtk_0_5_la-inf-gtk-browser-store.Tpo -c -o libinfgtk_0_5_la-inf-gtk-browser-store.lo `test -f 'inf-gtk-browser-store.c' || echo '$(srcdir)/'`inf-gtk-browser-store.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfgtk_0_5_la-inf-gtk-browser-store.Tpo $(DEPDIR)/libinfgtk_0_5_la-inf-gtk-browser-store.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-gtk-browser-store.c' object='libinfgtk_0_5_la-inf-gtk-browser-store.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfgtk_0_5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfgtk_0_5_la-inf-gtk-browser-store.lo `test -f 'inf-gtk-browser-store.c' || echo '$(srcdir)/'`inf-gtk-browser-store.c libinfgtk_0_5_la-inf-gtk-browser-view.lo: inf-gtk-browser-view.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfgtk_0_5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfgtk_0_5_la-inf-gtk-browser-view.lo -MD -MP -MF $(DEPDIR)/libinfgtk_0_5_la-inf-gtk-browser-view.Tpo -c -o libinfgtk_0_5_la-inf-gtk-browser-view.lo `test -f 'inf-gtk-browser-view.c' || echo '$(srcdir)/'`inf-gtk-browser-view.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfgtk_0_5_la-inf-gtk-browser-view.Tpo $(DEPDIR)/libinfgtk_0_5_la-inf-gtk-browser-view.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-gtk-browser-view.c' object='libinfgtk_0_5_la-inf-gtk-browser-view.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfgtk_0_5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfgtk_0_5_la-inf-gtk-browser-view.lo `test -f 'inf-gtk-browser-view.c' || echo '$(srcdir)/'`inf-gtk-browser-view.c libinfgtk_0_5_la-inf-gtk-certificate-dialog.lo: inf-gtk-certificate-dialog.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfgtk_0_5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfgtk_0_5_la-inf-gtk-certificate-dialog.lo -MD -MP -MF $(DEPDIR)/libinfgtk_0_5_la-inf-gtk-certificate-dialog.Tpo -c -o libinfgtk_0_5_la-inf-gtk-certificate-dialog.lo `test -f 'inf-gtk-certificate-dialog.c' || echo '$(srcdir)/'`inf-gtk-certificate-dialog.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfgtk_0_5_la-inf-gtk-certificate-dialog.Tpo $(DEPDIR)/libinfgtk_0_5_la-inf-gtk-certificate-dialog.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-gtk-certificate-dialog.c' object='libinfgtk_0_5_la-inf-gtk-certificate-dialog.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfgtk_0_5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfgtk_0_5_la-inf-gtk-certificate-dialog.lo `test -f 'inf-gtk-certificate-dialog.c' || echo '$(srcdir)/'`inf-gtk-certificate-dialog.c libinfgtk_0_5_la-inf-gtk-certificate-manager.lo: inf-gtk-certificate-manager.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfgtk_0_5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfgtk_0_5_la-inf-gtk-certificate-manager.lo -MD -MP -MF $(DEPDIR)/libinfgtk_0_5_la-inf-gtk-certificate-manager.Tpo -c -o libinfgtk_0_5_la-inf-gtk-certificate-manager.lo `test -f 'inf-gtk-certificate-manager.c' || echo '$(srcdir)/'`inf-gtk-certificate-manager.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfgtk_0_5_la-inf-gtk-certificate-manager.Tpo $(DEPDIR)/libinfgtk_0_5_la-inf-gtk-certificate-manager.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-gtk-certificate-manager.c' object='libinfgtk_0_5_la-inf-gtk-certificate-manager.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfgtk_0_5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfgtk_0_5_la-inf-gtk-certificate-manager.lo `test -f 'inf-gtk-certificate-manager.c' || echo '$(srcdir)/'`inf-gtk-certificate-manager.c libinfgtk_0_5_la-inf-gtk-certificate-view.lo: inf-gtk-certificate-view.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfgtk_0_5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfgtk_0_5_la-inf-gtk-certificate-view.lo -MD -MP -MF $(DEPDIR)/libinfgtk_0_5_la-inf-gtk-certificate-view.Tpo -c -o libinfgtk_0_5_la-inf-gtk-certificate-view.lo `test -f 'inf-gtk-certificate-view.c' || echo '$(srcdir)/'`inf-gtk-certificate-view.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfgtk_0_5_la-inf-gtk-certificate-view.Tpo $(DEPDIR)/libinfgtk_0_5_la-inf-gtk-certificate-view.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-gtk-certificate-view.c' object='libinfgtk_0_5_la-inf-gtk-certificate-view.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfgtk_0_5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfgtk_0_5_la-inf-gtk-certificate-view.lo `test -f 'inf-gtk-certificate-view.c' || echo '$(srcdir)/'`inf-gtk-certificate-view.c libinfgtk_0_5_la-inf-gtk-chat.lo: inf-gtk-chat.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfgtk_0_5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfgtk_0_5_la-inf-gtk-chat.lo -MD -MP -MF $(DEPDIR)/libinfgtk_0_5_la-inf-gtk-chat.Tpo -c -o libinfgtk_0_5_la-inf-gtk-chat.lo `test -f 'inf-gtk-chat.c' || echo '$(srcdir)/'`inf-gtk-chat.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfgtk_0_5_la-inf-gtk-chat.Tpo $(DEPDIR)/libinfgtk_0_5_la-inf-gtk-chat.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-gtk-chat.c' object='libinfgtk_0_5_la-inf-gtk-chat.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfgtk_0_5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfgtk_0_5_la-inf-gtk-chat.lo `test -f 'inf-gtk-chat.c' || echo '$(srcdir)/'`inf-gtk-chat.c libinfgtk_0_5_la-inf-gtk-io.lo: inf-gtk-io.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfgtk_0_5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfgtk_0_5_la-inf-gtk-io.lo -MD -MP -MF $(DEPDIR)/libinfgtk_0_5_la-inf-gtk-io.Tpo -c -o libinfgtk_0_5_la-inf-gtk-io.lo `test -f 'inf-gtk-io.c' || echo '$(srcdir)/'`inf-gtk-io.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfgtk_0_5_la-inf-gtk-io.Tpo $(DEPDIR)/libinfgtk_0_5_la-inf-gtk-io.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-gtk-io.c' object='libinfgtk_0_5_la-inf-gtk-io.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfgtk_0_5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfgtk_0_5_la-inf-gtk-io.lo `test -f 'inf-gtk-io.c' || echo '$(srcdir)/'`inf-gtk-io.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-libinfgtk_0_5_laHEADERS: $(libinfgtk_0_5_la_HEADERS) @$(NORMAL_INSTALL) @list='$(libinfgtk_0_5_la_HEADERS)'; test -n "$(libinfgtk_0_5_ladir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(libinfgtk_0_5_ladir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libinfgtk_0_5_ladir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libinfgtk_0_5_ladir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(libinfgtk_0_5_ladir)" || exit $$?; \ done uninstall-libinfgtk_0_5_laHEADERS: @$(NORMAL_UNINSTALL) @list='$(libinfgtk_0_5_la_HEADERS)'; test -n "$(libinfgtk_0_5_ladir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(libinfgtk_0_5_ladir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(libinfgtk_0_5_ladir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-libinfgtk_0_5_laHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES \ uninstall-libinfgtk_0_5_laHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-libLTLIBRARIES \ install-libinfgtk_0_5_laHEADERS install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES \ uninstall-libinfgtk_0_5_laHEADERS # 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: libinfinity-0.5.5/libinfgtk/inf-gtk-browser-model-filter.c0000644000175000017500000002304512264763732020520 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include static GObjectClass* parent_class; typedef struct _InfGtkBrowserModelFilterPrivate InfGtkBrowserModelFilterPrivate; struct _InfGtkBrowserModelFilterPrivate { InfGtkBrowserModel* child_model; }; #define INF_GTK_BROWSER_MODEL_FILTER_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), INF_GTK_TYPE_BROWSER_MODEL_FILTER, InfGtkBrowserModelFilterPrivate)) static void inf_gtk_browser_model_filter_set_browser_cb(InfGtkBrowserModel* model, GtkTreePath* path, GtkTreeIter* iter, InfcBrowser* browser, gpointer user_data) { GtkTreeModelFilter* model_filter; GtkTreePath* own_path; GtkTreeIter own_iter; gboolean result; model_filter = GTK_TREE_MODEL_FILTER(user_data); result = gtk_tree_model_filter_convert_child_iter_to_iter( model_filter, &own_iter, iter ); if(result == TRUE) { own_path = gtk_tree_model_filter_convert_child_path_to_path( model_filter, path ); g_assert(own_path != NULL); inf_gtk_browser_model_set_browser( INF_GTK_BROWSER_MODEL(user_data), own_path, &own_iter, browser ); gtk_tree_path_free(own_path); } } static void inf_gtk_browser_model_filter_sync_child_model(InfGtkBrowserModelFilter* model, InfGtkBrowserModel* child_model) { InfGtkBrowserModelFilterPrivate* priv; priv = INF_GTK_BROWSER_MODEL_FILTER_PRIVATE(model); if(priv->child_model != NULL) { inf_signal_handlers_disconnect_by_func( priv->child_model, G_CALLBACK(inf_gtk_browser_model_filter_set_browser_cb), model ); g_object_unref(priv->child_model); } priv->child_model = child_model; if(child_model != NULL) { g_object_ref(child_model); g_signal_connect( G_OBJECT(child_model), "set-browser", G_CALLBACK(inf_gtk_browser_model_filter_set_browser_cb), model ); } } static void inf_gtk_browser_model_filter_notify_model_cb(GObject* object, GParamSpec* pspec, gpointer user_data) { GtkTreeModel* child_model; child_model = gtk_tree_model_filter_get_model( GTK_TREE_MODEL_FILTER(object) ); inf_gtk_browser_model_filter_sync_child_model( INF_GTK_BROWSER_MODEL_FILTER(object), INF_GTK_BROWSER_MODEL(child_model) ); } /* * GObject overrides */ static void inf_gtk_browser_model_filter_init(GTypeInstance* instance, gpointer g_class) { InfGtkBrowserModelFilter* model_sort; InfGtkBrowserModelFilterPrivate* priv; model_sort = INF_GTK_BROWSER_MODEL_FILTER(instance); priv = INF_GTK_BROWSER_MODEL_FILTER_PRIVATE(model_sort); /* Keep child model in sync with the one from GtkTreeModelFilter */ g_signal_connect( instance, "notify::model", G_CALLBACK(inf_gtk_browser_model_filter_notify_model_cb), NULL ); } static GObject* inf_gtk_browser_model_filter_constructor(GType type, guint n_construct_properties, GObjectConstructParam* properties) { GObject* object; object = G_OBJECT_CLASS(parent_class)->constructor( type, n_construct_properties, properties ); /* Set initial model, we do not get notified for this */ inf_gtk_browser_model_filter_sync_child_model( INF_GTK_BROWSER_MODEL_FILTER(object), INF_GTK_BROWSER_MODEL( gtk_tree_model_filter_get_model(GTK_TREE_MODEL_FILTER(object)) ) ); return object; } static void inf_gtk_browser_model_filter_dispose(GObject* object) { InfGtkBrowserModelFilter* model_sort; InfGtkBrowserModelFilterPrivate* priv; model_sort = INF_GTK_BROWSER_MODEL_FILTER(object); priv = INF_GTK_BROWSER_MODEL_FILTER_PRIVATE(model_sort); /* Release own child model, since we won't get notified anymore when the * parent's dispose runs. We disconnect the signal handler before chaining * up. */ inf_gtk_browser_model_filter_sync_child_model(model_sort, NULL); inf_signal_handlers_disconnect_by_func( object, G_CALLBACK(inf_gtk_browser_model_filter_notify_model_cb), NULL ); G_OBJECT_CLASS(parent_class)->dispose(object); } /* * InfGtkBrowserModel implementation. */ static void inf_gtk_browser_model_filter_resolve(InfGtkBrowserModel* model, InfDiscovery* discovery, InfDiscoveryInfo* info) { GtkTreeModel* child_model; child_model = gtk_tree_model_filter_get_model(GTK_TREE_MODEL_FILTER(model)); inf_gtk_browser_model_resolve( INF_GTK_BROWSER_MODEL(child_model), discovery, info ); } static gboolean inf_gtk_browser_model_filter_browser_iter_to_tree_iter(InfGtkBrowserModel* m, InfcBrowser* browser, InfcBrowserIter* iter, GtkTreeIter* tree_iter) { GtkTreeModel* child_model; GtkTreeIter child_iter; gboolean result; child_model = gtk_tree_model_filter_get_model(GTK_TREE_MODEL_FILTER(m)); result = inf_gtk_browser_model_browser_iter_to_tree_iter( INF_GTK_BROWSER_MODEL(child_model), browser, iter, &child_iter ); if(result == TRUE) { return gtk_tree_model_filter_convert_child_iter_to_iter( GTK_TREE_MODEL_FILTER(m), tree_iter, &child_iter ); } else { return FALSE; } } /* * GType registration */ static void inf_gtk_browser_model_filter_class_init(gpointer g_class, gpointer class_data) { GObjectClass* object_class; InfGtkBrowserModelFilterClass* browser_model_filter_class; object_class = G_OBJECT_CLASS(g_class); browser_model_filter_class = INF_GTK_BROWSER_MODEL_FILTER_CLASS(g_class); parent_class = G_OBJECT_CLASS(g_type_class_peek_parent(g_class)); g_type_class_add_private(g_class, sizeof(InfGtkBrowserModelFilterPrivate)); object_class->constructor = inf_gtk_browser_model_filter_constructor; object_class->dispose = inf_gtk_browser_model_filter_dispose; } static void inf_gtk_browser_model_filter_browser_model_init(gpointer g_iface, gpointer iface_data) { InfGtkBrowserModelIface* iface; iface = (InfGtkBrowserModelIface*)g_iface; iface->set_browser = NULL; iface->resolve = inf_gtk_browser_model_filter_resolve; /* inf_gtk_browser_model_filter_browser_model_browser_iter_to_tree_iter * would be consistent, but a _bit_ too long to fit properly into 80 * chars ;) */ iface->browser_iter_to_tree_iter = inf_gtk_browser_model_filter_browser_iter_to_tree_iter; } GType inf_gtk_browser_model_filter_get_type(void) { static GType browser_model_filter_type = 0; if(!browser_model_filter_type) { static const GTypeInfo browser_model_filter_type_info = { sizeof(InfGtkBrowserModelFilterClass), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ inf_gtk_browser_model_filter_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InfGtkBrowserModelFilter), /* instance_size */ 0, /* n_preallocs */ inf_gtk_browser_model_filter_init, /* instance_init */ NULL /* value_table */ }; static const GInterfaceInfo browser_model_info = { inf_gtk_browser_model_filter_browser_model_init, NULL, NULL }; browser_model_filter_type = g_type_register_static( GTK_TYPE_TREE_MODEL_FILTER, "InfGtkBrowserModelFilter", &browser_model_filter_type_info, 0 ); g_type_add_interface_static( browser_model_filter_type, INF_GTK_TYPE_BROWSER_MODEL, &browser_model_info ); } return browser_model_filter_type; } /* * Public API. */ /** * inf_gtk_browser_model_filter_new: * @child_model: A #InfGtkBrowserModel. * * Creates a new #InfGtkBrowserModelFilter, filtering @child_model. * * Return Value: A new #InfGtkBrowserModelFilter. **/ InfGtkBrowserModelFilter* inf_gtk_browser_model_filter_new(InfGtkBrowserModel* child_model) { GObject* object; object = g_object_new( INF_GTK_TYPE_BROWSER_MODEL_FILTER, "child-model", child_model, NULL ); return INF_GTK_BROWSER_MODEL_FILTER(object); } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfgtk/inf-gtk-browser-model.h0000644000175000017500000001012612264763732017236 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_GTK_BROWSER_MODEL_H__ #define __INF_GTK_BROWSER_MODEL_H__ #include #include #include #include G_BEGIN_DECLS #define INF_GTK_TYPE_BROWSER_MODEL (inf_gtk_browser_model_get_type()) #define INF_GTK_BROWSER_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INF_GTK_TYPE_BROWSER_MODEL, InfGtkBrowserModel)) #define INF_GTK_IS_BROWSER_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INF_GTK_TYPE_BROWSER_MODEL)) #define INF_GTK_BROWSER_MODEL_GET_IFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE((inst), INF_GTK_TYPE_BROWSER_MODEL, InfGtkBrowserModelIface)) #define INF_GTK_TYPE_BROWSER_MODEL_STATUS (inf_gtk_browser_model_status_get_type()) typedef struct _InfGtkBrowserModel InfGtkBrowserModel; typedef struct _InfGtkBrowserModelIface InfGtkBrowserModelIface; typedef enum _InfGtkBrowserModelStatus { INF_GTK_BROWSER_MODEL_INVALID, INF_GTK_BROWSER_MODEL_DISCOVERED, INF_GTK_BROWSER_MODEL_RESOLVING, INF_GTK_BROWSER_MODEL_DISCONNECTED, INF_GTK_BROWSER_MODEL_CONNECTING, INF_GTK_BROWSER_MODEL_CONNECTED, INF_GTK_BROWSER_MODEL_ERROR } InfGtkBrowserModelStatus; /* Note that not all of the columns are valid for all rows */ typedef enum _InfGtkBrowserModelColumn { INF_GTK_BROWSER_MODEL_COL_DISCOVERY_INFO, INF_GTK_BROWSER_MODEL_COL_DISCOVERY, INF_GTK_BROWSER_MODEL_COL_BROWSER, INF_GTK_BROWSER_MODEL_COL_STATUS, /* only toplevel */ INF_GTK_BROWSER_MODEL_COL_NAME, INF_GTK_BROWSER_MODEL_COL_ERROR, INF_GTK_BROWSER_MODEL_COL_NODE, INF_GTK_BROWSER_MODEL_NUM_COLS } InfGtkBrowserModelColumn; struct _InfGtkBrowserModelIface { GTypeInterface parent; /* signals */ void(*set_browser)(InfGtkBrowserModel* model, GtkTreePath* path, GtkTreeIter* iter, InfcBrowser* browser); /* virtual functions */ void(*resolve)(InfGtkBrowserModel* model, InfDiscovery* discovery, InfDiscoveryInfo* info); gboolean(*browser_iter_to_tree_iter)(InfGtkBrowserModel* model, InfcBrowser* browser, InfcBrowserIter* browser_iter, GtkTreeIter* tree_iter); }; struct _InfGtkBrowserModel { GObject parent; }; GType inf_gtk_browser_model_status_get_type(void) G_GNUC_CONST; GType inf_gtk_browser_model_get_type(void) G_GNUC_CONST; void inf_gtk_browser_model_set_browser(InfGtkBrowserModel* model, GtkTreePath* path, GtkTreeIter* iter, InfcBrowser* browser); void inf_gtk_browser_model_resolve(InfGtkBrowserModel* model, InfDiscovery* discovery, InfDiscoveryInfo* info); gboolean inf_gtk_browser_model_browser_iter_to_tree_iter(InfGtkBrowserModel* model, InfcBrowser* browser, InfcBrowserIter* browser_iter, GtkTreeIter* tree_iter); G_END_DECLS #endif /* __INF_GTK_BROWSER_MODEL_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfgtk/inf-gtk-io.h0000644000175000017500000000347612264763732015076 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_GTK_IO_H__ #define __INF_GTK_IO_H__ #include G_BEGIN_DECLS #define INF_GTK_TYPE_IO (inf_gtk_io_get_type()) #define INF_GTK_IO(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INF_GTK_TYPE_IO, InfGtkIo)) #define INF_GTK_IO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INF_GTK_TYPE_IO, InfGtkIoClass)) #define INF_GTK_IS_IO(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INF_GTK_TYPE_IO)) #define INF_GTK_IS_IO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INF_GTK_TYPE_IO)) #define INF_GTK_IO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), INF_GTK_TYPE_IO, InfGtkIoClass)) typedef struct _InfGtkIo InfGtkIo; typedef struct _InfGtkIoClass InfGtkIoClass; struct _InfGtkIoClass { GObjectClass parent_class; }; struct _InfGtkIo { GObject parent; }; GType inf_gtk_io_get_type(void) G_GNUC_CONST; InfGtkIo* inf_gtk_io_new(void); G_END_DECLS #endif /* __INF_GTK_IO_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfgtk/inf-gtk-browser-model-sort.h0000644000175000017500000000451212264763732020225 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_GTK_BROWSER_MODEL_SORT_H__ #define __INF_GTK_BROWSER_MODEL_SORT_H__ #include #include #include G_BEGIN_DECLS #define INF_GTK_TYPE_BROWSER_MODEL_SORT (inf_gtk_browser_model_sort_get_type()) #define INF_GTK_BROWSER_MODEL_SORT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INF_GTK_TYPE_BROWSER_MODEL_SORT, InfGtkBrowserModelSort)) #define INF_GTK_BROWSER_MODEL_SORT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INF_GTK_TYPE_BROWSER_MODEL_SORT, InfGtkBrowserModelSortClass)) #define INF_GTK_IS_BROWSER_MODEL_SORT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INF_GTK_TYPE_BROWSER_MODEL_SORT)) #define INF_GTK_IS_BROWSER_MODEL_SORT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INF_GTK_TYPE_BROWSER_MODEL_SORT)) #define INF_GTK_BROWSER_MODEL_SORT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), INF_GTK_TYPE_BROWSER_MODEL_SORT, InfGtkBrowserModelSortClass)) typedef struct _InfGtkBrowserModelSort InfGtkBrowserModelSort; typedef struct _InfGtkBrowserModelSortClass InfGtkBrowserModelSortClass; struct _InfGtkBrowserModelSortClass { GtkTreeModelSortClass parent_class; }; struct _InfGtkBrowserModelSort { GtkTreeModelSort parent; }; GType inf_gtk_browser_model_sort_get_type(void) G_GNUC_CONST; InfGtkBrowserModelSort* inf_gtk_browser_model_sort_new(InfGtkBrowserModel* child_model); G_END_DECLS #endif /* __INF_GTK_BROWSER_MODEL_SORT_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfgtk/inf-gtk-io.c0000644000175000017500000004535412264763732015072 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include struct _InfIoWatch { InfGtkIo* io; InfNativeSocket* socket; guint id; InfIoWatchFunc func; gpointer user_data; GDestroyNotify notify; /* Additional state to avoid freeing the userdata while running * the callback */ gboolean executing; gboolean disposed; }; struct _InfIoTimeout { InfGtkIo* io; guint id; InfIoTimeoutFunc func; gpointer user_data; GDestroyNotify notify; }; struct _InfIoDispatch { InfGtkIo* io; guint id; InfIoDispatchFunc func; gpointer user_data; GDestroyNotify notify; }; typedef struct _InfGtkIoUserdata InfGtkIoUserdata; struct _InfGtkIoUserdata { union { InfIoWatch* watch; InfIoTimeout* timeout; InfIoDispatch* dispatch; } shared; GMutex* mutex; int* mutexref; }; typedef struct _InfGtkIoPrivate InfGtkIoPrivate; struct _InfGtkIoPrivate { /* TODO: GMainContext */ GMutex* mutex; int* mutexref; /* reference counter for the mutex */ GSList* watches; GSList* timeouts; GSList* dispatchs; }; #define INF_GTK_IO_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), INF_GTK_TYPE_IO, InfGtkIoPrivate)) static GObjectClass* parent_class; static void inf_gtk_io_userdata_free(gpointer data) { InfGtkIoUserdata* userdata; userdata = (InfGtkIoUserdata*)data; /* Note that the shared members may already be invalid at this point */ /* Note also that we cannot lock the mutex here, because this function * might or might not be called with it being locked already. However in * this case we can use an atomic operation instead. */ if(g_atomic_int_dec_and_test(userdata->mutexref) == TRUE) { g_mutex_free(userdata->mutex); g_free(userdata->mutexref); } g_slice_free(InfGtkIoUserdata, userdata); } static InfIoWatch* inf_gtk_io_watch_new(InfGtkIo* io, InfNativeSocket* socket, InfIoWatchFunc func, gpointer user_data, GDestroyNotify notify) { InfIoWatch* watch; watch = g_slice_new(InfIoWatch); watch->io = io; watch->socket = socket; watch->id = 0; watch->func = func; watch->user_data = user_data; watch->notify = notify; watch->executing = FALSE; watch->disposed = FALSE; return watch; } static void inf_gtk_io_watch_free(InfIoWatch* watch) { if(watch->notify) watch->notify(watch->user_data); g_slice_free(InfIoWatch, watch); } static InfIoTimeout* inf_gtk_io_timeout_new(InfGtkIo* io, InfIoTimeoutFunc func, gpointer user_data, GDestroyNotify notify) { InfIoTimeout* timeout; timeout = g_slice_new(InfIoTimeout); timeout->io = io; timeout->id = 0; timeout->func = func; timeout->user_data = user_data; timeout->notify = notify; return timeout; } static void inf_gtk_io_timeout_free(InfIoTimeout* timeout) { if(timeout->notify) timeout->notify(timeout->user_data); g_slice_free(InfIoTimeout, timeout); } static InfIoDispatch* inf_gtk_io_dispatch_new(InfGtkIo* io, InfIoDispatchFunc func, gpointer user_data, GDestroyNotify notify) { InfIoDispatch* dispatch; dispatch = g_slice_new(InfIoDispatch); dispatch->io = io; dispatch->id = 0; dispatch->func = func; dispatch->user_data = user_data; dispatch->notify = notify; return dispatch; } static void inf_gtk_io_dispatch_free(InfIoDispatch* dispatch) { if(dispatch->notify) dispatch->notify(dispatch->user_data); g_slice_free(InfIoDispatch, dispatch); } static InfIoWatch* inf_gtk_io_watch_lookup(InfGtkIo* io, InfNativeSocket* socket) { InfGtkIoPrivate* priv; GSList* item; priv = INF_GTK_IO_PRIVATE(io); for(item = priv->watches; item != NULL; item = g_slist_next(item)) if( ((InfIoWatch*)item->data)->socket == socket) return (InfIoWatch*)item->data; return NULL; } static void inf_gtk_io_init(GTypeInstance* instance, gpointer g_class) { InfGtkIo* io; InfGtkIoPrivate* priv; io = INF_GTK_IO(instance); priv = INF_GTK_IO_PRIVATE(io); priv->mutex = g_mutex_new(); priv->mutexref = g_malloc(sizeof(int)); *priv->mutexref = 1; priv->watches = NULL; priv->timeouts = NULL; priv->dispatchs = NULL; } static void inf_gtk_io_finalize(GObject* object) { InfGtkIo* io; InfGtkIoPrivate* priv; GSList* item; int mutexref; io = INF_GTK_IO(object); priv = INF_GTK_IO_PRIVATE(io); g_mutex_lock(priv->mutex); for(item = priv->watches; item != NULL; item = g_slist_next(item)) { /* We have a stack-ref on the InfGtkIo when exeucting the callback */ g_assert( ((InfIoWatch*)item->data)->executing == FALSE); if( ((InfIoWatch*)item->data)->id != 0) g_source_remove( ((InfIoWatch*)item->data)->id); inf_gtk_io_watch_free((InfIoWatch*)item->data); } g_slist_free(priv->watches); for(item = priv->timeouts; item != NULL; item = g_slist_next(item)) { if( ((InfIoTimeout*)item->data)->id != 0) g_source_remove( ((InfIoTimeout*)item->data)->id); inf_gtk_io_timeout_free((InfIoTimeout*)item->data); } g_slist_free(priv->timeouts); for(item = priv->dispatchs; item != NULL; item = g_slist_next(item)) { if( ((InfIoDispatch*)item->data)->id != 0) g_source_remove( ((InfIoDispatch*)item->data)->id); inf_gtk_io_dispatch_free((InfIoDispatch*)item->data); } g_slist_free(priv->dispatchs); g_mutex_unlock(priv->mutex); /* some callback userdata might still have a reference to the mutex, and * wait for the callback function to be called until it is released. The * callback function will do nothing since g_source_is_destroyed() will * return FALSE since we removed all sources above. But we need to keep * the mutex alive so that the callbacks can check. */ if(g_atomic_int_dec_and_test(priv->mutexref)) { g_mutex_free(priv->mutex); g_free(priv->mutexref); } G_OBJECT_CLASS(parent_class)->finalize(object); } static GIOCondition inf_gtk_io_inf_events_to_glib_events(InfIoEvent events) { GIOCondition cond; cond = 0; if(events & INF_IO_INCOMING) cond |= G_IO_IN; if(events & INF_IO_OUTGOING) cond |= G_IO_OUT; if(events & INF_IO_ERROR) cond |= (G_IO_ERR | G_IO_HUP); return cond; } static InfIoEvent inf_gtk_io_inf_events_from_glib_events(GIOCondition cond) { InfIoEvent event; event = 0; if(cond & G_IO_IN) event |= INF_IO_INCOMING; if(cond & G_IO_OUT) event |= INF_IO_OUTGOING; if(cond & (G_IO_ERR | G_IO_HUP)) event |= INF_IO_ERROR; return event; } static gboolean inf_gtk_io_watch_func(GIOChannel* channel, GIOCondition condition, gpointer user_data) { InfGtkIoUserdata* userdata; InfIoWatch* watch; InfGtkIoPrivate* priv; userdata = (InfGtkIoUserdata*)user_data; g_mutex_lock(userdata->mutex); if(!g_source_is_destroyed(g_main_current_source())) { /* At this point we now that InfGtkIo is still alive because otherwise * the source would have been destroyed in _finalize. */ watch = userdata->shared.watch; g_object_ref(watch->io); priv = INF_GTK_IO_PRIVATE(watch->io); g_assert(*priv->mutexref > 1); /* Both InfGtkIo and we have a reference */ g_assert(g_slist_find(priv->watches, watch) != NULL); watch->executing = TRUE; g_mutex_unlock(userdata->mutex); /* Note that at this point the watch object could be removed from the * list, but, since executing is set to TRUE, it is not freed. */ watch->func( watch->socket, inf_gtk_io_inf_events_from_glib_events(condition), watch->user_data ); g_mutex_lock(userdata->mutex); watch->executing = FALSE; g_object_unref(watch->io); if(watch->disposed == TRUE) { g_mutex_unlock(userdata->mutex); inf_gtk_io_watch_free(watch); } else { g_mutex_unlock(userdata->mutex); } } else { g_mutex_unlock(userdata->mutex); } return TRUE; } static gboolean inf_gtk_io_timeout_func(gpointer user_data) { InfIoTimeout* timeout; InfGtkIoPrivate* priv; InfGtkIoUserdata* userdata; userdata = (InfGtkIoUserdata*)user_data; g_mutex_lock(userdata->mutex); if(!g_source_is_destroyed(g_main_current_source())) { /* At this point we now that InfGtkIo is still alive because otherwise * the source would have been destroyed in _finalize. */ timeout = userdata->shared.timeout; priv = INF_GTK_IO_PRIVATE(timeout->io); g_assert(*priv->mutexref > 1); /* Both InfGtkIo and we have a reference */ g_assert(g_slist_find(priv->timeouts, timeout) != NULL); priv->timeouts = g_slist_remove(priv->timeouts, timeout); g_mutex_unlock(userdata->mutex); timeout->func(timeout->user_data); inf_gtk_io_timeout_free(timeout); } else { g_mutex_unlock(userdata->mutex); } return FALSE; } static gboolean inf_gtk_io_dispatch_func(gpointer user_data) { InfIoDispatch* dispatch; InfGtkIoPrivate* priv; InfGtkIoUserdata* userdata; userdata = (InfGtkIoUserdata*)user_data; g_mutex_lock(userdata->mutex); if(!g_source_is_destroyed(g_main_current_source())) { /* At this point we now that InfGtkIo is still alive because otherwise * the source would have been destroyed in _finalize. */ dispatch = userdata->shared.dispatch; priv = INF_GTK_IO_PRIVATE(dispatch->io); g_assert(*priv->mutexref > 1); /* Both InfGtkIo and we have a reference */ g_assert(g_slist_find(priv->dispatchs, dispatch) != NULL); priv->dispatchs = g_slist_remove(priv->dispatchs, dispatch); g_mutex_unlock(userdata->mutex); dispatch->func(dispatch->user_data); inf_gtk_io_dispatch_free(dispatch); } else { g_mutex_unlock(userdata->mutex); } return FALSE; } static InfIoWatch* inf_gtk_io_io_add_watch(InfIo* io, InfNativeSocket* socket, InfIoEvent events, InfIoWatchFunc func, gpointer user_data, GDestroyNotify notify) { InfGtkIoPrivate* priv; InfIoWatch* watch; InfGtkIoUserdata* data; GIOChannel* channel; priv = INF_GTK_IO_PRIVATE(io); g_mutex_lock(priv->mutex); watch = inf_gtk_io_watch_lookup(INF_GTK_IO(io), socket); if(watch != NULL) { g_mutex_unlock(priv->mutex); return NULL; } watch = inf_gtk_io_watch_new( INF_GTK_IO(io), socket, func, user_data, notify ); data = g_slice_new(InfGtkIoUserdata); data->shared.watch = watch; data->mutex = priv->mutex; data->mutexref = priv->mutexref; g_atomic_int_inc(data->mutexref); #ifdef G_OS_WIN32 channel = g_io_channel_win32_new_socket(*socket); #else channel = g_io_channel_unix_new(*socket); #endif watch->id = g_io_add_watch_full( channel, G_PRIORITY_DEFAULT, inf_gtk_io_inf_events_to_glib_events(events), inf_gtk_io_watch_func, data, inf_gtk_io_userdata_free ); g_io_channel_unref(channel); priv->watches = g_slist_prepend(priv->watches, watch); g_mutex_unlock(priv->mutex); return watch; } static void inf_gtk_io_io_update_watch(InfIo* io, InfIoWatch* watch, InfIoEvent events) { InfGtkIoPrivate* priv; InfGtkIoUserdata* data; GIOChannel* channel; priv = INF_GTK_IO_PRIVATE(io); g_mutex_lock(priv->mutex); g_assert(g_slist_find(priv->watches, watch) != NULL); data = g_slice_new(InfGtkIoUserdata); data->shared.watch = watch; data->mutex = priv->mutex; data->mutexref = priv->mutexref; g_atomic_int_inc(data->mutexref); g_mutex_unlock(priv->mutex); g_source_remove(watch->id); #ifdef G_OS_WIN32 channel = g_io_channel_win32_new_socket(*watch->socket); #else channel = g_io_channel_unix_new(*watch->socket); #endif watch->id = g_io_add_watch_full( channel, G_PRIORITY_DEFAULT, inf_gtk_io_inf_events_to_glib_events(events), inf_gtk_io_watch_func, data, inf_gtk_io_userdata_free ); g_io_channel_unref(channel); } static void inf_gtk_io_io_remove_watch(InfIo* io, InfIoWatch* watch) { InfGtkIoPrivate* priv; priv = INF_GTK_IO_PRIVATE(io); g_mutex_lock(priv->mutex); g_assert(g_slist_find(priv->watches, watch) != NULL); priv->watches = g_slist_remove(priv->watches, watch); if(watch->executing) { /* If we are currently running the watch callback then don't free the * watch object right now, because this would destroy the userdata before * the callback finished running. Instead, remember that the watch is * going to be disposed and remove it in the watch func right after * having called the callback. */ watch->disposed = TRUE; g_mutex_unlock(priv->mutex); } else { g_mutex_unlock(priv->mutex); inf_gtk_io_watch_free(watch); } /* Note that we can do this safely without having locked the mutex because * if the callback function is currently being invoked then its user_data * will not be destroyed immediately. */ g_source_remove(watch->id); } static InfIoTimeout* inf_gtk_io_io_add_timeout(InfIo* io, guint msecs, InfIoTimeoutFunc func, gpointer user_data, GDestroyNotify notify) { InfGtkIoPrivate* priv; InfIoTimeout* timeout; InfGtkIoUserdata* data; priv = INF_GTK_IO_PRIVATE(io); timeout = inf_gtk_io_timeout_new(INF_GTK_IO(io), func, user_data, notify); data = g_slice_new(InfGtkIoUserdata); data->shared.timeout = timeout; data->mutex = priv->mutex; data->mutexref = priv->mutexref; g_mutex_lock(priv->mutex); g_atomic_int_inc(data->mutexref); timeout->id = g_timeout_add_full( G_PRIORITY_DEFAULT, msecs, inf_gtk_io_timeout_func, data, inf_gtk_io_userdata_free ); priv->timeouts = g_slist_prepend(priv->timeouts, timeout); g_mutex_unlock(priv->mutex); return timeout; } static void inf_gtk_io_io_remove_timeout(InfIo* io, InfIoTimeout* timeout) { InfGtkIoPrivate* priv; priv = INF_GTK_IO_PRIVATE(io); g_mutex_lock(priv->mutex); g_assert(g_slist_find(priv->timeouts, timeout) != NULL); priv->timeouts = g_slist_remove(priv->timeouts, timeout); g_mutex_unlock(priv->mutex); /* Note that we can do this safely without having locked the mutex because * if the callback function is currently being invoked then its user_data * will not be destroyed immediately. */ g_source_remove(timeout->id); inf_gtk_io_timeout_free(timeout); } static InfIoDispatch* inf_gtk_io_io_add_dispatch(InfIo* io, InfIoDispatchFunc func, gpointer user_data, GDestroyNotify notify) { InfGtkIoPrivate* priv; InfIoDispatch* dispatch; InfGtkIoUserdata* data; priv = INF_GTK_IO_PRIVATE(io); dispatch = inf_gtk_io_dispatch_new(INF_GTK_IO(io), func, user_data, notify); data = g_slice_new(InfGtkIoUserdata); data->shared.dispatch = dispatch; data->mutex = priv->mutex; data->mutexref = priv->mutexref; g_mutex_lock(priv->mutex); g_atomic_int_inc(data->mutexref); dispatch->id = g_idle_add_full( G_PRIORITY_DEFAULT_IDLE, inf_gtk_io_dispatch_func, data, inf_gtk_io_userdata_free ); priv->dispatchs = g_slist_prepend(priv->dispatchs, dispatch); g_mutex_unlock(priv->mutex); return dispatch; } static void inf_gtk_io_io_remove_dispatch(InfIo* io, InfIoDispatch* dispatch) { InfGtkIoPrivate* priv; priv = INF_GTK_IO_PRIVATE(io); g_mutex_lock(priv->mutex); g_assert(g_slist_find(priv->dispatchs, dispatch) != NULL); priv->dispatchs = g_slist_remove(priv->dispatchs, dispatch); g_mutex_unlock(priv->mutex); /* Note that we can do this safely without having locked the mutex because * if the callback function is currently being invoked then its user_data * will not be destroyed immediately. */ g_source_remove(dispatch->id); inf_gtk_io_dispatch_free(dispatch); } static void inf_gtk_io_class_init(gpointer g_class, gpointer class_data) { GObjectClass* object_class; object_class = G_OBJECT_CLASS(g_class); parent_class = G_OBJECT_CLASS(g_type_class_peek_parent(g_class)); g_type_class_add_private(g_class, sizeof(InfGtkIoPrivate)); object_class->finalize = inf_gtk_io_finalize; } static void inf_gtk_io_io_init(gpointer g_iface, gpointer iface_data) { InfIoIface* iface; iface = (InfIoIface*)g_iface; iface->add_watch = inf_gtk_io_io_add_watch; iface->update_watch = inf_gtk_io_io_update_watch; iface->remove_watch = inf_gtk_io_io_remove_watch; iface->add_timeout = inf_gtk_io_io_add_timeout; iface->remove_timeout = inf_gtk_io_io_remove_timeout; iface->add_dispatch = inf_gtk_io_io_add_dispatch; iface->remove_dispatch = inf_gtk_io_io_remove_dispatch; } GType inf_gtk_io_get_type(void) { static GType io_type = 0; if(!io_type) { static const GTypeInfo io_type_info = { sizeof(InfGtkIoClass), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ inf_gtk_io_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InfGtkIo), /* instance_size */ 0, /* n_preallocs */ inf_gtk_io_init, /* instance_init */ NULL /* value_table */ }; static const GInterfaceInfo io_info = { inf_gtk_io_io_init, NULL, NULL }; io_type = g_type_register_static( G_TYPE_OBJECT, "InfGtkIo", &io_type_info, 0 ); g_type_add_interface_static( io_type, INF_TYPE_IO, &io_info ); } return io_type; } /** * inf_gtk_io_new: * * Creates a new #InfGtkIo. * * Returns: A new #InfGtkIo. Free with g_object_unref() when no longer needed. **/ InfGtkIo* inf_gtk_io_new(void) { GObject* object; object = g_object_new(INF_GTK_TYPE_IO, NULL); return INF_GTK_IO(object); } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfgtk/inf-gtk-certificate-manager.c0000644000175000017500000006665712264763732020366 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ /* TODO: Put the non-GUI-relevant parts of this code into libinfinity */ /* TODO: Support CRLs */ #include #include #include #include #include #include #include #include #include typedef struct _InfGtkCertificateManagerQuery InfGtkCertificateManagerQuery; struct _InfGtkCertificateManagerQuery { InfGtkCertificateManager* manager; InfXmppConnection* connection; InfGtkCertificateDialog* dialog; GtkWidget* checkbutton; gnutls_x509_crt_t old_certificate; /* points into known_hosts array */ InfCertificateChain* certificate_chain; }; typedef struct _InfGtkCertificateManagerPrivate InfGtkCertificateManagerPrivate; struct _InfGtkCertificateManagerPrivate { GtkWindow* parent_window; InfXmppManager* xmpp_manager; gchar* trust_file; gchar* known_hosts_file; GPtrArray* ca_certs; GPtrArray* known_hosts; GSList* queries; }; enum { PROP_0, PROP_PARENT_WINDOW, PROP_XMPP_MANAGER, PROP_TRUST_FILE, PROP_KNOWN_HOSTS_FILE }; #define INF_GTK_CERTIFICATE_MANAGER_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), INF_GTK_TYPE_CERTIFICATE_MANAGER, InfGtkCertificateManagerPrivate)) static GObjectClass* parent_class; #if 0 static InfGtkCertificateManagerQuery* inf_gtk_certificate_manager_find_query(InfGtkCertificateManager* manager, InfXmppConnection* connection) { InfGtkCertificateManagerPrivate* priv; GSList* item; InfGtkCertificateManagerQuery* query; priv = INF_GTK_CERTIFICATE_MANAGER_PRIVATE(manager); for(item = priv->queries; item != NULL; item == item->next) { query = (InfGtkCertificateManagerQuery*)item->data; if(query->connection == connection) return query; } return NULL; } #endif static void inf_gtk_certificate_manager_notify_status_cb(GObject* object, GParamSpec* pspec, gpointer user_data); static void inf_gtk_certificate_manager_query_free(InfGtkCertificateManagerQuery* query) { inf_signal_handlers_disconnect_by_func( G_OBJECT(query->connection), G_CALLBACK(inf_gtk_certificate_manager_notify_status_cb), query ); g_object_unref(query->connection); inf_certificate_chain_unref(query->certificate_chain); gtk_widget_destroy(GTK_WIDGET(query->dialog)); g_slice_free(InfGtkCertificateManagerQuery, query); } static void inf_gtk_certificate_manager_response_cb(GtkDialog* dialog, int response_id, gpointer user_data) { InfGtkCertificateManagerQuery* query; InfGtkCertificateManagerPrivate* priv; InfGtkCertificateDialogFlags flags; GSList* item; InfGtkCertificateManagerQuery* other_query; guint i; gnutls_x509_crt_t own; gnutls_x509_crt_t copied_own; InfXmppConnection* connection; query = (InfGtkCertificateManagerQuery*)user_data; priv = INF_GTK_CERTIFICATE_MANAGER_PRIVATE(query->manager); g_object_get(G_OBJECT(dialog), "certificate-flags", &flags, NULL); /* If the certificate changed, and we shall remember the answer, then we * remove the old certificate from the known hosts file. If the user * accepted the connection, then we will add the new certificate below. */ if(flags & INF_GTK_CERTIFICATE_DIALOG_CERT_CHANGED) { if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(query->checkbutton))) { /* Make sure the certificate is not currently in use by * another dialog. */ for(item = priv->queries; item != NULL; item = g_slist_next(item)) { other_query = (InfGtkCertificateManagerQuery*)item->data; if(query != other_query) if(query->old_certificate == other_query->old_certificate) break; } if(item == NULL) { for(i = 0; i < priv->known_hosts->len; ++ i) { if(g_ptr_array_index(priv->known_hosts, i) == query->old_certificate) { gnutls_x509_crt_deinit(query->old_certificate); g_ptr_array_remove_index_fast(priv->known_hosts, i); break; } } } query->old_certificate = NULL; } } own = inf_certificate_chain_get_own_certificate(query->certificate_chain); connection = query->connection; g_object_ref(connection); switch(response_id) { case GTK_RESPONSE_ACCEPT: if( (flags & INF_GTK_CERTIFICATE_DIALOG_CERT_CHANGED) || (flags & INF_GTK_CERTIFICATE_DIALOG_CERT_ISSUER_NOT_TRUSTED)) { if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(query->checkbutton))) { /* We should not add the same certificate twice, meaning we don't * already have a certificate for this host. If we had an older one, * then it should have been removed above. */ g_assert(query->old_certificate == NULL); if(inf_cert_util_copy(&copied_own, own) == GNUTLS_E_SUCCESS) g_ptr_array_add(priv->known_hosts, copied_own); } } /* We do this before calling verify_continue since this could cause a * status notify, in which our signal handler would already remove the * query. We would then try to free it again at the end of this call. */ priv->queries = g_slist_remove(priv->queries, query); inf_gtk_certificate_manager_query_free(query); inf_xmpp_connection_certificate_verify_continue(connection); break; case GTK_RESPONSE_REJECT: case GTK_RESPONSE_DELETE_EVENT: if( (flags & INF_GTK_CERTIFICATE_DIALOG_CERT_CHANGED) || (flags & INF_GTK_CERTIFICATE_DIALOG_CERT_ISSUER_NOT_TRUSTED)) { /* TODO: Remember that the connection was rejected if the checkbutton * is active. */ } /* We do this before calling verify_cancel since this could cause a * status notify, in which our signal handler would already remove the * query. We would then try to free it again at the end of this call. */ priv->queries = g_slist_remove(priv->queries, query); inf_gtk_certificate_manager_query_free(query); inf_xmpp_connection_certificate_verify_cancel(connection); break; default: g_assert_not_reached(); break; } g_object_unref(connection); } static void inf_gtk_certificate_manager_notify_status_cb(GObject* object, GParamSpec* pspec, gpointer user_data) { InfGtkCertificateManagerQuery* query; InfGtkCertificateManagerPrivate* priv; InfXmppConnection* connection; InfXmlConnectionStatus status; query = (InfGtkCertificateManagerQuery*)user_data; priv = INF_GTK_CERTIFICATE_MANAGER_PRIVATE(query->manager); connection = INF_XMPP_CONNECTION(object); g_object_get(G_OBJECT(connection), "status", &status, NULL); if(status == INF_XML_CONNECTION_CLOSING || status == INF_XML_CONNECTION_CLOSED) { priv->queries = g_slist_remove(priv->queries, query); inf_gtk_certificate_manager_query_free(query); } } static void inf_gtk_certificate_manager_free_certificate_array(GPtrArray* array) { guint i; for(i = 0; i < array->len; ++ i) gnutls_x509_crt_deinit((gnutls_x509_crt_t)g_ptr_array_index(array, i)); g_ptr_array_free(array, TRUE); } static void inf_gtk_certificate_manager_set_known_hosts(InfGtkCertificateManager* manager, const gchar* known_hosts_file) { InfGtkCertificateManagerPrivate* priv; gchar* path; int ret; GError* error; int save_errno; priv = INF_GTK_CERTIFICATE_MANAGER_PRIVATE(manager); if(priv->known_hosts_file != NULL) { if(priv->known_hosts != NULL) { path = g_path_get_dirname(priv->known_hosts_file); ret = g_mkdir_with_parents(path, 0700); save_errno = errno; g_free(path); if(ret != 0) { /* TODO_Win32: Is the error code also in errno on Windows? */ g_warning( _("Failed to save known hosts file: %s\n"), strerror(save_errno) ); } else { error = NULL; ret = inf_cert_util_save_file( (gnutls_x509_crt_t*)priv->known_hosts->pdata, priv->known_hosts->len, priv->known_hosts_file, &error ); if(ret == FALSE) { g_warning( _("Failed to save known hosts file: %s\n"), error->message ); g_error_free(error); } } inf_gtk_certificate_manager_free_certificate_array(priv->known_hosts); priv->known_hosts = NULL; } g_free(priv->known_hosts_file); } priv->known_hosts_file = g_strdup(known_hosts_file); } static void inf_gtk_certificate_manager_certificate_func(InfXmppConnection* connection, InfCertificateChain* chain, gpointer user_data) { InfGtkCertificateManager* manager; InfGtkCertificateManagerPrivate* priv; InfGtkCertificateDialogFlags flags; gnutls_x509_crt_t own; gchar* hostname; time_t t; int ret; unsigned int verify; gchar* own_hostname; gnutls_x509_crt_t known; guint i; gchar* own_fingerprint; gchar* known_fingerprint; InfGtkCertificateManagerQuery* query; gchar* text; GtkWidget* vbox; GtkWidget* button; GtkWidget* image; GtkWidget* label; GError* error; manager = INF_GTK_CERTIFICATE_MANAGER(user_data); priv = INF_GTK_CERTIFICATE_MANAGER_PRIVATE(manager); /* TODO: We don't want to load these at the beginning to improve startup * time... maybe we should do this in an idle handler, or even * asynchronously via Gio. */ if(priv->ca_certs == NULL && priv->trust_file != NULL) { error = NULL; priv->ca_certs = inf_cert_util_load_file(priv->trust_file, NULL, &error); if(priv->ca_certs == NULL) { g_warning(_("Could not load trust file: %s"), error->message); g_error_free(error); g_free(priv->trust_file); priv->trust_file = NULL; g_object_notify(G_OBJECT(manager), "trust-file"); } } if(priv->ca_certs == NULL) priv->ca_certs = g_ptr_array_new(); if(priv->known_hosts == NULL && priv->known_hosts_file != NULL) { error = NULL; priv->known_hosts = inf_cert_util_load_file( priv->known_hosts_file, NULL, &error ); if(priv->known_hosts == NULL) { /* If the known hosts file was nonexistant, then this is not an error * since we will write to end when being finalized, with hosts we * met (and trusted) during the session. */ if(error->domain != g_file_error_quark() || error->code != G_FILE_ERROR_NOENT) { g_warning(_("Could not load known hosts file: %s"), error->message); g_free(priv->known_hosts_file); priv->known_hosts_file = NULL; g_object_notify(G_OBJECT(manager), "known-hosts-file"); } else { priv->known_hosts = g_ptr_array_new(); } g_error_free(error); } } g_object_get(G_OBJECT(connection), "remote-hostname", &hostname, NULL); own = inf_certificate_chain_get_own_certificate(chain); flags = 0; if(!gnutls_x509_crt_check_hostname(own, hostname)) flags |= INF_GTK_CERTIFICATE_DIALOG_CERT_HOSTNAME_MISMATCH; t = gnutls_x509_crt_get_activation_time(own); if(t == (time_t)(-1) || t > time(NULL)) flags |= INF_GTK_CERTIFICATE_DIALOG_CERT_NOT_ACTIVATED; t = gnutls_x509_crt_get_expiration_time(own); if(t == (time_t)(-1) || t < time(NULL)) flags |= INF_GTK_CERTIFICATE_DIALOG_CERT_EXPIRED; ret = gnutls_x509_crt_list_verify( inf_certificate_chain_get_raw(chain), inf_certificate_chain_get_n_certificates(chain), (gnutls_x509_crt_t*)priv->ca_certs->pdata, priv->ca_certs->len, NULL, 0, GNUTLS_VERIFY_ALLOW_X509_V1_CA_CRT, &verify ); if(ret < 0) { g_warning(_("Could not verify certificate: %s"), gnutls_strerror(ret)); inf_xmpp_connection_certificate_verify_cancel(connection); } else { if((verify & GNUTLS_CERT_INVALID) != 0) flags |= INF_GTK_CERTIFICATE_DIALOG_CERT_INVALID; #define GNUTLS_CERT_ISSUER_NOT_TRUSTED \ (GNUTLS_CERT_SIGNER_NOT_FOUND | GNUTLS_CERT_SIGNER_NOT_CA) if((verify & GNUTLS_CERT_ISSUER_NOT_TRUSTED) != 0) { flags |= INF_GTK_CERTIFICATE_DIALOG_CERT_ISSUER_NOT_TRUSTED; /* If the certificate is invalid because of this, then unset the * invalid flag again. We handle the two cases separately. */ if((verify & ~GNUTLS_CERT_ISSUER_NOT_TRUSTED) == GNUTLS_CERT_INVALID) flags &= ~INF_GTK_CERTIFICATE_DIALOG_CERT_INVALID; } own_hostname = inf_cert_util_get_hostname(own); /* We don't ever trust hosts for which we have a certificate without * hostname, as we can't identify the certificate with the corresponding * host */ if(own_hostname != NULL) { for(i = 0; i < priv->known_hosts->len; ++ i) { known = (gnutls_x509_crt_t)g_ptr_array_index(priv->known_hosts, i); if(gnutls_x509_crt_check_hostname(known, own_hostname)) { /* TODO: Compare this as binary, not as string */ own_fingerprint = inf_cert_util_get_fingerprint(own, GNUTLS_DIG_SHA1); known_fingerprint = inf_cert_util_get_fingerprint(known, GNUTLS_DIG_SHA1); if(strcmp(own_fingerprint, known_fingerprint) == 0) { /* We know this host, so we trust it, even if the issuer is * not a CA. */ flags &= ~INF_GTK_CERTIFICATE_DIALOG_CERT_ISSUER_NOT_TRUSTED; } else { /* The fingerprint does not match, so the certificate for this * host has changed. If the new cert is CA signed we don't care. */ if(flags & INF_GTK_CERTIFICATE_DIALOG_CERT_ISSUER_NOT_TRUSTED) { flags |= INF_GTK_CERTIFICATE_DIALOG_CERT_CHANGED; /* Check whether it has changed because the old one expired * (then we have expected the certificate change, otherwise * something strange is going on). */ t = gnutls_x509_crt_get_expiration_time(known); if(t == (time_t)(-1) || t < time(NULL)) flags |= INF_GTK_CERTIFICATE_DIALOG_CERT_OLD_EXPIRED; } } g_free(own_fingerprint); g_free(known_fingerprint); break; } } /* Host not found in known hosts list */ if(i == priv->known_hosts->len) known = NULL; } g_free(own_hostname); if(flags == 0) { /* Nothing to complain about, continue connection immediately. */ inf_xmpp_connection_certificate_verify_continue(connection); /* TODO: Add host to known hosts list, so that we can warn when its * certificate changes? */ } else { query = g_slice_new(InfGtkCertificateManagerQuery); query->manager = manager; query->connection = connection; query->dialog = inf_gtk_certificate_dialog_new( priv->parent_window, #if GTK_CHECK_VERSION(2,90,7) 0, #else GTK_DIALOG_NO_SEPARATOR, #endif flags, hostname, chain ); query->certificate_chain = chain; query->old_certificate = known; g_object_ref(query->connection); inf_certificate_chain_ref(chain); g_signal_connect( G_OBJECT(connection), "notify::status", G_CALLBACK(inf_gtk_certificate_manager_notify_status_cb), query ); g_signal_connect( G_OBJECT(query->dialog), "response", G_CALLBACK(inf_gtk_certificate_manager_response_cb), query ); image = gtk_image_new_from_stock(GTK_STOCK_CANCEL, GTK_ICON_SIZE_BUTTON); gtk_widget_show(image); button = gtk_dialog_add_button( GTK_DIALOG(query->dialog), _("_Cancel connection"), GTK_RESPONSE_REJECT ); gtk_button_set_image(GTK_BUTTON(button), image); image = gtk_image_new_from_stock(GTK_STOCK_CONNECT, GTK_ICON_SIZE_BUTTON); gtk_widget_show(image); button = gtk_dialog_add_button( GTK_DIALOG(query->dialog), _("C_ontinue connection"), GTK_RESPONSE_ACCEPT ); gtk_button_set_image(GTK_BUTTON(button), image); /* TODO: Do we want a default response here? Which one? */ text = g_strdup_printf( _("Do you want to continue the connection to host %s?"), hostname ); label = gtk_label_new(text); gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0); gtk_widget_show(label); g_free(text); #if GTK_CHECK_VERSION(2,14,0) vbox = gtk_dialog_get_content_area(GTK_DIALOG(query->dialog)); #else vbox = GTK_DIALOG(query->dialog)->vbox; #endif gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0); text = g_strdup_printf( _("Trust the certificate of host %s in the future"), hostname ); query->checkbutton = gtk_check_button_new_with_label(text); /* TODO: Be able to remember any answer, not only the one to * "issuer not trusted" */ if((flags & INF_GTK_CERTIFICATE_DIALOG_CERT_ISSUER_NOT_TRUSTED) || (flags & INF_GTK_CERTIFICATE_DIALOG_CERT_CHANGED) ) { gtk_widget_show(query->checkbutton); } g_free(text); gtk_box_pack_start(GTK_BOX(vbox), query->checkbutton, FALSE, FALSE, 0); /* TODO: In which cases should the checkbutton be checked by default? */ priv->queries = g_slist_prepend(priv->queries, query); gtk_window_present(GTK_WINDOW(query->dialog)); } } g_free(hostname); } static void inf_gtk_certificate_manager_add_connection_cb(InfXmppManager* manager, InfXmppConnection* connection, gpointer user_data) { InfXmppConnectionSite site; g_object_get(G_OBJECT(connection), "site", &site, NULL); if(site == INF_XMPP_CONNECTION_CLIENT) { inf_xmpp_connection_set_certificate_callback( connection, inf_gtk_certificate_manager_certificate_func, user_data ); } } static void inf_gtk_certificate_manager_init(GTypeInstance* instance, gpointer g_class) { InfGtkCertificateManager* manager; InfGtkCertificateManagerPrivate* priv; manager = INF_GTK_CERTIFICATE_MANAGER(instance); priv = INF_GTK_CERTIFICATE_MANAGER_PRIVATE(manager); priv->parent_window = NULL; priv->xmpp_manager = NULL; priv->trust_file = NULL; priv->known_hosts_file = NULL; priv->ca_certs = NULL; priv->known_hosts = NULL; } static void inf_gtk_certificate_manager_dispose(GObject* object) { InfGtkCertificateManager* manager; InfGtkCertificateManagerPrivate* priv; GSList* item; manager = INF_GTK_CERTIFICATE_MANAGER(object); priv = INF_GTK_CERTIFICATE_MANAGER_PRIVATE(manager); if(priv->parent_window != NULL) { g_object_unref(priv->parent_window); priv->parent_window = NULL; } if(priv->xmpp_manager != NULL) { g_object_unref(priv->xmpp_manager); priv->xmpp_manager = NULL; } for(item = priv->queries; item != NULL; item = g_slist_next(item)) { inf_gtk_certificate_manager_query_free( (InfGtkCertificateManagerQuery*)item->data ); } g_slist_free(priv->queries); priv->queries = NULL; G_OBJECT_CLASS(parent_class)->dispose(object); } static void inf_gtk_certificate_manager_finalize(GObject* object) { InfGtkCertificateManager* manager; InfGtkCertificateManagerPrivate* priv; manager = INF_GTK_CERTIFICATE_MANAGER(object); priv = INF_GTK_CERTIFICATE_MANAGER_PRIVATE(manager); inf_gtk_certificate_manager_set_known_hosts(manager, NULL); if(priv->ca_certs != NULL) inf_gtk_certificate_manager_free_certificate_array(priv->ca_certs); g_free(priv->known_hosts_file); G_OBJECT_CLASS(parent_class)->finalize(object); } static void inf_gtk_certificate_manager_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec) { InfGtkCertificateManager* manager; InfGtkCertificateManagerPrivate* priv; manager = INF_GTK_CERTIFICATE_MANAGER(object); priv = INF_GTK_CERTIFICATE_MANAGER_PRIVATE(manager); switch(prop_id) { case PROP_PARENT_WINDOW: g_assert(priv->parent_window == NULL); /* construct/only */ priv->parent_window = GTK_WINDOW(g_value_dup_object(value)); break; case PROP_XMPP_MANAGER: g_assert(priv->xmpp_manager == NULL); /* construct/only */ priv->xmpp_manager = INF_XMPP_MANAGER(g_value_dup_object(value)); g_signal_connect( G_OBJECT(priv->xmpp_manager), "add-connection", G_CALLBACK(inf_gtk_certificate_manager_add_connection_cb), manager ); break; case PROP_TRUST_FILE: g_free(priv->trust_file); priv->trust_file = g_value_dup_string(value); if(priv->ca_certs != NULL) { inf_gtk_certificate_manager_free_certificate_array(priv->ca_certs); priv->ca_certs = NULL; } break; case PROP_KNOWN_HOSTS_FILE: inf_gtk_certificate_manager_set_known_hosts( manager, g_value_get_string(value) ); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void inf_gtk_certificate_manager_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec) { InfGtkCertificateManager* manager; InfGtkCertificateManagerPrivate* priv; manager = INF_GTK_CERTIFICATE_MANAGER(object); priv = INF_GTK_CERTIFICATE_MANAGER_PRIVATE(manager); switch(prop_id) { case PROP_PARENT_WINDOW: g_value_set_object(value, G_OBJECT(priv->parent_window)); break; case PROP_XMPP_MANAGER: g_value_set_object(value, G_OBJECT(priv->xmpp_manager)); break; case PROP_TRUST_FILE: g_value_set_string(value, priv->trust_file); break; case PROP_KNOWN_HOSTS_FILE: g_value_set_string(value, priv->known_hosts_file); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } /* * GType registration */ static void inf_gtk_certificate_manager_class_init(gpointer g_class, gpointer class_data) { GObjectClass* object_class; InfGtkCertificateManagerClass* certificate_manager_class; object_class = G_OBJECT_CLASS(g_class); certificate_manager_class = INF_GTK_CERTIFICATE_MANAGER_CLASS(g_class); parent_class = G_OBJECT_CLASS(g_type_class_peek_parent(g_class)); g_type_class_add_private(g_class, sizeof(InfGtkCertificateManagerPrivate)); object_class->dispose = inf_gtk_certificate_manager_dispose; object_class->finalize = inf_gtk_certificate_manager_finalize; object_class->set_property = inf_gtk_certificate_manager_set_property; object_class->get_property = inf_gtk_certificate_manager_get_property; g_object_class_install_property( object_class, PROP_PARENT_WINDOW, g_param_spec_object( "parent-window", "Parent window", "The parent window for certificate approval dialogs", GTK_TYPE_WINDOW, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); g_object_class_install_property( object_class, PROP_XMPP_MANAGER, g_param_spec_object( "xmpp-manager", "XMPP manager", "The XMPP manager of registered connections", INF_TYPE_XMPP_MANAGER, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); g_object_class_install_property( object_class, PROP_TRUST_FILE, g_param_spec_string( "trust-file", "Trust file", "File containing trusted root CAs", NULL, G_PARAM_READWRITE ) ); g_object_class_install_property( object_class, PROP_KNOWN_HOSTS_FILE, g_param_spec_string( "known-hosts-file", "Known hosts file", "File containing certificates of known hosts", NULL, G_PARAM_READWRITE ) ); } GType inf_gtk_certificate_manager_get_type(void) { static GType certificate_manager_type = 0; if(!certificate_manager_type) { static const GTypeInfo certificate_manager_type_info = { sizeof(InfGtkCertificateManagerClass), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ inf_gtk_certificate_manager_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InfGtkCertificateManager), /* instance_size */ 0, /* n_preallocs */ inf_gtk_certificate_manager_init, /* instance_init */ NULL /* value_table */ }; certificate_manager_type = g_type_register_static( G_TYPE_OBJECT, "InfGtkCertificateManager", &certificate_manager_type_info, 0 ); } return certificate_manager_type; } /* * Public API. */ /** * inf_gtk_certificate_manager_new: * @parent_window: The #GtkWindow to which to make certificate approval * dialogs transient to. * @xmpp_manager: The #InfXmppManager whose #InfXmppConnections to * manage the certificates for. * @trust_file: Path pointing to a file that contains trusted root CAs, or * %NULL. * @known_hosts_file: Path pointing to a file that contains certificates of * known hosts, or %NULL. * * Creates a new #InfGtkCertificateManager. For each new client-side * #InfXmppConnection in @xmpp_manager, the certificate manager will verify * the server's certificate. * * If the root CA of that certificate is contained in @trust_file, or the * server certificate itself is known already (meaning it is contained in * @known_hosts_file), then the certificate is accepted automatically. * Otherwise, the user is asked for approval. If the user approves the * certificate, then it is inserted into the @known_hosts_file. * * Returns: A new #InfGtkCertificateManager. **/ InfGtkCertificateManager* inf_gtk_certificate_manager_new(GtkWindow* parent_window, InfXmppManager* xmpp_manager, const gchar* trust_file, const gchar* known_hosts_file) { GObject* object; object = g_object_new( INF_GTK_TYPE_CERTIFICATE_MANAGER, "parent-window", parent_window, "xmpp-manager", xmpp_manager, "trust-file", trust_file, "known-hosts-file", known_hosts_file, NULL ); return INF_GTK_CERTIFICATE_MANAGER(object); } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfgtk/inf-gtk-certificate-manager.h0000644000175000017500000000502112264763732020345 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_GTK_CERTIFICATE_MANAGER_H__ #define __INF_GTK_CERTIFICATE_MANAGER_H__ #include #include #include G_BEGIN_DECLS #define INF_GTK_TYPE_CERTIFICATE_MANAGER (inf_gtk_certificate_manager_get_type()) #define INF_GTK_CERTIFICATE_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INF_GTK_TYPE_CERTIFICATE_MANAGER, InfGtkCertificateManager)) #define INF_GTK_CERTIFICATE_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INF_GTK_TYPE_CERTIFICATE_MANAGER, InfGtkCertificateManagerClass)) #define INF_GTK_IS_CERTIFICATE_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INF_GTK_TYPE_CERTIFICATE_MANAGER)) #define INF_GTK_IS_CERTIFICATE_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INF_GTK_TYPE_CERTIFICATE_MANAGER)) #define INF_GTK_CERTIFICATE_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), INF_GTK_TYPE_CERTIFICATE_MANAGER, InfGtkCertificateManagerClass)) typedef struct _InfGtkCertificateManager InfGtkCertificateManager; typedef struct _InfGtkCertificateManagerClass InfGtkCertificateManagerClass; struct _InfGtkCertificateManagerClass { GObjectClass parent_class; }; struct _InfGtkCertificateManager { GObject parent; }; GType inf_gtk_certificate_manager_get_type(void) G_GNUC_CONST; InfGtkCertificateManager* inf_gtk_certificate_manager_new(GtkWindow* parent_window, InfXmppManager* xmpp_manager, const gchar* trust_file, const gchar* known_hosts_file); G_END_DECLS #endif /* __INF_GTK_CERTIFICATE_MANAGER_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfgtk/inf-gtk-chat.c0000644000175000017500000007427412264763732015405 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include #include #include /* For strlen() */ /** * SECTION:inf-gtk-chat * @title: InfGtkChat * @short_description: Gtk interface to #InfChatSession * @include: libinfgtk/inf-gtk-chat.h * @stability: Unstable * * #InfGtkChat is a widget showing a #InfChatSession conversation. Use * inf_gtk_chat_set_session() to set the session whose conversation to show * in the widget. If you have a local user in the session you can also call * inf_gtk_chat_set_active_user(). In this case the input text entry is made * available and messages are sent via that user. **/ /* This is a small hack to get the scrolling in the textview right */ typedef enum _InfGtkChatVMode { /* VMode is disabled, always keep bottom row constant */ INF_GTK_CHAT_VMODE_DISABLED, /* VMode is enabled, keep top row constant for next line addition */ INF_GTK_CHAT_VMODE_ENABLED, /* VMode is set, keep top row constant */ INF_GTK_CHAT_VMODE_SET } InfGtkChatVMode; typedef struct _InfGtkChatEntryKeyPressEventCbForeachData InfGtkChatEntryKeyPressEventCbForeachData; struct _InfGtkChatEntryKeyPressEventCbForeachData { gchar* match; guint count; guint index; InfUser* result; InfUser* first; }; typedef struct _InfGtkChatPrivate InfGtkChatPrivate; struct _InfGtkChatPrivate { GtkWidget* chat_view; GtkWidget* entry; GtkWidget* button; GtkAdjustment* vadj; gdouble voffset; InfGtkChatVMode vmode; InfChatSession* session; InfChatBuffer* buffer; InfUser* active_user; GtkTextTag* tag_normal; GtkTextTag* tag_system; GtkTextTag* tag_emote; GtkTextTag* tag_backlog; /* Tab completion */ gchar* completion_text; guint completion_start; guint completion_end; guint completion_index; }; enum { PROP_0, PROP_SESSION, PROP_ACTIVE_USER }; #define INF_GTK_CHAT_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), INF_GTK_TYPE_CHAT, InfGtkChatPrivate)) static GtkVBoxClass* parent_class; /* * Message representation */ /* Copied from InfChatSession. TODO: Should go as a public helper function * in libinfinity. */ static gchar* inf_gtk_chat_strdup_strftime(const char* format, const struct tm* tm, gsize* len) { gsize alloc; gchar* str; size_t result; alloc = 64; str = g_malloc(alloc * sizeof(gchar)); result = strftime(str, alloc, format, tm); while(result == 0 && alloc < 1024) { alloc *= 2; str = g_realloc(str, alloc * sizeof(gchar)); result = strftime(str, alloc, format, tm); } if(result == 0) { g_free(str); return NULL; } if(len) *len = result; return str; } static void inf_gtk_chat_add_message(InfGtkChat* chat, const InfChatBufferMessage* message) { InfGtkChatPrivate* priv; GtkTextBuffer* buffer; GtkTextIter insert_pos; const gchar* formatter; time_t cur_time; struct tm cur_time_tm; struct tm given_time_tm; gchar* time_str; gchar* loc_text; gchar* text; GtkTextTag* tag; gdouble scroll_val; gdouble scroll_upper; gdouble scroll_page_size; priv = INF_GTK_CHAT_PRIVATE(chat); buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(priv->chat_view)); cur_time = time(NULL); cur_time_tm = *localtime(&cur_time); given_time_tm = *localtime(&message->time); /* Show date if text was not logged today */ if(cur_time_tm.tm_yday != given_time_tm.tm_yday || cur_time_tm.tm_year != given_time_tm.tm_year) { formatter = "%x %X"; } else { formatter = "%X"; } time_str = inf_gtk_chat_strdup_strftime(formatter, &given_time_tm, NULL); switch(message->type) { case INF_CHAT_BUFFER_MESSAGE_NORMAL: tag = priv->tag_normal; text = g_strdup_printf( "[%s] <%s> %s", time_str, inf_user_get_name(message->user), message->text ); break; case INF_CHAT_BUFFER_MESSAGE_EMOTE: tag = priv->tag_emote; text = g_strdup_printf( "[%s] * %s %s", time_str, inf_user_get_name(message->user), message->text ); break; case INF_CHAT_BUFFER_MESSAGE_USERJOIN: tag = priv->tag_system; loc_text = g_strdup_printf(_("%s has joined"), inf_user_get_name(message->user)); text = g_strdup_printf("[%s] %s", time_str, loc_text); g_free(loc_text); break; case INF_CHAT_BUFFER_MESSAGE_USERPART: tag = priv->tag_system; loc_text = g_strdup_printf(_("%s has left"), inf_user_get_name(message->user)); text = g_strdup_printf("[%s] %s", time_str, loc_text); g_free(loc_text); break; default: g_assert_not_reached(); break; } g_free(time_str); /* Always apply backlog tag if it's a backlog message */ if(message->flags & INF_CHAT_BUFFER_MESSAGE_BACKLOG) tag = priv->tag_backlog; g_object_get( G_OBJECT(priv->vadj), "value", &scroll_val, "upper", &scroll_upper, "page-size", &scroll_page_size, NULL ); gtk_text_buffer_get_end_iter(buffer, &insert_pos); gtk_text_buffer_insert_with_tags(buffer, &insert_pos, text, -1, tag, NULL); gtk_text_buffer_insert(buffer, &insert_pos, "\n", 1); if(scroll_val != scroll_upper - scroll_page_size && scroll_upper - scroll_page_size > 0 && priv->vmode == INF_GTK_CHAT_VMODE_ENABLED) { /* This is a kind of hack to keep the view where it is, otherwise * inf_gtk_chat_adjustment_changed_cb() would try to keep the distance * to the bottom row constant, moving the viewport by the newly * added row. */ priv->vmode = INF_GTK_CHAT_VMODE_SET; } } /* like the g_utf8_next_char macro, but without the cast to char* at the end */ #define inf_utf8_next_char(p) ((p) + g_utf8_skip[*(const guchar *)(p)]) static void inf_gtk_chat_commit_message(InfGtkChat* chat) { InfGtkChatPrivate* priv; const gchar* text; priv = INF_GTK_CHAT_PRIVATE(chat); g_assert(priv->session != NULL); g_assert(priv->buffer != NULL); g_assert(priv->active_user != NULL); text = gtk_entry_get_text(GTK_ENTRY(priv->entry)); if(g_str_has_prefix(text, "/me") && (text[3] == '\0' || g_unichar_isspace(g_utf8_get_char(text+3)))) { text += 3; while(g_unichar_isspace(g_utf8_get_char(text))) text = inf_utf8_next_char(text); inf_chat_buffer_add_emote_message( priv->buffer, priv->active_user, text, /* TODO: Use gtk_entry_get_text_length() - (text - * gtk_entry_get_text())) once we can use GTK+ 2.14. */ strlen(text), time(NULL), 0 ); } else { inf_chat_buffer_add_message( priv->buffer, priv->active_user, text, /* TODO: Use gtk_entry_get_text_length() once we can use GTK+ 2.14. */ strlen(text), time(NULL), 0 ); } gtk_entry_set_text(GTK_ENTRY(priv->entry), ""); } /* * Signal handlers */ static void inf_gtk_chat_entry_activate_cb(GtkEntry* entry, gpointer user_data) { const gchar* text; text = gtk_entry_get_text(entry); if(text != NULL && *text != '\0') inf_gtk_chat_commit_message(INF_GTK_CHAT(user_data)); } static void inf_gtk_chat_entry_changed_cb(GtkEntry* entry, gpointer user_data) { InfGtkChat* chat; InfGtkChatPrivate* priv; chat = INF_GTK_CHAT(user_data); priv = INF_GTK_CHAT_PRIVATE(chat); /* Reset tab completion */ g_free(priv->completion_text); priv->completion_text = NULL; } static void inf_gtk_chat_entry_key_press_event_cb_foreach_func(InfUser* user, gpointer user_data) { InfGtkChatEntryKeyPressEventCbForeachData* data; gchar* normalized; gchar* casefold; data = (InfGtkChatEntryKeyPressEventCbForeachData*)user_data; if(inf_user_get_status(user) != INF_USER_UNAVAILABLE) { normalized = g_utf8_normalize(inf_user_get_name(user), -1, G_NORMALIZE_ALL); casefold = g_utf8_casefold(normalized, -1); g_free(normalized); if(g_str_has_prefix(casefold, data->match)) { if(data->count == data->index) data->result = user; ++data->count; if(data->first == NULL) data->first = user; } g_free(casefold); } } static gboolean inf_gtk_chat_entry_key_press_event_cb(GtkWidget* widget, GdkEventKey* event, gpointer user_data) { InfGtkChat* chat; InfGtkChatPrivate* priv; guint index; guint begin; const gchar* text; gchar* normalized; InfGtkChatEntryKeyPressEventCbForeachData foreach_data; InfUser* complete; int position; chat = INF_GTK_CHAT(user_data); priv = INF_GTK_CHAT_PRIVATE(chat); /* This must not be pressed for tab completion to be triggered: */ #define MASK (GDK_SHIFT_MASK | GDK_CONTROL_MASK | GDK_MOD1_MASK) #if GTK_CHECK_VERSION(2,90,7) if(event->keyval == GDK_KEY_Tab && (event->state & MASK) == 0) #else if(event->keyval == GDK_Tab && (event->state & MASK) == 0) #endif { index = gtk_editable_get_position(GTK_EDITABLE(widget)); if(priv->completion_text != NULL && index != priv->completion_end) { /* Cursor was moved since last completion attempt: Reset completion */ g_free(priv->completion_text); priv->completion_text = NULL; } else if(priv->completion_text != NULL) { /* Otherwise complete next in row */ if(priv->completion_end > 0) ++priv->completion_index; } if(priv->completion_text == NULL) { /* No previous completion, so find completion text and completion * starting point. */ begin = index; text = gtk_entry_get_text(GTK_ENTRY(priv->entry)); while(begin > 0) { begin = g_utf8_prev_char(&text[begin]) - text; if(g_unichar_isspace(g_utf8_get_char(&text[begin]))) { begin = inf_utf8_next_char(&text[begin]) - text; break; } } if(begin < index) { normalized = g_utf8_normalize( &text[begin], index - begin, G_NORMALIZE_ALL ); priv->completion_text = g_utf8_casefold(normalized, -1); g_free(normalized); priv->completion_end = index; priv->completion_start = begin; } } if(priv->completion_text != NULL) { foreach_data.match = priv->completion_text; foreach_data.count = 0; foreach_data.index = priv->completion_index; foreach_data.result = NULL; foreach_data.first = NULL; inf_user_table_foreach_user( inf_session_get_user_table(INF_SESSION(priv->session)), inf_gtk_chat_entry_key_press_event_cb_foreach_func, &foreach_data ); complete = foreach_data.result; if(complete == NULL) { if(foreach_data.first != NULL) { /* wrap around */ complete = foreach_data.first; priv->completion_index = 0; } } if(complete == NULL) { /* No match: Reset completion, don't do anything */ g_free(priv->completion_text); priv->completion_text = NULL; } else { inf_signal_handlers_block_by_func( G_OBJECT(priv->entry), G_CALLBACK(inf_gtk_chat_entry_changed_cb), chat ); if(priv->completion_start != priv->completion_end) { gtk_editable_delete_text( GTK_EDITABLE(widget), priv->completion_start, priv->completion_end ); } position = priv->completion_start; gtk_editable_insert_text( GTK_EDITABLE(priv->entry), inf_user_get_name(complete), -1, &position ); if(priv->completion_start == 0) { gtk_editable_insert_text( GTK_EDITABLE(priv->entry), ": ", 2, &position ); } else { gtk_editable_insert_text( GTK_EDITABLE(priv->entry), " ", 1, &position ); } priv->completion_end = position; gtk_editable_set_position(GTK_EDITABLE(priv->entry), position); inf_signal_handlers_unblock_by_func( G_OBJECT(priv->entry), G_CALLBACK(inf_gtk_chat_entry_changed_cb), chat ); } } return TRUE; } return FALSE; } static void inf_gtk_chat_entry_button_clicked_cb(GtkButton* button, gpointer user_data) { inf_gtk_chat_commit_message(INF_GTK_CHAT(user_data)); } static void inf_gtk_chat_buffer_add_message_cb(InfChatBuffer* buffer, const InfChatBufferMessage* message, gpointer user_data) { inf_gtk_chat_add_message(INF_GTK_CHAT(user_data), message); } static void inf_gtk_chat_user_notify_status_cb(GObject* object, GParamSpec* pspec, gpointer user_data) { if(inf_user_get_status(INF_USER(object)) == INF_USER_UNAVAILABLE) inf_gtk_chat_set_active_user(INF_GTK_CHAT(user_data), NULL); } static void inf_gtk_chat_user_notify_flags_cb(GObject* object, GParamSpec* pspec, gpointer user_data) { if( (inf_user_get_flags(INF_USER(object)) & INF_USER_LOCAL) == 0) inf_gtk_chat_set_active_user(INF_GTK_CHAT(user_data), NULL); } static void inf_gtk_chat_adjustment_changed_cb(GObject* object, gpointer user_data) { InfGtkChatPrivate* priv; InfGtkChatVMode prev_mode; gdouble value; gdouble new_value; gdouble upper; gdouble page_size; gdouble max; priv = INF_GTK_CHAT_PRIVATE(user_data); g_object_get( object, "value", &value, "upper", &upper, "page-size", &page_size, NULL ); max = (upper > page_size) ? (upper - page_size) : 0.0; if(priv->vmode != INF_GTK_CHAT_VMODE_SET) { prev_mode = priv->vmode; new_value = (max > priv->voffset) ? (max - priv->voffset) : 0.0; if(value != new_value) { gtk_adjustment_set_value(GTK_ADJUSTMENT(object), new_value); /* Undo effect of signal handler: We only enable vmode operation if * the adjustment value was changed independently, for example by the * user moving the scrollbar. */ priv->vmode = prev_mode; } } else { priv->voffset = (max > value) ? (max - value) : 0.0; priv->vmode = INF_GTK_CHAT_VMODE_ENABLED; } } static void inf_gtk_chat_adjustment_value_changed_cb(GObject* object, gpointer user_data) { InfGtkChatPrivate* priv; gdouble value; gdouble upper; gdouble page_size; gdouble max; priv = INF_GTK_CHAT_PRIVATE(user_data); g_object_get( object, "value", &value, "upper", &upper, "page-size", &page_size, NULL ); max = (upper > page_size) ? (upper - page_size) : 0.0; priv->voffset = (max > value) ? (max - value) : 0.0; /* Enable vmode as soon as we scroll away from the bottom of the textview. * This keeps the viewport constant when adding new rows but the scroll * position not being at the bottom of the view. Due to some strange GTK+ * weirdness this does not work when initially populating the buffer with * backlog messages, so we enable this explicitely after the scrollbar is * moved away from the very bottom of the view. */ if(priv->vmode == INF_GTK_CHAT_VMODE_DISABLED) priv->vmode = INF_GTK_CHAT_VMODE_ENABLED; } /* * GObject overrides */ static void inf_gtk_chat_init(GTypeInstance* instance, gpointer g_class) { InfGtkChat* chat; InfGtkChatPrivate* priv; GtkWidget* scroll; GtkWidget* image; GtkWidget* hbox; chat = INF_GTK_CHAT(instance); priv = INF_GTK_CHAT_PRIVATE(chat); priv->session = NULL; priv->buffer = NULL; priv->active_user = NULL; priv->voffset = 0.0; priv->vmode = INF_GTK_CHAT_VMODE_DISABLED; /* Actually they are invalid as long as completion_text is NULL, but * let's be sure */ priv->completion_text = NULL; priv->completion_start = 0; priv->completion_end = 0; priv->completion_index = 0; priv->chat_view = gtk_text_view_new(); gtk_text_view_set_editable(GTK_TEXT_VIEW(priv->chat_view), FALSE); gtk_text_view_set_wrap_mode( GTK_TEXT_VIEW(priv->chat_view), GTK_WRAP_WORD_CHAR ); gtk_text_view_set_indent(GTK_TEXT_VIEW(priv->chat_view), -12); /* TODO: this prevents copying via ctrl+c - maybe the entry ctrl+c * should catch this and copy from the textview instead: */ #if GTK_CHECK_VERSION(2,18,0) gtk_widget_set_can_focus(priv->chat_view, FALSE); #else GTK_WIDGET_UNSET_FLAGS(priv->chat_view, GTK_CAN_FOCUS); #endif gtk_widget_show(priv->chat_view); /* TODO: These should probably be style properties: */ priv->tag_normal = gtk_text_buffer_create_tag( GTK_TEXT_BUFFER(gtk_text_view_get_buffer(GTK_TEXT_VIEW(priv->chat_view))), "normal", NULL ); priv->tag_system = gtk_text_buffer_create_tag( GTK_TEXT_BUFFER(gtk_text_view_get_buffer(GTK_TEXT_VIEW(priv->chat_view))), "system", "foreground", "#0000ff", NULL ); priv->tag_emote = gtk_text_buffer_create_tag( GTK_TEXT_BUFFER(gtk_text_view_get_buffer(GTK_TEXT_VIEW(priv->chat_view))), "emote", "foreground", "#113322", NULL ); priv->tag_backlog = gtk_text_buffer_create_tag( GTK_TEXT_BUFFER(gtk_text_view_get_buffer(GTK_TEXT_VIEW(priv->chat_view))), "backlog", "foreground", "#606060", NULL ); scroll = gtk_scrolled_window_new(NULL, NULL); gtk_scrolled_window_set_shadow_type( GTK_SCROLLED_WINDOW(scroll), GTK_SHADOW_IN ); gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW(scroll), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC ); gtk_container_add(GTK_CONTAINER(scroll), priv->chat_view); priv->vadj = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(scroll)); gtk_widget_show(scroll); g_signal_connect( G_OBJECT(priv->vadj), "changed", G_CALLBACK(inf_gtk_chat_adjustment_changed_cb), chat ); g_signal_connect( G_OBJECT(priv->vadj), "value-changed", G_CALLBACK(inf_gtk_chat_adjustment_value_changed_cb), chat ); priv->entry = gtk_entry_new(); g_object_set(G_OBJECT(priv->entry), "truncate-multiline", TRUE, NULL); g_signal_connect( G_OBJECT(priv->entry), "activate", G_CALLBACK(inf_gtk_chat_entry_activate_cb), chat ); g_signal_connect_after( G_OBJECT(priv->entry), "changed", G_CALLBACK(inf_gtk_chat_entry_changed_cb), chat ); g_signal_connect( G_OBJECT(priv->entry), "key-press-event", G_CALLBACK(inf_gtk_chat_entry_key_press_event_cb), chat ); gtk_widget_set_sensitive(priv->entry, FALSE); gtk_widget_show(priv->entry); image = gtk_image_new_from_stock(GTK_STOCK_JUMP_TO, GTK_ICON_SIZE_BUTTON); priv->button = gtk_button_new_with_label(_("Send")); gtk_button_set_image(GTK_BUTTON(priv->button), image); g_signal_connect( G_OBJECT(priv->button), "clicked", G_CALLBACK(inf_gtk_chat_entry_button_clicked_cb), chat ); /*gtk_widget_show(priv->button);*/ hbox = gtk_hbox_new(FALSE, 12); gtk_box_pack_start(GTK_BOX(hbox), priv->entry, TRUE, TRUE, 0); gtk_box_pack_start(GTK_BOX(hbox), priv->button, FALSE, TRUE, 0); gtk_widget_show(hbox); gtk_box_pack_start(GTK_BOX(chat), scroll, TRUE, TRUE, 0); gtk_box_pack_start(GTK_BOX(chat), hbox, FALSE, TRUE, 0); gtk_box_set_spacing(GTK_BOX(chat), 6); } static void inf_gtk_chat_dispose(GObject* object) { InfGtkChat* chat; InfGtkChatPrivate* priv; chat = INF_GTK_CHAT(object); priv = INF_GTK_CHAT_PRIVATE(chat); if(priv->session != NULL) inf_gtk_chat_set_session(chat, NULL); G_OBJECT_CLASS(parent_class)->dispose(object); } static void inf_gtk_chat_finalize(GObject* object) { InfGtkChat* chat; InfGtkChatPrivate* priv; chat = INF_GTK_CHAT(object); priv = INF_GTK_CHAT_PRIVATE(chat); g_free(priv->completion_text); G_OBJECT_CLASS(parent_class)->finalize(object); } static void inf_gtk_chat_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec) { InfGtkChat* chat; InfGtkChatPrivate* priv; chat = INF_GTK_CHAT(object); priv = INF_GTK_CHAT_PRIVATE(chat); switch(prop_id) { case PROP_SESSION: inf_gtk_chat_set_session( chat, INF_CHAT_SESSION(g_value_get_object(value)) ); break; case PROP_ACTIVE_USER: inf_gtk_chat_set_active_user(chat, INF_USER(g_value_get_object(value))); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void inf_gtk_chat_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec) { InfGtkChat* chat; InfGtkChatPrivate* priv; chat = INF_GTK_CHAT(object); priv = INF_GTK_CHAT_PRIVATE(chat); switch(prop_id) { case PROP_SESSION: g_value_set_object(value, priv->session); break; case PROP_ACTIVE_USER: g_value_set_object(value, priv->active_user); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } /* * GType registration */ static void inf_gtk_chat_class_init(gpointer g_class, gpointer class_data) { GObjectClass* object_class; object_class = G_OBJECT_CLASS(g_class); parent_class = GTK_VBOX_CLASS(g_type_class_peek_parent(g_class)); g_type_class_add_private(g_class, sizeof(InfGtkChatPrivate)); object_class->dispose = inf_gtk_chat_dispose; object_class->finalize = inf_gtk_chat_finalize; object_class->set_property = inf_gtk_chat_set_property; object_class->get_property = inf_gtk_chat_get_property; g_object_class_install_property( object_class, PROP_SESSION, g_param_spec_object( "session", "Session", "The chat session this widget is displaying", INF_TYPE_CHAT_SESSION, G_PARAM_READWRITE ) ); g_object_class_install_property( object_class, PROP_ACTIVE_USER, g_param_spec_object( "active-user", "Active user", "The user outgoing messages come from", INF_TYPE_USER, G_PARAM_READWRITE ) ); } GType inf_gtk_chat_get_type(void) { static GType chat_type = 0; if(!chat_type) { static const GTypeInfo chat_type_info = { sizeof(InfGtkChatClass), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ inf_gtk_chat_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InfGtkChat), /* instance_size */ 0, /* n_preallocs */ inf_gtk_chat_init, /* instance_init */ NULL /* value_table */ }; chat_type = g_type_register_static( GTK_TYPE_VBOX, "InfGtkChat", &chat_type_info, 0 ); } return chat_type; } /* * Public API. */ /** * inf_gtk_chat_new: * * Creates a new #InfGtkChat. To show a chat conversation set a session to * show via inf_gtk_chat_set_session(). * * Returns: A new #InfGtkChat. */ GtkWidget* inf_gtk_chat_new(void) { GObject* object; object = g_object_new(INF_GTK_TYPE_CHAT, NULL); return GTK_WIDGET(object); } /** * inf_gtk_chat_set_session: * @chat: A #InfGtkChat. * @session: The #InfChatSession to set. * * Sets the chat session to show in the chat widget. If there is a previous * session set the chat view will be cleared before showing the new session. * If the previous session had an active user set it will be unset. If * @session is %NULL this function just clears the chat view and unsets the * active user, if any. */ void inf_gtk_chat_set_session(InfGtkChat* chat, InfChatSession* session) { InfGtkChatPrivate* priv; guint i; g_return_if_fail(INF_GTK_IS_CHAT(chat)); g_return_if_fail(session == NULL || INF_IS_CHAT_SESSION(session)); priv = INF_GTK_CHAT_PRIVATE(chat); /* Notify "active-user" and "session" simultanously */ g_object_freeze_notify(G_OBJECT(chat)); if(priv->session != NULL) { g_assert(priv->buffer != NULL); /* Remove active user, if any */ if(priv->active_user != NULL) inf_gtk_chat_set_active_user(chat, NULL); inf_signal_handlers_disconnect_by_func( G_OBJECT(priv->buffer), G_CALLBACK(inf_gtk_chat_buffer_add_message_cb), chat ); g_object_unref(priv->session); g_object_unref(priv->buffer); gtk_text_buffer_set_text( gtk_text_view_get_buffer(GTK_TEXT_VIEW(priv->chat_view)), "", 0 ); } priv->session = session; if(session != NULL) { g_object_ref(session); priv->buffer = INF_CHAT_BUFFER(inf_session_get_buffer(INF_SESSION(session))); g_object_ref(priv->buffer); g_signal_connect_after( G_OBJECT(priv->buffer), "add-message", G_CALLBACK(inf_gtk_chat_buffer_add_message_cb), chat ); /* Show messages from oldest to newest */ for(i = 0; i < inf_chat_buffer_get_n_messages(priv->buffer); ++i) { inf_gtk_chat_add_message( chat, inf_chat_buffer_get_message(priv->buffer, i) ); } } else { priv->buffer = NULL; } g_object_notify(G_OBJECT(chat), "session"); g_object_thaw_notify(G_OBJECT(chat)); } /** * inf_gtk_chat_set_active_user: * @chat: A #InfGtkChat. * @user: A local #InfUser which joined chat's session. * * Sets the active user for the chat. This must be a user in the chat's * session's user table and it must have the %INF_USER_LOCAL flag set, i.e. * you need to have it joined before using infc_session_proxy_join_user() * or infd_session_proxy_add_user(). * * If an active user is set the chat's text entry is made sensitive and the * user can type chat messages. They are sent to the session as originated by * @user. If @user's status changes to %INF_USER_UNAVAILABLE or the * %INF_USER_LOCAL flag is removed the active user will be unset * automatically. * * This cannot be called when the chat has no session set yet. * Use inf_gtk_chat_set_session() first. */ void inf_gtk_chat_set_active_user(InfGtkChat* chat, InfUser* user) { InfGtkChatPrivate* priv; const gchar* text; g_return_if_fail(INF_GTK_IS_CHAT(chat)); g_return_if_fail(user == NULL || INF_IS_USER(user)); priv = INF_GTK_CHAT_PRIVATE(chat); g_return_if_fail(priv->session != NULL); g_return_if_fail( user == NULL || inf_user_get_status(user) != INF_USER_UNAVAILABLE ); g_return_if_fail( user == NULL || (inf_user_get_flags(user) & INF_USER_LOCAL) != 0 ); g_return_if_fail( user == NULL || inf_user_table_lookup_user_by_id( inf_session_get_user_table(INF_SESSION(priv->session)), inf_user_get_id(user) ) == user ); if(priv->active_user != NULL) { inf_signal_handlers_disconnect_by_func( G_OBJECT(priv->active_user), G_CALLBACK(inf_gtk_chat_user_notify_status_cb), chat ); inf_signal_handlers_disconnect_by_func( G_OBJECT(priv->active_user), G_CALLBACK(inf_gtk_chat_user_notify_flags_cb), chat ); g_object_unref(priv->active_user); } priv->active_user = user; if(user != NULL) { g_object_ref(user); g_signal_connect( G_OBJECT(user), "notify::status", G_CALLBACK(inf_gtk_chat_user_notify_status_cb), chat ); g_signal_connect( G_OBJECT(user), "notify::flags", G_CALLBACK(inf_gtk_chat_user_notify_flags_cb), chat ); gtk_widget_set_sensitive(priv->entry, TRUE); text = gtk_entry_get_text(GTK_ENTRY(priv->entry)); gtk_widget_set_sensitive(priv->button, text != NULL && *text != '\0'); /* TODO: Only do this when there currently is no focus child: */ /* TODO: Doesn't work anyway: */ #if 0 gtk_container_set_focus_child( GTK_CONTAINER( gtk_widget_get_parent(gtk_widget_get_parent(priv->entry)) ), gtk_widget_get_parent(priv->entry) ); gtk_container_set_focus_child( GTK_CONTAINER(gtk_widget_get_parent(priv->entry)), priv->entry ); #endif } else { gtk_widget_set_sensitive(priv->entry, FALSE); gtk_widget_set_sensitive(priv->button, FALSE); } g_object_notify(G_OBJECT(chat), "active-user"); } /** * inf_gtk_chat_get_active_user: * @chat: A #InfGtkChat. * * Returns the active user for @chat as set with * inf_gtk_chat_set_active_user(). * * Returns: The chat's active user, or %NULL if there is none. */ InfUser* inf_gtk_chat_get_active_user(InfGtkChat* chat) { g_return_val_if_fail(INF_GTK_IS_CHAT(chat), NULL); return INF_GTK_CHAT_PRIVATE(chat)->active_user; } /* TODO: I don't like this API because it allows users to do crap with the * entry such as setting it to be sensitive when it shouldn't be. It's * currently used to set the focus on the entry widget after setting the * active user for which I did not find another way... IMHO doing * gtk_container_set_focus_child() should be enough, but it isn't. I'm not * sure what the problem is... maybe we should replace it by * inf_gtk_chat_entry_grab_focus() or something. */ /** * inf_gtk_chat_get_entry: * @chat: A #InfGtkChat. * * Returns the chat's text input entry. * * Returns: The chat's #GtkEntry. This is owned by the chat, so you don't * need to free it. */ GtkWidget* inf_gtk_chat_get_entry(InfGtkChat* chat) { g_return_val_if_fail(INF_GTK_IS_CHAT(chat), NULL); return INF_GTK_CHAT_PRIVATE(chat)->entry; } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfgtk/inf-gtk-browser-view.h0000644000175000017500000000604412264763732017114 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_GTK_BROWSER_VIEW_H__ #define __INF_GTK_BROWSER_VIEW_H__ #include #include #include G_BEGIN_DECLS #define INF_GTK_TYPE_BROWSER_VIEW (inf_gtk_browser_view_get_type()) #define INF_GTK_BROWSER_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INF_GTK_TYPE_BROWSER_VIEW, InfGtkBrowserView)) #define INF_GTK_BROWSER_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INF_GTK_TYPE_BROWSER_VIEW, InfGtkBrowserViewClass)) #define INF_GTK_IS_BROWSER_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INF_GTK_TYPE_BROWSER_VIEW)) #define INF_GTK_IS_BROWSER_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INF_GTK_TYPE_BROWSER_VIEW)) #define INF_GTK_BROWSER_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), INF_GTK_TYPE_BROWSER_VIEW, InfGtkBrowserViewClass)) #define INF_GTK_TYPE_BROWSER_VIEW_STATUS (inf_gtk_browser_view_status_get_type()) typedef struct _InfGtkBrowserView InfGtkBrowserView; typedef struct _InfGtkBrowserViewClass InfGtkBrowserViewClass; struct _InfGtkBrowserViewClass { GtkTreeViewClass parent_class; /* signals */ void (*activate)(InfGtkBrowserView* view, GtkTreeIter* iter); void (*selection_changed)(InfGtkBrowserView* view, GtkTreeIter* iter); void (*populate_popup)(InfGtkBrowserView* view, GtkMenu* menu); #if ! GTK_CHECK_VERSION(2, 91, 0) void (*set_scroll_adjustments)(InfGtkBrowserView* view, GtkAdjustment* hadjustment, GtkAdjustment* vadjustment); #endif }; struct _InfGtkBrowserView { GtkTreeView parent; }; GType inf_gtk_browser_view_get_type(void) G_GNUC_CONST; GtkWidget* inf_gtk_browser_view_new(void); GtkWidget* inf_gtk_browser_view_new_with_model(InfGtkBrowserModel* model); gboolean inf_gtk_browser_view_get_selected(InfGtkBrowserView* view, GtkTreeIter* iter); void inf_gtk_browser_view_set_selected(InfGtkBrowserView* view, GtkTreeIter* iter); G_END_DECLS #endif /* __INF_GTK_BROWSER_VIEW_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfgtk/inf-gtk-certificate-view.c0000644000175000017500000003672312264763732017715 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include #include #include typedef struct _InfGtkCertificateViewPrivate InfGtkCertificateViewPrivate; struct _InfGtkCertificateViewPrivate { gnutls_x509_crt_t certificate; GtkWidget* general_vbox; GtkSizeGroup* general_size_group; GtkWidget* common_name; GtkWidget* organization; GtkWidget* organizational_unit; GtkWidget* serial_number; GtkWidget* issuer_common_name; GtkWidget* issuer_organization; GtkWidget* issuer_organizational_unit; GtkWidget* activation_time; GtkWidget* expiration_time; GtkWidget* sha1_fingerprint; GtkWidget* md5_fingerprint; }; enum { PROP_0, PROP_CERTIFICATE }; #define INF_GTK_CERTIFICATE_VIEW_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), INF_GTK_TYPE_CERTIFICATE_VIEW, InfGtkCertificateViewPrivate)) static GtkNotebookClass* parent_class; static void inf_gtk_certificate_view_set_label(GtkLabel* label, const gchar* value) { const gchar* text; gchar* markup; if(value != NULL) { gtk_label_set_text(label, value); } else { text = _(""); markup = g_markup_printf_escaped("%s", text); gtk_label_set_markup(label, markup); g_free(markup); } } static void inf_gtk_certificate_view_set_label_dn_by_oid(gnutls_x509_crt_t cert, GtkLabel* label, const char* oid) { gchar* value; value = inf_cert_util_get_dn_by_oid(cert, oid, 0); inf_gtk_certificate_view_set_label(label, value); g_free(value); } static void inf_gtk_certificate_view_set_label_issuer_dn_by_oid(gnutls_x509_crt_t cert, GtkLabel* label, const gchar* oid) { gchar* value; value = inf_cert_util_get_issuer_dn_by_oid(cert, oid, 0); inf_gtk_certificate_view_set_label(label, value); g_free(value); } static void inf_gtk_certificate_view_add_section(GtkSizeGroup* size_group, GtkVBox* parent, const gchar* title, const gchar* first_caption, ...) { GtkWidget* table; va_list valist; const gchar* caption; GtkWidget** location; GtkWidget* caption_label; unsigned int i; GtkWidget* alignment; GtkWidget* frame; GtkWidget* title_label; gchar* title_markup; table = gtk_table_new(1, 2, FALSE); gtk_table_set_col_spacings(GTK_TABLE(table), 12); gtk_table_set_row_spacings(GTK_TABLE(table), 6); va_start(valist, first_caption); caption = first_caption; for(i = 1; caption != NULL; ++ i) { location = va_arg(valist, GtkWidget**); gtk_table_resize(GTK_TABLE(table), i, 2); caption_label = gtk_label_new(caption); gtk_misc_set_alignment(GTK_MISC(caption_label), 0.0, 0.0); gtk_widget_show(caption_label); *location = gtk_label_new(NULL); gtk_misc_set_alignment(GTK_MISC(*location), 0.0, 0.0); gtk_label_set_selectable(GTK_LABEL(*location), TRUE); gtk_widget_show(*location); gtk_size_group_add_widget(size_group, caption_label); gtk_table_attach( GTK_TABLE(table), caption_label, 0, 1, i-1, i, GTK_FILL, GTK_FILL, 0, 0 ); gtk_table_attach( GTK_TABLE(table), *location, 1, 2, i-1, i, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0 ); caption = va_arg(valist, const gchar*); } va_end(valist); gtk_widget_show(table); alignment = gtk_alignment_new(0.0, 0.0, 1.0, 1.0); gtk_alignment_set_padding(GTK_ALIGNMENT(alignment), 6, 0, 12, 0); gtk_container_add(GTK_CONTAINER(alignment), table); gtk_widget_show(alignment); frame = gtk_frame_new(NULL); title_label = gtk_label_new(NULL); title_markup = g_markup_printf_escaped("%s", title); gtk_label_set_markup(GTK_LABEL(title_label), title_markup); g_free(title_markup); gtk_widget_show(title_label); gtk_frame_set_label_widget(GTK_FRAME(frame), title_label); gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_NONE); gtk_container_add(GTK_CONTAINER(frame), alignment); gtk_widget_show(frame); gtk_box_pack_start(GTK_BOX(parent), frame, FALSE, FALSE, 0); } static void inf_gtk_certificate_view_init(GTypeInstance* instance, gpointer g_class) { InfGtkCertificateView* view; InfGtkCertificateViewPrivate* priv; PangoFontDescription* monospace_desc; gint size; view = INF_GTK_CERTIFICATE_VIEW(instance); priv = INF_GTK_CERTIFICATE_VIEW_PRIVATE(view); priv->certificate = NULL; gtk_notebook_set_show_tabs(GTK_NOTEBOOK(view), FALSE); gtk_notebook_set_show_border(GTK_NOTEBOOK(view), FALSE); priv->general_vbox = gtk_vbox_new(FALSE, 12); priv->general_size_group = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); inf_gtk_certificate_view_add_section( priv->general_size_group, GTK_VBOX(priv->general_vbox), _("Issued To"), _("Common Name:"), &priv->common_name, _("Organization:"), &priv->organization, _("Organizational Unit:"), &priv->organizational_unit, _("Serial Number:"), &priv->serial_number, NULL ); inf_gtk_certificate_view_add_section( priv->general_size_group, GTK_VBOX(priv->general_vbox), _("Issued By"), _("Common Name:"), &priv->issuer_common_name, _("Organization:"), &priv->issuer_organization, _("Organizational Unit:"), &priv->issuer_organizational_unit, NULL ); inf_gtk_certificate_view_add_section( priv->general_size_group, GTK_VBOX(priv->general_vbox), _("Validity"), _("Issued On:"), &priv->activation_time, _("Expires On:"), &priv->expiration_time, NULL ); inf_gtk_certificate_view_add_section( priv->general_size_group, GTK_VBOX(priv->general_vbox), _("Fingerprints"), _("SHA1 Fingerprint:"), &priv->sha1_fingerprint, _("MD5 Fingerprint:"), &priv->md5_fingerprint, NULL ); size = pango_font_description_get_size( gtk_widget_get_style(priv->serial_number)->font_desc); monospace_desc = pango_font_description_new(); pango_font_description_set_family(monospace_desc, "Monospace"); pango_font_description_set_size(monospace_desc, size * PANGO_SCALE_SMALL); gtk_widget_modify_font(priv->serial_number, monospace_desc); gtk_widget_modify_font(priv->sha1_fingerprint, monospace_desc); gtk_widget_modify_font(priv->md5_fingerprint, monospace_desc); pango_font_description_free(monospace_desc); gtk_notebook_append_page( GTK_NOTEBOOK(view), priv->general_vbox, gtk_label_new(_("General")) ); gtk_widget_show(priv->general_vbox); } static void inf_gtk_certificate_view_dispose(GObject* object) { InfGtkCertificateView* view; InfGtkCertificateViewPrivate* priv; view = INF_GTK_CERTIFICATE_VIEW(object); priv = INF_GTK_CERTIFICATE_VIEW_PRIVATE(view); if(priv->general_size_group != NULL) { g_object_unref(priv->general_size_group); priv->general_size_group = NULL; } G_OBJECT_CLASS(parent_class)->dispose(object); } static void inf_gtk_certificate_view_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec) { InfGtkCertificateView* view; InfGtkCertificateViewPrivate* priv; view = INF_GTK_CERTIFICATE_VIEW(object); priv = INF_GTK_CERTIFICATE_VIEW_PRIVATE(view); switch(prop_id) { case PROP_CERTIFICATE: inf_gtk_certificate_view_set_certificate( view, (gnutls_x509_crt_t)g_value_get_pointer(value) ); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void inf_gtk_certificate_view_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec) { InfGtkCertificateView* view; InfGtkCertificateViewPrivate* priv; view = INF_GTK_CERTIFICATE_VIEW(object); priv = INF_GTK_CERTIFICATE_VIEW_PRIVATE(view); switch(prop_id) { case PROP_CERTIFICATE: g_value_set_pointer(value, priv->certificate); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } /* * GType registration */ static void inf_gtk_certificate_view_class_init(gpointer g_class, gpointer class_data) { GObjectClass* object_class; object_class = G_OBJECT_CLASS(g_class); parent_class = GTK_NOTEBOOK_CLASS(g_type_class_peek_parent(g_class)); g_type_class_add_private(g_class, sizeof(InfGtkCertificateViewPrivate)); object_class->dispose = inf_gtk_certificate_view_dispose; object_class->set_property = inf_gtk_certificate_view_set_property; object_class->get_property = inf_gtk_certificate_view_get_property; g_object_class_install_property( object_class, PROP_CERTIFICATE, g_param_spec_pointer( "certificate", "Certificate", "The certificate to show", G_PARAM_READWRITE ) ); } GType inf_gtk_certificate_view_get_type(void) { static GType certificate_view_type = 0; if(!certificate_view_type) { static const GTypeInfo certificate_view_type_info = { sizeof(InfGtkCertificateViewClass), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ inf_gtk_certificate_view_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InfGtkCertificateView), /* instance_size */ 0, /* n_preallocs */ inf_gtk_certificate_view_init, /* instance_init */ NULL /* value_table */ }; certificate_view_type = g_type_register_static( GTK_TYPE_NOTEBOOK, "InfGtkCertificateView", &certificate_view_type_info, 0 ); } return certificate_view_type; } /* * Public API. */ /** * inf_gtk_certificate_view_new: * * Creates a new #InfGtkCertificateView. To show a certificate, use * inf_gtk_certificate_view_set_certificate() on the returned widget. * * Returns: A new #InfGtkCertificateView. */ GtkWidget* inf_gtk_certificate_view_new(void) { GObject* object; object = g_object_new(INF_GTK_TYPE_CERTIFICATE_VIEW, NULL); return GTK_WIDGET(object); } /** * inf_gtk_certificate_view_new_with_certificate: * @cert: The certificate to show. * * Creates a new #InfGtkCertificateView showing the given certificate. This * is the same as creating a new certificate view and calling * inf_gtk_certificate_view_set_certificate() afterwards. * * @cert must not be freed as long as the certificate view is showing it. You * can make the view not showing it anymore by calling * inf_gtk_certificate_view_set_certificate() with %NULL as certificate. * * Returns: A new #InfGtkCertificateView. */ GtkWidget* inf_gtk_certificate_view_new_with_certificate(gnutls_x509_crt_t cert) { GObject* object; object = g_object_new( INF_GTK_TYPE_CERTIFICATE_VIEW, "certificate", cert, NULL ); return GTK_WIDGET(object); } /** * inf_gtk_certificate_view_set_certificate: * @view: A #InfGtkCertificateView. * @cert: The certificate to show. * * Shows the given certificate in @view. * * @cert must not be freed as long as the certificate view is showing it. You * can make the view not showing it anymore by calling * inf_gtk_certificate_view_set_certificate() with %NULL as certificate. */ void inf_gtk_certificate_view_set_certificate(InfGtkCertificateView* view, gnutls_x509_crt_t cert) { InfGtkCertificateViewPrivate* priv; gchar* value; g_return_if_fail(INF_GTK_IS_CERTIFICATE_VIEW(view)); priv = INF_GTK_CERTIFICATE_VIEW_PRIVATE(view); priv->certificate = cert; if(cert == NULL) { gtk_label_set_text(GTK_LABEL(priv->common_name), NULL); gtk_label_set_text(GTK_LABEL(priv->organization), NULL); gtk_label_set_text(GTK_LABEL(priv->organizational_unit), NULL); gtk_label_set_text(GTK_LABEL(priv->serial_number), NULL); gtk_label_set_text(GTK_LABEL(priv->issuer_common_name), NULL); gtk_label_set_text(GTK_LABEL(priv->issuer_organization), NULL); gtk_label_set_text(GTK_LABEL(priv->issuer_organizational_unit), NULL); gtk_label_set_text(GTK_LABEL(priv->activation_time), NULL); gtk_label_set_text(GTK_LABEL(priv->expiration_time), NULL); gtk_label_set_text(GTK_LABEL(priv->sha1_fingerprint), NULL); gtk_label_set_text(GTK_LABEL(priv->md5_fingerprint), NULL); } else { inf_gtk_certificate_view_set_label_dn_by_oid( cert, GTK_LABEL(priv->common_name), GNUTLS_OID_X520_COMMON_NAME ); inf_gtk_certificate_view_set_label_dn_by_oid( cert, GTK_LABEL(priv->organization), GNUTLS_OID_X520_ORGANIZATION_NAME ); inf_gtk_certificate_view_set_label_dn_by_oid( cert, GTK_LABEL(priv->organizational_unit), GNUTLS_OID_X520_ORGANIZATIONAL_UNIT_NAME ); value = inf_cert_util_get_serial_number(cert); inf_gtk_certificate_view_set_label( GTK_LABEL(priv->serial_number), value ); g_free(value); inf_gtk_certificate_view_set_label_issuer_dn_by_oid( cert, GTK_LABEL(priv->issuer_common_name), GNUTLS_OID_X520_COMMON_NAME ); inf_gtk_certificate_view_set_label_issuer_dn_by_oid( cert, GTK_LABEL(priv->issuer_organization), GNUTLS_OID_X520_ORGANIZATION_NAME ); inf_gtk_certificate_view_set_label_issuer_dn_by_oid( cert, GTK_LABEL(priv->issuer_organizational_unit), GNUTLS_OID_X520_ORGANIZATIONAL_UNIT_NAME ); value = inf_cert_util_get_activation_time(cert); inf_gtk_certificate_view_set_label( GTK_LABEL(priv->activation_time), value ); g_free(value); value = inf_cert_util_get_expiration_time(cert); inf_gtk_certificate_view_set_label( GTK_LABEL(priv->expiration_time), value ); g_free(value); value = inf_cert_util_get_fingerprint(cert, GNUTLS_DIG_SHA1); inf_gtk_certificate_view_set_label( GTK_LABEL(priv->sha1_fingerprint), value ); g_free(value); value = inf_cert_util_get_fingerprint(cert, GNUTLS_DIG_MD5); inf_gtk_certificate_view_set_label( GTK_LABEL(priv->md5_fingerprint), value ); g_free(value); } g_object_notify(G_OBJECT(view), "certificate"); } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfgtk/inf-gtk-browser-store.h0000644000175000017500000000631012264763732017272 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_GTK_BROWSER_STORE_H__ #define __INF_GTK_BROWSER_STORE_H__ #include #include #include #include #include #include G_BEGIN_DECLS #define INF_GTK_TYPE_BROWSER_STORE (inf_gtk_browser_store_get_type()) #define INF_GTK_BROWSER_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INF_GTK_TYPE_BROWSER_STORE, InfGtkBrowserStore)) #define INF_GTK_BROWSER_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INF_GTK_TYPE_BROWSER_STORE, InfGtkBrowserStoreClass)) #define INF_GTK_IS_BROWSER_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INF_GTK_TYPE_BROWSER_STORE)) #define INF_GTK_IS_BROWSER_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INF_GTK_TYPE_BROWSER_STORE)) #define INF_GTK_BROWSER_STORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), INF_GTK_TYPE_BROWSER_STORE, InfGtkBrowserStoreClass)) typedef struct _InfGtkBrowserStore InfGtkBrowserStore; typedef struct _InfGtkBrowserStoreClass InfGtkBrowserStoreClass; struct _InfGtkBrowserStoreClass { GObjectClass parent_class; }; struct _InfGtkBrowserStore { GObject parent; }; GType inf_gtk_browser_store_get_type(void) G_GNUC_CONST; InfGtkBrowserStore* inf_gtk_browser_store_new(InfIo* io, InfCommunicationManager* comm_manager); void inf_gtk_browser_store_add_discovery(InfGtkBrowserStore* store, InfDiscovery* discovery); void inf_gtk_browser_store_add_connection(InfGtkBrowserStore* store, InfXmlConnection* connection, const gchar* name); void inf_gtk_browser_store_remove_connection(InfGtkBrowserStore* store, InfXmlConnection* connection); void inf_gtk_browser_store_clear_connection_error(InfGtkBrowserStore* store, InfXmlConnection* connection); void inf_gtk_browser_store_set_connection_name(InfGtkBrowserStore* store, InfXmlConnection* connection, const gchar* name); G_END_DECLS #endif /* __INF_GTK_BROWSER_STORE_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfgtk/inf-gtk-certificate-dialog.c0000644000175000017500000005621612264763732020201 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include #include #include #include typedef struct _InfGtkCertificateDialogPrivate InfGtkCertificateDialogPrivate; struct _InfGtkCertificateDialogPrivate { InfCertificateChain* certificate_chain; InfGtkCertificateDialogFlags certificate_flags; gchar* hostname; GtkTreeStore* certificate_tree_store; GtkWidget* main_vbox; GtkWidget* upper_hbox; GtkWidget* info_vbox; GtkWidget* certificate_expander; GtkWidget* certificate_tree_view; GtkWidget* certificate_info_view; }; enum { PROP_0, PROP_CERTIFICATE_CHAIN, PROP_CERTIFICATE_FLAGS, PROP_HOSTNAME }; #define INF_GTK_CERTIFICATE_DIALOG_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), INF_GTK_TYPE_CERTIFICATE_DIALOG, InfGtkCertificateDialogPrivate)) static GtkDialogClass* parent_class; static void inf_gtk_certificate_dialog_renew_info(InfGtkCertificateDialog* dialog) { InfGtkCertificateDialogPrivate* priv; gnutls_x509_crt_t own_cert; gint normal_width_chars; gint size; PangoFontDescription* font_desc; const gchar* ctext; gchar* text; gchar* markup; GString* info_text; GtkWidget* caption; GtkWidget* info; priv = INF_GTK_CERTIFICATE_DIALOG_PRIVATE(dialog); if(priv->info_vbox != NULL) { gtk_container_remove(GTK_CONTAINER(priv->upper_hbox), priv->info_vbox); priv->info_vbox = NULL; } if(priv->certificate_flags != 0 && priv->hostname != NULL) { own_cert = inf_certificate_chain_get_own_certificate(priv->certificate_chain); text = g_strdup_printf( _("The connection to host \"%s\" is not considered secure"), priv->hostname ); caption = gtk_label_new(NULL); gtk_misc_set_alignment(GTK_MISC(caption), 0.0, 0.0); gtk_label_set_line_wrap(GTK_LABEL(caption), TRUE); size = pango_font_description_get_size( gtk_widget_get_style(caption)->font_desc); font_desc = pango_font_description_new(); pango_font_description_set_weight(font_desc, PANGO_WEIGHT_BOLD); pango_font_description_set_size(font_desc, size * PANGO_SCALE_LARGE); gtk_widget_modify_font(caption, font_desc); pango_font_description_free(font_desc); normal_width_chars = gtk_label_get_max_width_chars(GTK_LABEL(caption)); gtk_label_set_max_width_chars( GTK_LABEL(caption), (gint)(normal_width_chars / PANGO_SCALE_LARGE) ); gtk_label_set_text(GTK_LABEL(caption), text); g_free(text); gtk_widget_show(caption); info_text = g_string_sized_new(256); if(priv->certificate_flags & INF_GTK_CERTIFICATE_DIALOG_CERT_CHANGED) { ctext = _("The certificate of the host has changed!"); markup = g_markup_printf_escaped("%s", ctext); g_string_append(info_text, markup); g_free(markup); g_string_append_c(info_text, ' '); if(priv->certificate_flags & INF_GTK_CERTIFICATE_DIALOG_CERT_OLD_EXPIRED) { g_string_append( info_text, _("The previous certificate of the server has expired.") ); } else { /* TODO: Don't show this if the issuer of the new certificate * is trusted, either because it's in the trust file or because it * is in the known hosts file. */ g_string_append( info_text, _("It is possible that the connection to the server is being " "hijacked. It is also possible that the host just has got a new " "certificate. However, please only continue the connection if " "you expected this warning.") ); } } if(priv->certificate_flags & INF_GTK_CERTIFICATE_DIALOG_CERT_ISSUER_NOT_TRUSTED) { if(info_text->len > 0) g_string_append(info_text, "\n\n"); g_string_append( info_text, _("The certificate issuer is not trusted.") ); if(gnutls_x509_crt_check_issuer(own_cert, own_cert)) { g_string_append_c(info_text, ' '); g_string_append(info_text, _("The certificate is self-signed.")); } } if(priv->certificate_flags & INF_GTK_CERTIFICATE_DIALOG_CERT_INVALID) { if(info_text->len > 0) g_string_append(info_text, "\n\n"); ctext = _("The certificate is invalid!"); markup = g_markup_printf_escaped("%s", ctext); g_string_append(info_text, markup); g_free(markup); } if(priv->certificate_flags & INF_GTK_CERTIFICATE_DIALOG_CERT_HOSTNAME_MISMATCH) { if(info_text->len > 0) g_string_append(info_text, "\n\n"); text = inf_cert_util_get_hostname(own_cert); g_string_append_printf( info_text, _("The hostname of the server, \"%s\", does not match the hostname " "the certificate is issued to, \"%s\"."), priv->hostname, text ); g_free(text); } if(priv->certificate_flags & INF_GTK_CERTIFICATE_DIALOG_CERT_EXPIRED) { if(info_text->len > 0) g_string_append(info_text, "\n\n"); text = inf_cert_util_get_expiration_time(own_cert); g_string_append_printf( info_text, _("The certificate has expired. The expiration date was %s"), text ); g_free(text); } if(priv->certificate_flags & INF_GTK_CERTIFICATE_DIALOG_CERT_NOT_ACTIVATED) { if(info_text->len > 0) g_string_append(info_text, "\n\n"); text = inf_cert_util_get_activation_time(own_cert); g_string_append_printf( info_text, _("The certificate has not yet been activated. " "Activation date is %s"), text ); g_free(text); } info = gtk_label_new(NULL); markup = g_string_free(info_text, FALSE); gtk_label_set_markup(GTK_LABEL(info), markup); g_free(markup); gtk_label_set_selectable(GTK_LABEL(info), TRUE); gtk_label_set_line_wrap(GTK_LABEL(info), TRUE); gtk_misc_set_alignment(GTK_MISC(info), 0.0, 0.0); gtk_widget_show(info); priv->info_vbox = gtk_vbox_new(FALSE, 12); gtk_box_pack_start(GTK_BOX(priv->info_vbox), caption, FALSE, TRUE, 0); gtk_box_pack_start(GTK_BOX(priv->info_vbox), info, FALSE, TRUE, 0); gtk_widget_show(priv->info_vbox); gtk_box_pack_start( GTK_BOX(priv->upper_hbox), priv->info_vbox, TRUE, TRUE, 0 ); } } static void inf_gtk_certificate_dialog_set_chain(InfGtkCertificateDialog* dialog, InfCertificateChain* chain) { InfGtkCertificateDialogPrivate* priv; guint i; gnutls_x509_crt_t crt; GtkTreeIter prev_row; GtkTreeIter new_row; GtkTreeIter* parent; GtkTreePath* path; priv = INF_GTK_CERTIFICATE_DIALOG_PRIVATE(dialog); if(priv->certificate_chain != NULL) inf_certificate_chain_unref(priv->certificate_chain); priv->certificate_chain = chain; gtk_tree_store_clear(priv->certificate_tree_store); inf_gtk_certificate_view_set_certificate( INF_GTK_CERTIFICATE_VIEW(priv->certificate_info_view), NULL ); parent = NULL; if(chain != NULL) { inf_certificate_chain_ref(chain); for(i = inf_certificate_chain_get_n_certificates(chain); i > 0; -- i) { crt = inf_certificate_chain_get_nth_certificate(chain, i - 1); gtk_tree_store_append(priv->certificate_tree_store, &new_row, parent); gtk_tree_store_set(priv->certificate_tree_store, &new_row, 0, crt, -1); prev_row = new_row; parent = &prev_row; } path = gtk_tree_model_get_path( GTK_TREE_MODEL(priv->certificate_tree_store), &new_row ); gtk_tree_view_expand_to_path( GTK_TREE_VIEW(priv->certificate_tree_view), path ); gtk_tree_selection_select_path( gtk_tree_view_get_selection(GTK_TREE_VIEW(priv->certificate_tree_view)), path ); gtk_tree_view_scroll_to_cell( GTK_TREE_VIEW(priv->certificate_tree_view), path, NULL, FALSE, 0.0, 0.0 ); gtk_tree_path_free(path); gtk_widget_show(priv->certificate_expander); } else { gtk_widget_hide(priv->certificate_expander); } g_object_notify(G_OBJECT(dialog), "certificate-chain"); } static void inf_gtk_certificate_dialog_selection_changed_cb(GtkTreeSelection* selection, gpointer user_data) { InfGtkCertificateDialog* dialog; InfGtkCertificateDialogPrivate* priv; GtkTreeIter iter; gnutls_x509_crt_t cert; dialog = INF_GTK_CERTIFICATE_DIALOG(user_data); priv = INF_GTK_CERTIFICATE_DIALOG_PRIVATE(dialog); if(gtk_tree_selection_get_selected(selection, NULL, &iter)) { gtk_tree_model_get( GTK_TREE_MODEL(priv->certificate_tree_store), &iter, 0, &cert, -1 ); inf_gtk_certificate_view_set_certificate( INF_GTK_CERTIFICATE_VIEW(priv->certificate_info_view), cert ); } else { inf_gtk_certificate_view_set_certificate( INF_GTK_CERTIFICATE_VIEW(priv->certificate_info_view), NULL ); } } static void inf_gtk_certificate_dialog_chain_data_func(GtkTreeViewColumn* column, GtkCellRenderer* renderer, GtkTreeModel* tree_model, GtkTreeIter* iter, gpointer user_data) { gpointer crt_ptr; gnutls_x509_crt_t cert; GValue value = { 0 }; gchar* common_name; gtk_tree_model_get(tree_model, iter, 0, &crt_ptr, -1); cert = (gnutls_x509_crt_t)crt_ptr; common_name = inf_cert_util_get_dn_by_oid(cert, GNUTLS_OID_X520_COMMON_NAME, 0); g_value_init(&value, G_TYPE_STRING); if(common_name != NULL) g_value_take_string(&value, common_name); else g_value_set_static_string(&value, _("")); g_object_set_property(G_OBJECT(renderer), "text", &value); g_value_unset(&value); } static void inf_gtk_certificate_dialog_init(GTypeInstance* instance, gpointer g_class) { GtkWidget* image; GtkWidget* hbox; GtkWidget* scroll; GtkWidget* vbox; GtkTreeViewColumn* column; GtkCellRenderer* renderer; GtkTreeSelection* selection; GtkIconTheme* theme; GtkIconInfo* icon_info; InfGtkCertificateDialog* dialog; InfGtkCertificateDialogPrivate* priv; dialog = INF_GTK_CERTIFICATE_DIALOG(instance); priv = INF_GTK_CERTIFICATE_DIALOG_PRIVATE(dialog); priv->certificate_chain = NULL; priv->certificate_flags = 0; priv->hostname = NULL; priv->certificate_tree_store = gtk_tree_store_new(1, G_TYPE_POINTER); /* Warning */ priv->info_vbox = NULL; priv->upper_hbox = gtk_hbox_new(FALSE, 12); image = gtk_image_new_from_stock( GTK_STOCK_DIALOG_AUTHENTICATION, GTK_ICON_SIZE_DIALOG ); gtk_misc_set_alignment(GTK_MISC(image), 0.0, 0.0); gtk_widget_show(image); gtk_box_pack_start( GTK_BOX(priv->upper_hbox), image, FALSE, TRUE, 0 ); gtk_widget_show(priv->upper_hbox); /* Certificate info */ column = gtk_tree_view_column_new(); gtk_tree_view_column_set_title(column, _("Certificate Chain")); gtk_tree_view_column_set_spacing(column, 6); renderer = gtk_cell_renderer_pixbuf_new(); theme = gtk_icon_theme_get_default(); icon_info = gtk_icon_theme_lookup_icon( theme, "application-certificate", GTK_ICON_SIZE_MENU, GTK_ICON_LOOKUP_USE_BUILTIN ); if(icon_info != NULL) { g_object_set( G_OBJECT(renderer), "icon-name", "application-certificate", NULL ); gtk_icon_info_free(icon_info); } else { g_object_set( G_OBJECT(renderer), "visible", FALSE, NULL ); } gtk_tree_view_column_pack_start(column, renderer, FALSE); renderer = gtk_cell_renderer_text_new(); gtk_tree_view_column_pack_start(column, renderer, TRUE); gtk_tree_view_column_set_cell_data_func( column, renderer, inf_gtk_certificate_dialog_chain_data_func, NULL, NULL ); priv->certificate_tree_view = gtk_tree_view_new_with_model( GTK_TREE_MODEL(priv->certificate_tree_store) ); gtk_tree_view_append_column( GTK_TREE_VIEW(priv->certificate_tree_view), column ); gtk_tree_view_set_show_expanders( GTK_TREE_VIEW(priv->certificate_tree_view), FALSE ); gtk_tree_view_set_level_indentation( GTK_TREE_VIEW(priv->certificate_tree_view), 12 ); selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(priv->certificate_tree_view)); gtk_tree_selection_set_mode(selection, GTK_SELECTION_BROWSE); g_signal_connect( G_OBJECT(selection), "changed", G_CALLBACK(inf_gtk_certificate_dialog_selection_changed_cb), dialog ); gtk_widget_show(priv->certificate_tree_view); scroll = gtk_scrolled_window_new(NULL, NULL); gtk_widget_set_size_request(scroll, 200, -1); gtk_scrolled_window_set_shadow_type( GTK_SCROLLED_WINDOW(scroll), GTK_SHADOW_IN ); gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW(scroll), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC ); gtk_container_add(GTK_CONTAINER(scroll), priv->certificate_tree_view); gtk_widget_show(scroll); priv->certificate_info_view = inf_gtk_certificate_view_new(); gtk_widget_show(priv->certificate_info_view); hbox = gtk_hbox_new(FALSE, 12); gtk_box_pack_start(GTK_BOX(hbox), scroll, FALSE, FALSE, 0); gtk_box_pack_start( GTK_BOX(hbox), priv->certificate_info_view, TRUE, TRUE, 0 ); gtk_widget_show(hbox); priv->certificate_expander = gtk_expander_new_with_mnemonic(_("_View Certificate")); gtk_expander_set_spacing(GTK_EXPANDER(priv->certificate_expander), 6); gtk_container_add(GTK_CONTAINER(priv->certificate_expander), hbox); priv->main_vbox = gtk_vbox_new(FALSE, 12); /* Main */ gtk_box_pack_start( GTK_BOX(priv->main_vbox), priv->upper_hbox, FALSE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX(priv->main_vbox), priv->certificate_expander, TRUE, TRUE, 0 ); gtk_widget_show(priv->main_vbox); #if GTK_CHECK_VERSION(2,14,0) vbox = gtk_dialog_get_content_area(GTK_DIALOG(dialog)); #else vbox = GTK_DIALOG(dialog)->vbox; #endif gtk_box_pack_start(GTK_BOX(vbox), priv->main_vbox, TRUE, TRUE, 0); gtk_box_set_spacing(GTK_BOX(vbox), 12); gtk_container_set_border_width(GTK_CONTAINER(dialog), 12); gtk_window_set_resizable(GTK_WINDOW(dialog), FALSE); gtk_window_set_title(GTK_WINDOW(dialog), _("Connection not secure")); } static void inf_gtk_certificate_dialog_finalize(GObject* object) { InfGtkCertificateDialog* dialog; InfGtkCertificateDialogPrivate* priv; dialog = INF_GTK_CERTIFICATE_DIALOG(object); priv = INF_GTK_CERTIFICATE_DIALOG_PRIVATE(dialog); inf_certificate_chain_unref(priv->certificate_chain); g_free(priv->hostname); G_OBJECT_CLASS(parent_class)->finalize(object); } static void inf_gtk_certificate_dialog_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec) { InfGtkCertificateDialog* dialog; InfGtkCertificateDialogPrivate* priv; dialog = INF_GTK_CERTIFICATE_DIALOG(object); priv = INF_GTK_CERTIFICATE_DIALOG_PRIVATE(dialog); switch(prop_id) { case PROP_CERTIFICATE_CHAIN: inf_gtk_certificate_dialog_set_chain( dialog, (InfCertificateChain*)g_value_get_boxed(value) ); break; case PROP_CERTIFICATE_FLAGS: priv->certificate_flags = g_value_get_flags(value); if(priv->certificate_flags != 0 && priv->hostname != NULL) inf_gtk_certificate_dialog_renew_info(dialog); break; case PROP_HOSTNAME: if(priv->hostname != NULL) g_free(priv->hostname); priv->hostname = g_value_dup_string(value); if(priv->certificate_flags != 0 && priv->hostname != NULL) inf_gtk_certificate_dialog_renew_info(dialog); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void inf_gtk_certificate_dialog_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec) { InfGtkCertificateDialog* dialog; InfGtkCertificateDialogPrivate* priv; dialog = INF_GTK_CERTIFICATE_DIALOG(object); priv = INF_GTK_CERTIFICATE_DIALOG_PRIVATE(dialog); switch(prop_id) { case PROP_CERTIFICATE_CHAIN: g_value_set_boxed(value, priv->certificate_chain); break; case PROP_CERTIFICATE_FLAGS: g_value_set_flags(value, priv->certificate_flags); break; case PROP_HOSTNAME: g_value_set_string(value, priv->hostname); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } /* * GType registration */ static void inf_gtk_certificate_dialog_class_init(gpointer g_class, gpointer class_data) { GObjectClass* object_class; object_class = G_OBJECT_CLASS(g_class); parent_class = GTK_DIALOG_CLASS(g_type_class_peek_parent(g_class)); g_type_class_add_private(g_class, sizeof(InfGtkCertificateDialogPrivate)); object_class->finalize = inf_gtk_certificate_dialog_finalize; object_class->set_property = inf_gtk_certificate_dialog_set_property; object_class->get_property = inf_gtk_certificate_dialog_get_property; g_object_class_install_property( object_class, PROP_CERTIFICATE_CHAIN, g_param_spec_boxed( "certificate-chain", "Certificate chain", "The certificate chain to show in the dialog", INF_TYPE_CERTIFICATE_CHAIN, G_PARAM_READWRITE ) ); g_object_class_install_property( object_class, PROP_CERTIFICATE_FLAGS, g_param_spec_flags( "certificate-flags", "Certificate flags", "What warnings about the certificate to display", INF_GTK_TYPE_CERTIFICATE_DIALOG_FLAGS, 0, G_PARAM_READWRITE ) ); g_object_class_install_property( object_class, PROP_HOSTNAME, g_param_spec_string( "hostname", "Host name", "Host name of the server from which the certificate is", NULL, G_PARAM_READWRITE ) ); } GType inf_gtk_certificate_dialog_flags_get_type(void) { static GType certificate_dialog_flags_type = 0; if(!certificate_dialog_flags_type) { static const GFlagsValue certificate_dialog_flags_type_values[] = { { INF_GTK_CERTIFICATE_DIALOG_CERT_NOT_ACTIVATED, "INF_GTK_CERTIFICATE_DIALOG_CERT_NOT_ACTIVATED", "cert-not-activated" }, { INF_GTK_CERTIFICATE_DIALOG_CERT_EXPIRED, "INF_GTK_CERTIFICATE_DIALOG_CERT_EXPIRED", "cert-expired" }, { INF_GTK_CERTIFICATE_DIALOG_CERT_HOSTNAME_MISMATCH, "INF_GTK_CERTIFICATE_DIALOG_CERT_HOSTNAME_MISMATCH", "cert-hostname-mismatch" }, { INF_GTK_CERTIFICATE_DIALOG_CERT_ISSUER_NOT_TRUSTED, "INF_GTK_CERTIFICATE_DIALOG_CERT_ISSUER_NOT_TRUSTED", "cert-not-trusted" }, { INF_GTK_CERTIFICATE_DIALOG_CERT_INVALID, "INF_GTK_CERTIFICATE_DIALOG_CERT_INVALID", "cert-invalid" }, { INF_GTK_CERTIFICATE_DIALOG_CERT_CHANGED, "INF_GTK_CERTIFICATE_DIALOG_CERT_CHANGED", "cert-changed" }, { 0, NULL, NULL } }; certificate_dialog_flags_type = g_flags_register_static( "InfCertificateDialogFlags", certificate_dialog_flags_type_values ); } return certificate_dialog_flags_type; } GType inf_gtk_certificate_dialog_get_type(void) { static GType certificate_dialog_type = 0; if(!certificate_dialog_type) { static const GTypeInfo certificate_dialog_type_info = { sizeof(InfGtkCertificateDialogClass), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ inf_gtk_certificate_dialog_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InfGtkCertificateDialog), /* instance_size */ 0, /* n_preallocs */ inf_gtk_certificate_dialog_init, /* instance_init */ NULL /* value_table */ }; certificate_dialog_type = g_type_register_static( GTK_TYPE_DIALOG, "InfGtkCertificateDialog", &certificate_dialog_type_info, 0 ); } return certificate_dialog_type; } /* * Public API. */ /** * inf_gtk_certificate_dialog_new: * @parent: Parent #GtkWindow of the dialog. * @dialog_flags: Flags for the dialog, see #GtkDialogFlags. * @certificate_flags: What certificate warnings to show, see * #InfGtkCertificateDialogFlags. * @hostname: The host name of the server that provides the certificate. * @certificate_chain: The certificate chain provided by the server. * * Creates a new #InfGtkCertificateDialog. A #InfGtkCertificateDialog shows * warnings about a server's certificate to a user, for example when the * issuer is not trusted or the certificate is expired. * * Returns: A New #InfGtkCertificateDialog. */ InfGtkCertificateDialog* inf_gtk_certificate_dialog_new(GtkWindow* parent, GtkDialogFlags dialog_flags, InfGtkCertificateDialogFlags certificate_flags, const gchar* hostname, InfCertificateChain* certificate_chain) { GObject* object; g_return_val_if_fail(parent == NULL || GTK_IS_WINDOW(parent), NULL); g_return_val_if_fail(certificate_flags != 0, NULL); g_return_val_if_fail(hostname != NULL, NULL); g_return_val_if_fail(certificate_chain != NULL, NULL); object = g_object_new( INF_GTK_TYPE_CERTIFICATE_DIALOG, "certificate-chain", certificate_chain, "certificate-flags", certificate_flags, "hostname", hostname, NULL ); if(dialog_flags & GTK_DIALOG_MODAL) gtk_window_set_modal(GTK_WINDOW(object), TRUE); if(dialog_flags & GTK_DIALOG_DESTROY_WITH_PARENT) gtk_window_set_destroy_with_parent(GTK_WINDOW(object), TRUE); #if !GTK_CHECK_VERSION(2,90,7) if(dialog_flags & GTK_DIALOG_NO_SEPARATOR) gtk_dialog_set_has_separator(GTK_DIALOG(object), FALSE); #endif gtk_window_set_transient_for(GTK_WINDOW(object), parent); return INF_GTK_CERTIFICATE_DIALOG(object); } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfgtk/inf-gtk-chat.h0000644000175000017500000000513212264763732015375 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_GTK_CHAT_H__ #define __INF_GTK_CHAT_H__ #include #include #include #include G_BEGIN_DECLS #define INF_GTK_TYPE_CHAT (inf_gtk_chat_get_type()) #define INF_GTK_CHAT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INF_GTK_TYPE_CHAT, InfGtkChat)) #define INF_GTK_CHAT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INF_GTK_TYPE_CHAT, InfGtkChatClass)) #define INF_GTK_IS_CHAT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INF_GTK_TYPE_CHAT)) #define INF_GTK_IS_CHAT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INF_GTK_TYPE_CHAT)) #define INF_GTK_CHAT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), INF_GTK_TYPE_CHAT, InfGtkChatClass)) #define INF_GTK_TYPE_CHAT_FLAGS (inf_gtk_chat_flags_get_type()) typedef struct _InfGtkChat InfGtkChat; typedef struct _InfGtkChatClass InfGtkChatClass; /** * InfGtkChatClass: * * This structure does not contain any public fields. */ struct _InfGtkChatClass { /*< private >*/ GtkVBoxClass parent_class; }; /** * InfGtkChat: * * #InfGtkChat is an opaque data type. You should only access it via the * public API functions. */ struct _InfGtkChat { /*< private >*/ GtkVBox parent; }; GType inf_gtk_chat_get_type(void) G_GNUC_CONST; GtkWidget* inf_gtk_chat_new(void); void inf_gtk_chat_set_session(InfGtkChat* chat, InfChatSession* session); void inf_gtk_chat_set_active_user(InfGtkChat* chat, InfUser* user); InfUser* inf_gtk_chat_get_active_user(InfGtkChat* chat); GtkWidget* inf_gtk_chat_get_entry(InfGtkChat* chat); G_END_DECLS #endif /* __INF_GTK_CHAT_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinftextgtk/0000755000175000017500000000000012264766267013742 500000000000000libinfinity-0.5.5/libinftextgtk/inf-text-gtk-hue-chooser.h0000644000175000017500000000510712264763732020570 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_TEXT_GTK_HUE_CHOOSER_H__ #define __INF_TEXT_GTK_HUE_CHOOSER_H__ #include G_BEGIN_DECLS #define INF_TEXT_GTK_TYPE_HUE_CHOOSER (inf_text_gtk_hue_chooser_get_type()) #define INF_TEXT_GTK_HUE_CHOOSER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INF_TEXT_GTK_TYPE_HUE_CHOOSER, InfTextGtkHueChooser)) #define INF_TEXT_GTK_HUE_CHOOSER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INF_TEXT_GTK_TYPE_HUE_CHOOSER, InfTextGtkHueChooserClass)) #define INF_TEXT_GTK_IS_HUE_CHOOSER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INF_TEXT_GTK_TYPE_HUE_CHOOSER)) #define INF_TEXT_GTK_IS_HUE_CHOOSER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INF_TEXT_GTK_TYPE_HUE_CHOOSER)) #define INF_TEXT_GTK_HUE_CHOOSER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), INF_TEXT_GTK_TYPE_HUE_CHOOSER, InfTextGtkHueChooserClass)) typedef struct _InfTextGtkHueChooser InfTextGtkHueChooser; typedef struct _InfTextGtkHueChooserClass InfTextGtkHueChooserClass; struct _InfTextGtkHueChooserClass { GtkWidgetClass parent_class; void(*hue_change)(InfTextGtkHueChooser* chooser, gdouble hue); void(*move)(InfTextGtkHueChooser* chooser, GtkDirectionType direction); }; struct _InfTextGtkHueChooser { GtkWidget parent; }; GType inf_text_gtk_hue_chooser_get_type(void) G_GNUC_CONST; GtkWidget* inf_text_gtk_hue_chooser_new(void); GtkWidget* inf_text_gtk_hue_chooser_new_with_hue(gdouble hue); void inf_text_gtk_hue_chooser_set_hue(InfTextGtkHueChooser* chooser, gdouble hue); gdouble inf_text_gtk_hue_chooser_get_hue(InfTextGtkHueChooser* chooser); G_END_DECLS #endif /* __INF_TEXT_GTK_HUE_CHOOSER_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinftextgtk/Makefile.am0000644000175000017500000000164112264763732015712 00000000000000# TODO: Find a way to have the version number set automatically. lib_LTLIBRARIES = libinftextgtk-0.5.la libinftextgtk_0_5_la_CPPFLAGS = \ -I$(top_srcdir) \ $(inftextgtk_CFLAGS) \ $(inftext_CFLAGS) \ $(infinity_CFLAGS) libinftextgtk_0_5_la_LDFLAGS = \ -no-undefined \ -version-info $(LIBINFINITY_LIBTOOL_VERSION) libinftextgtk_0_5_la_LIBADD = \ ${top_builddir}/libinftext/libinftext-$(LIBINFINITY_API_VERSION).la \ ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ $(inftextgtk_LIBS) \ $(inftext_LIBS) \ $(infinity_LIBS) libinftextgtk_0_5_ladir = \ $(includedir)/libinftextgtk-$(LIBINFINITY_API_VERSION)/libinftextgtk libinftextgtk_0_5_la_HEADERS = \ inf-text-gtk-buffer.h \ inf-text-gtk-hue-chooser.h \ inf-text-gtk-view.h \ inf-text-gtk-viewport.h libinftextgtk_0_5_la_SOURCES = \ inf-text-gtk-buffer.c \ inf-text-gtk-hue-chooser.c \ inf-text-gtk-view.c \ inf-text-gtk-viewport.c libinfinity-0.5.5/libinftextgtk/inf-text-gtk-viewport.h0000644000175000017500000000541212264763732020225 00000000000000/* infinote - Collaborative notetaking application * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef __INF_TEXT_GTK_VIEWPORT_H__ #define __INF_TEXT_GTK_VIEWPORT_H__ #include #include #include #include G_BEGIN_DECLS #define INF_TEXT_GTK_TYPE_VIEWPORT (inf_text_gtk_viewport_get_type()) #define INF_TEXT_GTK_VIEWPORT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INF_TEXT_GTK_TYPE_VIEWPORT, InfTextGtkViewport)) #define INF_TEXT_GTK_VIEWPORT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INF_TEXT_GTK_TYPE_VIEWPORT, InfTextGtkViewportClass)) #define INF_TEXT_GTK_IS_VIEWPORT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INF_TEXT_GTK_TYPE_VIEWPORT)) #define INF_TEXT_GTK_IS_VIEWPORT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INF_TEXT_GTK_TYPE_VIEWPORT)) #define INF_TEXT_GTK_VIEWPORT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), INF_TEXT_GTK_TYPE_VIEWPORT, InfTextGtkViewportClass)) typedef struct _InfTextGtkViewport InfTextGtkViewport; typedef struct _InfTextGtkViewportClass InfTextGtkViewportClass; struct _InfTextGtkViewportClass { GObjectClass parent_class; }; struct _InfTextGtkViewport { GObject parent; }; GType inf_text_gtk_viewport_get_type(void) G_GNUC_CONST; InfTextGtkViewport* inf_text_gtk_viewport_new(GtkScrolledWindow* scroll, InfUserTable* user_table); GtkScrolledWindow* inf_text_gtk_viewport_get_scrolled_window(InfTextGtkViewport* viewport); InfUserTable* inf_text_gtk_viewport_get_user_table(InfTextGtkViewport* viewport); void inf_text_gtk_viewport_set_active_user(InfTextGtkViewport* viewport, InfTextUser* user); InfTextUser* inf_text_gtk_viewport_get_active_user(InfTextGtkViewport* viewport); void inf_text_gtk_viewport_set_show_user_markers(InfTextGtkViewport* viewport, gboolean show); G_END_DECLS #endif /* __INF_TEXT_GTK_VIEWPORT_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinftextgtk/inf-text-gtk-viewport.c0000644000175000017500000010063612264763732020224 00000000000000/* infinote - Collaborative notetaking application * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include #include typedef struct _InfTextGtkViewportUser InfTextGtkViewportUser; struct _InfTextGtkViewportUser { InfTextGtkViewport* viewport; InfTextUser* user; GdkRectangle rectangle; }; typedef struct _InfTextGtkViewportPrivate InfTextGtkViewportPrivate; struct _InfTextGtkViewportPrivate { GtkScrolledWindow* scroll; InfUserTable* user_table; InfTextUser* active_user; GSList* users; gboolean show_user_markers; }; enum { PROP_0, /* construct only */ PROP_SCROLLED_WINDOW, PROP_USER_TABLE, /* read/write */ PROP_ACTIVE_USER, PROP_SHOW_USER_MARKERS }; #define INF_TEXT_GTK_VIEWPORT_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), INF_TEXT_GTK_TYPE_VIEWPORT, InfTextGtkViewportPrivate)) static GObjectClass* parent_class; /* Converts from HSV to RGB */ /* TODO: Use gtk_hsv_to_rgb from GTK+ 2.14 instead */ static void hsv_to_rgb(gdouble *h, gdouble *s, gdouble *v) { gdouble hue, saturation, value; gdouble f, p, q, t; if (*s == 0.0) { *h = *v; *s = *v; *v = *v; /* heh */ } else { hue = *h * 6.0; saturation = *s; value = *v; if (hue == 6.0) hue = 0.0; f = hue - (int) hue; p = value * (1.0 - saturation); q = value * (1.0 - saturation * f); t = value * (1.0 - saturation * (1.0 - f)); switch ((int) hue) { case 0: *h = value; *s = t; *v = p; break; case 1: *h = q; *s = value; *v = p; break; case 2: *h = p; *s = value; *v = t; break; case 3: *h = p; *s = q; *v = value; break; case 4: *h = t; *s = p; *v = value; break; case 5: *h = value; *s = p; *v = q; break; default: g_assert_not_reached (); } } } /* Converts from RGB to HSV */ /* TODO: Use gtk_rgb_to_hsv from GTK+ 2.14 instead */ static void rgb_to_hsv (gdouble *r, gdouble *g, gdouble *b) { gdouble red, green, blue; gdouble h, s, v; gdouble min, max; gdouble delta; red = *r; green = *g; blue = *b; h = 0.0; if (red > green) { if (red > blue) max = red; else max = blue; if (green < blue) min = green; else min = blue; } else { if (green > blue) max = green; else max = blue; if (red < blue) min = red; else min = blue; } v = max; if (max != 0.0) s = (max - min) / max; else s = 0.0; if (s == 0.0) h = 0.0; else { delta = max - min; if (red == max) h = (green - blue) / delta; else if (green == max) h = 2 + (blue - red) / delta; else if (blue == max) h = 4 + (red - green) / delta; h /= 6.0; if (h < 0.0) h += 1.0; else if (h > 1.0) h -= 1.0; } *r = h; *g = s; *b = v; } static InfTextGtkViewportUser* inf_text_gtk_viewport_find_user(InfTextGtkViewport* viewport, InfTextUser* user) { InfTextGtkViewportPrivate* priv; GSList* item; priv = INF_TEXT_GTK_VIEWPORT_PRIVATE(viewport); for(item = priv->users; item != NULL; item = item->next) if( ((InfTextGtkViewportUser*)item->data)->user == user) return (InfTextGtkViewportUser*)item->data; return NULL; } static void inf_text_gtk_viewport_user_compute_user_area(InfTextGtkViewportUser* user) { InfTextGtkViewportPrivate* priv; GtkWidget* textview; GtkWidget* scrollbar; GtkTextIter iter; GdkRectangle rect; gint y; gint end_y; gint scroll_height; gint slider_size; gint stepper_size; gint stepper_spacing; gint border; GdkRectangle allocation; gint scroll_ox; gint scroll_oy; gint dy; priv = INF_TEXT_GTK_VIEWPORT_PRIVATE(user->viewport); /* TODO: We might want to skip this if show-user-markers is false. */ textview = gtk_bin_get_child(GTK_BIN(priv->scroll)); scrollbar = gtk_scrolled_window_get_vscrollbar(priv->scroll); #if GTK_CHECK_VERSION(2,20,0) if(GTK_IS_TEXT_VIEW(textview) && scrollbar != NULL && gtk_widget_get_realized(textview)) #else if(GTK_IS_TEXT_VIEW(textview) && scrollbar != NULL && GTK_WIDGET_REALIZED(textview)) #endif { gtk_text_buffer_get_iter_at_offset( gtk_text_view_get_buffer(GTK_TEXT_VIEW(textview)), &iter, inf_text_user_get_caret_position(user->user) ); gtk_text_view_get_iter_location(GTK_TEXT_VIEW(textview), &iter, &rect); y = rect.y; gtk_text_buffer_get_end_iter( gtk_text_view_get_buffer(GTK_TEXT_VIEW(textview)), &iter ); gtk_text_view_get_iter_location(GTK_TEXT_VIEW(textview), &iter, &rect); end_y = rect.y; g_assert(end_y > 0 || y == 0); gtk_widget_style_get( scrollbar, "slider-width", &slider_size, "stepper-size", &stepper_size, "stepper-spacing", &stepper_spacing, "trough-border", &border, NULL ); #if GTK_CHECK_VERSION(2,18,0) gtk_widget_get_allocation(scrollbar, &allocation); #else allocation = scrollbar->allocation; #endif scroll_ox = border; scroll_oy = border + stepper_size + stepper_spacing; scroll_height = allocation.height - 2*scroll_oy; if(end_y > 0) y = y * scroll_height / end_y; user->rectangle.x = scroll_ox + allocation.x; user->rectangle.y = scroll_oy + allocation.y + y - slider_size/3; user->rectangle.width = slider_size; user->rectangle.height = slider_size*2/3; if(user->rectangle.y < scroll_oy + allocation.y) { dy = scroll_oy + allocation.y - user->rectangle.y; user->rectangle.y += dy; user->rectangle.height -= dy; } if(user->rectangle.y + user->rectangle.height > scroll_oy + allocation.y + scroll_height) { user->rectangle.height = scroll_oy + allocation.y + scroll_height - user->rectangle.y; } } else { user->rectangle.x = user->rectangle.y = 0; user->rectangle.width = user->rectangle.height = 0; } } static void inf_text_gtk_viewport_user_invalidate_user_area(InfTextGtkViewportUser* user) { InfTextGtkViewportPrivate* priv; priv = INF_TEXT_GTK_VIEWPORT_PRIVATE(user->viewport); if(priv->show_user_markers && user->rectangle.width > 0 && user->rectangle.height > 0) { gtk_widget_queue_draw_area( gtk_scrolled_window_get_vscrollbar(priv->scroll), user->rectangle.x, user->rectangle.y, user->rectangle.width, user->rectangle.height ); } } static gboolean #if GTK_CHECK_VERSION(2, 91, 0) inf_text_gtk_viewport_scrollbar_draw_cb(GtkWidget* scrollbar, cairo_t* cr, gpointer user_data) #else inf_text_gtk_viewport_scrollbar_expose_event_cb(GtkWidget* scrollbar, GdkEventExpose* event, gpointer user_data) #endif { InfTextGtkViewport* viewport; InfTextGtkViewportPrivate* priv; InfTextGtkViewportUser* viewport_user; GdkRectangle* rectangle; GdkColor* color; double h,s,v; double r,g,b; GSList* item; double line_width; #if GTK_CHECK_VERSION(2, 91, 0) GdkRectangle clip_area; #else cairo_t* cr; #endif viewport = INF_TEXT_GTK_VIEWPORT(user_data); priv = INF_TEXT_GTK_VIEWPORT_PRIVATE(viewport); /* Can this happen? */ #if GTK_CHECK_VERSION(2, 91, 0) if(!gtk_cairo_should_draw_window(cr, gtk_widget_get_window(scrollbar))) #elif GTK_CHECK_VERSION(2,14,0) if(event->window != gtk_widget_get_window(scrollbar)) #else if(event->window != GTK_WIDGET(scrollbar)->window) #endif return FALSE; if(priv->show_user_markers) { color = >k_widget_get_style(scrollbar)->bg[GTK_STATE_NORMAL]; h = color->red / 65535.0; s = color->green / 65535.0; v = color->blue / 65535.0; rgb_to_hsv(&h, &s, &v); s = MIN(MAX(s, 0.5), 0.8); v = MAX(v, 0.5); #if GTK_CHECK_VERSION(2, 91, 0) gtk_cairo_transform_to_window( cr, GTK_WIDGET(scrollbar), gtk_widget_get_window(scrollbar) ); gdk_cairo_get_clip_rectangle(cr, &clip_area); #else cr = gdk_cairo_create(event->window); #endif line_width = cairo_get_line_width(cr); for(item = priv->users; item != NULL; item = item->next) { viewport_user = (InfTextGtkViewportUser*)item->data; rectangle = &viewport_user->rectangle; #if GTK_CHECK_VERSION(2, 91, 0) if(gdk_rectangle_intersect(&clip_area, rectangle, NULL)) #elif GTK_CHECK_VERSION(2,90,5) if(cairo_region_contains_rectangle(event->region, rectangle) != CAIRO_REGION_OVERLAP_OUT) #else if(gdk_region_rect_in(event->region, rectangle) != GDK_OVERLAP_RECTANGLE_OUT) #endif { h = inf_text_user_get_hue(viewport_user->user); cairo_rectangle( cr, rectangle->x + line_width/2, rectangle->y + line_width/2, rectangle->width - line_width, rectangle->height - line_width ); r = h; g = s; b = v/2.0; hsv_to_rgb(&r, &g, &b); cairo_set_source_rgba(cr, r, g, b, 0.6); cairo_stroke_preserve(cr); r = h; g = s; b = v; hsv_to_rgb(&r, &g, &b); cairo_set_source_rgba(cr, r, g, b, 0.6); cairo_fill(cr); } } #if ! GTK_CHECK_VERSION(2, 91, 0) cairo_destroy(cr); #endif } return FALSE; } static void inf_text_gtk_viewport_scrollbar_size_allocate_cb(GtkWidget* scrollbar, GtkAllocation* allocation, gpointer user_data) { InfTextGtkViewport* viewport; InfTextGtkViewportPrivate* priv; GSList* item; InfTextGtkViewportUser* viewport_user; viewport = INF_TEXT_GTK_VIEWPORT(user_data); priv = INF_TEXT_GTK_VIEWPORT_PRIVATE(viewport); for(item = priv->users; item != NULL; item = item->next) { viewport_user = (InfTextGtkViewportUser*)item->data; inf_text_gtk_viewport_user_invalidate_user_area(viewport_user); inf_text_gtk_viewport_user_compute_user_area(viewport_user); inf_text_gtk_viewport_user_invalidate_user_area(viewport_user); } } static void inf_text_gtk_viewport_adjustment_changed_cb(GtkAdjustment* adjustment, gpointer user_data) { InfTextGtkViewport* viewport; InfTextGtkViewportPrivate* priv; GSList* item; InfTextGtkViewportUser* viewport_user; viewport = INF_TEXT_GTK_VIEWPORT(user_data); priv = INF_TEXT_GTK_VIEWPORT_PRIVATE(viewport); for(item = priv->users; item != NULL; item = item->next) { viewport_user = (InfTextGtkViewportUser*)item->data; inf_text_gtk_viewport_user_invalidate_user_area(viewport_user); inf_text_gtk_viewport_user_compute_user_area(viewport_user); inf_text_gtk_viewport_user_invalidate_user_area(viewport_user); } } static void inf_text_gtk_viewport_scrollbar_style_set_cb(GtkWidget* scrollbar, GtkStyle* prev_style, gpointer user_data) { InfTextGtkViewport* viewport; InfTextGtkViewportPrivate* priv; GSList* item; InfTextGtkViewportUser* viewport_user; viewport = INF_TEXT_GTK_VIEWPORT(user_data); priv = INF_TEXT_GTK_VIEWPORT_PRIVATE(viewport); for(item = priv->users; item != NULL; item = item->next) { viewport_user = (InfTextGtkViewportUser*)item->data; inf_text_gtk_viewport_user_invalidate_user_area(viewport_user); inf_text_gtk_viewport_user_compute_user_area(viewport_user); inf_text_gtk_viewport_user_invalidate_user_area(viewport_user); } } static void inf_text_gtk_viewport_user_selection_changed_cb(InfTextUser* user, guint position, gint length, gboolean by_request, gpointer user_data) { InfTextGtkViewportUser* viewport_user; InfTextGtkViewportPrivate* priv; viewport_user = (InfTextGtkViewportUser*)user_data; priv = INF_TEXT_GTK_VIEWPORT_PRIVATE(viewport_user->viewport); /* TODO: Just invalidate the region that really changed, by comparing * old and new rectangle's coordinates */ inf_text_gtk_viewport_user_invalidate_user_area(viewport_user); /* Recompute and revalidate */ inf_text_gtk_viewport_user_compute_user_area(viewport_user); inf_text_gtk_viewport_user_invalidate_user_area(viewport_user); } static void inf_text_gtk_viewport_user_notify_hue_cb(GObject* object, GParamSpec* pspec, gpointer user_data) { InfTextGtkViewportUser* viewport_user; InfTextGtkViewportPrivate* priv; viewport_user = (InfTextGtkViewportUser*)user_data; priv = INF_TEXT_GTK_VIEWPORT_PRIVATE(viewport_user->viewport); inf_text_gtk_viewport_user_invalidate_user_area(viewport_user); } static void inf_text_gtk_viewport_add_user(InfTextGtkViewport* viewport, InfTextUser* user) { InfTextGtkViewportPrivate* priv; InfTextGtkViewportUser* viewport_user; priv = INF_TEXT_GTK_VIEWPORT_PRIVATE(viewport); viewport_user = g_slice_new(InfTextGtkViewportUser); viewport_user->viewport = viewport; viewport_user->user = INF_TEXT_USER(user); priv->users = g_slist_prepend(priv->users, viewport_user); inf_text_gtk_viewport_user_compute_user_area(viewport_user); g_signal_connect_after( user, "selection-changed", G_CALLBACK(inf_text_gtk_viewport_user_selection_changed_cb), viewport_user ); g_signal_connect( user, "notify::hue", G_CALLBACK(inf_text_gtk_viewport_user_notify_hue_cb), viewport_user ); inf_text_gtk_viewport_user_invalidate_user_area(viewport_user); } static void inf_text_gtk_viewport_remove_user(InfTextGtkViewportUser* viewport_user) { InfTextGtkViewportPrivate* priv; priv = INF_TEXT_GTK_VIEWPORT_PRIVATE(viewport_user->viewport); inf_text_gtk_viewport_user_invalidate_user_area(viewport_user); inf_signal_handlers_disconnect_by_func( viewport_user->user, G_CALLBACK(inf_text_gtk_viewport_user_selection_changed_cb), viewport_user ); inf_signal_handlers_disconnect_by_func( viewport_user->user, G_CALLBACK(inf_text_gtk_viewport_user_notify_hue_cb), viewport_user ); priv->users = g_slist_remove(priv->users, viewport_user); g_slice_free(InfTextGtkViewportUser, viewport_user); } static void inf_text_gtk_viewport_user_notify_status_cb(GObject* object, GParamSpec* pspec, gpointer user_data) { InfTextGtkViewport* viewport; InfTextGtkViewportPrivate* priv; InfTextUser* user; InfTextGtkViewportUser* viewport_user; viewport = INF_TEXT_GTK_VIEWPORT(user_data); priv = INF_TEXT_GTK_VIEWPORT_PRIVATE(viewport); user = INF_TEXT_USER(object); g_assert(user != priv->active_user); viewport_user = inf_text_gtk_viewport_find_user(viewport, user); if(inf_user_get_status(INF_USER(user)) == INF_USER_ACTIVE) { if(!viewport_user) inf_text_gtk_viewport_add_user(viewport, user); } else { if(viewport_user) inf_text_gtk_viewport_remove_user(viewport_user); } } static void inf_text_gtk_viewport_user_removed(InfTextGtkViewport* viewport, InfTextUser* user) { InfTextGtkViewportPrivate* priv; InfTextGtkViewportUser* viewport_user; priv = INF_TEXT_GTK_VIEWPORT_PRIVATE(viewport); if(user == priv->active_user) { priv->active_user = NULL; g_object_notify(G_OBJECT(viewport), "active-user"); } else { inf_signal_handlers_disconnect_by_func( user, G_CALLBACK(inf_text_gtk_viewport_user_notify_status_cb), viewport ); if(inf_user_get_status(INF_USER(user)) == INF_USER_ACTIVE) { viewport_user = inf_text_gtk_viewport_find_user(viewport, user); g_assert(viewport_user != NULL); inf_text_gtk_viewport_remove_user(viewport_user); } } } static void inf_text_gtk_viewport_user_added(InfTextGtkViewport* viewport, InfTextUser* user) { InfTextGtkViewportPrivate* priv; priv = INF_TEXT_GTK_VIEWPORT_PRIVATE(viewport); /* Active user is guaranteed to be contained in user table, so if user was * just added then it can't be set as active user already. */ g_assert(user != priv->active_user); g_signal_connect( user, "notify::status", G_CALLBACK(inf_text_gtk_viewport_user_notify_status_cb), viewport ); if(inf_user_get_status(INF_USER(user)) == INF_USER_ACTIVE) inf_text_gtk_viewport_add_user(viewport, user); } static void inf_text_gtk_viewport_add_user_cb(InfUserTable* user_table, InfUser* user, gpointer user_data) { InfTextGtkViewport* viewport = INF_TEXT_GTK_VIEWPORT(user_data); g_assert(INF_TEXT_IS_USER(user)); inf_text_gtk_viewport_user_added(viewport, INF_TEXT_USER(user)); } static void inf_text_gtk_viewport_remove_user_cb(InfUserTable* user_table, InfUser* user, gpointer user_data) { InfTextGtkViewport* viewport = INF_TEXT_GTK_VIEWPORT(user_data); g_assert(INF_TEXT_IS_USER(user)); inf_text_gtk_viewport_user_removed(viewport, INF_TEXT_USER(user)); } static void inf_text_gtk_viewport_set_user_table_foreach_new_user_func(InfUser* user, gpointer user_data) { InfTextGtkViewport* viewport = INF_TEXT_GTK_VIEWPORT(user_data); g_assert(INF_TEXT_IS_USER(user)); inf_text_gtk_viewport_user_added(viewport, INF_TEXT_USER(user)); } static void inf_text_gtk_viewport_set_user_table_foreach_old_user_func(InfUser* user, gpointer user_data) { InfTextGtkViewport* viewport = INF_TEXT_GTK_VIEWPORT(user_data); g_assert(INF_TEXT_IS_USER(user)); inf_text_gtk_viewport_user_removed(viewport, INF_TEXT_USER(user)); } static void inf_text_gtk_viewport_set_scrolled_window(InfTextGtkViewport* viewport, GtkScrolledWindow* scroll) { InfTextGtkViewportPrivate* priv; GtkWidget* scrollbar; GtkAdjustment* adjustment; priv = INF_TEXT_GTK_VIEWPORT_PRIVATE(viewport); if(priv->scroll != NULL) { scrollbar = gtk_scrolled_window_get_vscrollbar(priv->scroll); /* Can already be unset at this point */ /* TODO: Should we catch that and unregister our signals before? OTOH it * is most likely going to be freed anyway... */ if(scrollbar != NULL) { adjustment = gtk_range_get_adjustment(GTK_RANGE(scrollbar)); g_assert(adjustment != NULL); inf_signal_handlers_disconnect_by_func( G_OBJECT(adjustment), G_CALLBACK(inf_text_gtk_viewport_adjustment_changed_cb), viewport ); inf_signal_handlers_disconnect_by_func( G_OBJECT(scrollbar), G_CALLBACK(inf_text_gtk_viewport_scrollbar_size_allocate_cb), viewport ); inf_signal_handlers_disconnect_by_func( G_OBJECT(scrollbar), G_CALLBACK(inf_text_gtk_viewport_scrollbar_style_set_cb), viewport ); inf_signal_handlers_disconnect_by_func( G_OBJECT(scrollbar), #if GTK_CHECK_VERSION(2, 91, 0) G_CALLBACK(inf_text_gtk_viewport_scrollbar_draw_cb), #else G_CALLBACK(inf_text_gtk_viewport_scrollbar_expose_event_cb), #endif viewport ); } g_object_unref(priv->scroll); } priv->scroll = scroll; if(scroll != NULL) { scrollbar = gtk_scrolled_window_get_vscrollbar(priv->scroll); /* TODO: can this happen? maybe for GTK_POLICY_NEVER? */ g_assert(scrollbar != NULL); adjustment = gtk_range_get_adjustment(GTK_RANGE(scrollbar)); g_assert(adjustment != NULL); g_object_ref(scroll); g_signal_connect_after( G_OBJECT(adjustment), "changed", G_CALLBACK(inf_text_gtk_viewport_adjustment_changed_cb), viewport ); g_signal_connect_after( G_OBJECT(scrollbar), "size-allocate", G_CALLBACK(inf_text_gtk_viewport_scrollbar_size_allocate_cb), viewport ); g_signal_connect_after( G_OBJECT(scrollbar), "style-set", G_CALLBACK(inf_text_gtk_viewport_scrollbar_style_set_cb), viewport ); #if GTK_CHECK_VERSION(2, 91, 0) g_signal_connect_after( G_OBJECT(scrollbar), "draw", G_CALLBACK(inf_text_gtk_viewport_scrollbar_draw_cb), viewport ); #else g_signal_connect_after( G_OBJECT(scrollbar), "expose-event", G_CALLBACK(inf_text_gtk_viewport_scrollbar_expose_event_cb), viewport ); #endif } g_object_notify(G_OBJECT(viewport), "scrolled-window"); } static void inf_text_gtk_viewport_set_user_table(InfTextGtkViewport* viewport, InfUserTable* user_table) { InfTextGtkViewportPrivate* priv; priv = INF_TEXT_GTK_VIEWPORT_PRIVATE(viewport); if(priv->user_table != NULL) { inf_signal_handlers_disconnect_by_func( G_OBJECT(priv->user_table), G_CALLBACK(inf_text_gtk_viewport_add_user_cb), viewport ); inf_signal_handlers_disconnect_by_func( G_OBJECT(priv->user_table), G_CALLBACK(inf_text_gtk_viewport_remove_user_cb), viewport ); inf_user_table_foreach_user( priv->user_table, inf_text_gtk_viewport_set_user_table_foreach_old_user_func, viewport ); g_object_unref(priv->user_table); } priv->user_table = user_table; if(user_table != NULL) { g_object_ref(user_table); g_signal_connect( G_OBJECT(user_table), "add-user", G_CALLBACK(inf_text_gtk_viewport_add_user_cb), viewport ); g_signal_connect( G_OBJECT(user_table), "remove-user", G_CALLBACK(inf_text_gtk_viewport_remove_user_cb), viewport ); inf_user_table_foreach_user( user_table, inf_text_gtk_viewport_set_user_table_foreach_new_user_func, viewport ); } g_object_notify(G_OBJECT(viewport), "user-table"); } static void inf_text_gtk_viewport_init(GTypeInstance* instance, gpointer g_class) { InfTextGtkViewport* viewport; InfTextGtkViewportPrivate* priv; viewport = INF_TEXT_GTK_VIEWPORT(instance); priv = INF_TEXT_GTK_VIEWPORT_PRIVATE(viewport); priv->scroll = NULL; priv->user_table = NULL; priv->active_user = NULL; priv->users = NULL; priv->show_user_markers = TRUE; } static void inf_text_gtk_viewport_dispose(GObject* object) { InfTextGtkViewport* viewport; InfTextGtkViewportPrivate* priv; viewport = INF_TEXT_GTK_VIEWPORT(object); priv = INF_TEXT_GTK_VIEWPORT_PRIVATE(viewport); inf_text_gtk_viewport_set_scrolled_window(viewport, NULL); inf_text_gtk_viewport_set_user_table(viewport, NULL); g_assert(priv->active_user == NULL); g_assert(priv->users == NULL); G_OBJECT_CLASS(parent_class)->dispose(object); } static void inf_text_gtk_viewport_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec) { InfTextGtkViewport* viewport; InfTextGtkViewportPrivate* priv; viewport = INF_TEXT_GTK_VIEWPORT(object); priv = INF_TEXT_GTK_VIEWPORT_PRIVATE(viewport); switch(prop_id) { case PROP_SCROLLED_WINDOW: g_assert(priv->scroll == NULL); /* construct only */ inf_text_gtk_viewport_set_scrolled_window( viewport, GTK_SCROLLED_WINDOW(g_value_get_object(value)) ); break; case PROP_USER_TABLE: g_assert(priv->user_table == NULL); /* construct/only */ inf_text_gtk_viewport_set_user_table( viewport, INF_USER_TABLE(g_value_get_object(value)) ); break; case PROP_ACTIVE_USER: inf_text_gtk_viewport_set_active_user( viewport, INF_TEXT_USER(g_value_get_object(value)) ); break; case PROP_SHOW_USER_MARKERS: inf_text_gtk_viewport_set_show_user_markers( viewport, g_value_get_boolean(value) ); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(value, prop_id, pspec); break; } } static void inf_text_gtk_viewport_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec) { InfTextGtkViewport* viewport; InfTextGtkViewportPrivate* priv; viewport = INF_TEXT_GTK_VIEWPORT(object); priv = INF_TEXT_GTK_VIEWPORT_PRIVATE(viewport); switch(prop_id) { case PROP_SCROLLED_WINDOW: g_value_set_object(value, G_OBJECT(priv->scroll)); break; case PROP_USER_TABLE: g_value_set_object(value, G_OBJECT(priv->user_table)); break; case PROP_ACTIVE_USER: g_value_set_object(value, G_OBJECT(priv->active_user)); break; case PROP_SHOW_USER_MARKERS: g_value_set_boolean(value, priv->show_user_markers); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void inf_text_gtk_viewport_class_init(gpointer g_class, gpointer class_data) { GObjectClass* object_class; object_class = G_OBJECT_CLASS(g_class); parent_class = G_OBJECT_CLASS(g_type_class_peek_parent(g_class)); g_type_class_add_private(g_class, sizeof(InfTextGtkViewportPrivate)); object_class->dispose = inf_text_gtk_viewport_dispose; object_class->set_property = inf_text_gtk_viewport_set_property; object_class->get_property = inf_text_gtk_viewport_get_property; g_object_class_install_property( object_class, PROP_SCROLLED_WINDOW, g_param_spec_object( "scrolled-window", "Scrolled Window", "The underlying GtkScrolledWindow", GTK_TYPE_SCROLLED_WINDOW, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); g_object_class_install_property( object_class, PROP_USER_TABLE, g_param_spec_object( "user-table", "User table", "The user table containing the users of the session shown in the " "viewport", INF_TYPE_USER_TABLE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); g_object_class_install_property( object_class, PROP_ACTIVE_USER, g_param_spec_object( "active-user", "Active user", "The user for which to show the viewport", INF_TEXT_TYPE_USER, G_PARAM_READWRITE ) ); g_object_class_install_property( object_class, PROP_SHOW_USER_MARKERS, g_param_spec_boolean( "show-user-markers", "Show user markers", "Whether to indicate the position of non-local user's cursors in the " "scrollbar", TRUE, G_PARAM_READWRITE ) ); } GType inf_text_gtk_viewport_get_type(void) { static GType viewport_type = 0; if(!viewport_type) { static const GTypeInfo viewport_type_info = { sizeof(InfTextGtkViewportClass), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ inf_text_gtk_viewport_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InfTextGtkViewport), /* instance_size */ 0, /* n_preallocs */ inf_text_gtk_viewport_init, /* instance_init */ NULL /* value_table */ }; viewport_type = g_type_register_static( G_TYPE_OBJECT, "InfTextGtkViewport", &viewport_type_info, 0 ); } return viewport_type; } /** * inf_text_gtk_viewport_new: * @scroll: A #GtkScrolledWindow. * @user_table: The #InfUserTable for the text session displayed in @viewport. * * Creates a new #InfTextGtkViewport for @scroll. This draws the position of * remote user's cursors into the scrollbars of @scroll. * * Returns: A new #InfTextGtkViewport. */ InfTextGtkViewport* inf_text_gtk_viewport_new(GtkScrolledWindow* scroll, InfUserTable* user_table) { GObject* object; g_return_val_if_fail(GTK_IS_SCROLLED_WINDOW(scroll), NULL); g_return_val_if_fail(INF_IS_USER_TABLE(user_table), NULL); object = g_object_new( INF_TEXT_GTK_TYPE_VIEWPORT, "scrolled-window", scroll, "user-table", user_table, NULL ); return INF_TEXT_GTK_VIEWPORT(object); } /** * inf_text_gtk_viewport_get_scrolled_window: * @viewport: A #InfTextGtkViewport. * * Returns the underlying #GtkScrolledWindow. * * Return Value: The #InfTextGtkViewport's #GtkScrolledWindow. **/ GtkScrolledWindow* inf_text_gtk_viewport_get_scrolled_window(InfTextGtkViewport* viewport) { g_return_val_if_fail(INF_TEXT_GTK_IS_VIEWPORT(viewport), NULL); return INF_TEXT_GTK_VIEWPORT_PRIVATE(viewport)->scroll; } /** * inf_text_gtk_viewport_get_user_table: * @viewport: A #InfTextGtkViewport. * * Returns the #InfUserTable containing the users of the session the * #InfTextGtkViewport's #GtkScrolledWindow is displaying. * * Returns: The #InfGtkTextViewport's #InfUserTable. */ InfUserTable* inf_text_gtk_viewport_get_user_table(InfTextGtkViewport* viewport) { g_return_val_if_fail(INF_TEXT_GTK_IS_VIEWPORT(viewport), NULL); return INF_TEXT_GTK_VIEWPORT_PRIVATE(viewport)->user_table; } /** * inf_text_gtk_viewport_set_active_user: * @viewport: A #InfTextGtkViewport. * @user: A user from @viewport's user table, or %NULL. * * Sets the user for which perspective to draw the viewport. The cursor * position for teh active user is not draws since it is assumed that the * viewport's "real" scrollbars match the active user's position. */ void inf_text_gtk_viewport_set_active_user(InfTextGtkViewport* viewport, InfTextUser* user) { InfTextGtkViewportPrivate* priv; InfTextUser* active_user; g_return_if_fail(INF_TEXT_GTK_IS_VIEWPORT(viewport)); g_return_if_fail(user == NULL || INF_TEXT_IS_USER(user)); priv = INF_TEXT_GTK_VIEWPORT_PRIVATE(viewport); g_return_if_fail( user == NULL || inf_user_table_lookup_user_by_id( priv->user_table, inf_user_get_id(INF_USER(user)) ) == INF_USER(user) ); if(priv->active_user != NULL) { active_user = priv->active_user; priv->active_user = NULL; inf_text_gtk_viewport_user_added(viewport, active_user); } if(user != NULL) { inf_text_gtk_viewport_user_removed(viewport, user); } priv->active_user = user; g_object_notify(G_OBJECT(viewport), "active-user"); } /** * inf_text_gtk_viewport_get_active_user: * @viewport: A #InfTextGtkViewport. * * Returns the active user of @viewport. See * inf_text_gtk_viewport_set_active_user(). * * Returns: The active user of @viewport. */ InfTextUser* inf_text_gtk_viewport_get_active_user(InfTextGtkViewport* viewport) { g_return_val_if_fail(INF_TEXT_GTK_IS_VIEWPORT(viewport), NULL); return INF_TEXT_GTK_VIEWPORT_PRIVATE(viewport)->active_user; } /** * inf_text_gtk_viewport_set_show_user_markers: * @viewport: A #InfTextGtkViewport. * @show: Whether to show the position of non-local users. * * If @show is %TRUE then draw a marker indicating the cursor position of all * non-local users with status %INF_USER_ACTIVE in the scrollbar of the * scrolled window. If @show is %FALSE then do not draw user markers into the * scrollbar. */ void inf_text_gtk_viewport_set_show_user_markers(InfTextGtkViewport* viewport, gboolean show) { InfTextGtkViewportPrivate* priv; g_return_if_fail(INF_TEXT_GTK_IS_VIEWPORT(viewport)); priv = INF_TEXT_GTK_VIEWPORT_PRIVATE(viewport); if(priv->show_user_markers != show) { gtk_widget_queue_draw(gtk_scrolled_window_get_vscrollbar(priv->scroll)); priv->show_user_markers = show; g_object_notify(G_OBJECT(viewport), "show-user-markers"); } } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinftextgtk/Makefile.in0000644000175000017500000007205212264766066015732 00000000000000# Makefile.in generated by automake 1.13.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = libinftextgtk DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/mkinstalldirs $(top_srcdir)/depcomp \ $(libinftextgtk_0_5_la_HEADERS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/libinfinity/inf-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" \ "$(DESTDIR)$(libinftextgtk_0_5_ladir)" LTLIBRARIES = $(lib_LTLIBRARIES) am__DEPENDENCIES_1 = libinftextgtk_0_5_la_DEPENDENCIES = ${top_builddir}/libinftext/libinftext-$(LIBINFINITY_API_VERSION).la \ ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) am_libinftextgtk_0_5_la_OBJECTS = \ libinftextgtk_0_5_la-inf-text-gtk-buffer.lo \ libinftextgtk_0_5_la-inf-text-gtk-hue-chooser.lo \ libinftextgtk_0_5_la-inf-text-gtk-view.lo \ libinftextgtk_0_5_la-inf-text-gtk-viewport.lo libinftextgtk_0_5_la_OBJECTS = $(am_libinftextgtk_0_5_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libinftextgtk_0_5_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(libinftextgtk_0_5_la_LDFLAGS) \ $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -I$(top_builddir)/libinfinity 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) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libinftextgtk_0_5_la_SOURCES) DIST_SOURCES = $(libinftextgtk_0_5_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(libinftextgtk_0_5_la_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBINFINITY_API_VERSION = @LIBINFINITY_API_VERSION@ LIBINFINITY_LIBTOOL_VERSION = @LIBINFINITY_LIBTOOL_VERSION@ LIBINFINITY_VERSION = @LIBINFINITY_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ avahi_CFLAGS = @avahi_CFLAGS@ avahi_LIBS = @avahi_LIBS@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gtk_requirement = @gtk_requirement@ gtk_version = @gtk_version@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infgtk_CFLAGS = @infgtk_CFLAGS@ infgtk_LIBS = @infgtk_LIBS@ infinity_CFLAGS = @infinity_CFLAGS@ infinity_LIBS = @infinity_LIBS@ infinoted_CFLAGS = @infinoted_CFLAGS@ infinoted_LIBS = @infinoted_LIBS@ infodir = @infodir@ inftext_CFLAGS = @inftext_CFLAGS@ inftext_LIBS = @inftext_LIBS@ inftextgtk_CFLAGS = @inftextgtk_CFLAGS@ inftextgtk_LIBS = @inftextgtk_LIBS@ install_sh = @install_sh@ libdaemon_CFLAGS = @libdaemon_CFLAGS@ libdaemon_LIBS = @libdaemon_LIBS@ 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@ # TODO: Find a way to have the version number set automatically. lib_LTLIBRARIES = libinftextgtk-0.5.la libinftextgtk_0_5_la_CPPFLAGS = \ -I$(top_srcdir) \ $(inftextgtk_CFLAGS) \ $(inftext_CFLAGS) \ $(infinity_CFLAGS) libinftextgtk_0_5_la_LDFLAGS = \ -no-undefined \ -version-info $(LIBINFINITY_LIBTOOL_VERSION) libinftextgtk_0_5_la_LIBADD = \ ${top_builddir}/libinftext/libinftext-$(LIBINFINITY_API_VERSION).la \ ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ $(inftextgtk_LIBS) \ $(inftext_LIBS) \ $(infinity_LIBS) libinftextgtk_0_5_ladir = \ $(includedir)/libinftextgtk-$(LIBINFINITY_API_VERSION)/libinftextgtk libinftextgtk_0_5_la_HEADERS = \ inf-text-gtk-buffer.h \ inf-text-gtk-hue-chooser.h \ inf-text-gtk-view.h \ inf-text-gtk-viewport.h libinftextgtk_0_5_la_SOURCES = \ inf-text-gtk-buffer.c \ inf-text-gtk-hue-chooser.c \ inf-text-gtk-view.c \ inf-text-gtk-viewport.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libinftextgtk/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu libinftextgtk/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libinftextgtk-0.5.la: $(libinftextgtk_0_5_la_OBJECTS) $(libinftextgtk_0_5_la_DEPENDENCIES) $(EXTRA_libinftextgtk_0_5_la_DEPENDENCIES) $(AM_V_CCLD)$(libinftextgtk_0_5_la_LINK) -rpath $(libdir) $(libinftextgtk_0_5_la_OBJECTS) $(libinftextgtk_0_5_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinftextgtk_0_5_la-inf-text-gtk-buffer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinftextgtk_0_5_la-inf-text-gtk-hue-chooser.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinftextgtk_0_5_la-inf-text-gtk-view.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinftextgtk_0_5_la-inf-text-gtk-viewport.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< libinftextgtk_0_5_la-inf-text-gtk-buffer.lo: inf-text-gtk-buffer.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinftextgtk_0_5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinftextgtk_0_5_la-inf-text-gtk-buffer.lo -MD -MP -MF $(DEPDIR)/libinftextgtk_0_5_la-inf-text-gtk-buffer.Tpo -c -o libinftextgtk_0_5_la-inf-text-gtk-buffer.lo `test -f 'inf-text-gtk-buffer.c' || echo '$(srcdir)/'`inf-text-gtk-buffer.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinftextgtk_0_5_la-inf-text-gtk-buffer.Tpo $(DEPDIR)/libinftextgtk_0_5_la-inf-text-gtk-buffer.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-text-gtk-buffer.c' object='libinftextgtk_0_5_la-inf-text-gtk-buffer.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinftextgtk_0_5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinftextgtk_0_5_la-inf-text-gtk-buffer.lo `test -f 'inf-text-gtk-buffer.c' || echo '$(srcdir)/'`inf-text-gtk-buffer.c libinftextgtk_0_5_la-inf-text-gtk-hue-chooser.lo: inf-text-gtk-hue-chooser.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinftextgtk_0_5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinftextgtk_0_5_la-inf-text-gtk-hue-chooser.lo -MD -MP -MF $(DEPDIR)/libinftextgtk_0_5_la-inf-text-gtk-hue-chooser.Tpo -c -o libinftextgtk_0_5_la-inf-text-gtk-hue-chooser.lo `test -f 'inf-text-gtk-hue-chooser.c' || echo '$(srcdir)/'`inf-text-gtk-hue-chooser.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinftextgtk_0_5_la-inf-text-gtk-hue-chooser.Tpo $(DEPDIR)/libinftextgtk_0_5_la-inf-text-gtk-hue-chooser.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-text-gtk-hue-chooser.c' object='libinftextgtk_0_5_la-inf-text-gtk-hue-chooser.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinftextgtk_0_5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinftextgtk_0_5_la-inf-text-gtk-hue-chooser.lo `test -f 'inf-text-gtk-hue-chooser.c' || echo '$(srcdir)/'`inf-text-gtk-hue-chooser.c libinftextgtk_0_5_la-inf-text-gtk-view.lo: inf-text-gtk-view.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinftextgtk_0_5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinftextgtk_0_5_la-inf-text-gtk-view.lo -MD -MP -MF $(DEPDIR)/libinftextgtk_0_5_la-inf-text-gtk-view.Tpo -c -o libinftextgtk_0_5_la-inf-text-gtk-view.lo `test -f 'inf-text-gtk-view.c' || echo '$(srcdir)/'`inf-text-gtk-view.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinftextgtk_0_5_la-inf-text-gtk-view.Tpo $(DEPDIR)/libinftextgtk_0_5_la-inf-text-gtk-view.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-text-gtk-view.c' object='libinftextgtk_0_5_la-inf-text-gtk-view.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinftextgtk_0_5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinftextgtk_0_5_la-inf-text-gtk-view.lo `test -f 'inf-text-gtk-view.c' || echo '$(srcdir)/'`inf-text-gtk-view.c libinftextgtk_0_5_la-inf-text-gtk-viewport.lo: inf-text-gtk-viewport.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinftextgtk_0_5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinftextgtk_0_5_la-inf-text-gtk-viewport.lo -MD -MP -MF $(DEPDIR)/libinftextgtk_0_5_la-inf-text-gtk-viewport.Tpo -c -o libinftextgtk_0_5_la-inf-text-gtk-viewport.lo `test -f 'inf-text-gtk-viewport.c' || echo '$(srcdir)/'`inf-text-gtk-viewport.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinftextgtk_0_5_la-inf-text-gtk-viewport.Tpo $(DEPDIR)/libinftextgtk_0_5_la-inf-text-gtk-viewport.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-text-gtk-viewport.c' object='libinftextgtk_0_5_la-inf-text-gtk-viewport.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinftextgtk_0_5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinftextgtk_0_5_la-inf-text-gtk-viewport.lo `test -f 'inf-text-gtk-viewport.c' || echo '$(srcdir)/'`inf-text-gtk-viewport.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-libinftextgtk_0_5_laHEADERS: $(libinftextgtk_0_5_la_HEADERS) @$(NORMAL_INSTALL) @list='$(libinftextgtk_0_5_la_HEADERS)'; test -n "$(libinftextgtk_0_5_ladir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(libinftextgtk_0_5_ladir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libinftextgtk_0_5_ladir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libinftextgtk_0_5_ladir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(libinftextgtk_0_5_ladir)" || exit $$?; \ done uninstall-libinftextgtk_0_5_laHEADERS: @$(NORMAL_UNINSTALL) @list='$(libinftextgtk_0_5_la_HEADERS)'; test -n "$(libinftextgtk_0_5_ladir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(libinftextgtk_0_5_ladir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(libinftextgtk_0_5_ladir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-libinftextgtk_0_5_laHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES \ uninstall-libinftextgtk_0_5_laHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-libLTLIBRARIES \ install-libinftextgtk_0_5_laHEADERS install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES \ uninstall-libinftextgtk_0_5_laHEADERS # 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: libinfinity-0.5.5/libinftextgtk/inf-text-gtk-buffer.h0000644000175000017500000001121312264763732017613 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_TEXT_GTK_BUFFER_H__ #define __INF_TEXT_GTK_BUFFER_H__ #include #include #include #include #include G_BEGIN_DECLS #define INF_TEXT_GTK_TYPE_BUFFER (inf_text_gtk_buffer_get_type()) #define INF_TEXT_GTK_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INF_TEXT_GTK_TYPE_BUFFER, InfTextGtkBuffer)) #define INF_TEXT_GTK_BUFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INF_TEXT_GTK_TYPE_BUFFER, InfTextGtkBufferClass)) #define INF_TEXT_GTK_IS_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INF_TEXT_GTK_TYPE_BUFFER)) #define INF_TEXT_GTK_IS_BUFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INF_TEXT_GTK_TYPE_BUFFER)) #define INF_TEXT_GTK_BUFFER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), INF_TEXT_GTK_TYPE_BUFFER, InfTextGtkBufferClass)) typedef struct _InfTextGtkBuffer InfTextGtkBuffer; typedef struct _InfTextGtkBufferClass InfTextGtkBufferClass; struct _InfTextGtkBufferClass { GObjectClass parent_class; }; struct _InfTextGtkBuffer { GObject parent; }; GType inf_text_gtk_buffer_get_type(void) G_GNUC_CONST; InfTextGtkBuffer* inf_text_gtk_buffer_new(GtkTextBuffer* buffer, InfUserTable* user_table); GtkTextBuffer* inf_text_gtk_buffer_get_text_buffer(InfTextGtkBuffer* buffer); void inf_text_gtk_buffer_set_active_user(InfTextGtkBuffer* buffer, InfTextUser* user); InfTextUser* inf_text_gtk_buffer_get_active_user(InfTextGtkBuffer* buffer); InfTextUser* inf_text_gtk_buffer_get_author(InfTextGtkBuffer* buffer, GtkTextIter* location); InfTextUser* inf_text_gtk_buffer_get_user_for_tag(InfTextGtkBuffer* buffer, GtkTextTag* tag); gboolean inf_text_gtk_buffer_is_author_toggle(InfTextGtkBuffer* buffer, const GtkTextIter* iter, InfTextUser** user_on, InfTextUser** user_off); gboolean inf_text_gtk_buffer_forward_to_author_toggle(InfTextGtkBuffer* buffer, GtkTextIter* iter, InfTextUser** user_on, InfTextUser** user_off); gboolean inf_text_gtk_buffer_backward_to_author_toggle(InfTextGtkBuffer* buffer, GtkTextIter* iter, InfTextUser** user_on, InfTextUser** user_off); void inf_text_gtk_buffer_set_wake_on_cursor_movement(InfTextGtkBuffer* buffer, gboolean wake); gboolean inf_text_gtk_buffer_get_wake_on_cursor_movement(InfTextGtkBuffer* buffer); void inf_text_gtk_buffer_ensure_author_tags_priority(InfTextGtkBuffer* buffer); void inf_text_gtk_buffer_set_saturation_value(InfTextGtkBuffer* buffer, gdouble saturation, gdouble value); gdouble inf_text_gtk_buffer_get_saturation(InfTextGtkBuffer* buffer); gdouble inf_text_gtk_buffer_get_value(InfTextGtkBuffer* buffer); void inf_text_gtk_buffer_set_show_user_colors(InfTextGtkBuffer* buffer, gboolean show); gboolean inf_text_gtk_buffer_get_show_user_colors(InfTextGtkBuffer* buffer); void inf_text_gtk_buffer_show_user_colors(InfTextGtkBuffer* buffer, gboolean show, GtkTextIter* start, GtkTextIter* end); G_END_DECLS #endif /* __INF_TEXT_GTK_BUFFER_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinftextgtk/inf-text-gtk-buffer.c0000644000175000017500000022673212264763732017624 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include #include /* for strlen() */ struct _InfTextBufferIter { GtkTextIter begin; GtkTextIter end; InfTextUser* user; }; typedef struct _InfTextGtkBufferRecord InfTextGtkBufferRecord; struct _InfTextGtkBufferRecord { gboolean insert; guint char_count; guint position; InfTextChunk* chunk; gboolean applied; InfTextGtkBufferRecord* next; }; typedef struct _InfTextGtkBufferUserTags InfTextGtkBufferUserTags; struct _InfTextGtkBufferUserTags { InfTextGtkBuffer* buffer; InfTextUser* user; GtkTextTag* colored_tag; GtkTextTag* colorless_tag; }; typedef struct _InfTextGtkBufferTagRemove InfTextGtkBufferTagRemove; struct _InfTextGtkBufferTagRemove { GtkTextBuffer* buffer; GtkTextIter begin_iter; GtkTextIter end_iter; InfTextGtkBufferUserTags* ignore_tags; }; typedef struct _InfTextGtkBufferPrivate InfTextGtkBufferPrivate; struct _InfTextGtkBufferPrivate { GtkTextBuffer* buffer; InfUserTable* user_table; GHashTable* user_tags; InfTextGtkBufferRecord* record; gboolean show_user_colors; InfTextUser* active_user; gboolean wake_on_cursor_movement; gdouble saturation; gdouble value; }; enum { PROP_0, PROP_BUFFER, PROP_USER_TABLE, PROP_ACTIVE_USER, PROP_WAKE_ON_CURSOR_MOVEMENT, PROP_SHOW_USER_COLORS, PROP_SATURATION, PROP_VALUE, /* overriden */ PROP_MODIFIED }; #define INF_TEXT_GTK_BUFFER_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), INF_TEXT_GTK_TYPE_BUFFER, InfTextGtkBufferPrivate)) static GObjectClass* parent_class; static GQuark inf_text_gtk_buffer_tag_user_quark; /* This function is stolen from gtkhsv.c from GTK+ */ /* TODO: Use gtk_hsv_to_rgb from GTK+ 2.14 instead */ /* Converts from HSV to RGB */ static void hsv_to_rgb (gdouble *h, gdouble *s, gdouble *v) { gdouble hue, saturation, value; gdouble f, p, q, t; if (*s == 0.0) { *h = *v; *s = *v; *v = *v; /* heh */ } else { hue = *h * 6.0; saturation = *s; value = *v; if (hue == 6.0) hue = 0.0; f = hue - (int) hue; p = value * (1.0 - saturation); q = value * (1.0 - saturation * f); t = value * (1.0 - saturation * (1.0 - f)); switch ((int) hue) { case 0: *h = value; *s = t; *v = p; break; case 1: *h = q; *s = value; *v = p; break; case 2: *h = p; *s = value; *v = t; break; case 3: *h = p; *s = q; *v = value; break; case 4: *h = t; *s = p; *v = value; break; case 5: *h = value; *s = p; *v = q; break; default: g_assert_not_reached (); break; } } } static void inf_text_gtk_update_tag_color(InfTextGtkBuffer* buffer, GtkTextTag* tag, InfTextUser* user) { InfTextGtkBufferPrivate* priv; gdouble hue; gdouble saturation; gdouble value; GdkColor color; priv = INF_TEXT_GTK_BUFFER_PRIVATE(buffer); hue = inf_text_user_get_hue(user); saturation = priv->saturation; value = priv->value; hsv_to_rgb(&hue, &saturation, &value); color.red = hue * 0xffff; color.green = saturation * 0xffff; color.blue = value * 0xffff; g_object_set(G_OBJECT(tag), "background-gdk", &color, NULL); } static void inf_text_gtk_user_notify_hue_cb(GObject* object, GParamSpec* pspec, gpointer user_data) { InfTextGtkBuffer* buffer; InfTextGtkBufferPrivate* priv; guint user_id; InfTextGtkBufferUserTags* tags; buffer = INF_TEXT_GTK_BUFFER(user_data); priv = INF_TEXT_GTK_BUFFER_PRIVATE(buffer); user_id = inf_user_get_id(INF_USER(object)); tags = g_hash_table_lookup(priv->user_tags, GUINT_TO_POINTER(user_id)); g_assert(tags != NULL && tags->colored_tag != NULL); inf_text_gtk_update_tag_color( buffer, tags->colored_tag, INF_TEXT_USER(object) ); } static void inf_text_gtk_buffer_user_tags_free(gpointer user_tags) { InfTextGtkBufferUserTags* tags; tags = (InfTextGtkBufferUserTags*)user_tags; if(tags->colored_tag) { inf_signal_handlers_disconnect_by_func( tags->user, G_CALLBACK(inf_text_gtk_user_notify_hue_cb), tags->buffer ); g_object_unref(tags->colored_tag); } if(tags->colorless_tag) g_object_unref(tags->colorless_tag); g_slice_free(InfTextGtkBufferUserTags, tags); } static InfTextGtkBufferUserTags* inf_text_gtk_buffer_get_user_tags(InfTextGtkBuffer* buffer, guint user_id) { InfTextGtkBufferPrivate* priv; InfTextGtkBufferUserTags* tags; InfUser* user; priv = INF_TEXT_GTK_BUFFER_PRIVATE(buffer); if(user_id == 0) return NULL; tags = g_hash_table_lookup(priv->user_tags, GUINT_TO_POINTER(user_id)); if(tags != NULL) { return tags; } else { user = inf_user_table_lookup_user_by_id(priv->user_table, user_id); g_assert(INF_TEXT_IS_USER(user)); tags = g_slice_new(InfTextGtkBufferUserTags); tags->buffer = buffer; tags->user = INF_TEXT_USER(user); tags->colored_tag = NULL; tags->colorless_tag = NULL; g_hash_table_insert(priv->user_tags, GUINT_TO_POINTER(user_id), tags); return tags; } } static GtkTextTag* inf_text_gtk_buffer_get_user_tag(InfTextGtkBuffer* buffer, InfTextGtkBufferUserTags* user_tags, gboolean colored) { InfTextGtkBufferPrivate* priv; GtkTextTagTable* table; GtkTextTag** tag; gchar* tag_name; guint user_id; const gchar* colorstr; priv = INF_TEXT_GTK_BUFFER_PRIVATE(buffer); tag = colored ? &user_tags->colored_tag : &user_tags->colorless_tag; if(*tag != NULL) return *tag; user_id = 0; if(user_tags->user != NULL) user_id = inf_user_get_id(INF_USER(user_tags->user)); colorstr = colored ? "colored" : "colorless"; tag_name = g_strdup_printf("inftextgtk-user-%s-%u", colorstr, user_id); *tag = gtk_text_tag_new(tag_name); g_free(tag_name); table = gtk_text_buffer_get_tag_table(priv->buffer); gtk_text_tag_table_add(table, *tag); /* Set lowest priority for author tags, so GtkSourceView's bracket * matching highlight tags and highlight of FIXME and such in comments is * shown instead of the user color. */ gtk_text_tag_set_priority(*tag, 0); g_object_set_qdata( G_OBJECT(*tag), inf_text_gtk_buffer_tag_user_quark, user_tags->user ); if(colored) { g_signal_connect( G_OBJECT(user_tags->user), "notify::hue", G_CALLBACK(inf_text_gtk_user_notify_hue_cb), buffer ); inf_text_gtk_update_tag_color(buffer, *tag, user_tags->user); } return *tag; } static InfTextUser* inf_text_gtk_buffer_author_from_tag(GtkTextTag* tag) { gpointer author_ptr; author_ptr = g_object_get_qdata( G_OBJECT(tag), inf_text_gtk_buffer_tag_user_quark ); return INF_TEXT_USER(author_ptr); } static InfTextUser* inf_text_gtk_buffer_iter_list_contains_author_tag(GSList* tag_list) { GSList* item; InfTextUser* author; for(item = tag_list; item != NULL; item = g_slist_next(item)) { author = inf_text_gtk_buffer_author_from_tag(GTK_TEXT_TAG(item->data)); if(author != NULL) return author; } return NULL; } static InfTextUser* inf_text_gtk_buffer_iter_get_author(GtkTextIter* location) { GSList* tag_list; InfTextUser* author; tag_list = gtk_text_iter_get_tags(location); author = inf_text_gtk_buffer_iter_list_contains_author_tag(tag_list); g_slist_free(tag_list); return author; } static gboolean inf_text_gtk_buffer_iter_is_author_toggle(const GtkTextIter* iter, InfTextUser** toggled_on, InfTextUser** toggled_off) { GSList* tag_list; InfTextUser* author_on; InfTextUser* author_off; tag_list = gtk_text_iter_get_toggled_tags(iter, TRUE); author_on = inf_text_gtk_buffer_iter_list_contains_author_tag(tag_list); g_slist_free(tag_list); /* We need to check both the tags that are toggled on and the tags that * are toggled off at this point, because text that is not written by * anyone specific (author NULL) does not count as author tag. */ if(author_on == NULL || toggled_off != NULL) { tag_list = gtk_text_iter_get_toggled_tags(iter, FALSE); author_off = inf_text_gtk_buffer_iter_list_contains_author_tag(tag_list); g_slist_free(tag_list); } if(author_on == NULL && author_off == NULL) if(!gtk_text_iter_is_start(iter) && !gtk_text_iter_is_end(iter)) return FALSE; if(toggled_on) *toggled_on = author_on; if(toggled_off) *toggled_off = author_off; return TRUE; } static void inf_text_gtk_buffer_iter_next_author_toggle(GtkTextIter* iter, InfTextUser** user_on, InfTextUser** user_off) { gboolean is_author_toggle; do { gtk_text_iter_forward_to_tag_toggle(iter, NULL); is_author_toggle = inf_text_gtk_buffer_iter_is_author_toggle( iter, user_on, user_off ); } while(!is_author_toggle); } static void inf_text_gtk_buffer_iter_prev_author_toggle(GtkTextIter* iter, InfTextUser** user_on, InfTextUser** user_off) { gboolean is_author_toggle; do { gtk_text_iter_backward_to_tag_toggle(iter, NULL); is_author_toggle = inf_text_gtk_buffer_iter_is_author_toggle( iter, user_on, user_off ); } while(!is_author_toggle); } static void inf_text_gtk_buffer_ensure_author_tags_priority_foreach_func(GtkTextTag* tag, gpointer data) { InfTextUser* author; author = inf_text_gtk_buffer_author_from_tag(tag); if(author != NULL) gtk_text_tag_set_priority(tag, 0); } static void inf_text_gtk_buffer_set_saturation_value_tag_table_foreach_func(GtkTextTag* t, gpointer data) { InfTextGtkBuffer* buffer; InfTextGtkBufferPrivate* priv; InfTextUser* author; buffer = INF_TEXT_GTK_BUFFER(data); priv = INF_TEXT_GTK_BUFFER_PRIVATE(buffer); author = inf_text_gtk_buffer_author_from_tag(t); if(author != NULL) inf_text_gtk_update_tag_color(buffer, t, author); } /* Required by inf_text_gtk_buffer_record_signal() and * inf_text_gtk_buffer_mark_set_cb() */ static void inf_text_gtk_buffer_active_user_selection_changed_cb(InfTextUser* user, guint position, gint length, gboolean by_request, gpointer user_data); /* Required by inf_text_gtk_buffer_record_signal() and * inf_text_gtk_buffer_mark_set_cb() */ static void inf_text_gtk_buffer_active_user_notify_status_cb(GObject* object, GParamSpec* pspec, gpointer user_data); static void inf_text_gtk_buffer_apply_tag_cb(GtkTextBuffer* gtk_buffer, GtkTextTag* tag, GtkTextIter* start, GtkTextIter* end, gpointer user_data) { /* Don't allow author tags to be applied by default. GTK+ seems to do this * when copy+pasting text from the text buffer itself, but we want to make * sure that a given segment of text has always a unique author set. */ if(inf_text_gtk_buffer_author_from_tag(tag) != NULL) g_signal_stop_emission_by_name(G_OBJECT(gtk_buffer), "apply-tag"); } static void inf_text_gtk_buffer_buffer_insert_text_tag_table_foreach_func(GtkTextTag* tag, gpointer data) { InfTextGtkBufferTagRemove* tag_remove; tag_remove = (InfTextGtkBufferTagRemove*)data; if(tag_remove->ignore_tags == NULL || (tag != tag_remove->ignore_tags->colored_tag && tag != tag_remove->ignore_tags->colorless_tag)) { gtk_text_buffer_remove_tag( tag_remove->buffer, tag, &tag_remove->begin_iter, &tag_remove->end_iter ); } } /* Record tracking: * This is to allow and correctly handle nested emissions of GtkTextBuffer's * insert-text/delete-range signals. The text-inserted and text-erased * signals of InfTextBuffer need to be emitted right after the operation was * applied to the buffer which is why we need some bookkeeping here. */ #ifndef G_DISABLE_ASSERT /* Check whether the top record has been applied correctly to the buffer */ static gboolean inf_text_gtk_buffer_record_check(InfTextGtkBuffer* buffer, InfTextGtkBufferRecord* record) { InfTextGtkBufferPrivate* priv; InfTextChunk* chunk; guint text_len; guint buf_len; gpointer buf_text; gpointer chunk_text; gsize buf_bytes; gsize chunk_bytes; int result; priv = INF_TEXT_GTK_BUFFER_PRIVATE(buffer); text_len = inf_text_chunk_get_length(record->chunk); buf_len = gtk_text_buffer_get_char_count(priv->buffer); /* We can only check insertions */ if(record->insert) { if(record->char_count + text_len != buf_len) return FALSE; if(record->position + text_len > buf_len) return FALSE; chunk = inf_text_buffer_get_slice( INF_TEXT_BUFFER(buffer), record->position, text_len ); buf_text = inf_text_chunk_get_text(record->chunk, &buf_bytes); chunk_text = inf_text_chunk_get_text(chunk, &chunk_bytes); inf_text_chunk_free(chunk); if(buf_bytes == chunk_bytes) result = memcmp(buf_text, chunk_text, buf_bytes); else result = -1; g_free(buf_text); g_free(chunk_text); if(result != 0) return FALSE; } else { if(text_len > record->char_count) return FALSE; if(record->char_count - text_len != buf_len) return FALSE; } return TRUE; } #endif static void inf_text_gtk_buffer_record_transform(InfTextGtkBufferRecord* record, InfTextGtkBufferRecord* against) { guint record_len; guint against_len; /* What we do here is common sense; in fact this depends on how * insert-text/delete-range signal handlers do revalidation of iters if * they insert/erase text themselves. We rely on them doing it exactly * this way currently, otherwise we cannot identify new/erased text to * emit text-inserted/text-erased for, resulting in new/erased text not * being transmitted to remote users, in turn resulting in lost session * consistency. This is why the inf_text_gtk_buffer_record_check() * check will fail if this happens. */ g_assert(record->applied == FALSE); g_assert(against->applied == TRUE); record_len = inf_text_chunk_get_length(record->chunk); against_len = inf_text_chunk_get_length(against->chunk); if(record->insert && against->insert) { if(record->position >= against->position) record->position += against_len; } else if(record->insert && !against->insert) { if(record->position >= against->position + against_len) record->position -= against_len; else if(record->position >= against->position) record->position = against->position; } else if(!record->insert && against->insert) { if(record->position >= against->position) { record->position += against->position; } else if(record->position < against->position && record->position + record_len > against->position) { /* Add text right into deletion range... */ inf_text_chunk_insert_chunk( record->chunk, against->position - record->position, against->chunk ); } } else if(!record->insert && !against->insert) { if(against->position + against_len <= record->position + record_len) { record->position -= against_len; } else if(against->position + against_len > record->position && against->position + against_len <= record->position + record_len) { record->position = against->position; inf_text_chunk_erase( record->chunk, 0, against->position + against_len - record->position ); } else if(against->position <= record->position && against->position + against_len >= record->position + record_len) { record->position = against->position; inf_text_chunk_erase( record->chunk, 0, inf_text_chunk_get_length(record->chunk) ); } else if(against->position >= record->position && against->position + against_len <= record->position + record_len) { inf_text_chunk_erase( record->chunk, against->position - record->position, inf_text_chunk_get_length(against->chunk) ); } else if(against->position >= record->position && against->position + against_len >= record->position + record_len) { inf_text_chunk_erase( record->chunk, against->position - record->position, record->position + record_len - against->position ); } } /* Revalidate char count */ if(against->insert) { record->char_count += against_len; } else { g_assert(record->char_count >= against_len); record->char_count -= against_len; } } static void inf_text_gtk_buffer_record_signal(InfTextGtkBuffer* buffer, InfTextGtkBufferRecord* record) { InfTextGtkBufferPrivate* priv; InfTextGtkBufferRecord* rec; InfTextGtkBufferTagRemove tag_remove; GtkTextTag* tag; priv = INF_TEXT_GTK_BUFFER_PRIVATE(buffer); g_assert(priv->active_user != NULL); g_assert(record->applied == FALSE); g_assert(inf_text_gtk_buffer_record_check(buffer, record)); record->applied = TRUE; for(rec = record->next; rec != NULL; rec = rec->next) if(!rec->applied) inf_text_gtk_buffer_record_transform(rec->next, record); if(record->insert) { /* Allow author tag changes within this function: */ inf_signal_handlers_block_by_func( G_OBJECT(priv->buffer), G_CALLBACK(inf_text_gtk_buffer_apply_tag_cb), buffer ); /* Tag the inserted text with the user's color */ tag_remove.buffer = priv->buffer; tag_remove.ignore_tags = inf_text_gtk_buffer_get_user_tags( buffer, inf_user_get_id(INF_USER(priv->active_user)) ); g_assert(tag_remove.ignore_tags != NULL); tag = inf_text_gtk_buffer_get_user_tag( buffer, tag_remove.ignore_tags, priv->show_user_colors ); /* Remove other user tags, if any */ gtk_text_buffer_get_iter_at_offset( priv->buffer, &tag_remove.begin_iter, record->position ); gtk_text_buffer_get_iter_at_offset( priv->buffer, &tag_remove.end_iter, record->position + inf_text_chunk_get_length(record->chunk) ); gtk_text_tag_table_foreach( gtk_text_buffer_get_tag_table(tag_remove.buffer), inf_text_gtk_buffer_buffer_insert_text_tag_table_foreach_func, &tag_remove ); /* Apply tag for this particular user */ gtk_text_buffer_apply_tag( priv->buffer, tag, &tag_remove.begin_iter, &tag_remove.end_iter ); /* Allow author tag changes within this function: */ inf_signal_handlers_unblock_by_func( G_OBJECT(priv->buffer), G_CALLBACK(inf_text_gtk_buffer_apply_tag_cb), buffer ); } /* Block the notify_status signal handler of the active user. That signal * handler syncs the cursor position of the user to the insertion mark of * the TextBuffer when the user becomes active again. However, when we * insert or erase text, then this will be updated anyway. */ inf_signal_handlers_block_by_func( G_OBJECT(priv->active_user), G_CALLBACK(inf_text_gtk_buffer_active_user_notify_status_cb), buffer ); /* Block selection-changed of active user. This would try to resync the * buffer markers, but GtkTextBuffer already did this for us. */ inf_signal_handlers_block_by_func( G_OBJECT(priv->active_user), G_CALLBACK(inf_text_gtk_buffer_active_user_selection_changed_cb), buffer ); if(record->insert) { inf_text_buffer_text_inserted( INF_TEXT_BUFFER(buffer), record->position, record->chunk, INF_USER(priv->active_user) ); } else { inf_text_buffer_text_erased( INF_TEXT_BUFFER(buffer), record->position, record->chunk, INF_USER(priv->active_user) ); } inf_signal_handlers_unblock_by_func( G_OBJECT(priv->active_user), G_CALLBACK(inf_text_gtk_buffer_active_user_notify_status_cb), buffer ); inf_signal_handlers_unblock_by_func( G_OBJECT(priv->active_user), G_CALLBACK(inf_text_gtk_buffer_active_user_selection_changed_cb), buffer ); } static void inf_text_gtk_buffer_push_record(InfTextGtkBuffer* buffer, gboolean insert, guint position, InfTextChunk* chunk) { InfTextGtkBufferPrivate* priv; InfTextGtkBufferRecord* rec; priv = INF_TEXT_GTK_BUFFER_PRIVATE(buffer); rec = priv->record; priv->record = g_slice_new(InfTextGtkBufferRecord); priv->record->insert = insert; priv->record->char_count = gtk_text_buffer_get_char_count(priv->buffer); priv->record->position = position; priv->record->chunk = chunk; priv->record->applied = FALSE; priv->record->next = rec; /* It is enough to check whether the top record was applied to the buffer, * since, for previous records we would have been notified in a previous * callback already. */ if(rec != NULL && rec->applied == FALSE) { /* If char count differs then the previous record has already been applied * (that is the default handler ran but not our after handler, so * probably another after handler inserted new text). */ /* TODO: This does not work if length of record is zero */ if(rec->char_count != (guint)gtk_text_buffer_get_char_count(priv->buffer)) { /* This record has been applied already, so signal. */ inf_text_gtk_buffer_record_signal(buffer, rec); #ifndef G_ASSERT_DISABLED /* Outer records would already have been signalled by previous signal * handler invocations if they were applied. */ for(; rec != NULL; rec = rec->next) { g_assert( rec->applied == TRUE || rec->char_count == (guint)gtk_text_buffer_get_char_count(priv->buffer) ); } #endif } } } static void inf_text_gtk_buffer_pop_record(InfTextGtkBuffer* buffer) { InfTextGtkBufferPrivate* priv; InfTextGtkBufferRecord* rec; guint char_count; guint length; priv = INF_TEXT_GTK_BUFFER_PRIVATE(buffer); g_assert(priv->record != NULL); if(!priv->record->applied) { length = inf_text_chunk_get_length(priv->record->chunk); char_count = gtk_text_buffer_get_char_count(priv->buffer); if(priv->record->insert) { g_assert(priv->record->char_count + length == char_count); } else { g_assert(priv->record->char_count >= length); g_assert(priv->record->char_count - length == char_count); } /* Signal application */ inf_text_gtk_buffer_record_signal(buffer, priv->record); } rec = priv->record; priv->record = rec->next; inf_text_chunk_free(rec->chunk); g_slice_free(InfTextGtkBufferRecord, rec); } static void inf_text_gtk_buffer_insert_text_cb_before(GtkTextBuffer* gtk_buffer, GtkTextIter* location, gchar* text, gint len, gpointer user_data) { InfTextGtkBuffer* buffer; InfTextGtkBufferPrivate* priv; InfTextChunk* chunk; buffer = INF_TEXT_GTK_BUFFER(user_data); priv = INF_TEXT_GTK_BUFFER_PRIVATE(buffer); g_assert(priv->active_user != NULL); chunk = inf_text_chunk_new("UTF-8"); inf_text_chunk_insert_text( chunk, 0, text, len, g_utf8_strlen(text, len), inf_user_get_id(INF_USER(priv->active_user)) ); inf_text_gtk_buffer_push_record( buffer, TRUE, gtk_text_iter_get_offset(location), chunk ); } static void inf_text_gtk_buffer_insert_text_cb_after(GtkTextBuffer* gtk_buffer, GtkTextIter* location, gchar* text, gint len, gpointer user_data) { InfTextGtkBuffer* buffer; InfTextGtkBufferPrivate* priv; gpointer rec_text; gsize bytes; buffer = INF_TEXT_GTK_BUFFER(user_data); priv = INF_TEXT_GTK_BUFFER_PRIVATE(buffer); g_assert(priv->record != NULL); g_assert(priv->record->insert == TRUE); #ifndef G_ASSERT_DISABLED if(priv->record->applied == FALSE) { g_assert( priv->record->position + inf_text_chunk_get_length(priv->record->chunk) == (guint)gtk_text_iter_get_offset(location) ); rec_text = inf_text_chunk_get_text(priv->record->chunk, &bytes); g_assert(bytes == (gsize)len); g_assert(memcmp(text, rec_text, bytes) == 0); g_free(rec_text); } #endif inf_text_gtk_buffer_pop_record(buffer); } static void inf_text_gtk_buffer_delete_range_cb_before(GtkTextBuffer* gtk_buffer, GtkTextIter* begin, GtkTextIter* end, gpointer user_data) { InfTextGtkBuffer* buffer; InfTextGtkBufferPrivate* priv; guint begin_offset; guint end_offset; InfTextChunk* chunk; buffer = INF_TEXT_GTK_BUFFER(user_data); priv = INF_TEXT_GTK_BUFFER_PRIVATE(buffer); begin_offset = gtk_text_iter_get_offset(begin); end_offset = gtk_text_iter_get_offset(end); chunk = inf_text_buffer_get_slice( INF_TEXT_BUFFER(buffer), begin_offset, end_offset - begin_offset ); inf_text_gtk_buffer_push_record(buffer, FALSE, begin_offset, chunk); } static void inf_text_gtk_buffer_delete_range_cb_after(GtkTextBuffer* gtk_buffer, GtkTextIter* begin, GtkTextIter* end, gpointer user_data) { InfTextGtkBuffer* buffer; InfTextGtkBufferPrivate* priv; buffer = INF_TEXT_GTK_BUFFER(user_data); priv = INF_TEXT_GTK_BUFFER_PRIVATE(buffer); g_assert(priv->record != NULL); g_assert(priv->record->insert == FALSE); g_assert(priv->record->applied == TRUE || priv->record->position == (guint)gtk_text_iter_get_offset(begin)); inf_text_gtk_buffer_pop_record(buffer); } static void inf_text_gtk_buffer_mark_set_cb(GtkTextBuffer* gtk_buffer, GtkTextIter* location, GtkTextMark* mark, gpointer user_data) { InfTextGtkBuffer* buffer; InfTextGtkBufferPrivate* priv; GtkTextMark* insert_mark; GtkTextMark* sel_mark; GtkTextIter insert_iter; GtkTextIter sel_iter; guint offset; int sel; buffer = INF_TEXT_GTK_BUFFER(user_data); priv = INF_TEXT_GTK_BUFFER_PRIVATE(buffer); insert_mark = gtk_text_buffer_get_insert(gtk_buffer); sel_mark = gtk_text_buffer_get_selection_bound(gtk_buffer); if( (mark == insert_mark || mark == sel_mark) && priv->active_user != NULL) { /* Don't send status updates for inactive users as these would make it * active. Instead, we send one update when the user becomes active * again. */ if(inf_user_get_status(INF_USER(priv->active_user)) == INF_USER_ACTIVE || priv->wake_on_cursor_movement == TRUE) { gtk_text_buffer_get_iter_at_mark(gtk_buffer, &insert_iter, insert_mark); gtk_text_buffer_get_iter_at_mark(gtk_buffer, &sel_iter, sel_mark); offset = gtk_text_iter_get_offset(&insert_iter); sel = gtk_text_iter_get_offset(&sel_iter) - offset; if(inf_text_user_get_caret_position(priv->active_user) != offset || inf_text_user_get_selection_length(priv->active_user) != sel) { /* Block the notify_status signal handler of the active user. That * signal handler syncs the cursor position of the user to the * insertion mark of the TextBuffer when the user becomes active * again. However, when we move the cursor, then this will be updated * anyway. */ inf_signal_handlers_block_by_func( G_OBJECT(priv->active_user), G_CALLBACK(inf_text_gtk_buffer_active_user_notify_status_cb), buffer ); inf_signal_handlers_block_by_func( G_OBJECT(priv->active_user), G_CALLBACK(inf_text_gtk_buffer_active_user_selection_changed_cb), buffer ); inf_text_user_set_selection(priv->active_user, offset, sel, TRUE); inf_signal_handlers_unblock_by_func( G_OBJECT(priv->active_user), G_CALLBACK(inf_text_gtk_buffer_active_user_notify_status_cb), buffer ); inf_signal_handlers_unblock_by_func( G_OBJECT(priv->active_user), G_CALLBACK(inf_text_gtk_buffer_active_user_selection_changed_cb), buffer ); } } } } static void inf_text_gtk_buffer_active_user_notify_status_cb(GObject* object, GParamSpec* pspec, gpointer user_data) { InfTextGtkBuffer* buffer; InfTextGtkBufferPrivate* priv; GtkTextMark* insert_mark; GtkTextMark* sel_mark; GtkTextIter insert_iter; GtkTextIter sel_iter; guint offset; int sel; buffer = INF_TEXT_GTK_BUFFER(user_data); priv = INF_TEXT_GTK_BUFFER_PRIVATE(buffer); g_assert(INF_TEXT_USER(object) == priv->active_user); switch(inf_user_get_status(INF_USER(object))) { case INF_USER_ACTIVE: /* User became active: Sync user selection and the insertion mark of the * TextBuffer. They can get out of sync while the user is inactive, and * wake-on-cursor-movement is FALSE. For example text can be selected in * an inactive document, and then the user decides to select something * else, erasing the previous selection. */ insert_mark = gtk_text_buffer_get_insert(priv->buffer); sel_mark = gtk_text_buffer_get_selection_bound(priv->buffer); gtk_text_buffer_get_iter_at_mark(priv->buffer, &insert_iter, insert_mark); gtk_text_buffer_get_iter_at_mark(priv->buffer, &sel_iter, sel_mark); offset = gtk_text_iter_get_offset(&insert_iter); sel = gtk_text_iter_get_offset(&sel_iter) - offset; if(inf_text_user_get_caret_position(priv->active_user) != offset || inf_text_user_get_selection_length(priv->active_user) != sel) { inf_signal_handlers_block_by_func( G_OBJECT(priv->active_user), G_CALLBACK(inf_text_gtk_buffer_active_user_selection_changed_cb), buffer ); inf_text_user_set_selection(priv->active_user, offset, sel, TRUE); inf_signal_handlers_unblock_by_func( G_OBJECT(priv->active_user), G_CALLBACK(inf_text_gtk_buffer_active_user_selection_changed_cb), buffer ); } break; case INF_USER_UNAVAILABLE: /* TODO: Do we want to unset the active-user automatically here? */ break; default: /* Not of interest. */ break; } } static void inf_text_gtk_buffer_active_user_selection_changed_cb(InfTextUser* user, guint position, gint selection_length, gboolean by_request, gpointer user_data) { InfTextGtkBuffer* buffer; InfTextGtkBufferPrivate* priv; GtkTextIter insert; GtkTextIter selection_bound; buffer = INF_TEXT_GTK_BUFFER(user_data); priv = INF_TEXT_GTK_BUFFER_PRIVATE(buffer); inf_signal_handlers_block_by_func( G_OBJECT(priv->buffer), G_CALLBACK(inf_text_gtk_buffer_mark_set_cb), buffer ); gtk_text_buffer_get_iter_at_offset(priv->buffer, &insert, position); gtk_text_buffer_get_iter_at_offset( priv->buffer, &selection_bound, position + selection_length ); gtk_text_buffer_select_range(priv->buffer, &insert, &selection_bound); inf_signal_handlers_unblock_by_func( G_OBJECT(priv->buffer), G_CALLBACK(inf_text_gtk_buffer_mark_set_cb), buffer ); } static void inf_text_gtk_buffer_modified_changed_cb(GtkTextBuffer* buffer, gpointer user_data) { g_object_notify(G_OBJECT(user_data), "modified"); } static void inf_text_gtk_buffer_set_modified(InfTextGtkBuffer* buffer, gboolean modified) { InfTextGtkBufferPrivate* priv; priv = INF_TEXT_GTK_BUFFER_PRIVATE(buffer); if(priv->buffer != NULL) { inf_signal_handlers_block_by_func( G_OBJECT(priv->buffer), G_CALLBACK(inf_text_gtk_buffer_modified_changed_cb), buffer ); gtk_text_buffer_set_modified(priv->buffer, modified); inf_signal_handlers_unblock_by_func( G_OBJECT(priv->buffer), G_CALLBACK(inf_text_gtk_buffer_modified_changed_cb), buffer ); g_object_notify(G_OBJECT(buffer), "modified"); } } static void inf_text_gtk_buffer_set_buffer(InfTextGtkBuffer* buffer, GtkTextBuffer* gtk_buffer) { InfTextGtkBufferPrivate* priv; priv = INF_TEXT_GTK_BUFFER_PRIVATE(buffer); if(priv->buffer != NULL) { inf_signal_handlers_disconnect_by_func( G_OBJECT(priv->buffer), G_CALLBACK(inf_text_gtk_buffer_apply_tag_cb), buffer ); inf_signal_handlers_disconnect_by_func( G_OBJECT(priv->buffer), G_CALLBACK(inf_text_gtk_buffer_insert_text_cb_before), buffer ); inf_signal_handlers_disconnect_by_func( G_OBJECT(priv->buffer), G_CALLBACK(inf_text_gtk_buffer_insert_text_cb_after), buffer ); inf_signal_handlers_disconnect_by_func( G_OBJECT(priv->buffer), G_CALLBACK(inf_text_gtk_buffer_delete_range_cb_before), buffer ); inf_signal_handlers_disconnect_by_func( G_OBJECT(priv->buffer), G_CALLBACK(inf_text_gtk_buffer_delete_range_cb_after), buffer ); inf_signal_handlers_disconnect_by_func( G_OBJECT(priv->buffer), G_CALLBACK(inf_text_gtk_buffer_mark_set_cb), buffer ); inf_signal_handlers_disconnect_by_func( G_OBJECT(priv->buffer), G_CALLBACK(inf_text_gtk_buffer_modified_changed_cb), buffer ); g_object_unref(G_OBJECT(priv->buffer)); } priv->buffer = gtk_buffer; if(gtk_buffer != NULL) { g_object_ref(G_OBJECT(gtk_buffer)); g_signal_connect( G_OBJECT(gtk_buffer), "apply-tag", G_CALLBACK(inf_text_gtk_buffer_apply_tag_cb), buffer ); g_signal_connect( G_OBJECT(gtk_buffer), "insert-text", G_CALLBACK(inf_text_gtk_buffer_insert_text_cb_before), buffer ); g_signal_connect_after( G_OBJECT(gtk_buffer), "insert-text", G_CALLBACK(inf_text_gtk_buffer_insert_text_cb_after), buffer ); g_signal_connect( G_OBJECT(gtk_buffer), "delete-range", G_CALLBACK(inf_text_gtk_buffer_delete_range_cb_before), buffer ); g_signal_connect_after( G_OBJECT(gtk_buffer), "delete-range", G_CALLBACK(inf_text_gtk_buffer_delete_range_cb_after), buffer ); g_signal_connect_after( G_OBJECT(gtk_buffer), "mark-set", G_CALLBACK(inf_text_gtk_buffer_mark_set_cb), buffer ); g_signal_connect_after( G_OBJECT(gtk_buffer), "modified-changed", G_CALLBACK(inf_text_gtk_buffer_modified_changed_cb), buffer ); } g_object_notify(G_OBJECT(buffer), "buffer"); /* TODO: Notify modified, if it changed */ } static void inf_text_gtk_buffer_init(GTypeInstance* instance, gpointer g_class) { InfTextGtkBuffer* buffer; InfTextGtkBufferPrivate* priv; buffer = INF_TEXT_GTK_BUFFER(instance); priv = INF_TEXT_GTK_BUFFER_PRIVATE(buffer); priv->buffer = NULL; priv->user_table = NULL; priv->user_tags = g_hash_table_new_full( NULL, NULL, NULL, inf_text_gtk_buffer_user_tags_free ); priv->show_user_colors = TRUE; priv->active_user = NULL; priv->wake_on_cursor_movement = FALSE; priv->saturation = 0.35; priv->value = 1.0; } static void inf_text_gtk_buffer_dispose(GObject* object) { InfTextGtkBuffer* buffer; InfTextGtkBufferPrivate* priv; buffer = INF_TEXT_GTK_BUFFER(object); priv = INF_TEXT_GTK_BUFFER_PRIVATE(buffer); g_hash_table_remove_all(priv->user_tags); inf_text_gtk_buffer_set_buffer(buffer, NULL); inf_text_gtk_buffer_set_active_user(buffer, NULL); g_object_unref(priv->user_table); G_OBJECT_CLASS(parent_class)->dispose(object); } static void inf_text_gtk_buffer_finalize(GObject* object) { InfTextGtkBuffer* buffer; InfTextGtkBufferPrivate* priv; buffer = INF_TEXT_GTK_BUFFER(object); priv = INF_TEXT_GTK_BUFFER_PRIVATE(buffer); g_hash_table_unref(priv->user_tags); G_OBJECT_CLASS(parent_class)->finalize(object); } static void inf_text_gtk_buffer_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec) { InfTextGtkBuffer* buffer; InfTextGtkBufferPrivate* priv; buffer = INF_TEXT_GTK_BUFFER(object); priv = INF_TEXT_GTK_BUFFER_PRIVATE(buffer); switch(prop_id) { case PROP_BUFFER: g_assert(priv->buffer == NULL); /* construct only */ inf_text_gtk_buffer_set_buffer( buffer, GTK_TEXT_BUFFER(g_value_get_object(value)) ); break; case PROP_USER_TABLE: g_assert(priv->user_table == NULL); /* construct/only */ priv->user_table = INF_USER_TABLE(g_value_dup_object(value)); break; case PROP_ACTIVE_USER: inf_text_gtk_buffer_set_active_user( buffer, INF_TEXT_USER(g_value_get_object(value)) ); break; case PROP_WAKE_ON_CURSOR_MOVEMENT: priv->wake_on_cursor_movement = g_value_get_boolean(value); break; case PROP_SHOW_USER_COLORS: priv->show_user_colors = g_value_get_boolean(value); break; case PROP_MODIFIED: inf_text_gtk_buffer_set_modified(buffer, g_value_get_boolean(value)); break; case PROP_SATURATION: inf_text_gtk_buffer_set_saturation_value( buffer, g_value_get_double(value), priv->value ); break; case PROP_VALUE: inf_text_gtk_buffer_set_saturation_value( buffer, priv->saturation, g_value_get_double(value) ); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void inf_text_gtk_buffer_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec) { InfTextGtkBuffer* buffer; InfTextGtkBufferPrivate* priv; buffer = INF_TEXT_GTK_BUFFER(object); priv = INF_TEXT_GTK_BUFFER_PRIVATE(buffer); switch(prop_id) { case PROP_BUFFER: g_value_set_object(value, G_OBJECT(priv->buffer)); break; case PROP_USER_TABLE: g_value_set_object(value, G_OBJECT(priv->user_table)); break; case PROP_ACTIVE_USER: g_value_set_object(value, G_OBJECT(priv->active_user)); break; case PROP_WAKE_ON_CURSOR_MOVEMENT: g_value_set_boolean(value, priv->wake_on_cursor_movement); break; case PROP_SHOW_USER_COLORS: g_value_set_boolean(value, priv->show_user_colors); break; case PROP_MODIFIED: if(priv->buffer != NULL) g_value_set_boolean(value, gtk_text_buffer_get_modified(priv->buffer)); else g_value_set_boolean(value, FALSE); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static gboolean inf_text_gtk_buffer_buffer_get_modified(InfBuffer* buffer) { InfTextGtkBuffer* gtk_buffer; InfTextGtkBufferPrivate* priv; gtk_buffer = INF_TEXT_GTK_BUFFER(buffer); priv = INF_TEXT_GTK_BUFFER_PRIVATE(gtk_buffer); if(priv->buffer != NULL) return gtk_text_buffer_get_modified(priv->buffer); else return FALSE; } static void inf_text_gtk_buffer_buffer_set_modified(InfBuffer* buffer, gboolean modified) { inf_text_gtk_buffer_set_modified(INF_TEXT_GTK_BUFFER(buffer), modified); } static const gchar* inf_text_gtk_buffer_buffer_get_encoding(InfTextBuffer* buffer) { return "UTF-8"; } static guint inf_text_gtk_buffer_get_length(InfTextBuffer* buffer) { InfTextGtkBufferPrivate* priv; priv = INF_TEXT_GTK_BUFFER_PRIVATE(buffer); return gtk_text_buffer_get_char_count(priv->buffer); } static InfTextChunk* inf_text_gtk_buffer_buffer_get_slice(InfTextBuffer* buffer, guint pos, guint len) { InfTextGtkBufferPrivate* priv; GtkTextIter begin; GtkTextIter iter; InfTextChunk* result; guint remaining; guint size; InfTextUser* author; gchar* text; priv = INF_TEXT_GTK_BUFFER_PRIVATE(buffer); gtk_text_buffer_get_iter_at_offset(priv->buffer, &iter, pos); result = inf_text_chunk_new("UTF-8"); remaining = len; while(remaining > 0) { /* This indicates invalid length */ g_assert(gtk_text_iter_is_end(&iter) == FALSE); begin = iter; inf_text_gtk_buffer_iter_next_author_toggle(&iter, NULL, &author); size = gtk_text_iter_get_offset(&iter) - gtk_text_iter_get_offset(&begin); /* Not the whole segment if region to slice ends before segment end */ if(size > remaining) { size = remaining; iter = begin; gtk_text_iter_forward_chars(&iter, size); } text = gtk_text_buffer_get_slice(priv->buffer, &begin, &iter, TRUE); /* TODO: Faster inf_text_chunk_append that optionally eats text */ inf_text_chunk_insert_text( result, len - remaining, text, strlen(text), /* I hate strlen. GTK+ should tell us how many bytes. */ size, (author == NULL) ? 0 : inf_user_get_id(INF_USER(author)) ); remaining -= size; g_free(text); } return result; } static void inf_text_gtk_buffer_buffer_insert_text(InfTextBuffer* buffer, guint pos, InfTextChunk* chunk, InfUser* user) { InfTextGtkBufferPrivate* priv; InfTextChunkIter chunk_iter; InfTextGtkBufferTagRemove tag_remove; GtkTextTag* tag; GtkTextMark* mark; GtkTextIter insert_iter; gboolean insert_at_cursor; gboolean insert_at_selection_bound; priv = INF_TEXT_GTK_BUFFER_PRIVATE(buffer); tag_remove.buffer = priv->buffer; /* This would have to be handled separately, but I think this is unlikely * to happen anyway. If it does happen then we would again need to rely on * iterator revalidation to happen in the way we expect it. */ g_assert(priv->record == NULL); /* Allow author tag changes within this function: */ inf_signal_handlers_block_by_func( G_OBJECT(priv->buffer), G_CALLBACK(inf_text_gtk_buffer_apply_tag_cb), buffer ); inf_signal_handlers_block_by_func( G_OBJECT(priv->buffer), G_CALLBACK(inf_text_gtk_buffer_insert_text_cb_before), buffer ); inf_signal_handlers_block_by_func( G_OBJECT(priv->buffer), G_CALLBACK(inf_text_gtk_buffer_insert_text_cb_after), buffer ); if(inf_text_chunk_iter_init(chunk, &chunk_iter)) { gtk_text_buffer_get_iter_at_offset( priv->buffer, &tag_remove.end_iter, pos ); do { tag_remove.ignore_tags = inf_text_gtk_buffer_get_user_tags( INF_TEXT_GTK_BUFFER(buffer), inf_text_chunk_iter_get_author(&chunk_iter) ); if(tag_remove.ignore_tags) { tag = inf_text_gtk_buffer_get_user_tag( INF_TEXT_GTK_BUFFER(buffer), tag_remove.ignore_tags, priv->show_user_colors ); } else { tag = NULL; } gtk_text_buffer_insert_with_tags( tag_remove.buffer, &tag_remove.end_iter, inf_text_chunk_iter_get_text(&chunk_iter), inf_text_chunk_iter_get_bytes(&chunk_iter), tag, NULL ); /* Remove other user tags. If we inserted the new text within another * user's text, GtkTextBuffer automatically applies that tag to the * new text. */ /* TODO: We could probably look for the tag that we have to remove * before inserting text, to optimize this a bit. */ tag_remove.begin_iter = tag_remove.end_iter; gtk_text_iter_backward_chars( &tag_remove.begin_iter, inf_text_chunk_iter_get_length(&chunk_iter) ); gtk_text_tag_table_foreach( gtk_text_buffer_get_tag_table(tag_remove.buffer), inf_text_gtk_buffer_buffer_insert_text_tag_table_foreach_func, &tag_remove ); } while(inf_text_chunk_iter_next(&chunk_iter)); /* Fix left gravity of own cursor on remote insert */ /* TODO: We could also do this by simply resyncing the text buffer marks * to the active user's caret and selection properties. But then we * wouldn't have left gravtiy if no active user was present. */ if(user != INF_USER(priv->active_user) || user == NULL) { mark = gtk_text_buffer_get_insert(priv->buffer); gtk_text_buffer_get_iter_at_mark(priv->buffer, &insert_iter, mark); if(gtk_text_iter_equal(&insert_iter, &tag_remove.end_iter)) insert_at_cursor = TRUE; else insert_at_cursor = FALSE; mark = gtk_text_buffer_get_selection_bound(priv->buffer); gtk_text_buffer_get_iter_at_mark(priv->buffer, &insert_iter, mark); if(gtk_text_iter_equal(&insert_iter, &tag_remove.end_iter)) insert_at_selection_bound = TRUE; else insert_at_selection_bound = FALSE; if(insert_at_cursor || insert_at_selection_bound) { inf_signal_handlers_block_by_func( G_OBJECT(priv->buffer), G_CALLBACK(inf_text_gtk_buffer_mark_set_cb), buffer ); gtk_text_iter_backward_chars( &tag_remove.end_iter, inf_text_chunk_get_length(chunk) ); if(insert_at_cursor) { gtk_text_buffer_move_mark( priv->buffer, gtk_text_buffer_get_insert(priv->buffer), &tag_remove.end_iter ); } if(insert_at_selection_bound) { gtk_text_buffer_move_mark( priv->buffer, gtk_text_buffer_get_selection_bound(priv->buffer), &tag_remove.end_iter ); } inf_signal_handlers_unblock_by_func( G_OBJECT(priv->buffer), G_CALLBACK(inf_text_gtk_buffer_mark_set_cb), buffer ); } } } inf_signal_handlers_unblock_by_func( G_OBJECT(priv->buffer), G_CALLBACK(inf_text_gtk_buffer_apply_tag_cb), buffer ); inf_signal_handlers_unblock_by_func( G_OBJECT(priv->buffer), G_CALLBACK(inf_text_gtk_buffer_insert_text_cb_before), buffer ); inf_signal_handlers_unblock_by_func( G_OBJECT(priv->buffer), G_CALLBACK(inf_text_gtk_buffer_insert_text_cb_after), buffer ); inf_text_buffer_text_inserted(buffer, pos, chunk, user); } static void inf_text_gtk_buffer_buffer_erase_text(InfTextBuffer* buffer, guint pos, guint len, InfUser* user) { InfTextGtkBufferPrivate* priv; InfTextChunk* chunk; GtkTextIter begin; GtkTextIter end; priv = INF_TEXT_GTK_BUFFER_PRIVATE(buffer); /* This would have to be handled separately, but I think this is unlikely * to happen anyway. If it does happen then we would again need to rely on * iterator revalidation to happen in the way we expect it. */ g_assert(priv->record == NULL); chunk = inf_text_buffer_get_slice(buffer, pos, len); gtk_text_buffer_get_iter_at_offset(priv->buffer, &begin, pos); gtk_text_buffer_get_iter_at_offset(priv->buffer, &end, pos + len); inf_signal_handlers_block_by_func( G_OBJECT(priv->buffer), G_CALLBACK(inf_text_gtk_buffer_delete_range_cb_before), buffer ); inf_signal_handlers_block_by_func( G_OBJECT(priv->buffer), G_CALLBACK(inf_text_gtk_buffer_delete_range_cb_after), buffer ); gtk_text_buffer_delete(priv->buffer, &begin, &end); inf_signal_handlers_unblock_by_func( G_OBJECT(priv->buffer), G_CALLBACK(inf_text_gtk_buffer_delete_range_cb_before), buffer ); inf_signal_handlers_unblock_by_func( G_OBJECT(priv->buffer), G_CALLBACK(inf_text_gtk_buffer_delete_range_cb_after), buffer ); inf_text_buffer_text_erased(buffer, pos, chunk, user); inf_text_chunk_free(chunk); } static InfTextBufferIter* inf_text_gtk_buffer_buffer_create_iter(InfTextBuffer* buffer) { InfTextGtkBufferPrivate* priv; InfTextBufferIter* iter; priv = INF_TEXT_GTK_BUFFER_PRIVATE(buffer); if(gtk_text_buffer_get_char_count(priv->buffer) == 0) { return NULL; } else { iter = g_slice_new(InfTextBufferIter); gtk_text_buffer_get_start_iter(priv->buffer, &iter->begin); iter->end = iter->begin; inf_text_gtk_buffer_iter_next_author_toggle( &iter->end, NULL, &iter->user ); return iter; } } static void inf_text_gtk_buffer_buffer_destroy_iter(InfTextBuffer* buffer, InfTextBufferIter* iter) { g_slice_free(InfTextBufferIter, iter); } static gboolean inf_text_gtk_buffer_buffer_iter_next(InfTextBuffer* buffer, InfTextBufferIter* iter) { if(gtk_text_iter_is_end(&iter->end)) return FALSE; iter->begin = iter->end; inf_text_gtk_buffer_iter_next_author_toggle(&iter->end, NULL, &iter->user); return TRUE; } static gboolean inf_text_gtk_buffer_buffer_iter_prev(InfTextBuffer* buffer, InfTextBufferIter* iter) { if(gtk_text_iter_is_start(&iter->begin)) return FALSE; iter->end = iter->begin; inf_text_gtk_buffer_iter_prev_author_toggle( &iter->begin, &iter->user, NULL ); return TRUE; } static gpointer inf_text_gtk_buffer_buffer_iter_get_text(InfTextBuffer* buffer, InfTextBufferIter* iter) { InfTextGtkBufferPrivate* priv; priv = INF_TEXT_GTK_BUFFER_PRIVATE(buffer); return gtk_text_buffer_get_slice( priv->buffer, &iter->begin, &iter->end, TRUE ); } static guint inf_text_gtk_buffer_buffer_iter_get_length(InfTextBuffer* buffer, InfTextBufferIter* iter) { return gtk_text_iter_get_offset(&iter->begin) - gtk_text_iter_get_offset(&iter->end); } static gsize inf_text_gtk_buffer_buffer_iter_get_bytes(InfTextBuffer* buffer, InfTextBufferIter* iter) { GtkTextIter walk; gsize bytes; guint remaining; guint end; guint line_chars; guint line_bytes; gboolean result; walk = iter->begin; bytes = 0; remaining = gtk_text_iter_get_offset(&iter->end) - gtk_text_iter_get_offset(&walk); end = gtk_text_iter_get_offset(&iter->end); while(remaining > 0) { line_chars = gtk_text_iter_get_chars_in_line(&walk) - gtk_text_iter_get_line_offset(&walk); if(line_chars + gtk_text_iter_get_offset(&walk) <= end) { /* Need whole line */ line_bytes = gtk_text_iter_get_bytes_in_line(&walk) - gtk_text_iter_get_line_index(&walk); remaining -= line_chars; bytes += line_bytes; result = gtk_text_iter_forward_line(&walk); /* We cannot be in last line, because the end iterator would have to * be past the last line then. */ g_assert(remaining == 0 || result == TRUE); } else { /* End iterator is in this line */ line_bytes = gtk_text_iter_get_line_index(&iter->end) - gtk_text_iter_get_line_index(&walk); remaining = 0; bytes += line_bytes; } } return bytes; } static guint inf_text_gtk_buffer_buffer_iter_get_author(InfTextBuffer* buffer, InfTextBufferIter* iter) { return (iter->user == NULL) ? 0 : inf_user_get_id(INF_USER(iter->user)); } static void inf_text_gtk_buffer_class_init(gpointer g_class, gpointer class_data) { GObjectClass* object_class; object_class = G_OBJECT_CLASS(g_class); parent_class = G_OBJECT_CLASS(g_type_class_peek_parent(g_class)); g_type_class_add_private(g_class, sizeof(InfTextGtkBufferPrivate)); object_class->dispose = inf_text_gtk_buffer_dispose; object_class->finalize = inf_text_gtk_buffer_finalize; object_class->set_property = inf_text_gtk_buffer_set_property; object_class->get_property = inf_text_gtk_buffer_get_property; inf_text_gtk_buffer_tag_user_quark = g_quark_from_static_string( "inf-text-gtk-buffer-tag-user" ); g_object_class_install_property( object_class, PROP_BUFFER, g_param_spec_object( "buffer", "Buffer", "The underlaying GtkTextBuffer", GTK_TYPE_TEXT_BUFFER, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); g_object_class_install_property( object_class, PROP_USER_TABLE, g_param_spec_object( "user-table", "User table", "A user table of the participating users", INF_TYPE_USER_TABLE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); g_object_class_install_property( object_class, PROP_ACTIVE_USER, g_param_spec_object( "active-user", "Active user", "The user currently inserting text locally", INF_TEXT_TYPE_USER, G_PARAM_READWRITE ) ); g_object_class_install_property( object_class, PROP_WAKE_ON_CURSOR_MOVEMENT, g_param_spec_boolean( "wake-on-cursor-movement", "Wake on cursor movement", "Whether to make inactive users active when the insertion mark in the " "TextBuffer moves", FALSE, G_PARAM_READWRITE ) ); g_object_class_install_property( object_class, PROP_SHOW_USER_COLORS, g_param_spec_boolean( "show-user-colors", "Show user colors", "Whether to show user colors initially for newly written text", TRUE, G_PARAM_READWRITE ) ); g_object_class_install_property( object_class, PROP_SATURATION, g_param_spec_double( "saturation", "Saturation", "Saturation of user colors in a HSV color model", 0.0, 1.0, 0.35, G_PARAM_READWRITE ) ); g_object_class_install_property( object_class, PROP_VALUE, g_param_spec_double( "value", "Value", "Value of user colors in a HSV color model", 0.0, 1.0, 1.0, G_PARAM_READWRITE ) ); g_object_class_override_property(object_class, PROP_MODIFIED, "modified"); } static void inf_text_gtk_buffer_buffer_init(gpointer g_iface, gpointer iface_data) { InfBufferIface* iface; iface = (InfBufferIface*)g_iface; iface->get_modified = inf_text_gtk_buffer_buffer_get_modified; iface->set_modified = inf_text_gtk_buffer_buffer_set_modified; } static void inf_text_gtk_buffer_text_buffer_init(gpointer g_iface, gpointer iface_data) { InfTextBufferIface* iface; iface = (InfTextBufferIface*)g_iface; iface->get_encoding = inf_text_gtk_buffer_buffer_get_encoding; iface->get_length = inf_text_gtk_buffer_get_length; iface->get_slice = inf_text_gtk_buffer_buffer_get_slice; iface->insert_text = inf_text_gtk_buffer_buffer_insert_text; iface->erase_text = inf_text_gtk_buffer_buffer_erase_text; iface->create_iter = inf_text_gtk_buffer_buffer_create_iter; iface->destroy_iter = inf_text_gtk_buffer_buffer_destroy_iter; iface->iter_next = inf_text_gtk_buffer_buffer_iter_next; iface->iter_prev = inf_text_gtk_buffer_buffer_iter_prev; iface->iter_get_text = inf_text_gtk_buffer_buffer_iter_get_text; iface->iter_get_length = inf_text_gtk_buffer_buffer_iter_get_length; iface->iter_get_bytes = inf_text_gtk_buffer_buffer_iter_get_bytes; iface->iter_get_author = inf_text_gtk_buffer_buffer_iter_get_author; iface->text_inserted = NULL; iface->text_erased = NULL; } GType inf_text_gtk_buffer_get_type(void) { static GType buffer_type = 0; if(!buffer_type) { static const GTypeInfo buffer_type_info = { sizeof(InfTextGtkBufferClass), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ inf_text_gtk_buffer_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InfTextGtkBuffer), /* instance_size */ 0, /* n_preallocs */ inf_text_gtk_buffer_init, /* instance_init */ NULL /* value_table */ }; static const GInterfaceInfo buffer_info = { inf_text_gtk_buffer_buffer_init, NULL, NULL }; static const GInterfaceInfo text_buffer_info = { inf_text_gtk_buffer_text_buffer_init, NULL, NULL }; buffer_type = g_type_register_static( G_TYPE_OBJECT, "InfTextGtkBuffer", &buffer_type_info, 0 ); g_type_add_interface_static( buffer_type, INF_TYPE_BUFFER, &buffer_info ); g_type_add_interface_static( buffer_type, INF_TEXT_TYPE_BUFFER, &text_buffer_info ); } return buffer_type; } /** * inf_text_gtk_buffer_new: * @buffer: The underlaying #GtkTextBuffer. * @user_table: The #InfUserTable containing the participating users. * * Creates a new #InfTextGtkBuffer wrapping @buffer. It implements the * #InfTextBuffer interface by using @buffer to store the text. User colors * are read from the users from @user_table. * * Return Value: A #InfTextGtkBuffer. **/ InfTextGtkBuffer* inf_text_gtk_buffer_new(GtkTextBuffer* buffer, InfUserTable* user_table) { GObject* object; g_return_val_if_fail(GTK_IS_TEXT_BUFFER(buffer), NULL); g_return_val_if_fail(INF_IS_USER_TABLE(user_table), NULL); object = g_object_new( INF_TEXT_GTK_TYPE_BUFFER, "buffer", buffer, "user-table", user_table, NULL ); return INF_TEXT_GTK_BUFFER(object); } /** * inf_text_gtk_buffer_get_text_buffer: * @buffer: A #InfTextGtkBuffer. * * Returns the underlaying #GtkTextBuffer. * * Return Value: A #GtkTextBuffer. **/ GtkTextBuffer* inf_text_gtk_buffer_get_text_buffer(InfTextGtkBuffer* buffer) { g_return_val_if_fail(INF_TEXT_GTK_IS_BUFFER(buffer), NULL); return INF_TEXT_GTK_BUFFER_PRIVATE(buffer)->buffer; } /** * inf_text_gtk_buffer_set_active_user: * @buffer: A #InfTextGtkBuffer. * @user: A #InfTextUser, or %NULL. * * Sets the active user for @buffer. The active user is the user by which * edits not issued through the #InfTextBuffer interface are performed (for * example, edits by the user when the underlaying buffer is displayed in * a #GtkTextView). * * Note that such modifications should not be performed when no active user is * set. Note also the active user must be available and have the * %INF_USER_LOCAL flag set. **/ void inf_text_gtk_buffer_set_active_user(InfTextGtkBuffer* buffer, InfTextUser* user) { InfTextGtkBufferPrivate* priv; g_return_if_fail(INF_TEXT_GTK_IS_BUFFER(buffer)); g_return_if_fail(user == NULL || INF_TEXT_IS_USER(user)); g_return_if_fail( user == NULL || (inf_user_get_flags(INF_USER(user)) & INF_USER_LOCAL) != 0 ); g_return_if_fail( user == NULL || inf_user_get_status(INF_USER(user)) != INF_USER_UNAVAILABLE ); priv = INF_TEXT_GTK_BUFFER_PRIVATE(buffer); if(priv->active_user != NULL) { inf_signal_handlers_disconnect_by_func( G_OBJECT(priv->active_user), G_CALLBACK(inf_text_gtk_buffer_active_user_notify_status_cb), buffer ); inf_signal_handlers_disconnect_by_func( G_OBJECT(priv->active_user), G_CALLBACK(inf_text_gtk_buffer_active_user_selection_changed_cb), buffer ); g_object_unref(G_OBJECT(priv->active_user)); } priv->active_user = user; if(user != NULL) { /* TODO: Set cursor and selection of new user */ g_object_ref(G_OBJECT(user)); g_signal_connect( G_OBJECT(user), "notify::status", G_CALLBACK(inf_text_gtk_buffer_active_user_notify_status_cb), buffer ); g_signal_connect( G_OBJECT(user), "selection-changed", G_CALLBACK(inf_text_gtk_buffer_active_user_selection_changed_cb), buffer ); } g_object_notify(G_OBJECT(buffer), "active-user"); } /** * inf_text_gtk_buffer_get_active_user: * @buffer: A #InfTextGtkBuffer. * * Returns the current active user for @buffer. * * Return Value: A #InfTextUser. **/ InfTextUser* inf_text_gtk_buffer_get_active_user(InfTextGtkBuffer* buffer) { g_return_val_if_fail(INF_TEXT_GTK_IS_BUFFER(buffer), NULL); return INF_TEXT_GTK_BUFFER_PRIVATE(buffer)->active_user; } /** * inf_text_gtk_buffer_get_author: * @buffer: A #InfTextGtkBuffer. * @location: A #GtkTextIter which is not the end iterator. * * Returns the #InfTextUser which wrote the character at @location. If there * is no such user, then %NULL is returned. * * Return Value: A #InfTextUser, or %NULL. */ InfTextUser* inf_text_gtk_buffer_get_author(InfTextGtkBuffer* buffer, GtkTextIter* location) { InfTextGtkBufferPrivate* priv; g_return_val_if_fail(INF_TEXT_GTK_IS_BUFFER(buffer), NULL); g_return_val_if_fail( location != NULL && !gtk_text_iter_is_end(location), NULL ); priv = INF_TEXT_GTK_BUFFER_PRIVATE(buffer); return inf_text_gtk_buffer_iter_get_author(location); } /** * inf_text_gtk_buffer_get_user_for_tag: * @buffer: A #InfTextGtkBuffer. * @tag: A #GtkTextTag from @buffer's underlying #GtkTextBuffer's tag table. * * If @tag is an author tag, i.e. used by @buffer to mark text that a certain * user has written, then this function returns the #InfTextUser whose text is * marked by @tag. If @tag is not an author tag then the function returns * %NULL. * * Returns: A #InfTextUser, or %NULL. */ InfTextUser* inf_text_gtk_buffer_get_user_for_tag(InfTextGtkBuffer* buffer, GtkTextTag* tag) { g_return_val_if_fail(INF_TEXT_GTK_IS_BUFFER(buffer), NULL); g_return_val_if_fail(GTK_IS_TEXT_TAG(tag), NULL); return inf_text_gtk_buffer_author_from_tag(tag); } /** * inf_text_gtk_buffer_is_author_toggle: * @buffer: A #InfTextGtkBuffer. * @iter: A #GtkTextIter pointing into @buffer's underlying #GtkTextBuffer. * @user_on: A location to store a #InfTextUser, or %NULL. * @user_off: Another location to store a #InfTextUser, or %NULL. * * This function returns %TRUE if the author of the text in @buffer changes * at @iter, or %FALSE otherwise. If it returns %TRUE, then the user who * authored the text to the right hand side of @iter is stored in @user_on (if * non-%NULL) and the author of the text to the left hand side of @iter is * stored in @user_off (if non-%NULL). Both can also be set to %NULL if there * is unowned text in the buffer or if @iter is at the start or end of the * buffer. * * Returns: Whether text attribution changes at @iter. */ gboolean inf_text_gtk_buffer_is_author_toggle(InfTextGtkBuffer* buffer, const GtkTextIter* iter, InfTextUser** user_on, InfTextUser** user_off) { g_return_val_if_fail(INF_TEXT_GTK_IS_BUFFER(buffer), FALSE); g_return_val_if_fail(iter != NULL, FALSE); return inf_text_gtk_buffer_iter_is_author_toggle( iter, user_on, user_off ); } /** * inf_text_gtk_buffer_forward_to_author_toggle: * @buffer: A #InfTextGtkBuffer. * @iter: A #GtkTextIter pointing into @buffer's underlying #GtkTextBuffer. * @user_on: A location to store a #InfTextUser, or %NULL. * @user_off: Another location to store a #InfTextUser, or %NULL. * * Moves @iter to the next point in @buffer's underlying #GtkTextBuffer where * the text has been written by another user. If @iter points to the end of * the buffer, then the function does nothing and returns %FALSE. Otherwise * it returns %TRUE and sets @user_on to the user which has written the text * on the right hand side of the location @iter has been moved to (if * non-%NULL) and @user_off to the user which has written the left hand side * of the location @iter has been moved to. * * Returns: %TRUE if @iter was moved, or %FALSE otherwise. */ gboolean inf_text_gtk_buffer_forward_to_author_toggle(InfTextGtkBuffer* buffer, GtkTextIter* iter, InfTextUser** user_on, InfTextUser** user_off) { g_return_val_if_fail(INF_TEXT_GTK_IS_BUFFER(buffer), FALSE); g_return_val_if_fail(iter != NULL, FALSE); if(gtk_text_iter_is_end(iter)) return FALSE; inf_text_gtk_buffer_iter_next_author_toggle(iter, user_on, user_off); return TRUE; } /** * inf_text_gtk_buffer_backward_to_author_toggle: * @buffer: A #InfTextGtkBuffer. * @iter: A #GtkTextIter pointing into @buffer's underlying #GtkTextBuffer. * @user_on: A location to store a #InfTextUser, or %NULL. * @user_off: Another location to store a #InfTextUser, or %NULL. * * Moves @iter to the previous point in @buffer's underlying #GtkTextBuffer * where the text has been written by another user. If @iter points to the * beginning of the buffer, then the function does nothing and returns %FALSE. * Otherwise it returns %TRUE and sets @user_on to the user which has written * the text on the right hand side of the location @iter has been moved to (if * non-%NULL) and @user_off to the user which has written the left hand side * of the location @iter has been moved to. * * Returns: %TRUE if @iter was moved, or %FALSE otherwise. */ gboolean inf_text_gtk_buffer_backward_to_author_toggle(InfTextGtkBuffer* buffer, GtkTextIter* iter, InfTextUser** user_on, InfTextUser** user_off) { g_return_val_if_fail(INF_TEXT_GTK_IS_BUFFER(buffer), FALSE); g_return_val_if_fail(iter != NULL, FALSE); if(gtk_text_iter_is_start(iter)) return FALSE; inf_text_gtk_buffer_iter_prev_author_toggle(iter, user_on, user_off); return TRUE; } /** * inf_text_gtk_buffer_set_wake_on_cursor_movement: * @buffer: A #InfTextGtkBuffer. * @wake: Whether to make inactive users active on cursor movement. * * This function spcecifies whether movement of the insertion point or * selection bound of the underlying text buffer causes the active user * (see inf_text_gtk_buffer_set_active_user()) to become active when its * status is %INF_USER_STATUS_INACTIVE. * * If @wake is %TRUE, then the user status changes to %INF_USER_STATUS_ACTIVE * in that case. If @wake is %FALSE, then the user status stays * %INF_USER_STATUS_INACTIVE, and its caret-position and selection-length * properties will be no longer be synchronized to the buffer marks until * the user is set active again. */ void inf_text_gtk_buffer_set_wake_on_cursor_movement(InfTextGtkBuffer* buffer, gboolean wake) { g_return_if_fail(INF_TEXT_GTK_IS_BUFFER(buffer)); INF_TEXT_GTK_BUFFER_PRIVATE(buffer)->wake_on_cursor_movement = wake; g_object_notify(G_OBJECT(buffer), "wake-on-cursor-movement"); } /** * inf_text_gtk_buffer_get_wake_on_cursor_movement: * @buffer: A #InfTextGtkBuffer. * * Returns whether movement of the insertion point or selection bound of the * underlying text buffer causes whether the active user (see * inf_text_gtk_buffer_set_active_user()) to become active when its status * is %INF_USER_STATUS_INACTIVE. See also * inf_text_gtk_buffer_set_wake_on_cursor_movement(). * * Returns: Whether to make inactive users active when the insertion mark * is moved. */ gboolean inf_text_gtk_buffer_get_wake_on_cursor_movement(InfTextGtkBuffer* buffer) { g_return_val_if_fail(INF_TEXT_GTK_IS_BUFFER(buffer), FALSE); return INF_TEXT_GTK_BUFFER_PRIVATE(buffer)->wake_on_cursor_movement; } /** * inf_text_gtk_buffer_ensure_author_tags_priority: * @buffer: A #InfTextGtkBuffer. * * Ensures that all author tags have the lowest priority of all tags in the * underlying #GtkTextBuffer's tag table. Normally you do not need to use * this function if you do not set the priority for your tags explicitely. * However, if you do (or are forced to do, because you are using a library * that does this, such as GtkSourceView), then you can call this function * afterwards to make sure all the user tags have the lowest priority. */ void inf_text_gtk_buffer_ensure_author_tags_priority(InfTextGtkBuffer* buffer) { InfTextGtkBufferPrivate* priv; GtkTextTagTable* tag_table; g_return_if_fail(INF_TEXT_GTK_IS_BUFFER(buffer)); priv = INF_TEXT_GTK_BUFFER_PRIVATE(buffer); tag_table = gtk_text_buffer_get_tag_table(priv->buffer); gtk_text_tag_table_foreach( tag_table, inf_text_gtk_buffer_ensure_author_tags_priority_foreach_func, buffer ); } /** * inf_text_gtk_buffer_set_saturation_value: * @buffer: A #InfTextGtkBuffer. * @saturation: Saturation to use for user colors. * @value: Value to use for user colors. * * Sets the saturation and value to use for user colors in a HSV color model. * The hue is defined by each user's individual color. The reason why S and V * are set locally the same for all users is that they can be adjusted * depending on one's theme: Dark themes want dark user colors, bright themes * want bright ones. */ void inf_text_gtk_buffer_set_saturation_value(InfTextGtkBuffer* buffer, gdouble saturation, gdouble value) { InfTextGtkBufferPrivate* priv; GtkTextTagTable* tag_table; g_return_if_fail(INF_TEXT_GTK_IS_BUFFER(buffer)); g_return_if_fail(saturation >= 0.0 && saturation <= 1.0); g_return_if_fail(value >= 0.0 && value <= 1.0); priv = INF_TEXT_GTK_BUFFER_PRIVATE(buffer); if(saturation == priv->saturation && value == priv->value) return; g_object_freeze_notify(G_OBJECT(buffer)); if(saturation != priv->saturation) { priv->saturation = saturation; g_object_notify(G_OBJECT(buffer), "saturation"); } if(value != priv->value) { priv->value = value; g_object_notify(G_OBJECT(buffer), "value"); } tag_table = gtk_text_buffer_get_tag_table(priv->buffer); gtk_text_tag_table_foreach( tag_table, inf_text_gtk_buffer_set_saturation_value_tag_table_foreach_func, buffer ); g_object_thaw_notify(G_OBJECT(buffer)); } /** * inf_text_gtk_buffer_get_saturation: * @buffer: A #InfTextGtkBuffer. * * Returns the saturation part of the HSV user color. * * Returns: The saturation used for user colors. */ gdouble inf_text_gtk_buffer_get_saturation(InfTextGtkBuffer* buffer) { g_return_val_if_fail(INF_TEXT_GTK_IS_BUFFER(buffer), 0.0); return INF_TEXT_GTK_BUFFER_PRIVATE(buffer)->saturation; } /** * inf_text_gtk_buffer_get_value: * @buffer: A #InfTextGtkBuffer. * * Returns the value part of the HSV user color. * * Returns: The value used for user colors. */ gdouble inf_text_gtk_buffer_get_value(InfTextGtkBuffer* buffer) { g_return_val_if_fail(INF_TEXT_GTK_IS_BUFFER(buffer), 0.0); return INF_TEXT_GTK_BUFFER_PRIVATE(buffer)->value; } /** * inf_text_gtk_buffer_set_show_user_colors: * @buffer: A #InfTextGtkBuffer. * @show: Whether to show user colors or not. * * If @show is %TRUE (the default), then the user color is used as background * for newly written text by that user. Otherwise, newly written text has no * background color. * * Note that this setting is for newly written text only. If you want to show * or hide user colors for existing text use * inf_text_gtk_buffer_show_user_colors(). */ void inf_text_gtk_buffer_set_show_user_colors(InfTextGtkBuffer* buffer, gboolean show) { g_return_if_fail(INF_TEXT_GTK_IS_BUFFER(buffer)); INF_TEXT_GTK_BUFFER_PRIVATE(buffer)->show_user_colors = show; g_object_notify(G_OBJECT(buffer), "show-user-colors"); } /** * inf_text_gtk_buffer_get_show_user_colors: * @buffer: A #InfTextGtkBuffer. * * Returns whether newly written text is attributed with the author's user * color or not. * * Returns: %TRUE if user color is applied to newly written text, or %FALSE * otherwise. */ gboolean inf_text_gtk_buffer_get_show_user_colors(InfTextGtkBuffer* buffer) { g_return_val_if_fail(INF_TEXT_GTK_IS_BUFFER(buffer), FALSE); return INF_TEXT_GTK_BUFFER_PRIVATE(buffer)->show_user_colors; } /** * inf_text_gtk_buffer_show_user_colors: * @buffer: A #InfTextGtkBuffer. * @show: Whether to show or hide user colors. * @start: Beginning of the range for which to show or hide user colors. * @end: End of the range for which to show or hide user colors. * * If @show is %FALSE, then don't show user colors (which user wrote what * text) as the background of the text, in the range from @start to @end. * If @show is %TRUE, show user colors if they have previously been hidden * via a call to this function with @show being %FALSE. */ void inf_text_gtk_buffer_show_user_colors(InfTextGtkBuffer* buffer, gboolean show, GtkTextIter* start, GtkTextIter* end) { InfTextGtkBufferPrivate* priv; GtkTextIter iter; GtkTextIter prev; InfTextUser* user; InfTextGtkBufferUserTags* tags; GtkTextTag* hide_tag; GtkTextTag* show_tag; g_return_if_fail(INF_TEXT_GTK_IS_BUFFER(buffer)); g_return_if_fail(start != NULL); g_return_if_fail(end != NULL); priv = INF_TEXT_GTK_BUFFER_PRIVATE(buffer); iter = *start; prev = iter; while(!gtk_text_iter_equal(&iter, end)) { inf_text_gtk_buffer_iter_next_author_toggle(&iter, NULL, &user); if(gtk_text_iter_compare(&iter, end) > 0) iter = *end; if(user != NULL) { tags = g_hash_table_lookup( priv->user_tags, GUINT_TO_POINTER(inf_user_get_id(INF_USER(user))) ); g_assert(tags != NULL); if(show) { hide_tag = inf_text_gtk_buffer_get_user_tag(buffer, tags, FALSE); show_tag = inf_text_gtk_buffer_get_user_tag(buffer, tags, TRUE); } else { hide_tag = inf_text_gtk_buffer_get_user_tag(buffer, tags, TRUE); show_tag = inf_text_gtk_buffer_get_user_tag(buffer, tags, FALSE); } inf_signal_handlers_block_by_func( priv->buffer, G_CALLBACK(inf_text_gtk_buffer_apply_tag_cb), buffer ); gtk_text_buffer_remove_tag(priv->buffer, hide_tag, &prev, &iter); gtk_text_buffer_apply_tag(priv->buffer, show_tag, &prev, &iter); inf_signal_handlers_unblock_by_func( priv->buffer, G_CALLBACK(inf_text_gtk_buffer_apply_tag_cb), buffer ); } prev = iter; } } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinftextgtk/inf-text-gtk-hue-chooser.c0000644000175000017500000007206512264763732020572 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include #include #include /* Based on gtkhsv.c from GTK+ */ typedef enum _InfTextGtkHueChooserDragMode { INF_TEXT_GTK_HUE_CHOOSER_DRAG_NONE, INF_TEXT_GTK_HUE_CHOOSER_DRAG_HUE } InfTextGtkHueChooserDragMode; typedef struct _InfTextGtkHueChooserPrivate InfTextGtkHueChooserPrivate; struct _InfTextGtkHueChooserPrivate { gdouble hue; GdkWindow* window; guint ring_width; guint size; InfTextGtkHueChooserDragMode mode; }; enum { PROP_0, PROP_HUE }; enum { HUE_CHANGE, MOVE, LAST_SIGNAL }; #define INF_TEXT_GTK_HUE_CHOOSER_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), INF_TEXT_GTK_TYPE_HUE_CHOOSER, InfTextGtkHueChooserPrivate)) static GtkWidgetClass* parent_class; static guint hue_chooser_signals[LAST_SIGNAL]; static const double INF_TEXT_GTK_HUE_CHOOSER_HUE_MOVE_DELTA = 0.002; /* * Helper functions */ #define INTENSITY(r, g, b) ((r) * 0.30 + (g) * 0.59 + (b) * 0.11) /* TODO: Use gtk_hsv_to_rgb from GTK+ 2.14 instead */ static void inf_text_gtk_hue_chooser_hsv_to_rgb(gdouble* h, gdouble* s, gdouble* v) { gdouble hue; gdouble saturation; gdouble value; gdouble f, p, q, t; if(*s == 0.0) { *h = *v; *s = *v; *v = *v; /* heh */ } else { hue = *h * 6.0; saturation = *s; value = *v; if(hue == 6.0) hue = 0.0; f = hue - (int)hue; p = value * (1.0 - saturation); q = value * (1.0 - saturation * f); t = value * (1.0 - saturation * (1.0 - f)); switch((int)hue) { case 0: *h = value; *s = t; *v = p; break; case 1: *h = q; *s = value; *v = p; break; case 2: *h = p; *s = value; *v = t; break; case 3: *h = p; *s = q; *v = value; break; case 4: *h = t; *s = p; *v = value; break; case 5: *h = value; *s = p; *v = q; break; default: g_assert_not_reached (); break; } } } static gboolean inf_text_gtk_hue_chooser_is_in_ring(InfTextGtkHueChooser* chooser, gdouble x, gdouble y) { InfTextGtkHueChooserPrivate* priv; GtkAllocation allocation; gdouble center_x; gdouble center_y; gdouble dx; gdouble dy; gdouble inner; gdouble outer; gdouble dist_sqr; #if GTK_CHECK_VERSION(2,18,0) gtk_widget_get_allocation(GTK_WIDGET(chooser), &allocation); #else allocation = GTK_WIDGET(chooser)->allocation; #endif priv = INF_TEXT_GTK_HUE_CHOOSER_PRIVATE(chooser); center_x = allocation.width / 2.0; center_y = allocation.height / 2.0; outer = priv->size / 2.0; inner = outer - priv->ring_width; dx = x - center_x; dy = center_y - y; dist_sqr = dx * dx + dy * dy; return (dist_sqr >= inner * inner && dist_sqr <= outer * outer); } static gdouble inf_text_gtk_hue_chooser_hue_by_coords(InfTextGtkHueChooser* chooser, gdouble x, gdouble y) { GtkAllocation allocation; double center_x; double center_y; double dx; double dy; double angle; #if GTK_CHECK_VERSION(2,18,0) gtk_widget_get_allocation(GTK_WIDGET(chooser), &allocation); #else allocation = GTK_WIDGET(chooser)->allocation; #endif center_x = allocation.width / 2.0; center_y = allocation.height / 2.0; dx = x - center_x; dy = center_y - y; angle = atan2(dy, dx); if(angle < 0.0) angle += 2.0 * G_PI; return angle / (2.0 * G_PI); } static void inf_text_gtk_hue_chooser_paint(InfTextGtkHueChooser* chooser, cairo_t* cr, gint x, gint y, gint width, gint height) { InfTextGtkHueChooserPrivate* priv; GtkAllocation allocation; int xx, yy; gdouble dx, dy, dist; gdouble center_x; gdouble center_y; gdouble inner, outer; guint32* buf; guint32* p; gdouble angle; gdouble hue; gdouble r; gdouble g; gdouble b; cairo_surface_t* source; cairo_t* source_cr; gint focus_width; gint focus_pad; gint r_, g_, b_; priv = INF_TEXT_GTK_HUE_CHOOSER_PRIVATE(chooser); gtk_widget_style_get( GTK_WIDGET(chooser), "focus-line-width", &focus_width, "focus-padding", &focus_pad, NULL ); #if GTK_CHECK_VERSION(2,18,0) gtk_widget_get_allocation(GTK_WIDGET(chooser), &allocation); #else allocation = GTK_WIDGET(chooser)->allocation; #endif center_x = allocation.width / 2.0; center_y = allocation.height / 2.0; outer = priv->size / 2.0; inner = outer - priv->ring_width; /* Create an image initialized with the ring colors */ buf = g_new(guint32, width * height); for(yy = 0; yy < height; yy++) { p = buf + yy * width; dy = -(yy + y - center_y); for (xx = 0; xx < width; xx++) { dx = xx + x - center_x; dist = dx * dx + dy * dy; if(dist < ((inner-1) * (inner-1)) || dist > ((outer+1) * (outer+1))) { *p++ = 0; continue; } angle = atan2 (dy, dx); if (angle < 0.0) angle += 2.0 * G_PI; hue = angle / (2.0 * G_PI); r = hue; g = 1.0; b = 1.0; inf_text_gtk_hue_chooser_hsv_to_rgb(&r, &g, &b); r_ = floor (r * 255 + 0.5); g_ = floor (g * 255 + 0.5); b_ = floor (b * 255 + 0.5); *p++ = ((r_ << 16) | (g_ << 8) | b_ ); } } source = cairo_image_surface_create_for_data( (unsigned char *)buf, CAIRO_FORMAT_RGB24, width, height, 4 * width ); /* Now draw the value marker onto the source image, so that it * will get properly clipped at the edges of the ring */ source_cr = cairo_create(source); r = priv->hue; g = 1.0; b = 1.0; inf_text_gtk_hue_chooser_hsv_to_rgb(&r, &g, &b); if(INTENSITY(r, g, b) > 0.5) cairo_set_source_rgb(source_cr, 0.0, 0.0, 0.0); else cairo_set_source_rgb(source_cr, 1.0, 1.0, 1.0); cairo_move_to(source_cr, -x + center_x, - y + center_y); cairo_line_to( source_cr, -x + center_x + cos(priv->hue * 2.0 * G_PI) * priv->size / 2, -y + center_y - sin(priv->hue * 2.0 * G_PI) * priv->size / 2 ); cairo_stroke(source_cr); cairo_destroy(source_cr); /* Draw the ring using the source image */ cairo_save(cr); cairo_set_source_surface(cr, source, x, y); cairo_surface_destroy(source); cairo_set_line_width(cr, priv->ring_width); cairo_new_path(cr); cairo_arc( cr, center_x, center_y, priv->size / 2.0 - priv->ring_width / 2.0, 0, 2 * G_PI ); cairo_stroke(cr); cairo_restore(cr); g_free (buf); } /* * GObject overrides */ static void inf_text_gtk_hue_chooser_init(GTypeInstance* instance, gpointer g_class) { InfTextGtkHueChooser* hue_chooser; InfTextGtkHueChooserPrivate* priv; hue_chooser = INF_TEXT_GTK_HUE_CHOOSER(instance); priv = INF_TEXT_GTK_HUE_CHOOSER_PRIVATE(hue_chooser); #if GTK_CHECK_VERSION(2,18,0) gtk_widget_set_has_window(GTK_WIDGET(hue_chooser), FALSE); gtk_widget_set_can_focus(GTK_WIDGET(hue_chooser), TRUE); #else GTK_WIDGET_SET_FLAGS(hue_chooser, GTK_NO_WINDOW); GTK_WIDGET_SET_FLAGS(hue_chooser, GTK_CAN_FOCUS); #endif priv->hue = 0.0; priv->window = NULL; priv->ring_width = 50; priv->size = 240; priv->mode = INF_TEXT_GTK_HUE_CHOOSER_DRAG_NONE; } static void inf_text_gtk_hue_chooser_dispose(GObject* object) { InfTextGtkHueChooser* hue_chooser; InfTextGtkHueChooserPrivate* priv; hue_chooser = INF_TEXT_GTK_HUE_CHOOSER(object); priv = INF_TEXT_GTK_HUE_CHOOSER_PRIVATE(hue_chooser); G_OBJECT_CLASS(parent_class)->dispose(object); } static void inf_text_gtk_hue_chooser_finalize(GObject* object) { InfTextGtkHueChooser* hue_chooser; InfTextGtkHueChooserPrivate* priv; hue_chooser = INF_TEXT_GTK_HUE_CHOOSER(object); priv = INF_TEXT_GTK_HUE_CHOOSER_PRIVATE(hue_chooser); G_OBJECT_CLASS(parent_class)->finalize(object); } static void inf_text_gtk_hue_chooser_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec) { InfTextGtkHueChooser* hue_chooser; InfTextGtkHueChooserPrivate* priv; hue_chooser = INF_TEXT_GTK_HUE_CHOOSER(object); priv = INF_TEXT_GTK_HUE_CHOOSER_PRIVATE(hue_chooser); switch(prop_id) { case PROP_HUE: inf_text_gtk_hue_chooser_set_hue(hue_chooser, g_value_get_double(value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void inf_text_gtk_hue_chooser_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec) { InfTextGtkHueChooser* hue_chooser; InfTextGtkHueChooserPrivate* priv; hue_chooser = INF_TEXT_GTK_HUE_CHOOSER(object); priv = INF_TEXT_GTK_HUE_CHOOSER_PRIVATE(hue_chooser); switch(prop_id) { case PROP_HUE: g_value_set_double(value, priv->hue); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } /* * GtkWidget overrides */ static void inf_text_gtk_hue_chooser_map(GtkWidget* widget) { InfTextGtkHueChooser* chooser; InfTextGtkHueChooserPrivate* priv; chooser = INF_TEXT_GTK_HUE_CHOOSER(widget); priv = INF_TEXT_GTK_HUE_CHOOSER_PRIVATE(chooser); GTK_WIDGET_CLASS(parent_class)->map(widget); gdk_window_show(priv->window); } static void inf_text_gtk_hue_chooser_unmap(GtkWidget* widget) { InfTextGtkHueChooser* chooser; InfTextGtkHueChooserPrivate* priv; chooser = INF_TEXT_GTK_HUE_CHOOSER(widget); priv = INF_TEXT_GTK_HUE_CHOOSER_PRIVATE(chooser); gdk_window_hide(priv->window); GTK_WIDGET_CLASS(parent_class)->unmap(widget); } static void inf_text_gtk_hue_chooser_realize(GtkWidget* widget) { InfTextGtkHueChooser* chooser; InfTextGtkHueChooserPrivate* priv; GtkAllocation allocation; GdkWindowAttr attr; GdkWindow* parent_window; chooser = INF_TEXT_GTK_HUE_CHOOSER(widget); priv = INF_TEXT_GTK_HUE_CHOOSER_PRIVATE(chooser); #if GTK_CHECK_VERSION(2,20,0) gtk_widget_set_realized(widget, TRUE); #else GTK_WIDGET_SET_FLAGS(widget, GTK_REALIZED); #endif #if GTK_CHECK_VERSION(2,18,0) gtk_widget_get_allocation(widget, &allocation); #else allocation = widget->allocation; #endif attr.window_type = GDK_WINDOW_CHILD; attr.x = allocation.x; attr.y = allocation.y; attr.width = allocation.width; attr.height = allocation.height; attr.wclass = GDK_INPUT_ONLY; attr.event_mask = gtk_widget_get_events(widget); attr.event_mask |= ( GDK_KEY_PRESS_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK ); parent_window = gtk_widget_get_parent_window(widget); g_object_ref(parent_window); #if GTK_CHECK_VERSION(2,18,0) gtk_widget_set_window(widget, parent_window); #else widget->window = parent_window; #endif priv->window = gdk_window_new(parent_window, &attr, GDK_WA_X | GDK_WA_Y); gdk_window_set_user_data(priv->window, chooser); gtk_widget_set_style( widget, gtk_style_attach(gtk_widget_get_style(widget), parent_window) ); } static void inf_text_gtk_hue_chooser_unrealize(GtkWidget* widget) { InfTextGtkHueChooser* chooser; InfTextGtkHueChooserPrivate* priv; chooser = INF_TEXT_GTK_HUE_CHOOSER(widget); priv = INF_TEXT_GTK_HUE_CHOOSER_PRIVATE(chooser); gdk_window_set_user_data(priv->window, NULL); gdk_window_destroy(priv->window); priv->window = NULL; GTK_WIDGET_CLASS(parent_class)->unrealize(widget); } static gint inf_text_gtk_hue_chooser_calculate_width_and_height(GtkWidget *widget) { InfTextGtkHueChooser* chooser; InfTextGtkHueChooserPrivate* priv; gint focus_width; gint focus_pad; chooser = INF_TEXT_GTK_HUE_CHOOSER(widget); priv = INF_TEXT_GTK_HUE_CHOOSER_PRIVATE(chooser); gtk_widget_style_get( widget, "focus-line-width", &focus_width, "focus-padding", &focus_pad, NULL ); return priv->size + 2 * (focus_width + focus_pad); } #if GTK_CHECK_VERSION(2,91,6) static void inf_text_gtk_hue_chooser_get_preferred_width(GtkWidget *widget, gint *minimum, gint *natural) { *minimum = *natural = inf_text_gtk_hue_chooser_calculate_width_and_height(widget); } static void inf_text_gtk_hue_chooser_get_preferred_height(GtkWidget *widget, gint *minimum, gint *natural) { *minimum = *natural = inf_text_gtk_hue_chooser_calculate_width_and_height(widget); } #else static void inf_text_gtk_hue_chooser_size_request(GtkWidget* widget, GtkRequisition* requisition) { requisition->width = requisition->height = inf_text_gtk_hue_chooser_calculate_width_and_height(widget); } #endif static void inf_text_gtk_hue_chooser_size_allocate(GtkWidget* widget, GtkAllocation* allocation) { InfTextGtkHueChooser* chooser; InfTextGtkHueChooserPrivate* priv; chooser = INF_TEXT_GTK_HUE_CHOOSER(widget); priv = INF_TEXT_GTK_HUE_CHOOSER_PRIVATE(chooser); #if GTK_CHECK_VERSION(2,18,0) gtk_widget_set_allocation(widget, allocation); #else widget->allocation = *allocation; #endif #if GTK_CHECK_VERSION(2,20,0) if(gtk_widget_get_realized(widget)) #else if(GTK_WIDGET_REALIZED(widget)) #endif { /* TODO: Keep 1:1 aspect ratio, center within allocation, set size * accordingly, always request only ring_width * 2. */ gdk_window_move_resize( priv->window, allocation->x, allocation->y, allocation->width, allocation->height ); } } static gboolean inf_text_gtk_hue_chooser_button_press_event(GtkWidget* widget, GdkEventButton* event) { InfTextGtkHueChooser* chooser; InfTextGtkHueChooserPrivate* priv; GdkCursor* cursor; double hue; chooser = INF_TEXT_GTK_HUE_CHOOSER(widget); priv = INF_TEXT_GTK_HUE_CHOOSER_PRIVATE(chooser); gtk_widget_queue_draw(widget); if(priv->mode != INF_TEXT_GTK_HUE_CHOOSER_DRAG_NONE || event->button != 1) return FALSE; if(inf_text_gtk_hue_chooser_is_in_ring(chooser, event->x, event->y)) { /* Start drag */ priv->mode = INF_TEXT_GTK_HUE_CHOOSER_DRAG_HUE; hue = inf_text_gtk_hue_chooser_hue_by_coords(chooser, event->x, event->y); inf_text_gtk_hue_chooser_set_hue(chooser, hue); cursor = gdk_cursor_new_for_display( gtk_widget_get_display(widget), GDK_CROSSHAIR ); #if GTK_CHECK_VERSION(2, 91, 0) gdk_device_grab( gdk_event_get_device((GdkEvent*)event), priv->window, GDK_OWNERSHIP_NONE, FALSE, GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_RELEASE_MASK, cursor, event->time ); #else gdk_pointer_grab( priv->window, FALSE, GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_RELEASE_MASK, NULL, cursor, event->time ); #endif gdk_cursor_unref(cursor); gtk_widget_grab_focus(widget); } return TRUE; } static gboolean inf_text_gtk_hue_chooser_button_release_event(GtkWidget* widget, GdkEventButton* event) { InfTextGtkHueChooser* chooser; InfTextGtkHueChooserPrivate* priv; double hue; chooser = INF_TEXT_GTK_HUE_CHOOSER(widget); priv = INF_TEXT_GTK_HUE_CHOOSER_PRIVATE(chooser); if(priv->mode == INF_TEXT_GTK_HUE_CHOOSER_DRAG_NONE || event->button != 1) return FALSE; priv->mode = INF_TEXT_GTK_HUE_CHOOSER_DRAG_NONE; hue = inf_text_gtk_hue_chooser_hue_by_coords(chooser, event->x, event->y); inf_text_gtk_hue_chooser_set_hue(chooser, hue); #if GTK_CHECK_VERSION(2, 91, 0) gdk_device_ungrab( gdk_event_get_device((GdkEvent*)event), event->time ); #else gdk_display_pointer_ungrab( gdk_drawable_get_display(event->window), event->time ); #endif return TRUE; } static gboolean inf_text_gtk_hue_chooser_motion_notify_event(GtkWidget* widget, GdkEventMotion* event) { InfTextGtkHueChooser* chooser; InfTextGtkHueChooserPrivate* priv; double hue; chooser = INF_TEXT_GTK_HUE_CHOOSER(widget); priv = INF_TEXT_GTK_HUE_CHOOSER_PRIVATE(chooser); if(priv->mode == INF_TEXT_GTK_HUE_CHOOSER_DRAG_NONE) return FALSE; gdk_event_request_motions(event); hue = inf_text_gtk_hue_chooser_hue_by_coords(chooser, event->x, event->y); inf_text_gtk_hue_chooser_set_hue(chooser, hue); return TRUE; } #if GTK_CHECK_VERSION(2,91,0) static gboolean inf_text_gtk_hue_chooser_draw(GtkWidget* widget, cairo_t* cr) { InfTextGtkHueChooser* chooser; InfTextGtkHueChooserPrivate* priv; chooser = INF_TEXT_GTK_HUE_CHOOSER(widget); priv = INF_TEXT_GTK_HUE_CHOOSER_PRIVATE(chooser); inf_text_gtk_hue_chooser_paint( chooser, cr, 0, 0, gtk_widget_get_allocated_width(widget), gtk_widget_get_allocated_height(widget) ); return FALSE; } #else static gboolean inf_text_gtk_hue_chooser_expose_event(GtkWidget* widget, GdkEventExpose* event) { InfTextGtkHueChooser* chooser; InfTextGtkHueChooserPrivate* priv; GtkAllocation allocation; GdkRectangle rect; GdkRectangle dest; cairo_t* cr; chooser = INF_TEXT_GTK_HUE_CHOOSER(widget); priv = INF_TEXT_GTK_HUE_CHOOSER_PRIVATE(chooser); #if GTK_CHECK_VERSION(2,18,0) if(!(gtk_widget_is_drawable(widget) && event->window == gtk_widget_get_window(widget))) { return FALSE; } #else if(!(GTK_WIDGET_DRAWABLE(widget) && event->window == widget->window)) return FALSE; #endif #if GTK_CHECK_VERSION(2,18,0) gtk_widget_get_allocation(widget, &allocation); #else allocation = widget->allocation; #endif rect.x = allocation.x; rect.y = allocation.y; rect.width = allocation.width; rect.height = allocation.height; if(!gdk_rectangle_intersect(&event->area, &rect, &dest)) return FALSE; #if GTK_CHECK_VERSION(2,14,0) cr = gdk_cairo_create(gtk_widget_get_window(widget)); #else cr = gdk_cairo_create(widget->window); #endif cairo_translate(cr, allocation.x, allocation.y); inf_text_gtk_hue_chooser_paint( chooser, cr, dest.x - allocation.x, dest.y - allocation.y, dest.width, dest.height ); cairo_destroy(cr); #if GTK_CHECK_VERSION(2,18,0) if(gtk_widget_has_focus(widget)) #else if(GTK_WIDGET_HAS_FOCUS(widget)) #endif { /* This looks irritating: */ #if 0 gtk_paint_focus( widget->style, widget->window, GTK_WIDGET_STATE(widget), &event->area, widget, NULL, widget->allocation.x, widget->allocation.y, widget->allocation.width, widget->allocation.height ); #endif } return FALSE; } #endif static gboolean inf_text_gtk_hue_chooser_focus(GtkWidget* widget, GtkDirectionType dir) { InfTextGtkHueChooser* chooser; InfTextGtkHueChooserPrivate* priv; chooser = INF_TEXT_GTK_HUE_CHOOSER(widget); priv = INF_TEXT_GTK_HUE_CHOOSER_PRIVATE(chooser); #if GTK_CHECK_VERSION(2,18,0) if(!gtk_widget_has_focus(widget)) #else if(!GTK_WIDGET_HAS_FOCUS(widget)) #endif { gtk_widget_grab_focus(GTK_WIDGET(widget)); return TRUE; } return FALSE; } static gboolean inf_text_gtk_hue_chooser_grab_broken_event(GtkWidget* widget, GdkEventGrabBroken* event) { InfTextGtkHueChooser* chooser; InfTextGtkHueChooserPrivate* priv; chooser = INF_TEXT_GTK_HUE_CHOOSER(widget); priv = INF_TEXT_GTK_HUE_CHOOSER_PRIVATE(chooser); priv->mode = INF_TEXT_GTK_HUE_CHOOSER_DRAG_NONE; return TRUE; } /* * Default signal handlers */ static void inf_text_gtk_hue_chooser_hue_change(InfTextGtkHueChooser* chooser, gdouble hue) { InfTextGtkHueChooserPrivate* priv; priv = INF_TEXT_GTK_HUE_CHOOSER_PRIVATE(chooser); priv->hue = hue; g_object_notify(G_OBJECT(chooser), "hue"); gtk_widget_queue_draw(GTK_WIDGET(chooser)); } static void inf_text_gtk_hue_chooser_move(InfTextGtkHueChooser* chooser, GtkDirectionType direction) { InfTextGtkHueChooserPrivate* priv; gdouble hue; priv = INF_TEXT_GTK_HUE_CHOOSER_PRIVATE(chooser); hue = priv->hue; switch(direction) { case GTK_DIR_UP: case GTK_DIR_LEFT: hue += INF_TEXT_GTK_HUE_CHOOSER_HUE_MOVE_DELTA; break; case GTK_DIR_DOWN: case GTK_DIR_RIGHT: hue -= INF_TEXT_GTK_HUE_CHOOSER_HUE_MOVE_DELTA; break; default: /* we don't care about the tab directions */ break; } /* wrap */ if(hue < 0.0) hue += 1.0; if(hue > 1.0) hue -= 1.0; inf_text_gtk_hue_chooser_set_hue(chooser, hue); } /* * Type registration */ static void inf_text_gtk_hue_chooser_class_init(gpointer g_class, gpointer class_data) { GObjectClass* gobject_class; GtkWidgetClass* widget_class; InfTextGtkHueChooserClass* hue_chooser_class; GtkBindingSet* binding_set; gobject_class = G_OBJECT_CLASS(g_class); widget_class = GTK_WIDGET_CLASS(g_class); hue_chooser_class = INF_TEXT_GTK_HUE_CHOOSER_CLASS(g_class); parent_class = GTK_WIDGET_CLASS(g_type_class_peek_parent(g_class)); g_type_class_add_private(g_class, sizeof(InfTextGtkHueChooserPrivate)); gobject_class->dispose = inf_text_gtk_hue_chooser_dispose; gobject_class->finalize = inf_text_gtk_hue_chooser_finalize; gobject_class->set_property = inf_text_gtk_hue_chooser_set_property; gobject_class->get_property = inf_text_gtk_hue_chooser_get_property; /*object_class->destroy = inf_text_gtk_hue_chooser_destroy;*/ widget_class->map = inf_text_gtk_hue_chooser_map; widget_class->unmap = inf_text_gtk_hue_chooser_unmap; widget_class->realize = inf_text_gtk_hue_chooser_realize; widget_class->unrealize = inf_text_gtk_hue_chooser_unrealize; #if GTK_CHECK_VERSION(2,91,6) widget_class->get_preferred_height = inf_text_gtk_hue_chooser_get_preferred_height; widget_class->get_preferred_width = inf_text_gtk_hue_chooser_get_preferred_width; #else widget_class->size_request = inf_text_gtk_hue_chooser_size_request; #endif widget_class->size_allocate = inf_text_gtk_hue_chooser_size_allocate; widget_class->button_press_event = inf_text_gtk_hue_chooser_button_press_event; widget_class->button_release_event = inf_text_gtk_hue_chooser_button_release_event; widget_class->motion_notify_event = inf_text_gtk_hue_chooser_motion_notify_event; #if GTK_CHECK_VERSION(2,91,0) widget_class->draw = inf_text_gtk_hue_chooser_draw; #else widget_class->expose_event = inf_text_gtk_hue_chooser_expose_event; #endif widget_class->focus = inf_text_gtk_hue_chooser_focus; widget_class->grab_broken_event = inf_text_gtk_hue_chooser_grab_broken_event; hue_chooser_class->hue_change = inf_text_gtk_hue_chooser_hue_change; hue_chooser_class->move = inf_text_gtk_hue_chooser_move; hue_chooser_signals[HUE_CHANGE] = g_signal_new( "hue-change", G_OBJECT_CLASS_TYPE(gobject_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(InfTextGtkHueChooserClass, hue_change), NULL, NULL, inf_marshal_VOID__DOUBLE, G_TYPE_NONE, 1, G_TYPE_DOUBLE ); hue_chooser_signals[MOVE] = g_signal_new( "move", G_OBJECT_CLASS_TYPE(gobject_class), G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, G_STRUCT_OFFSET(InfTextGtkHueChooserClass, move), NULL, NULL, inf_marshal_VOID__ENUM, G_TYPE_NONE, 1, GTK_TYPE_DIRECTION_TYPE ); g_object_class_install_property( gobject_class, PROP_HUE, g_param_spec_double( "hue", "Hue", "The current hue value", 0.0, 1.0, 0.0, G_PARAM_READWRITE | G_PARAM_CONSTRUCT ) ); binding_set = gtk_binding_set_by_class(g_class); gtk_binding_entry_add_signal( binding_set, #if GTK_CHECK_VERSION(2,90,7) GDK_KEY_Up, #else GDK_Up, #endif 0, "move", 1, G_TYPE_ENUM, GTK_DIR_UP ); gtk_binding_entry_add_signal( binding_set, #if GTK_CHECK_VERSION(2,90,7) GDK_KEY_KP_Up, #else GDK_KP_Up, #endif 0, "move", 1, G_TYPE_ENUM, GTK_DIR_UP ); gtk_binding_entry_add_signal( binding_set, #if GTK_CHECK_VERSION(2,90,7) GDK_KEY_Down, #else GDK_Down, #endif 0, "move", 1, G_TYPE_ENUM, GTK_DIR_DOWN ); gtk_binding_entry_add_signal( binding_set, #if GTK_CHECK_VERSION(2,90,7) GDK_KEY_KP_Down, #else GDK_KP_Down, #endif 0, "move", 1, G_TYPE_ENUM, GTK_DIR_DOWN ); gtk_binding_entry_add_signal( binding_set, #if GTK_CHECK_VERSION(2,90,7) GDK_KEY_Right, #else GDK_Right, #endif 0, "move", 1, G_TYPE_ENUM, GTK_DIR_RIGHT ); gtk_binding_entry_add_signal( binding_set, #if GTK_CHECK_VERSION(2,90,7) GDK_KEY_KP_Right, #else GDK_KP_Right, #endif 0, "move", 1, G_TYPE_ENUM, GTK_DIR_RIGHT ); gtk_binding_entry_add_signal( binding_set, #if GTK_CHECK_VERSION(2,90,7) GDK_KEY_Left, #else GDK_Left, #endif 0, "move", 1, G_TYPE_ENUM, GTK_DIR_LEFT ); gtk_binding_entry_add_signal( binding_set, #if GTK_CHECK_VERSION(2,90,7) GDK_KEY_KP_Left, #else GDK_KP_Left, #endif 0, "move", 1, G_TYPE_ENUM, GTK_DIR_LEFT ); } GType inf_text_gtk_hue_chooser_get_type(void) { static GType hue_chooser_type = 0; if(!hue_chooser_type) { static const GTypeInfo hue_chooser_type_info = { sizeof(InfTextGtkHueChooserClass), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ inf_text_gtk_hue_chooser_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InfTextGtkHueChooser), /* instance_size */ 0, /* n_preallocs */ inf_text_gtk_hue_chooser_init, /* instance_init */ NULL /* value_table */ }; hue_chooser_type = g_type_register_static( GTK_TYPE_WIDGET, "InfTextGtkHueChooser", &hue_chooser_type_info, 0 ); } return hue_chooser_type; } /* * Public API */ /** * inf_text_gtk_hue_chooser_new: * * Creates a new #InfTextGtkHueChooser widget with the initial hue set to 0.0 * (red). * * Return Value: A newly created #InfTextGtkHueChooser. **/ GtkWidget* inf_text_gtk_hue_chooser_new(void) { GObject* object; object = g_object_new(INF_TEXT_GTK_TYPE_HUE_CHOOSER, NULL); return GTK_WIDGET(object); } /** * inf_text_gtk_hue_chooser_new_with_hue: * @hue: Initial hue value * * Creates a new #InfTextGtkHueChooser widget with the given hue as initial * value. @hue must be between 0.0 and 1.0. * * Return Value: A newly created #InfTextGtkHueChooser. **/ GtkWidget* inf_text_gtk_hue_chooser_new_with_hue(gdouble hue) { GObject* object; g_return_val_if_fail(hue >= 0.0 && hue <= 1.0, NULL); object = g_object_new(INF_TEXT_GTK_TYPE_HUE_CHOOSER, "hue", hue, NULL); return GTK_WIDGET(object); } /** * inf_text_gtk_hue_chooser_set_hue: * @chooser: A #InfTextGtkHueChooser. * @hue: New hue value. * * Sets the current hue value of @chooser to @hue. @hue must be between 0.0 * and 1.0. */ void inf_text_gtk_hue_chooser_set_hue(InfTextGtkHueChooser* chooser, gdouble hue) { InfTextGtkHueChooserPrivate* priv; g_return_if_fail(INF_TEXT_GTK_IS_HUE_CHOOSER(chooser)); g_return_if_fail(hue >= 0.0 && hue <= 1.0); priv = INF_TEXT_GTK_HUE_CHOOSER_PRIVATE(chooser); g_signal_emit(G_OBJECT(chooser), hue_chooser_signals[HUE_CHANGE], 0, hue); } /** * inf_text_gtk_hue_chooser_get_hue: * @chooser: A #InfTextGtkHueChooser. * * Returns the currently selected hue value of @chooser. * * Returns: The current hue value, a number between 0.0 and 1.0. */ gdouble inf_text_gtk_hue_chooser_get_hue(InfTextGtkHueChooser* chooser) { g_return_val_if_fail(INF_TEXT_GTK_IS_HUE_CHOOSER(chooser), 0.0); return INF_TEXT_GTK_HUE_CHOOSER_PRIVATE(chooser)->hue; } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinftextgtk/inf-text-gtk-view.c0000644000175000017500000017322012264763732017316 00000000000000/* infinote - Collaborative notetaking application * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include #include typedef struct _InfTextGtkViewUser InfTextGtkViewUser; struct _InfTextGtkViewUser { InfTextGtkView* view; InfTextUser* user; gboolean cursor_visible; InfIoTimeout* timeout; /* TODO: Use glib for that; remove InfIo property */ guint revalidate_idle; /* All in buffer coordinates: */ /* The rectangular area occupied by the cursor */ GdkRectangle cursor_rect; /* The position and height of the selection bound. width is ignored. */ GdkRectangle selection_bound_rect; /* Current line */ gint line_y; gint line_height; }; /* Helper struct for redrawing selection area */ typedef struct _InfTextGtkViewUserToggle InfTextGtkViewUserToggle; struct _InfTextGtkViewUserToggle { /* User toggled on or off at this point */ InfTextGtkViewUser* user; /* Position of the toggle */ guint pos; /* NULL if this toggles on, or the corresponding on * toggle if it toggles off. */ InfTextGtkViewUserToggle* on_toggle; /* Position in textview, in window coordinates */ gint x; gint y; }; typedef struct _InfTextGtkViewPrivate InfTextGtkViewPrivate; struct _InfTextGtkViewPrivate { InfIo* io; GtkTextView* textview; InfUserTable* user_table; InfTextUser* active_user; GSList* users; gboolean show_remote_cursors; gboolean show_remote_selections; gboolean show_remote_current_lines; }; enum { PROP_0, /* construct only */ PROP_IO, PROP_VIEW, PROP_USER_TABLE, /* read/write */ PROP_ACTIVE_USER, PROP_SHOW_REMOTE_CURSORS, PROP_SHOW_REMOTE_SELECTIONS, PROP_SHOW_REMOTE_CURRENT_LINES }; #define INF_TEXT_GTK_VIEW_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), INF_TEXT_GTK_TYPE_VIEW, InfTextGtkViewPrivate)) static GObjectClass* parent_class; /* Converts from HSV to RGB */ /* TODO: Use gtk_hsv_to_rgb from GTK+ 2.14 instead */ static void hsv_to_rgb(gdouble *h, gdouble *s, gdouble *v) { gdouble hue, saturation, value; gdouble f, p, q, t; if (*s == 0.0) { *h = *v; *s = *v; *v = *v; /* heh */ } else { hue = *h * 6.0; saturation = *s; value = *v; if (hue == 6.0) hue = 0.0; f = hue - (int) hue; p = value * (1.0 - saturation); q = value * (1.0 - saturation * f); t = value * (1.0 - saturation * (1.0 - f)); switch ((int) hue) { case 0: *h = value; *s = t; *v = p; break; case 1: *h = q; *s = value; *v = p; break; case 2: *h = p; *s = value; *v = t; break; case 3: *h = p; *s = q; *v = value; break; case 4: *h = t; *s = p; *v = value; break; case 5: *h = value; *s = p; *v = q; break; default: g_assert_not_reached (); } } } /* Converts from RGB to HSV */ /* TODO: Use gtk_rgb_to_hsv from GTK+ 2.14 instead */ static void rgb_to_hsv (gdouble *r, gdouble *g, gdouble *b) { gdouble red, green, blue; gdouble h, s, v; gdouble min, max; gdouble delta; red = *r; green = *g; blue = *b; h = 0.0; if (red > green) { if (red > blue) max = red; else max = blue; if (green < blue) min = green; else min = blue; } else { if (green > blue) max = green; else max = blue; if (red < blue) min = red; else min = blue; } v = max; if (max != 0.0) s = (max - min) / max; else s = 0.0; if (s == 0.0) h = 0.0; else { delta = max - min; if (red == max) h = (green - blue) / delta; else if (green == max) h = 2 + (blue - red) / delta; else if (blue == max) h = 4 + (red - green) / delta; h /= 6.0; if (h < 0.0) h += 1.0; else if (h > 1.0) h -= 1.0; } *r = h; *g = s; *b = v; } static InfTextGtkViewUser* inf_text_gtk_view_find_user(InfTextGtkView* view, InfTextUser* user) { InfTextGtkViewPrivate* priv; GSList* item; priv = INF_TEXT_GTK_VIEW_PRIVATE(view); for(item = priv->users; item != NULL; item = item->next) if( ((InfTextGtkViewUser*)item->data)->user == user) return (InfTextGtkViewUser*)item->data; return NULL; } /* Compute cursor_rect, selection_bound_rect */ static void inf_text_gtk_view_user_compute_user_area(InfTextGtkViewUser* view_user) { InfTextGtkViewPrivate* priv; GtkTextIter iter; gfloat cursor_aspect_ratio; priv = INF_TEXT_GTK_VIEW_PRIVATE(view_user->view); gtk_widget_style_get( GTK_WIDGET(priv->textview), "cursor-aspect-ratio", &cursor_aspect_ratio, NULL ); gtk_text_buffer_get_iter_at_offset( gtk_text_view_get_buffer(priv->textview), &iter, inf_text_user_get_caret_position(view_user->user) ); /* Find current line */ gtk_text_view_get_line_yrange( priv->textview, &iter, &view_user->line_y, &view_user->line_height ); /* TODO: We don't need the cursor rect for show-remote-current-lines, and * we don't need the selection rect for show-remote-cursors and * show-remote-current-lines. So we might not even want to compute them in * if those are disabled. */ /* Find cursor position */ gtk_text_view_get_iter_location( priv->textview, &iter, &view_user->cursor_rect ); view_user->cursor_rect.width = MAX( (int)(view_user->cursor_rect.height * cursor_aspect_ratio), 1 ); /* Find selection bound */ gtk_text_iter_forward_chars( &iter, inf_text_user_get_selection_length(view_user->user) ); gtk_text_view_get_iter_location( priv->textview, &iter, &view_user->selection_bound_rect ); view_user->selection_bound_rect.width = MAX( (int)(view_user->selection_bound_rect.height * cursor_aspect_ratio), 1 ); } static guint inf_text_gtk_view_get_left_margin(GtkTextView* view) { GtkAdjustment* hadjustment; gint margin; gint hadj; #if GTK_CHECK_VERSION(2,22,0) hadjustment = gtk_text_view_get_hadjustment(view); #else hadjustment = view->hadjustment; #endif margin = gtk_text_view_get_left_margin(view); if(!hadjustment) return margin; hadj = gtk_adjustment_get_value(hadjustment); if(hadj < margin) return margin - hadj; return 0; } static guint inf_text_gtk_view_get_right_margin(GtkTextView* view) { GtkAdjustment* hadjustment; gint margin; gdouble hadj; gdouble hupper; gdouble hpage; #if GTK_CHECK_VERSION(2,22,0) hadjustment = gtk_text_view_get_hadjustment(view); #else hadjustment = view->hadjustment; #endif margin = gtk_text_view_get_right_margin(view); if(!hadjustment) return margin; /* TODO: I am not exactly sure where this +1 comes from, but it is required * so that the selection is aligned with the local selection at the right * margin. */ hadj = gtk_adjustment_get_value(hadjustment) + 1; g_object_get( G_OBJECT(hadjustment), "upper", &hupper, "page-size", &hpage, NULL ); if(hadj > hupper - hpage - margin) return margin - (gint)(hupper - hpage - hadj); return 0; } /* Invalidate the whole area of the textview covered by the given user: * cursor, selection, current line */ static void inf_text_gtk_view_user_invalidate_user_area(InfTextGtkViewUser* view_user) { InfTextGtkViewPrivate* priv; GdkWindow* window; GdkRectangle invalidate_rect; gint selection_bound_x; gint selection_bound_y; gint window_width; priv = INF_TEXT_GTK_VIEW_PRIVATE(view_user->view); #if GTK_CHECK_VERSION(2,20,0) if(gtk_widget_get_realized(GTK_WIDGET(priv->textview))) #else if(GTK_WIDGET_REALIZED(priv->textview)) #endif { /* Invalidate cursors/selections */ if(priv->show_remote_cursors || priv->show_remote_selections) { window = gtk_text_view_get_window(priv->textview, GTK_TEXT_WINDOW_TEXT); #if GTK_CHECK_VERSION(2, 91, 0) window_width = gdk_window_get_width(window); #else gdk_drawable_get_size(GDK_DRAWABLE(window), &window_width, NULL); #endif gtk_text_view_buffer_to_window_coords( priv->textview, GTK_TEXT_WINDOW_TEXT, view_user->cursor_rect.x, view_user->cursor_rect.y, &invalidate_rect.x, &invalidate_rect.y ); invalidate_rect.width = view_user->cursor_rect.width; invalidate_rect.height = view_user->cursor_rect.height; /* Don't check for InfTextUser's selection length here so that clearing * a previous selection works. */ if(priv->show_remote_selections && (view_user->selection_bound_rect.x != view_user->cursor_rect.x || view_user->selection_bound_rect.y != view_user->cursor_rect.y)) { gtk_text_view_buffer_to_window_coords( priv->textview, GTK_TEXT_WINDOW_TEXT, view_user->selection_bound_rect.x, view_user->selection_bound_rect.y, &selection_bound_x, &selection_bound_y ); /* Invalidate the whole area between cursor and selection bound */ if(selection_bound_y == invalidate_rect.y) { /* Cursor and selection bound are on the same line */ if(selection_bound_x > invalidate_rect.x) { /* Selection bound is to the right of cursor */ invalidate_rect.width = MAX( selection_bound_x - invalidate_rect.x, invalidate_rect.width ); } else { /* Selection bound is to the left of cursor */ invalidate_rect.width += (invalidate_rect.x - selection_bound_x); invalidate_rect.x = selection_bound_x; } } else { /* Cursor and selection bound are on different lines. Could split * the actual area to be invalidated into three rectangles here, * but let's just do the union for simplicity reasons. */ invalidate_rect.width = window_width; invalidate_rect.height = MAX( invalidate_rect.y + invalidate_rect.height, selection_bound_y + view_user->selection_bound_rect.height ) - MIN(invalidate_rect.y, selection_bound_y); invalidate_rect.x = inf_text_gtk_view_get_left_margin(priv->textview); invalidate_rect.y = MIN(invalidate_rect.y, selection_bound_y); invalidate_rect.width -= inf_text_gtk_view_get_left_margin(priv->textview) + inf_text_gtk_view_get_right_margin(priv->textview); } } gdk_window_invalidate_rect(window, &invalidate_rect, FALSE); } /* Invalidate current lines */ if(priv->show_remote_current_lines) { gtk_text_view_buffer_to_window_coords( priv->textview, GTK_TEXT_WINDOW_TEXT, 0, view_user->line_y, NULL, &invalidate_rect.y ); /* -1 to stay consistent with GtkSourceView */ invalidate_rect.x = inf_text_gtk_view_get_left_margin(priv->textview) - 1; invalidate_rect.width = window_width - invalidate_rect.x; invalidate_rect.height = view_user->line_height; gdk_window_invalidate_rect(window, &invalidate_rect, FALSE); } } } static gint inf_text_gtk_view_user_line_position_cmp(gconstpointer first, gconstpointer second) { const InfTextGtkViewUser* first_user; const InfTextGtkViewUser* second_user; first_user = (const InfTextGtkViewUser*)first; second_user = (const InfTextGtkViewUser*)second; if(second_user->line_y < first_user->line_y) return 1; else if(second_user->line_y > first_user->line_y) return -1; return 0; } static gint inf_text_gtk_view_user_toggle_position_cmp(gconstpointer first, gconstpointer second, gpointer user_data) { const InfTextGtkViewUserToggle* first_toggle; const InfTextGtkViewUserToggle* second_toggle; first_toggle = (const InfTextGtkViewUserToggle*)first; second_toggle = (const InfTextGtkViewUserToggle*)second; if(second_toggle->pos < first_toggle->pos) return 1; else if(second_toggle->pos > first_toggle->pos) return -1; return 0; } static gint inf_text_gtk_view_user_toggle_user_cmp(gconstpointer first, gconstpointer second) { const InfTextGtkViewUserToggle* first_toggle; const InfTextGtkViewUserToggle* second_toggle; guint first_id; guint second_id; first_toggle = (const InfTextGtkViewUserToggle*)first; second_toggle = (const InfTextGtkViewUserToggle*)second; first_id = inf_user_get_id(INF_USER(first_toggle->user->user)); second_id = inf_user_get_id(INF_USER(second_toggle->user->user)); if(second_id < first_id) return 1; else if(second_id > first_id) return -1; return 0; } static void inf_text_gtk_view_user_toggle_free(gpointer data) { g_slice_free(InfTextGtkViewUserToggle, data); } static InfTextGtkViewUserToggle* inf_text_gtk_view_add_user_toggle(GSequence* sequence, guint position, InfTextGtkViewUser* user, InfTextGtkViewUserToggle* on_toggle, gint x, gint y) { InfTextGtkViewUserToggle* toggle; toggle = g_slice_new(InfTextGtkViewUserToggle); toggle->user = user; toggle->pos = position; toggle->on_toggle = on_toggle; toggle->x = x; toggle->y = y; g_sequence_insert_sorted( sequence, toggle, inf_text_gtk_view_user_toggle_position_cmp, NULL ); return toggle; } static void inf_text_gtk_view_add_user_toggle_pair(GSequence* sequence, guint begin, guint end, InfTextGtkViewUser* user, gint begin_x, gint begin_y, gint end_x, gint end_y) { InfTextGtkViewUserToggle* begin_toggle; g_assert(end > begin); begin_toggle = inf_text_gtk_view_add_user_toggle( sequence, begin, user, NULL, begin_x, begin_y ); inf_text_gtk_view_add_user_toggle( sequence, end, user, begin_toggle, end_x, end_y ); } static gboolean #if GTK_CHECK_VERSION(2, 91, 0) inf_text_gtk_view_draw_before_cb(GtkWidget* widget, cairo_t* cr, gpointer user_data) #else inf_text_gtk_view_expose_event_before_cb(GtkWidget* widget, GdkEventExpose* event, gpointer user_data) #endif { InfTextGtkView* view; InfTextGtkViewPrivate* priv; GSList* item; GSList* prev_item; InfTextGtkViewUser* prev_user; InfTextGtkViewUser* view_user; GtkAdjustment* hadjustment; GtkAdjustment* vadjustment; GdkWindow *text_window; GdkColor* color; double h, s, v; double r, g, b; GSList* sort_users; GdkRectangle rect; gint window_width; gint rx, ry; #if GTK_CHECK_VERSION(2, 91, 0) GdkRectangle clip_area; #else cairo_t* cr; #endif cairo_pattern_t* pattern; double n, n_users; cairo_matrix_t matrix; view = INF_TEXT_GTK_VIEW(user_data); priv = INF_TEXT_GTK_VIEW_PRIVATE(view); text_window = gtk_text_view_get_window(priv->textview, GTK_TEXT_WINDOW_TEXT); #if GTK_CHECK_VERSION(2, 91, 0) if(!gtk_cairo_should_draw_window(cr, text_window)) #else if(text_window != event->window) #endif { return FALSE; } if(priv->show_remote_current_lines) { #if GTK_CHECK_VERSION(2, 91, 0) gtk_cairo_transform_to_window(cr, GTK_WIDGET(priv->textview), text_window); gdk_cairo_get_clip_rectangle(cr, &clip_area); #else cr = gdk_cairo_create(text_window); #endif #if GTK_CHECK_VERSION(2, 91, 0) window_width = gdk_window_get_width(text_window); #else gdk_drawable_get_size(GDK_DRAWABLE(text_window), &window_width, NULL); #endif /* Make selection color based on text color: If text is dark, selection * is dark, if text is bright selection is bright. Note that we draw with * 50% alpha only, so text remains readable. */ color = >k_widget_get_style(widget)->bg[GTK_STATE_NORMAL]; h = color->red / 65535.0; s = color->green / 65535.0; v = color->blue / 65535.0; rgb_to_hsv(&h, &s, &v); v = MAX(v, 0.3); s = MAX(s, 0.1 + 0.3*(1 - v)); sort_users = g_slist_copy(priv->users); sort_users = g_slist_sort(sort_users, inf_text_gtk_view_user_line_position_cmp); prev_item = sort_users; if(prev_item) prev_user = (InfTextGtkViewUser*)prev_item->data; n_users = 1.0; for(item = sort_users; item != NULL; item = item->next, n_users += 1.0) { if(item->next == NULL || ((InfTextGtkViewUser*)item->next->data)->line_y != prev_user->line_y) { gtk_text_view_buffer_to_window_coords( priv->textview, GTK_TEXT_WINDOW_TEXT, 0, prev_user->line_y, NULL, &rect.y ); /* -1 to stay consistent with GtkSourceView */ rect.x = inf_text_gtk_view_get_left_margin(priv->textview) - 1; rect.width = window_width - rect.x; rect.height = prev_user->line_height; #if GTK_CHECK_VERSION(2, 91, 0) if(gdk_rectangle_intersect(&clip_area, &rect, NULL)) #elif GTK_CHECK_VERSION(2,90,5) if(cairo_region_contains_rectangle(event->region, &rect) != CAIRO_REGION_OVERLAP_OUT) #else if(gdk_region_rect_in(event->region, &rect) != GDK_OVERLAP_RECTANGLE_OUT) #endif { #if GTK_CHECK_VERSION(2,22,0) hadjustment = gtk_text_view_get_hadjustment(priv->textview); vadjustment = gtk_text_view_get_vadjustment(priv->textview); #else hadjustment = priv->textview->hadjustment; vadjustment = priv->textview->vadjustment; #endif /* Construct pattern */ rx = gtk_adjustment_get_value(vadjustment); ry = gtk_adjustment_get_value(hadjustment); pattern = cairo_pattern_create_linear(0, 0, 3.5*n_users, 3.5*n_users); cairo_matrix_init_translate(&matrix, rx, ry); cairo_pattern_set_matrix(pattern, &matrix); cairo_pattern_set_extend(pattern, CAIRO_EXTEND_REPEAT); for(n = 0.0; prev_item != item->next; prev_item = prev_item->next, n += 1.0) { view_user = (InfTextGtkViewUser*)prev_item->data; h = inf_text_user_get_hue(view_user->user); r = h; g = s; b = v; hsv_to_rgb(&r, &g, &b); cairo_pattern_add_color_stop_rgb( pattern, n/n_users, r, g, b ); cairo_pattern_add_color_stop_rgb( pattern, (n+1.0)/n_users, r, g, b ); } cairo_set_source(cr, pattern); gdk_cairo_rectangle(cr, &rect); cairo_fill(cr); cairo_pattern_destroy(pattern); } prev_item = item->next; if(prev_item) prev_user = (InfTextGtkViewUser*)prev_item->data; n_users = 0.0; } } g_slist_free(sort_users); #if ! GTK_CHECK_VERSION(2, 91, 0) cairo_destroy(cr); #endif } return FALSE; } static gboolean #if GTK_CHECK_VERSION(2, 91, 0) inf_text_gtk_view_draw_after_cb(GtkWidget* widget, cairo_t* cr, gpointer user_data) #else inf_text_gtk_view_expose_event_after_cb(GtkWidget* widget, GdkEventExpose* event, gpointer user_data) #endif { InfTextGtkView* view; InfTextGtkViewPrivate* priv; gint window_width; GdkColor* cursor_color; double hc,sc,vc; double hs,ss,vs; GSList* item; InfTextGtkViewUser* view_user; double rc,gc,bc; double rs,gs,bs; #if GTK_CHECK_VERSION(2, 91, 0) GdkRectangle clip_area; #else cairo_t* cr; #endif gint ax, ay; GtkTextIter begin_iter; GtkTextIter end_iter; guint area_begin; guint area_end; guint own_sel_begin; guint own_sel_end; gint osbx, osby; gint osex, osey; gint sel; guint begin; guint end; GSequence* toggles; GSequenceIter* tog_iter; InfTextGtkViewUserToggle* cur_toggle; InfTextGtkViewUserToggle* prev_toggle; guint n_users; GSList* users; cairo_pattern_t* pattern; GtkAdjustment* hadjustment; GtkAdjustment* vadjustment; double n; cairo_matrix_t matrix; GdkRectangle rct; gint rx, ry; GdkWindow *text_window; view = INF_TEXT_GTK_VIEW(user_data); priv = INF_TEXT_GTK_VIEW_PRIVATE(view); text_window = gtk_text_view_get_window(priv->textview, GTK_TEXT_WINDOW_TEXT); #if GTK_CHECK_VERSION(2, 91, 0) if(!gtk_cairo_should_draw_window(cr, text_window)) #else if(text_window != event->window) #endif { return FALSE; } #if GTK_CHECK_VERSION(2, 91, 0) gtk_cairo_transform_to_window(cr, GTK_WIDGET(priv->textview), text_window); gdk_cairo_get_clip_rectangle(cr, &clip_area); #else cr = gdk_cairo_create(text_window); #endif if(priv->show_remote_selections) { #if GTK_CHECK_VERSION(2, 91, 0) window_width = gdk_window_get_width(text_window); #else gdk_drawable_get_size(GDK_DRAWABLE(text_window), &window_width, NULL); #endif /* Make selection color based on text color: If text is dark, selection * is dark, if text is bright selection is bright. Note that we draw with * 50% alpha only, so text remains readable. */ cursor_color = >k_widget_get_style(widget)->text[GTK_STATE_NORMAL]; hs = cursor_color->red / 65535.0; ss = cursor_color->green / 65535.0; vs = cursor_color->blue / 65535.0; rgb_to_hsv(&hs, &ss, &vs); vs = MAX(vs, 0.5); ss = 1.0 - 0.4*(vs); /* Find range of text to be updated */ gtk_text_view_window_to_buffer_coords( priv->textview, GTK_TEXT_WINDOW_TEXT, #if GTK_CHECK_VERSION(2, 91, 0) clip_area.x, clip_area.y, #else event->area.x, event->area.y, #endif &ax, &ay ); gtk_text_view_get_iter_at_location( priv->textview, &begin_iter, ax, ay ); gtk_text_view_get_iter_at_location( priv->textview, &end_iter, #if GTK_CHECK_VERSION(2, 91, 0) ax + clip_area.width, ay + clip_area.height #else ax + event->area.width, ay + event->area.height #endif ); area_begin = gtk_text_iter_get_offset(&begin_iter); area_end = gtk_text_iter_get_offset(&end_iter); g_assert(area_end >= area_begin); /* Find own selection (we don't draw remote * selections over own selection). */ gtk_text_buffer_get_selection_bounds( gtk_text_view_get_buffer(priv->textview), &begin_iter, &end_iter ); own_sel_begin = gtk_text_iter_get_offset(&begin_iter); own_sel_end = gtk_text_iter_get_offset(&end_iter); if(own_sel_begin != own_sel_end) { gtk_text_view_get_iter_location(priv->textview, &begin_iter, &rct); gtk_text_view_buffer_to_window_coords( priv->textview, GTK_TEXT_WINDOW_TEXT, rct.x, rct.y, &osbx, &osby ); gtk_text_view_get_iter_location(priv->textview, &end_iter, &rct); gtk_text_view_buffer_to_window_coords( priv->textview, GTK_TEXT_WINDOW_TEXT, rct.x, rct.y, &osex, &osey ); } /* Build toggle list */ toggles = g_sequence_new(inf_text_gtk_view_user_toggle_free); for(item = priv->users; item != NULL; item = item->next) { view_user = (InfTextGtkViewUser*)item->data; if(inf_text_user_get_selection_length(view_user->user) != 0) { begin = inf_text_user_get_caret_position(view_user->user); sel = inf_text_user_get_selection_length(view_user->user); if(sel > 0) { end = begin + sel; } else { g_assert(begin >= (unsigned int)-sel); end = begin; begin += sel; } /* This can happen if the document is not yet fully loaded, i.e. synchronization * is still in progress. */ if(begin > gtk_text_buffer_get_char_count(gtk_text_view_get_buffer(priv->textview))) begin = gtk_text_buffer_get_char_count(gtk_text_view_get_buffer(priv->textview)); if(end > gtk_text_buffer_get_char_count(gtk_text_view_get_buffer(priv->textview))) end = gtk_text_buffer_get_char_count(gtk_text_view_get_buffer(priv->textview)); begin = MIN(MAX(begin, area_begin), area_end); end = MIN(MAX(end, area_begin), area_end); g_assert(end >= begin); if(begin != end) { if(sel > 0) { gtk_text_view_buffer_to_window_coords( priv->textview, GTK_TEXT_WINDOW_TEXT, view_user->cursor_rect.x, view_user->cursor_rect.y, &rx, &ry ); gtk_text_view_buffer_to_window_coords( priv->textview, GTK_TEXT_WINDOW_TEXT, view_user->selection_bound_rect.x, view_user->selection_bound_rect.y, &ax, &ay ); } else { gtk_text_view_buffer_to_window_coords( priv->textview, GTK_TEXT_WINDOW_TEXT, view_user->selection_bound_rect.x, view_user->selection_bound_rect.y, &rx, &ry ); gtk_text_view_buffer_to_window_coords( priv->textview, GTK_TEXT_WINDOW_TEXT, view_user->cursor_rect.x, view_user->cursor_rect.y, &ax, &ay ); } if(own_sel_begin == own_sel_end || own_sel_end <= begin || own_sel_begin >= end) { /* Local selection and remote selection do not overlap */ inf_text_gtk_view_add_user_toggle_pair( toggles, begin, end, view_user, rx, ry, ax, ay ); } else if(own_sel_begin <= begin && own_sel_end >= end) { /* Whole remote selection is covered by local selection */ } else if(own_sel_begin > begin && own_sel_end >= end) { /* Last part of remote selection is covered by local selection */ inf_text_gtk_view_add_user_toggle_pair( toggles, begin, own_sel_begin, view_user, rx, ry, osbx, osby ); } else if(own_sel_begin <= begin && own_sel_end < end) { /* First part of remote selection is covered by local selection */ inf_text_gtk_view_add_user_toggle_pair( toggles, own_sel_end, end, view_user, osex, osey, ax, ay ); } else if(own_sel_begin > begin && own_sel_end < end) { /* Local selection is in middle of remote selection */ inf_text_gtk_view_add_user_toggle_pair( toggles, begin, own_sel_begin, view_user, rx, ry, osbx, osby ); inf_text_gtk_view_add_user_toggle_pair( toggles, own_sel_end, end, view_user, osex, osey, ax, ay ); } else { g_assert_not_reached(); } } } } /* Walk toggle list, draw selections */ tog_iter = g_sequence_get_begin_iter(toggles); cur_toggle = NULL; prev_toggle = NULL; users = NULL; n_users = 0; tog_iter = g_sequence_get_begin_iter(toggles); while(!g_sequence_iter_is_end(tog_iter)) { cur_toggle = (InfTextGtkViewUserToggle*)g_sequence_get(tog_iter); /* Draw users from prev_toggle to cur_toggle */ if(users != NULL) { g_assert(prev_toggle != NULL); g_assert(n_users > 0); #if GTK_CHECK_VERSION(2,22,0) hadjustment = gtk_text_view_get_hadjustment(priv->textview); vadjustment = gtk_text_view_get_vadjustment(priv->textview); #else hadjustment = priv->textview->hadjustment; vadjustment = priv->textview->vadjustment; #endif /* Construct pattern */ rx = gtk_adjustment_get_value(hadjustment); ry = gtk_adjustment_get_value(vadjustment); pattern = cairo_pattern_create_linear(0, 0, 3.5*n_users, 3.5*n_users); cairo_matrix_init_translate(&matrix, rx, ry); cairo_pattern_set_matrix(pattern, &matrix); cairo_pattern_set_extend(pattern, CAIRO_EXTEND_REPEAT); for(item = users, n = 0.0; item != NULL; item = item->next, n += 1.0) { view_user = ((InfTextGtkViewUserToggle*)item->data)->user; hs = inf_text_user_get_hue(view_user->user); rs = hs; gs = ss; bs = vs; hsv_to_rgb(&rs, &gs, &bs); cairo_pattern_add_color_stop_rgba( pattern, n/n_users, rs, gs, bs, 0.5 ); cairo_pattern_add_color_stop_rgba( pattern, (n+1.0)/n_users, rs, gs, bs, 0.5 ); } cairo_set_source(cr, pattern); if(prev_toggle->y == cur_toggle->y) { /* same line */ g_assert(prev_toggle->x < cur_toggle->x); rct.x = prev_toggle->x; rct.y = prev_toggle->y; rct.width = cur_toggle->x - prev_toggle->x; rct.height = cur_toggle->user->selection_bound_rect.height; gdk_cairo_rectangle(cr, &rct); } else { g_assert( cur_toggle->y - prev_toggle->y >= cur_toggle->user->selection_bound_rect.height ); /* multiple lines */ if(window_width > prev_toggle->x) { /* first line */ rct.x = prev_toggle->x; rct.y = prev_toggle->y; rct.width = window_width - prev_toggle->x - inf_text_gtk_view_get_right_margin(priv->textview); rct.height = prev_toggle->user->selection_bound_rect.height; gdk_cairo_rectangle(cr, &rct); } if(cur_toggle->x > 0) { /* last line */ rct.x = inf_text_gtk_view_get_left_margin(priv->textview); rct.y = cur_toggle->y; rct.width = cur_toggle->x - rct.x; rct.height = cur_toggle->user->selection_bound_rect.height; gdk_cairo_rectangle(cr, &rct); } if(cur_toggle->y - prev_toggle->y > cur_toggle->user->selection_bound_rect.height) { /* intermediate */ rct.x = inf_text_gtk_view_get_left_margin(priv->textview); rct.y = prev_toggle->y + prev_toggle->user->selection_bound_rect.height; rct.width = window_width - rct.x - inf_text_gtk_view_get_right_margin(priv->textview); rct.height = cur_toggle->y - prev_toggle->y - cur_toggle->user->selection_bound_rect.height; gdk_cairo_rectangle(cr, &rct); } } cairo_fill(cr); cairo_pattern_destroy(pattern); } prev_toggle = cur_toggle; /* advance to next position, toggle users on/off while doing so */ do { if(cur_toggle->on_toggle == NULL) { /* Keep toggles in user list sorted by user ID, so that the same * users generate the same pattern */ users = g_slist_insert_sorted( users, cur_toggle, inf_text_gtk_view_user_toggle_user_cmp ); ++n_users; } else { g_assert(n_users > 0); users = g_slist_remove(users, cur_toggle->on_toggle); --n_users; } tog_iter = g_sequence_iter_next(tog_iter); if(g_sequence_iter_is_end(tog_iter)) break; cur_toggle = (InfTextGtkViewUserToggle*)g_sequence_get(tog_iter); } while(cur_toggle->pos == prev_toggle->pos); } g_assert(n_users == 0); g_assert(users == NULL); g_sequence_free(toggles); } if(priv->show_remote_cursors) { gtk_widget_style_get (widget, "cursor-color", &cursor_color, NULL); if(cursor_color != NULL) { hc = cursor_color->red / 65535.0; sc = cursor_color->green / 65535.0; vc = cursor_color->blue / 65535.0; gdk_color_free(cursor_color); } else { cursor_color = >k_widget_get_style(widget)->text[GTK_STATE_NORMAL]; hc = cursor_color->red / 65535.0; sc = cursor_color->green / 65535.0; vc = cursor_color->blue / 65535.0; } rgb_to_hsv(&hc, &sc, &vc); sc = MIN(MAX(sc, 0.3), 0.8); vc = MAX(vc, 0.7); for(item = priv->users; item != NULL; item = item->next) { view_user = (InfTextGtkViewUser*)item->data; if(view_user->cursor_visible) { gtk_text_view_buffer_to_window_coords( priv->textview, GTK_TEXT_WINDOW_TEXT, view_user->cursor_rect.x, view_user->cursor_rect.y, &rct.x, &rct.y ); rct.width = view_user->cursor_rect.width; rct.height = view_user->cursor_rect.height; #if GTK_CHECK_VERSION(2, 91, 0) if(gdk_rectangle_intersect(&clip_area, &rct, NULL)) #elif GTK_CHECK_VERSION(2,90,5) if(cairo_region_contains_rectangle(event->region, &rct) != CAIRO_REGION_OVERLAP_OUT) #else if(gdk_region_rect_in(event->region, &rct) != GDK_OVERLAP_RECTANGLE_OUT) #endif { hc = inf_text_user_get_hue(view_user->user); rc = hc; gc = sc; bc = vc; hsv_to_rgb(&rc, &gc, &bc); cairo_set_source_rgb(cr, rc, gc, bc); gdk_cairo_rectangle(cr, &rct); cairo_fill(cr); } } } } #if ! GTK_CHECK_VERSION(2, 91, 0) cairo_destroy(cr); #endif return FALSE; } static void inf_text_gtk_view_style_set_cb(GtkWidget* widget, GtkStyle* previous_style, gpointer user_data) { InfTextGtkView* view; InfTextGtkViewPrivate* priv; GSList* item; InfTextGtkViewUser* view_user; view = INF_TEXT_GTK_VIEW(user_data); priv = INF_TEXT_GTK_VIEW_PRIVATE(view); for(item = priv->users; item != NULL; item = item->next) { view_user = (InfTextGtkViewUser*)item->data; inf_text_gtk_view_user_compute_user_area(view_user); } } static void inf_text_gtk_view_size_allocate_cb(GtkWidget* widget, GtkAllocation* allocation, gpointer user_data) { InfTextGtkView* view; InfTextGtkViewPrivate* priv; GSList* item; InfTextGtkViewUser* view_user; view = INF_TEXT_GTK_VIEW(user_data); priv = INF_TEXT_GTK_VIEW_PRIVATE(view); for(item = priv->users; item != NULL; item = item->next) { view_user = (InfTextGtkViewUser*)item->data; inf_text_gtk_view_user_compute_user_area(view_user); } } static void inf_text_gtk_view_user_cursor_blink_timeout_func(gpointer user_data) { InfTextGtkViewUser* view_user; InfTextGtkViewPrivate* priv; GtkSettings* settings; gboolean cursor_blink; gint cursor_blink_time; view_user = (InfTextGtkViewUser*)user_data; priv = INF_TEXT_GTK_VIEW_PRIVATE(view_user->view); view_user->cursor_visible = !view_user->cursor_visible; inf_text_gtk_view_user_invalidate_user_area(view_user); /* Schedule next cursor blink */ settings = gtk_widget_get_settings(GTK_WIDGET(priv->textview)); /* TODO: Handle gtk-cursor-blink-timeout */ g_object_get( G_OBJECT(settings), "gtk-cursor-blink", &cursor_blink, "gtk-cursor-blink-time", &cursor_blink_time, NULL ); if(cursor_blink) { if(!view_user->cursor_visible) cursor_blink_time = cursor_blink_time * 1 / 3; else cursor_blink_time = cursor_blink_time * 2 / 3; view_user->timeout = inf_io_add_timeout( priv->io, cursor_blink_time, inf_text_gtk_view_user_cursor_blink_timeout_func, view_user, NULL ); } else { view_user->timeout = NULL; } } static void inf_text_gtk_view_user_reset_timeout(InfTextGtkViewUser* view_user) { InfTextGtkViewPrivate* priv; GtkSettings* settings; gboolean cursor_blink; gint cursor_blink_time; priv = INF_TEXT_GTK_VIEW_PRIVATE(view_user->view); if(view_user->timeout) { inf_io_remove_timeout(priv->io, view_user->timeout); view_user->timeout = NULL; } if(!view_user->cursor_visible) { view_user->cursor_visible = TRUE; /* TODO: Only need to invalidate cursor rect, not whole user area */ inf_text_gtk_view_user_invalidate_user_area(view_user); } settings = gtk_widget_get_settings(GTK_WIDGET(priv->textview)); /* TODO: Reschedule timeout if these settings change */ g_object_get( G_OBJECT(settings), "gtk-cursor-blink", &cursor_blink, "gtk-cursor-blink-time", &cursor_blink_time, NULL ); if(cursor_blink) { view_user->timeout = inf_io_add_timeout( priv->io, cursor_blink_time, inf_text_gtk_view_user_cursor_blink_timeout_func, view_user, NULL ); } } static gboolean inf_text_gtk_view_user_selection_changed_cb_idle_func(gpointer user_data) { InfTextGtkViewUser* view_user; view_user = (InfTextGtkViewUser*)user_data; /* Revalidate */ inf_text_gtk_view_user_invalidate_user_area(view_user); view_user->revalidate_idle = 0; return FALSE; } static void inf_text_gtk_view_user_selection_changed_cb(InfTextUser* user, guint position, gint length, gboolean by_request, gpointer user_data) { InfTextGtkViewUser* view_user; InfTextGtkViewPrivate* priv; view_user = (InfTextGtkViewUser*)user_data; priv = INF_TEXT_GTK_VIEW_PRIVATE(view_user->view); /* We don't need to invalidate areas if the change was not made by a user * request. So for example if someone's cursor moved because another user * has inserted text somewhere before it, then we don't need to redraw that * cursor since it either: * a) was shifted to the right, in which case the underlying text was also * shifted and is therefore invalidated anyway. * b) Both text and cursor have not been shifted, no redraw necessary. * Note that we need to recompute the user area though because it might * have moved. */ if(by_request) { /* Invalidate current user area, e.g. to get rid of cursor at previous * location if it moved, or if the selection area was shrinked. */ /* TODO: Not sure whether this also needs to go to the idle handler... * if so make sure it is executed even if the viewuser is deleted in the * meanwhile. */ inf_text_gtk_view_user_invalidate_user_area(view_user); } inf_text_gtk_view_user_compute_user_area(view_user); if(by_request) { inf_text_gtk_view_user_reset_timeout(view_user); /* We can't invalidate here because * gtk_text_view_buffer_to_window_coords() does not give correct * coordinates at this point. We need to wait for the textview to * revalidate onscreen lines first (which it does in an idle handler, * note higher numbers indicate less priority). */ view_user->revalidate_idle = g_idle_add_full( GTK_TEXT_VIEW_PRIORITY_VALIDATE + 1, inf_text_gtk_view_user_selection_changed_cb_idle_func, view_user, NULL ); } } static void inf_text_gtk_view_user_notify_hue_cb(GObject* object, GParamSpec* pspec, gpointer user_data) { InfTextGtkViewUser* view_user; InfTextGtkViewPrivate* priv; view_user = (InfTextGtkViewUser*)user_data; priv = INF_TEXT_GTK_VIEW_PRIVATE(view_user->view); /* TODO: Might restrict this on current lines, * cursor rects and selection rects */ gtk_widget_queue_draw(GTK_WIDGET(priv->textview)); } static void inf_text_gtk_view_add_user(InfTextGtkView* view, InfTextUser* user) { InfTextGtkViewPrivate* priv; InfTextGtkViewUser* view_user; priv = INF_TEXT_GTK_VIEW_PRIVATE(view); view_user = g_slice_new(InfTextGtkViewUser); view_user->view = view; view_user->user = INF_TEXT_USER(user); view_user->cursor_visible = TRUE; view_user->timeout = NULL; view_user->revalidate_idle = 0; inf_text_gtk_view_user_compute_user_area(view_user); inf_text_gtk_view_user_reset_timeout(view_user); priv->users = g_slist_prepend(priv->users, view_user); g_signal_connect_after( user, "selection-changed", G_CALLBACK(inf_text_gtk_view_user_selection_changed_cb), view_user ); g_signal_connect( user, "notify::hue", G_CALLBACK(inf_text_gtk_view_user_notify_hue_cb), view_user ); inf_text_gtk_view_user_invalidate_user_area(view_user); } static void inf_text_gtk_view_remove_user(InfTextGtkViewUser* view_user) { InfTextGtkViewPrivate* priv; priv = INF_TEXT_GTK_VIEW_PRIVATE(view_user->view); inf_signal_handlers_disconnect_by_func( view_user->user, G_CALLBACK(inf_text_gtk_view_user_selection_changed_cb), view_user ); inf_signal_handlers_disconnect_by_func( view_user->user, G_CALLBACK(inf_text_gtk_view_user_notify_hue_cb), view_user ); if(view_user->timeout != NULL) inf_io_remove_timeout(priv->io, view_user->timeout); if(view_user->revalidate_idle != 0) g_source_remove(view_user->revalidate_idle); inf_text_gtk_view_user_invalidate_user_area(view_user); priv->users = g_slist_remove(priv->users, view_user); g_slice_free(InfTextGtkViewUser, view_user); } static void inf_text_gtk_view_user_notify_status_cb(GObject* object, GParamSpec* pspec, gpointer user_data) { InfTextGtkView* view; InfTextGtkViewPrivate* priv; InfTextUser* user; InfTextGtkViewUser* view_user; view = INF_TEXT_GTK_VIEW(user_data); priv = INF_TEXT_GTK_VIEW_PRIVATE(view); user = INF_TEXT_USER(object); g_assert(user != priv->active_user); view_user = inf_text_gtk_view_find_user(view, user); if(inf_user_get_status(INF_USER(user)) == INF_USER_ACTIVE) { if(!view_user) inf_text_gtk_view_add_user(view, user); } else { if(view_user) inf_text_gtk_view_remove_user(view_user); } } static void inf_text_gtk_view_user_removed(InfTextGtkView* view, InfTextUser* user) { InfTextGtkViewPrivate* priv; InfTextGtkViewUser* view_user; priv = INF_TEXT_GTK_VIEW_PRIVATE(view); if(user == priv->active_user) { priv->active_user = NULL; g_object_notify(G_OBJECT(view), "active-user"); } else { inf_signal_handlers_disconnect_by_func( user, G_CALLBACK(inf_text_gtk_view_user_notify_status_cb), view ); if(inf_user_get_status(INF_USER(user)) == INF_USER_ACTIVE) { view_user = inf_text_gtk_view_find_user(view, user); g_assert(view_user != NULL); inf_text_gtk_view_remove_user(view_user); } } } static void inf_text_gtk_view_user_added(InfTextGtkView* view, InfTextUser* user) { InfTextGtkViewPrivate* priv; priv = INF_TEXT_GTK_VIEW_PRIVATE(view); /* Active user is guaranteed to be contained in user table, so if user was * just added then it can't be set as active user already. */ g_assert(user != priv->active_user); g_signal_connect( user, "notify::status", G_CALLBACK(inf_text_gtk_view_user_notify_status_cb), view ); if(inf_user_get_status(INF_USER(user)) == INF_USER_ACTIVE) inf_text_gtk_view_add_user(view, user); } static void inf_text_gtk_view_add_user_cb(InfUserTable* user_table, InfUser* user, gpointer user_data) { InfTextGtkView* view = INF_TEXT_GTK_VIEW(user_data); g_assert(INF_TEXT_IS_USER(user)); inf_text_gtk_view_user_added(view, INF_TEXT_USER(user)); } static void inf_text_gtk_view_remove_user_cb(InfUserTable* user_table, InfUser* user, gpointer user_data) { InfTextGtkView* view = INF_TEXT_GTK_VIEW(user_data); g_assert(INF_TEXT_IS_USER(user)); inf_text_gtk_view_user_removed(view, INF_TEXT_USER(user)); } static void inf_text_gtk_view_set_user_table_foreach_new_user_func(InfUser* user, gpointer user_data) { InfTextGtkView* view = INF_TEXT_GTK_VIEW(user_data); g_assert(INF_TEXT_IS_USER(user)); inf_text_gtk_view_user_added(view, INF_TEXT_USER(user)); } static void inf_text_gtk_view_set_user_table_foreach_old_user_func(InfUser* user, gpointer user_data) { InfTextGtkView* view = INF_TEXT_GTK_VIEW(user_data); g_assert(INF_TEXT_IS_USER(user)); inf_text_gtk_view_user_removed(view, INF_TEXT_USER(user)); } static void inf_text_gtk_view_set_view(InfTextGtkView* view, GtkTextView* gtk_view) { InfTextGtkViewPrivate* priv; priv = INF_TEXT_GTK_VIEW_PRIVATE(view); if(priv->textview != NULL) { inf_signal_handlers_disconnect_by_func( G_OBJECT(priv->textview), #if GTK_CHECK_VERSION(2, 91, 0) G_CALLBACK(inf_text_gtk_view_draw_before_cb), #else G_CALLBACK(inf_text_gtk_view_expose_event_before_cb), #endif view ); inf_signal_handlers_disconnect_by_func( G_OBJECT(priv->textview), #if GTK_CHECK_VERSION(2, 91, 0) G_CALLBACK(inf_text_gtk_view_draw_after_cb), #else G_CALLBACK(inf_text_gtk_view_expose_event_after_cb), #endif view ); inf_signal_handlers_disconnect_by_func( G_OBJECT(priv->textview), G_CALLBACK(inf_text_gtk_view_style_set_cb), view ); inf_signal_handlers_disconnect_by_func( G_OBJECT(priv->textview), G_CALLBACK(inf_text_gtk_view_size_allocate_cb), view ); g_object_unref(priv->textview); } priv->textview = gtk_view; if(gtk_view != NULL) { g_object_ref(gtk_view); g_signal_connect( G_OBJECT(gtk_view), #if GTK_CHECK_VERSION(2, 91, 0) "draw", G_CALLBACK(inf_text_gtk_view_draw_before_cb), #else "expose-event", G_CALLBACK(inf_text_gtk_view_expose_event_before_cb), #endif view ); g_signal_connect_after( G_OBJECT(gtk_view), #if GTK_CHECK_VERSION(2, 91, 0) "draw", G_CALLBACK(inf_text_gtk_view_draw_after_cb), #else "expose-event", G_CALLBACK(inf_text_gtk_view_expose_event_after_cb), #endif view ); g_signal_connect_after( G_OBJECT(gtk_view), "style-set", G_CALLBACK(inf_text_gtk_view_style_set_cb), view ); /* This is required for the remote cursors showing up at the correct * position initially. Maybe gtk_text_view_get_iter_location() seems to * return junk before. Note that also style-set is not enough. */ g_signal_connect_after( G_OBJECT(gtk_view), "size-allocate", G_CALLBACK(inf_text_gtk_view_size_allocate_cb), view ); } g_object_notify(G_OBJECT(view), "view"); } static void inf_text_gtk_view_set_user_table(InfTextGtkView* view, InfUserTable* user_table) { InfTextGtkViewPrivate* priv; priv = INF_TEXT_GTK_VIEW_PRIVATE(view); if(priv->user_table != NULL) { inf_signal_handlers_disconnect_by_func( G_OBJECT(priv->user_table), G_CALLBACK(inf_text_gtk_view_add_user_cb), view ); inf_signal_handlers_disconnect_by_func( G_OBJECT(priv->user_table), G_CALLBACK(inf_text_gtk_view_remove_user_cb), view ); inf_user_table_foreach_user( priv->user_table, inf_text_gtk_view_set_user_table_foreach_old_user_func, view ); g_object_unref(priv->user_table); } priv->user_table = user_table; if(user_table != NULL) { g_object_ref(user_table); g_signal_connect( G_OBJECT(user_table), "add-user", G_CALLBACK(inf_text_gtk_view_add_user_cb), view ); g_signal_connect( G_OBJECT(user_table), "remove-user", G_CALLBACK(inf_text_gtk_view_remove_user_cb), view ); inf_user_table_foreach_user( user_table, inf_text_gtk_view_set_user_table_foreach_new_user_func, view ); } g_object_notify(G_OBJECT(view), "user-table"); } static void inf_text_gtk_view_init(GTypeInstance* instance, gpointer g_class) { InfTextGtkView* view; InfTextGtkViewPrivate* priv; view = INF_TEXT_GTK_VIEW(instance); priv = INF_TEXT_GTK_VIEW_PRIVATE(view); priv->io = NULL; priv->textview = NULL; priv->user_table = NULL; priv->active_user = NULL; priv->users = NULL; priv->show_remote_cursors = TRUE; priv->show_remote_selections = TRUE; priv->show_remote_current_lines = TRUE; } static void inf_text_gtk_view_dispose(GObject* object) { InfTextGtkView* view; InfTextGtkViewPrivate* priv; view = INF_TEXT_GTK_VIEW(object); priv = INF_TEXT_GTK_VIEW_PRIVATE(view); inf_text_gtk_view_set_view(view, NULL); inf_text_gtk_view_set_user_table(view, NULL); g_assert(priv->active_user == NULL); g_assert(priv->users == NULL); if(priv->io != NULL) { g_object_unref(priv->io); priv->io = NULL; } G_OBJECT_CLASS(parent_class)->dispose(object); } static void inf_text_gtk_view_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec) { InfTextGtkView* view; InfTextGtkViewPrivate* priv; view = INF_TEXT_GTK_VIEW(object); priv = INF_TEXT_GTK_VIEW_PRIVATE(view); switch(prop_id) { case PROP_IO: g_assert(priv->io == NULL); /* construct only */ priv->io = INF_IO(g_value_dup_object(value)); break; case PROP_VIEW: g_assert(priv->textview == NULL); /* construct only */ inf_text_gtk_view_set_view( view, GTK_TEXT_VIEW(g_value_get_object(value)) ); break; case PROP_USER_TABLE: g_assert(priv->user_table == NULL); /* construct/only */ inf_text_gtk_view_set_user_table( view, INF_USER_TABLE(g_value_get_object(value)) ); break; case PROP_ACTIVE_USER: inf_text_gtk_view_set_active_user( view, INF_TEXT_USER(g_value_get_object(value)) ); break; case PROP_SHOW_REMOTE_CURSORS: inf_text_gtk_view_set_show_remote_cursors( view, g_value_get_boolean(value) ); break; case PROP_SHOW_REMOTE_SELECTIONS: inf_text_gtk_view_set_show_remote_selections( view, g_value_get_boolean(value) ); break; case PROP_SHOW_REMOTE_CURRENT_LINES: inf_text_gtk_view_set_show_remote_current_lines( view, g_value_get_boolean(value) ); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(value, prop_id, pspec); break; } } static void inf_text_gtk_view_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec) { InfTextGtkView* view; InfTextGtkViewPrivate* priv; view = INF_TEXT_GTK_VIEW(object); priv = INF_TEXT_GTK_VIEW_PRIVATE(view); switch(prop_id) { case PROP_IO: g_value_set_object(value, G_OBJECT(priv->io)); break; case PROP_VIEW: g_value_set_object(value, G_OBJECT(priv->textview)); break; case PROP_USER_TABLE: g_value_set_object(value, G_OBJECT(priv->user_table)); break; case PROP_ACTIVE_USER: g_value_set_object(value, G_OBJECT(priv->active_user)); break; case PROP_SHOW_REMOTE_CURSORS: g_value_set_boolean(value, priv->show_remote_cursors); break; case PROP_SHOW_REMOTE_SELECTIONS: g_value_set_boolean(value, priv->show_remote_selections); break; case PROP_SHOW_REMOTE_CURRENT_LINES: g_value_set_boolean(value, priv->show_remote_current_lines); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void inf_text_gtk_view_class_init(gpointer g_class, gpointer class_data) { GObjectClass* object_class; object_class = G_OBJECT_CLASS(g_class); parent_class = G_OBJECT_CLASS(g_type_class_peek_parent(g_class)); g_type_class_add_private(g_class, sizeof(InfTextGtkViewPrivate)); object_class->dispose = inf_text_gtk_view_dispose; object_class->set_property = inf_text_gtk_view_set_property; object_class->get_property = inf_text_gtk_view_get_property; g_object_class_install_property( object_class, PROP_IO, g_param_spec_object( "io", "IO", "The IO object to schedule timeouts", INF_TYPE_IO, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); g_object_class_install_property( object_class, PROP_VIEW, g_param_spec_object( "view", "View", "The underlying GtkTextView", GTK_TYPE_TEXT_VIEW, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); g_object_class_install_property( object_class, PROP_USER_TABLE, g_param_spec_object( "user-table", "User table", "The user table containing the users of the session shown in the view", INF_TYPE_USER_TABLE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); g_object_class_install_property( object_class, PROP_ACTIVE_USER, g_param_spec_object( "active-user", "Active user", "The user for which to show the view", INF_TEXT_TYPE_USER, G_PARAM_READWRITE ) ); g_object_class_install_property( object_class, PROP_SHOW_REMOTE_CURSORS, g_param_spec_boolean( "show-remote-cursors", "Show remote cursors", "Whether to show cursors of non-local users", TRUE, G_PARAM_READWRITE ) ); g_object_class_install_property( object_class, PROP_SHOW_REMOTE_SELECTIONS, g_param_spec_boolean( "show-remote-selections", "Show remote selections", "Whether to highlight text selected by non-local users", TRUE, G_PARAM_READWRITE ) ); g_object_class_install_property( object_class, PROP_SHOW_REMOTE_CURRENT_LINES, g_param_spec_boolean( "show-remote-current-lines", "Show remote current lines", "Whether to highlight the line in which the cursor of non-local users is", TRUE, G_PARAM_READWRITE ) ); } GType inf_text_gtk_view_get_type(void) { static GType view_type = 0; if(!view_type) { static const GTypeInfo view_type_info = { sizeof(InfTextGtkViewClass), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ inf_text_gtk_view_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InfTextGtkView), /* instance_size */ 0, /* n_preallocs */ inf_text_gtk_view_init, /* instance_init */ NULL /* value_table */ }; view_type = g_type_register_static( G_TYPE_OBJECT, "InfTextGtkView", &view_type_info, 0 ); } return view_type; } /** * inf_text_gtk_view_new: * @io: A #InfIo. * @view: A #GtkTextView. * @user_table: The #InfUserTable for the text session displayed in @view. * * Creates a new #InfTextGtkView for @view. This draws remote user's cursors * and selections into the text view. * * Returns: A new #InfTextGtkView. */ InfTextGtkView* inf_text_gtk_view_new(InfIo* io, GtkTextView* view, InfUserTable* user_table) { GObject* object; g_return_val_if_fail(INF_IS_IO(io), NULL); g_return_val_if_fail(GTK_IS_TEXT_VIEW(view), NULL); g_return_val_if_fail(INF_IS_USER_TABLE(user_table), NULL); object = g_object_new( INF_TEXT_GTK_TYPE_VIEW, "io", io, "view", view, "user-table", user_table, NULL ); return INF_TEXT_GTK_VIEW(object); } /** * inf_text_gtk_view_get_text_view: * @view: A #InfTextGtkView. * * Returns the underlying #GtkTextView. * * Return Value: The #InfTextGtkView's #GtkTextView. **/ GtkTextView* inf_text_gtk_view_get_text_view(InfTextGtkView* view) { g_return_val_if_fail(INF_TEXT_GTK_IS_VIEW(view), NULL); return INF_TEXT_GTK_VIEW_PRIVATE(view)->textview; } /** * inf_text_gtk_view_get_user_table: * @view: A #InfTextGtkView. * * Returns the #InfUserTable containing the users of the session the * #InfTextGtkView's #GtkTextView is displaying. * * Returns: The #InfGtkTextView's #InfUserTable. */ InfUserTable* inf_text_gtk_view_get_user_table(InfTextGtkView* view) { g_return_val_if_fail(INF_TEXT_GTK_IS_VIEW(view), NULL); return INF_TEXT_GTK_VIEW_PRIVATE(view)->user_table; } /** * inf_text_gtk_view_set_active_user: * @view: A #InfTextGtkView. * @user: A user from @view's user table, or %NULL. * * Sets the user for which perspective to draw the view. The selection and * cursor position is not drawn for this user since it is assumed that the * view's buffer cursor position and selection match the active user ones * (which is automatically the case if the buffer is managed by a * #InfTextGtkBuffer). */ void inf_text_gtk_view_set_active_user(InfTextGtkView* view, InfTextUser* user) { InfTextGtkViewPrivate* priv; InfTextUser* active_user; g_return_if_fail(INF_TEXT_GTK_IS_VIEW(view)); g_return_if_fail(user == NULL || INF_TEXT_IS_USER(user)); priv = INF_TEXT_GTK_VIEW_PRIVATE(view); g_return_if_fail( user == NULL || inf_user_table_lookup_user_by_id( priv->user_table, inf_user_get_id(INF_USER(user)) ) == INF_USER(user) ); if(priv->active_user != NULL) { active_user = priv->active_user; priv->active_user = NULL; inf_text_gtk_view_user_added(view, active_user); } if(user != NULL) { inf_text_gtk_view_user_removed(view, user); } priv->active_user = user; g_object_notify(G_OBJECT(view), "active-user"); } /** * inf_text_gtk_view_get_active_user: * @view: A #InfTextGtkView. * * Returns the active user of @view. See inf_text_gtk_view_set_active_user(). * * Returns: The active user of @view. */ InfTextUser* inf_text_gtk_view_get_active_user(InfTextGtkView* view) { g_return_val_if_fail(INF_TEXT_GTK_IS_VIEW(view), NULL); return INF_TEXT_GTK_VIEW_PRIVATE(view)->active_user; } /** * inf_text_gtk_view_set_show_remote_cursors: * @view: A #InfTextGtkView. * @show: Whether to show cursors of non-local users. * * If @show is %TRUE then @view draws a cursor for each non-local user in * %INF_USER_ACTIVE status in that user's color into its underlying * #GtkTextView. If it is %FALSE then remote cursors are not drawn. */ void inf_text_gtk_view_set_show_remote_cursors(InfTextGtkView* view, gboolean show) { InfTextGtkViewPrivate* priv; g_return_if_fail(INF_TEXT_GTK_IS_VIEW(view)); priv = INF_TEXT_GTK_VIEW_PRIVATE(view); if(priv->show_remote_cursors != show) { gtk_widget_queue_draw(GTK_WIDGET(priv->textview)); priv->show_remote_cursors = show; g_object_notify(G_OBJECT(view), "show-remote-cursors"); } } /** * inf_text_gtk_view_set_show_remote_selections: * @view: A #InfTextGtkView. * @show: Whether to show selections of non-local users. * * If @show is %TRUE then @view draws the selection ranges for each non-local * user in %INF_USER_ACTIVE status. The selection range is drawn shaded in * that user's color on top of the author color which indicates who wrote the * selected text. If more than one user has a given piece of text selected * then an alternating stripe pattern with each of the user's colors is drawn. * If @show is %FALES then selection ranges of remote users are not drawn. */ void inf_text_gtk_view_set_show_remote_selections(InfTextGtkView* view, gboolean show) { InfTextGtkViewPrivate* priv; g_return_if_fail(INF_TEXT_GTK_IS_VIEW(view)); priv = INF_TEXT_GTK_VIEW_PRIVATE(view); if(priv->show_remote_selections != show) { gtk_widget_queue_draw(GTK_WIDGET(priv->textview)); priv->show_remote_selections = show; g_object_notify(G_OBJECT(view), "show-remote-selections"); } } /** * inf_text_gtk_view_set_show_remote_current_lines: * @view: A #InfTextGtkView. * @show: Whether to highlight the current line of non-local users. * * If @show is %TRUE then all lines in which the cursor of a non-local user * in %INF_USER_ACTIVE status is is highlighted with that user's color, similar * to GtkSourceView's "highlight current line" functionality. If it is %FALSE * then the current line of non-local users is not be highlighted. */ void inf_text_gtk_view_set_show_remote_current_lines(InfTextGtkView* view, gboolean show) { InfTextGtkViewPrivate* priv; g_return_if_fail(INF_TEXT_GTK_IS_VIEW(view)); priv = INF_TEXT_GTK_VIEW_PRIVATE(view); if(priv->show_remote_current_lines != show) { gtk_widget_queue_draw(GTK_WIDGET(priv->textview)); priv->show_remote_current_lines = show; g_object_notify(G_OBJECT(view), "show-remote-current-lines"); } } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinftextgtk/inf-text-gtk-view.h0000644000175000017500000000564012264763732017323 00000000000000/* infinote - Collaborative notetaking application * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef __INF_TEXT_GTK_VIEW_H__ #define __INF_TEXT_GTK_VIEW_H__ #include #include #include #include #include G_BEGIN_DECLS #define INF_TEXT_GTK_TYPE_VIEW (inf_text_gtk_view_get_type()) #define INF_TEXT_GTK_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INF_TEXT_GTK_TYPE_VIEW, InfTextGtkView)) #define INF_TEXT_GTK_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INF_TEXT_GTK_TYPE_VIEW, InfTextGtkViewClass)) #define INF_TEXT_GTK_IS_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INF_TEXT_GTK_TYPE_VIEW)) #define INF_TEXT_GTK_IS_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INF_TEXT_GTK_TYPE_VIEW)) #define INF_TEXT_GTK_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), INF_TEXT_GTK_TYPE_VIEW, InfTextGtkViewClass)) typedef struct _InfTextGtkView InfTextGtkView; typedef struct _InfTextGtkViewClass InfTextGtkViewClass; struct _InfTextGtkViewClass { GObjectClass parent_class; }; struct _InfTextGtkView { GObject parent; }; GType inf_text_gtk_view_get_type(void) G_GNUC_CONST; InfTextGtkView* inf_text_gtk_view_new(InfIo* io, GtkTextView* view, InfUserTable* user_table); GtkTextView* inf_text_gtk_view_get_text_view(InfTextGtkView* view); InfUserTable* inf_text_gtk_view_get_user_table(InfTextGtkView* view); void inf_text_gtk_view_set_active_user(InfTextGtkView* view, InfTextUser* user); InfTextUser* inf_text_gtk_view_get_active_user(InfTextGtkView* view); void inf_text_gtk_view_set_show_remote_cursors(InfTextGtkView* view, gboolean show); void inf_text_gtk_view_set_show_remote_selections(InfTextGtkView* view, gboolean show); void inf_text_gtk_view_set_show_remote_current_lines(InfTextGtkView* view, gboolean show); G_END_DECLS #endif /* __INF_TEXT_GTK_VIEW_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity.pc.in0000644000175000017500000000055612041011626014232 00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: libinfinity Description: Infinote core library Requires: glib-2.0 >= 2.16 gobject-2.0 >= 2.16 gthread-2.0 >= 2.16 libxml-2.0 gnutls libgsasl Version: @VERSION@ Libs: -L${libdir} -linfinity-@LIBINFINITY_API_VERSION@ Cflags: -I${includedir}/libinfinity-@LIBINFINITY_API_VERSION@ libinfinity-0.5.5/mkinstalldirs0000755000175000017500000000672212202130664013573 00000000000000#! /bin/sh # mkinstalldirs --- make directory hierarchy scriptversion=2009-04-28.21; # UTC # Original author: Noah Friedman # Created: 1993-05-16 # Public domain. # # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' IFS=" "" $nl" errstatus=0 dirmode= usage="\ Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ... Create each directory DIR (with mode MODE, if specified), including all leading file name components. Report bugs to ." # process command line arguments while test $# -gt 0 ; do case $1 in -h | --help | --h*) # -h for help echo "$usage" exit $? ;; -m) # -m PERM arg shift test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } dirmode=$1 shift ;; --version) echo "$0 $scriptversion" exit $? ;; --) # stop option processing shift break ;; -*) # unknown option echo "$usage" 1>&2 exit 1 ;; *) # first non-opt arg break ;; esac done for file do if test -d "$file"; then shift else break fi done case $# in 0) exit 0 ;; esac # Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and # mkdir -p a/c at the same time, both will detect that a is missing, # one will create a, then the other will try to create a and die with # a "File exists" error. This is a problem when calling mkinstalldirs # from a parallel make. We use --version in the probe to restrict # ourselves to GNU mkdir, which is thread-safe. case $dirmode in '') if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then echo "mkdir -p -- $*" exec mkdir -p -- "$@" else # On NextStep and OpenStep, the `mkdir' command does not # recognize any option. It will interpret all options as # directories to create, and then abort because `.' already # exists. test -d ./-p && rmdir ./-p test -d ./--version && rmdir ./--version fi ;; *) if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 && test ! -d ./--version; then echo "mkdir -m $dirmode -p -- $*" exec mkdir -m "$dirmode" -p -- "$@" else # Clean up after NextStep and OpenStep mkdir. for d in ./-m ./-p ./--version "./$dirmode"; do test -d $d && rmdir $d done fi ;; esac for file do case $file in /*) pathcomp=/ ;; *) pathcomp= ;; esac oIFS=$IFS IFS=/ set fnord $file shift IFS=$oIFS for d do test "x$d" = x && continue pathcomp=$pathcomp$d case $pathcomp in -*) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr else if test ! -z "$dirmode"; then echo "chmod $dirmode $pathcomp" lasterr= chmod "$dirmode" "$pathcomp" || lasterr=$? if test ! -z "$lasterr"; then errstatus=$lasterr fi fi fi fi pathcomp=$pathcomp/ done done exit $errstatus # Local Variables: # mode: shell-script # sh-indentation: 2 # 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: libinfinity-0.5.5/libinfinity/0000755000175000017500000000000012264766267013404 500000000000000libinfinity-0.5.5/libinfinity/inf-dll.h0000644000175000017500000000207312264763732015016 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_DLL_H__ #define __INF_DLL_H__ #include #ifdef G_OS_WIN32 #include extern HMODULE _inf_dll_handle; #endif /* G_OS_WIN32 */ #endif /* __INF_DLL_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/client/0000755000175000017500000000000012264766267014662 500000000000000libinfinity-0.5.5/libinfinity/client/infc-browser-iter.h0000644000175000017500000000265412264763732020315 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INFC_BROWSER_ITER_H__ #define __INFC_BROWSER_ITER_H__ #include G_BEGIN_DECLS #define INFC_TYPE_BROWSER_ITER (infc_browser_iter_get_type()) typedef struct _InfcBrowserIter InfcBrowserIter; struct _InfcBrowserIter { guint node_id; gpointer node; }; GType infc_browser_iter_get_type(void) G_GNUC_CONST; /* TODO: Do these two need to be public? */ InfcBrowserIter* infc_browser_iter_copy(InfcBrowserIter* iter); void infc_browser_iter_free(InfcBrowserIter* iter); G_END_DECLS #endif /* __INFC_BROWSER_ITER_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/client/Makefile.am0000644000175000017500000000123712264763732016633 00000000000000noinst_LTLIBRARIES = libinfinity_client.la libinfinity_client_la_CPPFLAGS = \ -I$(top_srcdir) \ $(infinity_CFLAGS) libinfinity_client_ladir = \ $(includedir)/libinfinity-$(LIBINFINITY_API_VERSION)/libinfinity/client libinfinity_client_la_SOURCES = \ infc-browser.c \ infc-browser-iter.c \ infc-explore-request.c \ infc-node-request.c \ infc-request.c \ infc-request-manager.c \ infc-session-proxy.c \ infc-user-request.c libinfinity_client_la_HEADERS = \ infc-browser.h \ infc-browser-iter.h \ infc-explore-request.h \ infc-node-request.h \ infc-note-plugin.h \ infc-request.h \ infc-request-manager.h \ infc-session-proxy.h \ infc-user-request.h libinfinity-0.5.5/libinfinity/client/infc-note-plugin.h0000644000175000017500000000327312264763732020130 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INFC_NOTE_PLUGIN_H__ #define __INFC_NOTE_PLUGIN_H__ #include #include #include G_BEGIN_DECLS /* TODO: GTypeModule stuff? */ typedef InfSession*(*InfcNotePluginSessionNew)(InfIo*, InfCommunicationManager*, InfSessionStatus, InfCommunicationJoinedGroup*, InfXmlConnection*, gpointer); typedef struct _InfcNotePlugin InfcNotePlugin; struct _InfcNotePlugin { gpointer user_data; const gchar* note_type; InfcNotePluginSessionNew session_new; }; G_END_DECLS #endif /* __INFC_NOTE_PLUGIN_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/client/infc-browser.h0000644000175000017500000002406512264763732017354 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INFC_BROWSER_H__ #define __INFC_BROWSER_H__ #include #include #include #include #include #include #include #include G_BEGIN_DECLS #define INFC_TYPE_BROWSER (infc_browser_get_type()) #define INFC_BROWSER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INFC_TYPE_BROWSER, InfcBrowser)) #define INFC_BROWSER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INFC_TYPE_BROWSER, InfcBrowserClass)) #define INFC_IS_BROWSER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INFC_TYPE_BROWSER)) #define INFC_IS_BROWSER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INFC_TYPE_BROWSER)) #define INFC_BROWSER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), INFC_TYPE_BROWSER, InfcBrowserClass)) #define INFC_TYPE_BROWSER_STATUS (infc_browser_status_get_type()) typedef struct _InfcBrowser InfcBrowser; typedef struct _InfcBrowserClass InfcBrowserClass; /** * InfcBrowserStatus: * @INFC_BROWSER_DISCONNECTED: The browser is currently not connected to a * server. * @INFC_BROWSER_CONNECTING: The browser is currently establishing a * connection to a remote server, but the connection is not yet fully * established. * @INFC_BROWSER_CONNECTED: The browser is connected to a remote server. * * This enumeration contains possible connection status values for * #InfcBrowser. Several operations, such as exploring a node or subscribing * to a session can only be performed when the browser is connected to a * remote infinote server. */ typedef enum _InfcBrowserStatus { INFC_BROWSER_DISCONNECTED, INFC_BROWSER_CONNECTING, INFC_BROWSER_CONNECTED } InfcBrowserStatus; #if 0 /*typedef enum _InfcBrowserNodeStatus {*/ /* The node is synchronized with the server */ INFC_BROWSER_NODE_SYNC, /* The node has been deleted locally, but the server has not yet * acknowledged the deletion and might still reject the request. */ INFC_BROWSER_NODE_DELETED, /* The node has been added locally, but the server has not yet * acknowledged the addition and might still reject the request. */ INFC_BROWSER_NODE_ADDED, /* The node has been moved locally, but the server has not yet * acknowledged the move and might still reject the request. */ INFC_BROWSER_NODE_MOVED, /* The node has been copied locally, but the server has not yet * acknowledged the copy and might still reject the request. */ INFC_BROWSER_NODE_COPIED, /* Inherit status from parent node (used internally) */ INFC_BROWSER_NODE_INHERIT /*} InfcBrowserNodeStatus;*/ #endif /** * InfcBrowserClass: * @error: Default signal handler for the #InfcBrowser::error signal. * @node_added: Default signal handler for the #InfcBrowser::node_added * signal. * @node_removed: Default signal handler for the #InfcBrowser::node_removed * signal. * @subscribe_session: Default signal handler for the * #InfcBrowser::subscribe_session signal. * @begin_explore: Default signal handler for the * #InfcBrowser::begin_explore signal. * @begin_subscribe: Default signal handler for the * #InfcBrowser::begin_subscribe signal. * * Signals for the #InfcBrowser class. */ struct _InfcBrowserClass { /*< private >*/ GObjectClass parent_class; /* Signals */ /*< public >*/ void (*error)(InfcBrowser* browser, const GError* error); void (*node_added)(InfcBrowser* browser, InfcBrowserIter* iter); void (*node_removed)(InfcBrowser* browser, InfcBrowserIter* iter); void (*subscribe_session)(InfcBrowser* browser, InfcBrowserIter* iter, InfcSessionProxy* proxy); void (*begin_explore)(InfcBrowser* browser, InfcBrowserIter* iter, InfcExploreRequest* request); void (*begin_subscribe)(InfcBrowser* browser, InfcBrowserIter* iter, InfcNodeRequest* request); }; /** * InfcBrowser: * * #InfcBrowser is an opaque data type. You should only access it via the * public API functions. */ struct _InfcBrowser { /*< private >*/ GObject parent; }; GType infc_browser_status_get_type(void) G_GNUC_CONST; GType infc_browser_get_type(void) G_GNUC_CONST; InfcBrowser* infc_browser_new(InfIo* io, InfCommunicationManager* comm_manager, InfXmlConnection* connection); InfCommunicationManager* infc_browser_get_communication_manager(InfcBrowser* browser); InfXmlConnection* infc_browser_get_connection(InfcBrowser* browser); InfcBrowserStatus infc_browser_get_status(InfcBrowser* browser); gboolean infc_browser_add_plugin(InfcBrowser* browser, const InfcNotePlugin* plugin); const InfcNotePlugin* infc_browser_lookup_plugin(InfcBrowser* browser, const gchar* note_type); void infc_browser_iter_get_root(InfcBrowser* browser, InfcBrowserIter* iter); gboolean infc_browser_iter_get_next(InfcBrowser* browser, InfcBrowserIter* iter); gboolean infc_browser_iter_get_prev(InfcBrowser* browser, InfcBrowserIter* iter); gboolean infc_browser_iter_get_parent(InfcBrowser* browser, InfcBrowserIter* iter); gboolean infc_browser_iter_get_explored(InfcBrowser* browser, const InfcBrowserIter* iter); gboolean infc_browser_iter_get_child(InfcBrowser* browser, InfcBrowserIter* iter); InfcExploreRequest* infc_browser_iter_explore(InfcBrowser* browser, const InfcBrowserIter* iter); const gchar* infc_browser_iter_get_name(InfcBrowser* browser, const InfcBrowserIter* iter); gchar* infc_browser_iter_get_path(InfcBrowser* browser, const InfcBrowserIter* iter); gboolean infc_browser_iter_is_subdirectory(InfcBrowser* browser, const InfcBrowserIter* iter); InfcNodeRequest* infc_browser_add_subdirectory(InfcBrowser* browser, const InfcBrowserIter* parent, const gchar* name); InfcNodeRequest* infc_browser_add_note(InfcBrowser* browser, const InfcBrowserIter* parent, const gchar* name, const InfcNotePlugin* plugin, gboolean initial_subscribe); InfcNodeRequest* infc_browser_add_note_with_content(InfcBrowser* browser, const InfcBrowserIter* parent, const gchar* name, const InfcNotePlugin* plugin, InfSession* session, gboolean initial_subscribe); InfcNodeRequest* infc_browser_remove_node(InfcBrowser* browser, const InfcBrowserIter* iter); const gchar* infc_browser_iter_get_note_type(InfcBrowser* browser, const InfcBrowserIter* iter); const InfcNotePlugin* infc_browser_iter_get_plugin(InfcBrowser* browser, const InfcBrowserIter* iter); InfcNodeRequest* infc_browser_iter_subscribe_session(InfcBrowser* browser, const InfcBrowserIter* iter); InfcNodeRequest* infc_browser_iter_save_session(InfcBrowser* browser, const InfcBrowserIter* iter); InfcSessionProxy* infc_browser_iter_get_session(InfcBrowser* browser, const InfcBrowserIter* iter); InfcSessionProxy* infc_browser_iter_get_sync_in(InfcBrowser* browser, const InfcBrowserIter* iter); InfcNodeRequest* infc_browser_iter_get_subscribe_request(InfcBrowser* browser, const InfcBrowserIter* iter); InfcExploreRequest* infc_browser_iter_get_explore_request(InfcBrowser* browser, const InfcBrowserIter* iter); GSList* infc_browser_iter_get_sync_in_requests(InfcBrowser* browser, const InfcBrowserIter* iter); gboolean infc_browser_iter_from_node_request(InfcBrowser* browser, InfcNodeRequest* request, InfcBrowserIter* iter); gboolean infc_browser_iter_from_explore_request(InfcBrowser* browser, InfcExploreRequest* request, InfcBrowserIter* iter); gboolean infc_browser_iter_is_valid(InfcBrowser* browser, const InfcBrowserIter* iter); /* TODO: This should not use InfcNodeRequest, but another request type * which is not identified with a node. */ InfcNodeRequest* infc_browser_subscribe_chat(InfcBrowser* browser); InfcNodeRequest* infc_browser_get_subscribe_chat_request(InfcBrowser* browser); InfcSessionProxy* infc_browser_get_chat_session(InfcBrowser* browser); G_END_DECLS #endif /* __INFC_BROWSER_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/client/infc-session-proxy.h0000644000175000017500000000574212264763732020534 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INFC_SESSION_PROXY_H__ #define __INFC_SESSION_PROXY_H__ #include #include #include #include G_BEGIN_DECLS #define INFC_TYPE_SESSION_PROXY (infc_session_proxy_get_type()) #define INFC_SESSION_PROXY(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INFC_TYPE_SESSION_PROXY, InfcSessionProxy)) #define INFC_SESSION_PROXY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INFC_TYPE_SESSION_PROXY, InfcSessionProxyClass)) #define INFC_IS_SESSION_PROXY(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INFC_TYPE_SESSION_PROXY)) #define INFC_IS_SESSION_PROXY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INFC_TYPE_SESSION_PROXY)) #define INFC_SESSION_PROXY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), INFC_TYPE_SESSION_PROXY, InfcSessionProxyClass)) typedef struct _InfcSessionProxy InfcSessionProxy; typedef struct _InfcSessionProxyClass InfcSessionProxyClass; struct _InfcSessionProxyClass { GObjectClass parent_class; GError* (*translate_error)(InfcSessionProxy* session, GQuark domain, guint code); }; struct _InfcSessionProxy { GObject parent; }; GType infc_session_proxy_get_type(void) G_GNUC_CONST; void infc_session_proxy_set_connection(InfcSessionProxy* proxy, InfCommunicationJoinedGroup* group, InfXmlConnection* connection, guint seq_id); InfcUserRequest* infc_session_proxy_join_user(InfcSessionProxy* proxy, const GParameter* params, guint n_params, GError** error); InfSession* infc_session_proxy_get_session(InfcSessionProxy* proxy); InfXmlConnection* infc_session_proxy_get_connection(InfcSessionProxy* proxy); InfCommunicationJoinedGroup* infc_session_proxy_get_subscription_group(InfcSessionProxy* proxy); G_END_DECLS #endif /* __INFC_SESSION_PROXY_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/client/infc-request-manager.h0000644000175000017500000001104412264763732020762 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INFC_REQUEST_MANAGER_H__ #define __INFC_REQUEST_MANAGER_H__ #include #include #include G_BEGIN_DECLS #define INFC_TYPE_REQUEST_MANAGER (infc_request_manager_get_type()) #define INFC_REQUEST_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INFC_TYPE_REQUEST_MANAGER, InfcRequestManager)) #define INFC_REQUEST_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INFC_TYPE_REQUEST_MANAGER, InfcRequestManagerClass)) #define INFC_IS_REQUEST_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INFC_TYPE_REQUEST_MANAGER)) #define INFC_IS_REQUEST_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INFC_TYPE_REQUEST_MANAGER)) #define INFC_REQUEST_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), INFC_TYPE_REQUEST_MANAGER, InfcRequestManagerClass)) typedef struct _InfcRequestManager InfcRequestManager; typedef struct _InfcRequestManagerClass InfcRequestManagerClass; struct _InfcRequestManagerClass { GObjectClass parent_class; void (*request_add)(InfcRequestManager* manager, InfcRequest* request); void (*request_remove)(InfcRequestManager* manager, InfcRequest* request); }; struct _InfcRequestManager { GObject parent; }; typedef void(*InfcRequestManagerForeachFunc)(InfcRequest*, gpointer); GType infc_request_manager_get_type(void) G_GNUC_CONST; InfcRequestManager* infc_request_manager_new(guint seq_id); InfcRequest* infc_request_manager_add_request(InfcRequestManager* manager, GType request_type, const gchar* request_name, const gchar* first_property_name, ...); InfcRequest* infc_request_manager_add_request_valist(InfcRequestManager* manager, GType request_type, const gchar* request_name, const gchar* first_property_name, va_list arglist); void infc_request_manager_remove_request(InfcRequestManager* manager, InfcRequest* request); void infc_request_manager_fail_request(InfcRequestManager* manager, InfcRequest* request, GError* error); void infc_request_manager_clear(InfcRequestManager* manager); InfcRequest* infc_request_manager_get_request_by_seq(InfcRequestManager* manager, guint seq); InfcRequest* infc_request_manager_get_request_by_xml(InfcRequestManager* manager, const gchar* name, xmlNodePtr xml, GError** error); InfcRequest* infc_request_manager_get_request_by_xml_required(InfcRequestManager* manager, const gchar* name, xmlNodePtr xml, GError** error); void infc_request_manager_foreach_request(InfcRequestManager* manager, InfcRequestManagerForeachFunc func, gpointer user_data); void infc_request_manager_foreach_named_request(InfcRequestManager* manager, const gchar* name, InfcRequestManagerForeachFunc func, gpointer user_data); G_END_DECLS #endif /* __INFC_REQUEST_MANAGER_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/client/infc-explore-request.h0000644000175000017500000000672712264763732021042 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INFC_EXPLORE_REQUEST_H__ #define __INFC_EXPLORE_REQUEST_H__ #include #include G_BEGIN_DECLS #define INFC_TYPE_EXPLORE_REQUEST (infc_explore_request_get_type()) #define INFC_EXPLORE_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INFC_TYPE_EXPLORE_REQUEST, InfcExploreRequest)) #define INFC_EXPLORE_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INFC_TYPE_EXPLORE_REQUEST, InfcExploreRequestClass)) #define INFC_IS_EXPLORE_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INFC_TYPE_EXPLORE_REQUEST)) #define INFC_IS_EXPLORE_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INFC_TYPE_EXPLORE_REQUEST)) #define INFC_EXPLORE_REQUEST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), INFC_TYPE_EXPLORE_REQUEST, InfcExploreRequestClass)) typedef struct _InfcExploreRequest InfcExploreRequest; typedef struct _InfcExploreRequestClass InfcExploreRequestClass; /** * InfcExploreRequestClass: * @initiated: Default signal handler for the #InfcExploreRequest::initiated * signal. * @progress: Default signal handler for the #InfcExploreRequest::progress * signal. * @finished: Default signal handler for the #InfcExploreRequest::finished * signal. * * This structure contains default signal handlers for #InfcExploreRequest. */ struct _InfcExploreRequestClass { /*< private >*/ InfcRequestClass parent_class; /*< public >*/ /* Signals */ void (*initiated)(InfcExploreRequest *explore_request, guint total); void (*progress)(InfcExploreRequest* explore_request, guint current, guint total); void (*finished)(InfcExploreRequest* explore_request); }; /** * InfcExploreRequest: * * #InfcExploreRequest is an opaque data type. You should only access it via * the public API functions. */ struct _InfcExploreRequest { /*< private >*/ InfcRequest parent; }; GType infc_explore_request_get_type(void) G_GNUC_CONST; guint infc_explore_request_get_node_id(InfcExploreRequest* request); void infc_explore_request_initiated(InfcExploreRequest* request, guint total); gboolean infc_explore_request_progress(InfcExploreRequest* request, GError** error); gboolean infc_explore_request_finished(InfcExploreRequest* request, GError** error); gboolean infc_explore_request_get_initiated(InfcExploreRequest* request); gboolean infc_explore_request_get_finished(InfcExploreRequest* request); G_END_DECLS #endif /* __INFC_EXPLORE_REQUEST_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/client/infc-user-request.c0000644000175000017500000000704612264763732020330 00000000000000/* infcinote - Collaborative notetaking application * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include enum { FINISHED, LAST_SIGNAL }; #define INFC_USER_REQUEST_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), INFC_TYPE_USER_REQUEST, InfcUserRequestPrivate)) static InfcRequestClass* parent_class; static guint user_request_signals[LAST_SIGNAL]; static void infc_user_request_init(GTypeInstance* instance, gpointer g_class) { InfcUserRequest* user_request; user_request = INFC_USER_REQUEST(instance); } static void infc_user_request_finalize(GObject* object) { InfcUserRequest* request; request = INFC_USER_REQUEST(object); if(G_OBJECT_CLASS(parent_class)->finalize != NULL) G_OBJECT_CLASS(parent_class)->finalize(object); } static void infc_user_request_class_init(gpointer g_class, gpointer class_data) { GObjectClass* object_class; InfcUserRequestClass* request_class; object_class = G_OBJECT_CLASS(g_class); request_class = INFC_USER_REQUEST_CLASS(g_class); parent_class = INFC_REQUEST_CLASS(g_type_class_peek_parent(g_class)); object_class->finalize = infc_user_request_finalize; request_class->finished = NULL; user_request_signals[FINISHED] = g_signal_new( "finished", G_OBJECT_CLASS_TYPE(object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(InfcUserRequestClass, finished), NULL, NULL, inf_marshal_VOID__OBJECT, G_TYPE_NONE, 1, INF_TYPE_USER ); } GType infc_user_request_get_type(void) { static GType user_request_type = 0; if(!user_request_type) { static const GTypeInfo user_request_type_info = { sizeof(InfcUserRequestClass), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ infc_user_request_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InfcUserRequest), /* instance_size */ 0, /* n_preallocs */ infc_user_request_init, /* instance_init */ NULL /* value_table */ }; user_request_type = g_type_register_static( INFC_TYPE_REQUEST, "InfcUserRequest", &user_request_type_info, 0 ); } return user_request_type; } /** * infc_user_request_finished: * @request: A #InfcUserRequest. * @user: The #InfUser affected by the request. * * Emits the "finished" signal on @request. **/ void infc_user_request_finished(InfcUserRequest* request, InfUser* user) { g_signal_emit(G_OBJECT(request), user_request_signals[FINISHED], 0, user); } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/client/Makefile.in0000644000175000017500000010124212264766065016643 00000000000000# Makefile.in generated by automake 1.13.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = libinfinity/client DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/mkinstalldirs $(top_srcdir)/depcomp \ $(libinfinity_client_la_HEADERS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/libinfinity/inf-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libinfinity_client_la_LIBADD = am_libinfinity_client_la_OBJECTS = \ libinfinity_client_la-infc-browser.lo \ libinfinity_client_la-infc-browser-iter.lo \ libinfinity_client_la-infc-explore-request.lo \ libinfinity_client_la-infc-node-request.lo \ libinfinity_client_la-infc-request.lo \ libinfinity_client_la-infc-request-manager.lo \ libinfinity_client_la-infc-session-proxy.lo \ libinfinity_client_la-infc-user-request.lo libinfinity_client_la_OBJECTS = $(am_libinfinity_client_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -I$(top_builddir)/libinfinity 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) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libinfinity_client_la_SOURCES) DIST_SOURCES = $(libinfinity_client_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libinfinity_client_ladir)" HEADERS = $(libinfinity_client_la_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBINFINITY_API_VERSION = @LIBINFINITY_API_VERSION@ LIBINFINITY_LIBTOOL_VERSION = @LIBINFINITY_LIBTOOL_VERSION@ LIBINFINITY_VERSION = @LIBINFINITY_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ avahi_CFLAGS = @avahi_CFLAGS@ avahi_LIBS = @avahi_LIBS@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gtk_requirement = @gtk_requirement@ gtk_version = @gtk_version@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infgtk_CFLAGS = @infgtk_CFLAGS@ infgtk_LIBS = @infgtk_LIBS@ infinity_CFLAGS = @infinity_CFLAGS@ infinity_LIBS = @infinity_LIBS@ infinoted_CFLAGS = @infinoted_CFLAGS@ infinoted_LIBS = @infinoted_LIBS@ infodir = @infodir@ inftext_CFLAGS = @inftext_CFLAGS@ inftext_LIBS = @inftext_LIBS@ inftextgtk_CFLAGS = @inftextgtk_CFLAGS@ inftextgtk_LIBS = @inftextgtk_LIBS@ install_sh = @install_sh@ libdaemon_CFLAGS = @libdaemon_CFLAGS@ libdaemon_LIBS = @libdaemon_LIBS@ 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@ noinst_LTLIBRARIES = libinfinity_client.la libinfinity_client_la_CPPFLAGS = \ -I$(top_srcdir) \ $(infinity_CFLAGS) libinfinity_client_ladir = \ $(includedir)/libinfinity-$(LIBINFINITY_API_VERSION)/libinfinity/client libinfinity_client_la_SOURCES = \ infc-browser.c \ infc-browser-iter.c \ infc-explore-request.c \ infc-node-request.c \ infc-request.c \ infc-request-manager.c \ infc-session-proxy.c \ infc-user-request.c libinfinity_client_la_HEADERS = \ infc-browser.h \ infc-browser-iter.h \ infc-explore-request.h \ infc-node-request.h \ infc-note-plugin.h \ infc-request.h \ infc-request-manager.h \ infc-session-proxy.h \ infc-user-request.h all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libinfinity/client/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu libinfinity/client/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libinfinity_client.la: $(libinfinity_client_la_OBJECTS) $(libinfinity_client_la_DEPENDENCIES) $(EXTRA_libinfinity_client_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libinfinity_client_la_OBJECTS) $(libinfinity_client_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_client_la-infc-browser-iter.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_client_la-infc-browser.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_client_la-infc-explore-request.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_client_la-infc-node-request.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_client_la-infc-request-manager.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_client_la-infc-request.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_client_la-infc-session-proxy.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_client_la-infc-user-request.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< libinfinity_client_la-infc-browser.lo: infc-browser.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_client_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_client_la-infc-browser.lo -MD -MP -MF $(DEPDIR)/libinfinity_client_la-infc-browser.Tpo -c -o libinfinity_client_la-infc-browser.lo `test -f 'infc-browser.c' || echo '$(srcdir)/'`infc-browser.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_client_la-infc-browser.Tpo $(DEPDIR)/libinfinity_client_la-infc-browser.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='infc-browser.c' object='libinfinity_client_la-infc-browser.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_client_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_client_la-infc-browser.lo `test -f 'infc-browser.c' || echo '$(srcdir)/'`infc-browser.c libinfinity_client_la-infc-browser-iter.lo: infc-browser-iter.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_client_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_client_la-infc-browser-iter.lo -MD -MP -MF $(DEPDIR)/libinfinity_client_la-infc-browser-iter.Tpo -c -o libinfinity_client_la-infc-browser-iter.lo `test -f 'infc-browser-iter.c' || echo '$(srcdir)/'`infc-browser-iter.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_client_la-infc-browser-iter.Tpo $(DEPDIR)/libinfinity_client_la-infc-browser-iter.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='infc-browser-iter.c' object='libinfinity_client_la-infc-browser-iter.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_client_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_client_la-infc-browser-iter.lo `test -f 'infc-browser-iter.c' || echo '$(srcdir)/'`infc-browser-iter.c libinfinity_client_la-infc-explore-request.lo: infc-explore-request.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_client_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_client_la-infc-explore-request.lo -MD -MP -MF $(DEPDIR)/libinfinity_client_la-infc-explore-request.Tpo -c -o libinfinity_client_la-infc-explore-request.lo `test -f 'infc-explore-request.c' || echo '$(srcdir)/'`infc-explore-request.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_client_la-infc-explore-request.Tpo $(DEPDIR)/libinfinity_client_la-infc-explore-request.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='infc-explore-request.c' object='libinfinity_client_la-infc-explore-request.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_client_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_client_la-infc-explore-request.lo `test -f 'infc-explore-request.c' || echo '$(srcdir)/'`infc-explore-request.c libinfinity_client_la-infc-node-request.lo: infc-node-request.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_client_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_client_la-infc-node-request.lo -MD -MP -MF $(DEPDIR)/libinfinity_client_la-infc-node-request.Tpo -c -o libinfinity_client_la-infc-node-request.lo `test -f 'infc-node-request.c' || echo '$(srcdir)/'`infc-node-request.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_client_la-infc-node-request.Tpo $(DEPDIR)/libinfinity_client_la-infc-node-request.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='infc-node-request.c' object='libinfinity_client_la-infc-node-request.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_client_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_client_la-infc-node-request.lo `test -f 'infc-node-request.c' || echo '$(srcdir)/'`infc-node-request.c libinfinity_client_la-infc-request.lo: infc-request.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_client_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_client_la-infc-request.lo -MD -MP -MF $(DEPDIR)/libinfinity_client_la-infc-request.Tpo -c -o libinfinity_client_la-infc-request.lo `test -f 'infc-request.c' || echo '$(srcdir)/'`infc-request.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_client_la-infc-request.Tpo $(DEPDIR)/libinfinity_client_la-infc-request.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='infc-request.c' object='libinfinity_client_la-infc-request.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_client_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_client_la-infc-request.lo `test -f 'infc-request.c' || echo '$(srcdir)/'`infc-request.c libinfinity_client_la-infc-request-manager.lo: infc-request-manager.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_client_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_client_la-infc-request-manager.lo -MD -MP -MF $(DEPDIR)/libinfinity_client_la-infc-request-manager.Tpo -c -o libinfinity_client_la-infc-request-manager.lo `test -f 'infc-request-manager.c' || echo '$(srcdir)/'`infc-request-manager.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_client_la-infc-request-manager.Tpo $(DEPDIR)/libinfinity_client_la-infc-request-manager.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='infc-request-manager.c' object='libinfinity_client_la-infc-request-manager.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_client_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_client_la-infc-request-manager.lo `test -f 'infc-request-manager.c' || echo '$(srcdir)/'`infc-request-manager.c libinfinity_client_la-infc-session-proxy.lo: infc-session-proxy.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_client_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_client_la-infc-session-proxy.lo -MD -MP -MF $(DEPDIR)/libinfinity_client_la-infc-session-proxy.Tpo -c -o libinfinity_client_la-infc-session-proxy.lo `test -f 'infc-session-proxy.c' || echo '$(srcdir)/'`infc-session-proxy.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_client_la-infc-session-proxy.Tpo $(DEPDIR)/libinfinity_client_la-infc-session-proxy.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='infc-session-proxy.c' object='libinfinity_client_la-infc-session-proxy.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_client_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_client_la-infc-session-proxy.lo `test -f 'infc-session-proxy.c' || echo '$(srcdir)/'`infc-session-proxy.c libinfinity_client_la-infc-user-request.lo: infc-user-request.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_client_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_client_la-infc-user-request.lo -MD -MP -MF $(DEPDIR)/libinfinity_client_la-infc-user-request.Tpo -c -o libinfinity_client_la-infc-user-request.lo `test -f 'infc-user-request.c' || echo '$(srcdir)/'`infc-user-request.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_client_la-infc-user-request.Tpo $(DEPDIR)/libinfinity_client_la-infc-user-request.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='infc-user-request.c' object='libinfinity_client_la-infc-user-request.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_client_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_client_la-infc-user-request.lo `test -f 'infc-user-request.c' || echo '$(srcdir)/'`infc-user-request.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-libinfinity_client_laHEADERS: $(libinfinity_client_la_HEADERS) @$(NORMAL_INSTALL) @list='$(libinfinity_client_la_HEADERS)'; test -n "$(libinfinity_client_ladir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(libinfinity_client_ladir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libinfinity_client_ladir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libinfinity_client_ladir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(libinfinity_client_ladir)" || exit $$?; \ done uninstall-libinfinity_client_laHEADERS: @$(NORMAL_UNINSTALL) @list='$(libinfinity_client_la_HEADERS)'; test -n "$(libinfinity_client_ladir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(libinfinity_client_ladir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libinfinity_client_ladir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-libinfinity_client_laHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libinfinity_client_laHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-libinfinity_client_laHEADERS \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-libinfinity_client_laHEADERS # 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: libinfinity-0.5.5/libinfinity/client/infc-user-request.h0000644000175000017500000000436112264763732020332 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INFC_USER_REQUEST_H__ #define __INFC_USER_REQUEST_H__ #include #include #include G_BEGIN_DECLS #define INFC_TYPE_USER_REQUEST (infc_user_request_get_type()) #define INFC_USER_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INFC_TYPE_USER_REQUEST, InfcUserRequest)) #define INFC_USER_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INFC_TYPE_USER_REQUEST, InfcUserRequestClass)) #define INFC_IS_USER_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INFC_TYPE_USER_REQUEST)) #define INFC_IS_USER_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INFC_TYPE_USER_REQUEST)) #define INFC_USER_REQUEST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), INFC_TYPE_USER_REQUEST, InfcUserRequestClass)) typedef struct _InfcUserRequest InfcUserRequest; typedef struct _InfcUserRequestClass InfcUserRequestClass; struct _InfcUserRequestClass { InfcRequestClass parent_class; /* Signals */ void (*finished)(InfcUserRequest* request, InfUser* user); }; struct _InfcUserRequest { InfcRequest parent; }; GType infc_user_request_get_type(void) G_GNUC_CONST; void infc_user_request_finished(InfcUserRequest* request, InfUser* user); G_END_DECLS #endif /* __INFC_USER_REQUEST_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/client/infc-session-proxy.c0000644000175000017500000010705012264763732020522 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include #include #include #include #include #include #include typedef struct _InfcSessionProxyPrivate InfcSessionProxyPrivate; struct _InfcSessionProxyPrivate { InfSession* session; InfCommunicationJoinedGroup* subscription_group; InfXmlConnection* connection; InfcRequestManager* request_manager; }; #define INFC_SESSION_PROXY_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), INFC_TYPE_SESSION_PROXY, InfcSessionProxyPrivate)) static GObjectClass* parent_class; enum { PROP_0, PROP_SESSION, PROP_SUBSCRIPTION_GROUP, PROP_SEQUENCE_ID, PROP_CONNECTION }; static void infc_session_proxy_release_connection(InfcSessionProxy* proxy); static void infc_session_proxy_unsubscribe_connection(InfcSessionProxy* proxy) { InfcSessionProxyPrivate* priv; InfSessionSyncStatus sync_status; InfXmlConnectionStatus conn_status; xmlNodePtr xml; priv = INFC_SESSION_PROXY_PRIVATE(proxy); g_assert(priv->connection != NULL); g_assert(priv->session != NULL); sync_status = inf_session_get_synchronization_status( priv->session, priv->connection ); g_object_get(G_OBJECT(priv->connection), "status", &conn_status, NULL); /* If synchronization is still in progress, the close default signal * handler in InfSession the base class will cancel the synchronization in * which case we do not need to send an extra session-unsubscribe * message. */ /* However, in case we are in AWAITING_ACK status we send session * unsubscribe because we cannot cancel the synchronization anymore but * the server will go into RUNNING state before receiving this message. */ /* Note that, also, the connection might not be open anymore at this point * if a handler for the connection's notify::status signal finalized or * closed the session explicitely before our handler was called. Therefore * we also check the connection status here. */ if(conn_status == INF_XML_CONNECTION_OPEN && sync_status != INF_SESSION_SYNC_IN_PROGRESS) { xml = xmlNewNode(NULL, (const xmlChar*)"session-unsubscribe"); inf_communication_group_send_message( INF_COMMUNICATION_GROUP(priv->subscription_group), priv->connection, xml ); } infc_session_proxy_release_connection(proxy); } /* * Signal handlers */ static void infc_session_proxy_connection_notify_status_cb(InfXmlConnection* connection, GParamSpec* pspec, gpointer user_data) { InfcSessionProxy* proxy; InfXmlConnectionStatus status; proxy = INFC_SESSION_PROXY(user_data); g_object_get(G_OBJECT(connection), "status", &status, NULL); if(status == INF_XML_CONNECTION_CLOSED || status == INF_XML_CONNECTION_CLOSING) { /* Reset connection in case of closure */ infc_session_proxy_release_connection(proxy); } } static void infc_session_proxy_session_synchronization_complete_cb(InfSession* session, InfXmlConnection* conn, gpointer user_data) { InfcSessionProxy* proxy; InfcSessionProxyPrivate* priv; InfSessionStatus status; proxy = INFC_SESSION_PROXY(user_data); priv = INFC_SESSION_PROXY_PRIVATE(proxy); g_object_get(G_OBJECT(session), "status", &status, NULL); /* There are actually 4 different situations here, depending on status * and priv->connection: * * 1) status == SYNCHRONIZING and priv->connection == NULL * This means that someone synchronized its session to us, but we are not * subscribed to that session. * * 2) status == SYNCHRONIZING and priv->connection != NULL * This means that someone synchronized us and we are subscribed to that * session. * * 3) status == RUNNING and priv->connection == NULL * This means that we synchronized our session to someone else but are * not subscribed to any session. * * 4) status == RUNNING and priv->connection != NULL * This means that we synchronized our session to someone else and are * subscribed to a session (possibly on another host as the one we * synchronized to!). */ if(status == INF_SESSION_SYNCHRONIZING) { if(priv->connection != NULL) { /* The connection that synchronized the session to us should be the * one we subscribed to. */ g_assert(priv->connection == conn); } } } static void infc_session_proxy_session_synchronization_failed_cb(InfSession* session, InfXmlConnection* conn, const GError* error, gpointer user_data) { InfcSessionProxy* proxy; InfcSessionProxyPrivate* priv; InfSessionStatus status; proxy = INFC_SESSION_PROXY(user_data); priv = INFC_SESSION_PROXY_PRIVATE(proxy); g_object_get(G_OBJECT(session), "status", &status, NULL); switch(status) { case INF_SESSION_SYNCHRONIZING: /* When the synchronization failed in synchronizing state, the session * will close itself anyway which is where we do the cleanup in this * case. */ break; case INF_SESSION_RUNNING: /* We do not need to send an explicit session-unsubscribe, because the * failed synchronization should already let the host know that * subscription makes no sense anymore. */ /* If the synchronization failed because the connection was closed, then * the connection might not exist anymore at this point since the * notify::status handler ran before this handler. */ if(priv->connection != NULL) infc_session_proxy_release_connection(proxy); break; case INF_SESSION_CLOSED: default: g_assert_not_reached(); break; } } static void infc_session_proxy_session_close_cb(InfSession* session, gpointer user_data) { InfcSessionProxy* proxy; InfcSessionProxyPrivate* priv; proxy = INFC_SESSION_PROXY(user_data); priv = INFC_SESSION_PROXY_PRIVATE(proxy); if(priv->connection != NULL) infc_session_proxy_unsubscribe_connection(proxy); /* Don't release session so others can still access */ #if 0 inf_signal_handlers_disconnect_by_func( G_OBJECT(priv->session), G_CALLBACK(infc_session_proxy_session_close_cb), proxy ); inf_signal_handlers_disconnect_by_func( G_OBJECT(priv->session), G_CALLBACK(infc_session_proxy_session_synchronization_complete_cb), proxy ); inf_signal_handlers_disconnect_by_func( G_OBJECT(priv->session), G_CALLBACK(infc_session_proxy_session_synchronization_failed_cb), proxy ); g_object_unref(G_OBJECT(priv->session)); priv->session = NULL; #endif } /* * Helper functions */ static void infc_session_proxy_release_connection_foreach_user_func(InfUser* user, gpointer user_data) { g_object_set(G_OBJECT(user), "status", INF_USER_UNAVAILABLE, NULL); } static void infc_session_proxy_release_connection(InfcSessionProxy* proxy) { InfcSessionProxyPrivate* priv; priv = INFC_SESSION_PROXY_PRIVATE(proxy); g_assert(priv->connection != NULL); g_assert(priv->subscription_group != NULL); /* TODO: Emit failed signal with some "cancelled" error? */ infc_request_manager_clear(priv->request_manager); g_object_unref(priv->request_manager); priv->request_manager = NULL; /* Set status of all users to unavailable */ /* TODO: Keep local users available */ inf_user_table_foreach_user( inf_session_get_user_table(priv->session), infc_session_proxy_release_connection_foreach_user_func, NULL ); inf_signal_handlers_disconnect_by_func( G_OBJECT(priv->connection), G_CALLBACK(infc_session_proxy_connection_notify_status_cb), proxy ); inf_session_set_subscription_group(priv->session, NULL); g_object_unref(priv->subscription_group); priv->subscription_group = NULL; g_object_unref(G_OBJECT(priv->connection)); priv->connection = NULL; g_object_notify(G_OBJECT(proxy), "connection"); g_object_notify(G_OBJECT(proxy), "subscription-group"); } static xmlNodePtr infc_session_proxy_request_to_xml(InfcRequest* request) { xmlNodePtr xml; gchar seq_buffer[16]; xml = xmlNewNode(NULL, (const xmlChar*)infc_request_get_name(request)); sprintf(seq_buffer, "%u", infc_request_get_seq(request)); xmlNewProp(xml, (const xmlChar*)"seq", (const xmlChar*)seq_buffer); return xml; } /* * GObject overrides. */ static void infc_session_proxy_init(GTypeInstance* instance, gpointer g_class) { InfcSessionProxy* proxy; InfcSessionProxyPrivate* priv; proxy = INFC_SESSION_PROXY(instance); priv = INFC_SESSION_PROXY_PRIVATE(proxy); priv->session = NULL; priv->subscription_group = NULL; priv->connection = NULL; priv->request_manager = NULL; } static void infc_session_proxy_dispose(GObject* object) { InfcSessionProxy* proxy; InfcSessionProxyPrivate* priv; proxy = INFC_SESSION_PROXY(object); priv = INFC_SESSION_PROXY_PRIVATE(proxy); if(priv->connection) infc_session_proxy_unsubscribe_connection(proxy); /* Release session */ if(priv->session != NULL) { inf_signal_handlers_disconnect_by_func( G_OBJECT(priv->session), G_CALLBACK(infc_session_proxy_session_close_cb), proxy ); inf_signal_handlers_disconnect_by_func( G_OBJECT(priv->session), G_CALLBACK(infc_session_proxy_session_synchronization_complete_cb), proxy ); inf_signal_handlers_disconnect_by_func( G_OBJECT(priv->session), G_CALLBACK(infc_session_proxy_session_synchronization_failed_cb), proxy ); g_object_unref(G_OBJECT(priv->session)); priv->session = NULL; } g_assert(priv->request_manager == NULL); G_OBJECT_CLASS(parent_class)->dispose(object); } static void infc_session_proxy_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec) { InfcSessionProxy* proxy; InfcSessionProxyPrivate* priv; proxy = INFC_SESSION_PROXY(object); priv = INFC_SESSION_PROXY_PRIVATE(proxy); switch(prop_id) { case PROP_SESSION: g_assert(priv->session == NULL); /* construct only */ priv->session = INF_SESSION(g_value_dup_object(value)); g_signal_connect( G_OBJECT(priv->session), "close", G_CALLBACK(infc_session_proxy_session_close_cb), proxy ); g_signal_connect( G_OBJECT(priv->session), "synchronization-complete", G_CALLBACK(infc_session_proxy_session_synchronization_complete_cb), proxy ); g_signal_connect( G_OBJECT(priv->session), "synchronization-failed", G_CALLBACK(infc_session_proxy_session_synchronization_failed_cb), proxy ); break; case PROP_SUBSCRIPTION_GROUP: case PROP_CONNECTION: /* these are read-only because they can only be changed both at once, * refer to infc_session_proxy_set_connection(). */ default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void infc_session_proxy_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec) { InfcSessionProxy* session; InfcSessionProxyPrivate* priv; session = INFC_SESSION_PROXY(object); priv = INFC_SESSION_PROXY_PRIVATE(session); switch(prop_id) { case PROP_SESSION: g_value_set_object(value, G_OBJECT(priv->session)); break; case PROP_SUBSCRIPTION_GROUP: g_value_set_boxed(value, priv->subscription_group); break; case PROP_CONNECTION: g_value_set_object(value, G_OBJECT(priv->connection)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static GError* infc_session_proxy_translate_error_impl(InfcSessionProxy* proxy, GQuark domain, guint code) { GError* error; const gchar* error_msg; if(domain == inf_request_error_quark()) error_msg = inf_request_strerror(code); else if(domain == inf_user_error_quark()) error_msg = inf_user_strerror(code); else error_msg = NULL; error = NULL; if(error_msg != NULL) { g_set_error(&error, domain, code, "%s", error_msg); } else { /* TODO: Check whether a human-readable error string was sent (that * we cannot translate then, of course). */ g_set_error( &error, inf_request_error_quark(), INF_REQUEST_ERROR_UNKNOWN_DOMAIN, _("Error comes from unknown error domain '%s' (code %u)"), g_quark_to_string(domain), (guint)code ); } return error; } /* * Message handling. */ static gboolean infc_session_proxy_handle_user_join(InfcSessionProxy* proxy, InfXmlConnection* connection, xmlNodePtr xml, GError** error) { InfcSessionProxyPrivate* priv; InfSessionClass* session_class; InfcRequest* request; GArray* array; InfUser* user; GParameter* param; guint i; priv = INFC_SESSION_PROXY_PRIVATE(proxy); session_class = INF_SESSION_GET_CLASS(priv->session); request = infc_request_manager_get_request_by_xml( priv->request_manager, "user-join", xml, NULL ); array = session_class->get_xml_user_props(priv->session, connection, xml); /* Set local flag if the join was requested by us (seq is present in * server response). */ param = inf_session_get_user_property(array, "flags"); g_assert(!G_IS_VALUE(¶m->value)); /* must not have been set already */ g_value_init(¶m->value, INF_TYPE_USER_FLAGS); if(request != NULL) g_value_set_flags(¶m->value, INF_USER_LOCAL); else g_value_set_flags(¶m->value, 0); /* Set connection. If none was given, use publisher connection */ param = inf_session_get_user_property(array, "connection"); if(!G_IS_VALUE(¶m->value)) { g_value_init(¶m->value, INF_TYPE_XML_CONNECTION); g_value_set_object(¶m->value, G_OBJECT(connection)); } /* This validates properties */ user = inf_session_add_user( priv->session, (const GParameter*)array->data, array->len, error ); for(i = 0; i < array->len; ++ i) g_value_unset(&g_array_index(array, GParameter, i).value); g_array_free(array, TRUE); if(user != NULL) { if(request != NULL) { infc_user_request_finished(INFC_USER_REQUEST(request), user); infc_request_manager_remove_request(priv->request_manager, request); } return TRUE; } else { return FALSE; } } static gboolean infc_session_proxy_handle_user_rejoin(InfcSessionProxy* proxy, InfXmlConnection* connection, xmlNodePtr xml, GError** error) { InfcSessionProxyPrivate* priv; InfSessionClass* session_class; InfcRequest* request; GArray* array; InfUser* user; const GParameter* idparam; GParameter* param; guint id; gboolean result; guint i; priv = INFC_SESSION_PROXY_PRIVATE(proxy); session_class = INF_SESSION_GET_CLASS(priv->session); request = infc_request_manager_get_request_by_xml( priv->request_manager, "user-join", xml, NULL ); array = session_class->get_xml_user_props(priv->session, connection, xml); /* Find rejoining user first */ idparam = inf_session_lookup_user_property( (const GParameter*)array->data, array->len, "id" ); if(idparam == NULL) { g_set_error( error, inf_request_error_quark(), INF_REQUEST_ERROR_NO_SUCH_ATTRIBUTE, "%s", _("Request does not contain required attribute 'id'") ); goto error; } id = g_value_get_uint(&idparam->value); user = inf_user_table_lookup_user_by_id( inf_session_get_user_table(priv->session), id ); if(user == NULL) { g_set_error( error, inf_user_error_quark(), INF_USER_ERROR_NO_SUCH_USER, _("No such user with ID %u"), id ); goto error; } /* Set local flag if the join was requested by us (seq is present in * server response). */ param = inf_session_get_user_property(array, "flags"); g_assert(!G_IS_VALUE(¶m->value)); /* must not have been set already */ g_value_init(¶m->value, INF_TYPE_USER_FLAGS); if(request != NULL) g_value_set_flags(¶m->value, INF_USER_LOCAL); else g_value_set_flags(¶m->value, 0); /* Set connection. If none was given, use publisher connection */ param = inf_session_get_user_property(array, "connection"); if(!G_IS_VALUE(¶m->value)) { g_value_init(¶m->value, INF_TYPE_XML_CONNECTION); g_value_set_object(¶m->value, G_OBJECT(connection)); } result = session_class->validate_user_props( priv->session, (const GParameter*)array->data, array->len, user, error ); if(result == FALSE) goto error; /* Set properties on the found user object, performing the rejoin */ g_object_freeze_notify(G_OBJECT(user)); for(i = 0; i < array->len; ++ i) { param = &g_array_index(array, GParameter, i); /* Don't set ID because the ID is the same anyway (we did the user lookup * by it). The "id" property is construct only anyway. */ if(strcmp(param->name, "id") != 0) g_object_set_property(G_OBJECT(user), param->name, ¶m->value); } /* TODO: Set user status to available, if the server did not send the * status property? Require the status property being set on a rejoin? * Make sure it is not unavailable? */ g_object_thaw_notify(G_OBJECT(user)); for(i = 0; i < array->len; ++ i) g_value_unset(&g_array_index(array, GParameter, i).value); g_array_free(array, TRUE); if(request != NULL) { infc_user_request_finished(INFC_USER_REQUEST(request), user); infc_request_manager_remove_request(priv->request_manager, request); } return TRUE; error: for(i = 0; i < array->len; ++ i) g_value_unset(&g_array_index(array, GParameter, i).value); g_array_free(array, TRUE); return FALSE; } static gboolean infc_session_proxy_handle_request_failed(InfcSessionProxy* proxy, InfXmlConnection* connection, xmlNodePtr xml, GError** error) { InfcSessionProxyPrivate* priv; InfcSessionProxyClass* proxy_class; xmlChar* domain; gboolean has_code; guint code; GError* req_error; InfcRequest* request; priv = INFC_SESSION_PROXY_PRIVATE(proxy); proxy_class = INFC_SESSION_PROXY_GET_CLASS(proxy); has_code = inf_xml_util_get_attribute_uint_required( xml, "code", &code, error ); if(has_code == FALSE) return FALSE; domain = inf_xml_util_get_attribute_required(xml, "domain", error); if(domain == NULL) return FALSE; req_error = NULL; request = infc_request_manager_get_request_by_xml_required( priv->request_manager, NULL, xml, error ); if(request == NULL) return FALSE; g_assert(proxy_class->translate_error != NULL); /* TODO: Add a GError* paramater to translate_error so that an error * can be reported if the error could not be translated. */ req_error = proxy_class->translate_error( proxy, g_quark_from_string((const gchar*)domain), code ); infc_request_manager_fail_request( priv->request_manager, request, req_error ); g_error_free(req_error); xmlFree(domain); return TRUE; } static gboolean infc_session_proxy_handle_session_close(InfcSessionProxy* proxy, InfXmlConnection* connection, xmlNodePtr xml, GError** error) { InfcSessionProxyPrivate* priv; priv = INFC_SESSION_PROXY_PRIVATE(proxy); g_assert(priv->connection != NULL); infc_session_proxy_release_connection(proxy); /* Do not call inf_session_close so the session can be reused by * reconnecting/synchronizing to another host. */ return TRUE; } /* * InfNetObject implementation */ static void infc_session_proxy_communication_object_sent(InfCommunicationObject* object, InfXmlConnection* connection, xmlNodePtr node) { InfcSessionProxy* proxy; InfcSessionProxyPrivate* priv; proxy = INFC_SESSION_PROXY(object); priv = INFC_SESSION_PROXY_PRIVATE(proxy); /* TODO: Don't forward for messages the proxy issued */ g_assert(priv->session != NULL); inf_communication_object_sent( INF_COMMUNICATION_OBJECT(priv->session), connection, node ); } static void infc_session_proxy_communication_object_enqueued(InfCommunicationObject* obj, InfXmlConnection* connection, xmlNodePtr node) { InfcSessionProxy* proxy; InfcSessionProxyPrivate* priv; proxy = INFC_SESSION_PROXY(obj); priv = INFC_SESSION_PROXY_PRIVATE(proxy); /* TODO: Don't forward for messages the proxy issued */ g_assert(priv->session != NULL); inf_communication_object_enqueued( INF_COMMUNICATION_OBJECT(priv->session), connection, node ); } static InfCommunicationScope infc_session_proxy_communication_object_received(InfCommunicationObject* obj, InfXmlConnection* connection, xmlNodePtr node, GError** error) { InfcSessionProxy* proxy; InfcSessionProxyPrivate* priv; InfcSessionProxyClass* proxy_class; InfSessionSyncStatus status; GError* local_error; InfcRequest* request; GError* seq_error; proxy = INFC_SESSION_PROXY(obj); priv = INFC_SESSION_PROXY_PRIVATE(proxy); proxy_class = INFC_SESSION_PROXY_GET_CLASS(proxy); status = inf_session_get_synchronization_status(priv->session, connection); local_error = NULL; g_assert(status != INF_SESSION_SYNC_NONE || priv->connection == connection); g_assert(inf_session_get_status(priv->session) != INF_SESSION_CLOSED); if(status != INF_SESSION_SYNC_NONE) { /* Direct delegate during synchronization */ return inf_communication_object_received( INF_COMMUNICATION_OBJECT(priv->session), connection, node, error ); } else { if(strcmp((const char*)node->name, "user-join") == 0) { infc_session_proxy_handle_user_join( proxy, connection, node, &local_error ); } else if(strcmp((const char*)node->name, "user-rejoin") == 0) { infc_session_proxy_handle_user_rejoin( proxy, connection, node, &local_error ); } else if(strcmp((const char*)node->name, "request-failed") == 0) { infc_session_proxy_handle_request_failed( proxy, connection, node, &local_error ); } else if(strcmp((const char*)node->name, "session-close") == 0) { infc_session_proxy_handle_session_close( proxy, connection, node, &local_error ); } else { return inf_communication_object_received( INF_COMMUNICATION_OBJECT(priv->session), connection, node, error ); } } if(local_error != NULL) { /* If the request had a (valid) seq set, we cancel the corresponding * request because the reply could not be processed. */ request = infc_request_manager_get_request_by_xml( priv->request_manager, NULL, node, NULL ); if(request != NULL) { /* If the request had a seq set, we cancel the corresponding request * because the reply could not be processed. */ seq_error = NULL; g_set_error( &seq_error, inf_request_error_quark(), INF_REQUEST_ERROR_REPLY_UNPROCESSED, _("Server reply could not be processed: %s"), local_error->message ); infc_request_manager_fail_request( priv->request_manager, request, seq_error ); g_error_free(seq_error); } g_propagate_error(error, local_error); } /* Don't forward any of the handled messages */ return FALSE; } /* * GType registration. */ static void infc_session_proxy_class_init(gpointer g_class, gpointer class_data) { GObjectClass* object_class; InfcSessionProxyClass* proxy_class; object_class = G_OBJECT_CLASS(g_class); proxy_class = INFC_SESSION_PROXY_CLASS(g_class); parent_class = G_OBJECT_CLASS(g_type_class_peek_parent(g_class)); g_type_class_add_private(g_class, sizeof(InfcSessionProxyPrivate)); object_class->dispose = infc_session_proxy_dispose; object_class->set_property = infc_session_proxy_set_property; object_class->get_property = infc_session_proxy_get_property; proxy_class->translate_error = infc_session_proxy_translate_error_impl; g_object_class_install_property( object_class, PROP_SESSION, g_param_spec_object( "session", "Session", "The underlaying session object", INF_TYPE_SESSION, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); g_object_class_install_property( object_class, PROP_SUBSCRIPTION_GROUP, g_param_spec_object( "subscription-group", "Subscription group", "The communication group of subscribed connections", INF_COMMUNICATION_TYPE_JOINED_GROUP, G_PARAM_READABLE ) ); g_object_class_install_property( object_class, PROP_CONNECTION, g_param_spec_object( "connection", "Subscription connection", "The connection with which the session communicates with the server", INF_TYPE_XML_CONNECTION, G_PARAM_READABLE ) ); } static void infc_session_proxy_communication_object_init(gpointer g_iface, gpointer iface_data) { InfCommunicationObjectIface* iface; iface = (InfCommunicationObjectIface*)g_iface; iface->sent = infc_session_proxy_communication_object_sent; iface->enqueued = infc_session_proxy_communication_object_enqueued; iface->received = infc_session_proxy_communication_object_received; } GType infc_session_proxy_get_type(void) { static GType session_proxy_type = 0; if(!session_proxy_type) { static const GTypeInfo session_proxy_type_info = { sizeof(InfcSessionProxyClass), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ infc_session_proxy_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InfcSessionProxy), /* instance_size */ 0, /* n_preallocs */ infc_session_proxy_init, /* instance_init */ NULL /* value_table */ }; static const GInterfaceInfo communication_object_info = { infc_session_proxy_communication_object_init, NULL, NULL }; session_proxy_type = g_type_register_static( G_TYPE_OBJECT, "InfcSessionProxy", &session_proxy_type_info, 0 ); g_type_add_interface_static( session_proxy_type, INF_COMMUNICATION_TYPE_OBJECT, &communication_object_info ); } return session_proxy_type; } /* * Public API. */ /** * infc_session_proxy_set_connection: * @proxy: A #InfcSessionProxy. * @group: A #InfCommunicationJoinedGroup of subscribed connections. Ignored * if @connection is %NULL. * @connection: A #InfXmlConnection. * @seq_id: A sequence identifier for @connection. Ignored if @connection * is %NULL. * * Sets the subscription connection for the given session. The subscription * connection is the connection through which session requests are transmitted * during subscription. * * The subscription connection might be set even if the session is in * SYNCHRONIZING state in which case the session is immediately subscribed * after synchronization. Note that no attempt is made to tell the other end * about the subscription. * * @seq_id should be a sequence identifier obtained from the server side. It * must be the same number that is used on the corresponding #InfdSessionProxy * on the remote side, see infd_session_proxy_subscribe_to(). Normally * #InfdDirectory or #InfcBrowser, respectively, take care of passing the * correct sequence identifier. * * When the subscription connection is being closed or replaced (by a * subsequent call to this function), all pending requests are dropped and * all users are set to be unavailable, but the session will not be closed, * so it may be reused by setting another subscription connection. However, * the session might not be synchronized again, but it is fully okay to close * the session by hand (using inf_session_close) and create a new session * that is synchronized. **/ void infc_session_proxy_set_connection(InfcSessionProxy* proxy, InfCommunicationJoinedGroup* group, InfXmlConnection* connection, guint seq_id) { InfcSessionProxyPrivate* priv; xmlNodePtr xml; g_return_if_fail(INFC_IS_SESSION_PROXY(proxy)); g_return_if_fail(connection == NULL || INF_IS_XML_CONNECTION(connection)); g_return_if_fail( (group == NULL && connection == NULL) || (INF_COMMUNICATION_IS_JOINED_GROUP(group) && connection != NULL) ); priv = INFC_SESSION_PROXY_PRIVATE(proxy); g_return_if_fail(priv->session != NULL); g_object_freeze_notify(G_OBJECT(proxy)); g_object_freeze_notify(G_OBJECT(priv->session)); if(priv->connection != NULL) { /* Unsubscribe from running session. Always send the unsubscribe request * because synchronizations are not cancelled through this call. */ xml = xmlNewNode(NULL, (const xmlChar*)"session-unsubscribe"); inf_communication_group_send_message( INF_COMMUNICATION_GROUP(priv->subscription_group), priv->connection, xml ); /* Note that this would cause a notify on the connection property, but * notifications have been freezed until the end of this function call. * Same with the subscription-group property of priv->session. */ infc_session_proxy_release_connection(proxy); } priv->connection = connection; if(connection != NULL) { priv->connection = connection; g_object_ref(G_OBJECT(connection)); g_signal_connect( G_OBJECT(connection), "notify::status", G_CALLBACK(infc_session_proxy_connection_notify_status_cb), proxy ); /* Set new group */ priv->subscription_group = group; g_object_ref(priv->subscription_group); g_assert(priv->request_manager == NULL); priv->request_manager = infc_request_manager_new(seq_id); } inf_session_set_subscription_group( priv->session, INF_COMMUNICATION_GROUP(priv->subscription_group) ); g_object_notify(G_OBJECT(proxy), "connection"); g_object_notify(G_OBJECT(proxy), "subscription-group"); g_object_thaw_notify(G_OBJECT(priv->session)); g_object_thaw_notify(G_OBJECT(proxy)); } /** * infc_session_proxy_join_user: * @proxy: A #InfcSessionProxy. * @params: Construction properties for the InfUser (or derived) object. * @n_params: Number of parameters. * @error: Location to store error information. * * Requests a user join for a user with the given properties (which must not * include #InfUser:id and #InfUser:flags since these are initially set by the * server). The #InfUser:status property is optional and defaults to * %INF_USER_ACTIVE if not given. It must not be %INF_USER_UNAVAILABLE. * * Return Value: A #InfcUserRequest object that may be used to get notified * when the request succeeds or fails. **/ InfcUserRequest* infc_session_proxy_join_user(InfcSessionProxy* proxy, const GParameter* params, guint n_params, GError** error) { InfcSessionProxyPrivate* priv; InfSessionClass* session_class; InfSessionStatus status; InfcRequest* request; xmlNodePtr xml; g_return_val_if_fail(INFC_IS_SESSION_PROXY(proxy), NULL); g_return_val_if_fail(params != NULL || n_params == 0, NULL); priv = INFC_SESSION_PROXY_PRIVATE(proxy); g_return_val_if_fail(priv->session != NULL, NULL); session_class = INF_SESSION_GET_CLASS(priv->session); /* Make sure we are subscribed */ g_object_get(G_OBJECT(priv->session), "status", &status, NULL); g_return_val_if_fail(status == INF_SESSION_RUNNING, NULL); g_return_val_if_fail(priv->connection != NULL, NULL); g_return_val_if_fail(priv->request_manager != NULL, NULL); /* TODO: Check params locally */ request = infc_request_manager_add_request( priv->request_manager, INFC_TYPE_USER_REQUEST, "user-join", NULL ); xml = infc_session_proxy_request_to_xml(INFC_REQUEST(request)); g_assert(session_class->set_xml_user_props != NULL); session_class->set_xml_user_props(priv->session, params, n_params, xml); inf_communication_group_send_message( INF_COMMUNICATION_GROUP(priv->subscription_group), priv->connection, xml ); return INFC_USER_REQUEST(request); } /** * infc_session_proxy_get_session: * @proxy: A #InfcSessionProxy. * * Returns the session proxied by @proxy, or %NULL if the session has been * closed. * * Return Value: A #InfSession, or %NULL. **/ InfSession* infc_session_proxy_get_session(InfcSessionProxy* proxy) { g_return_val_if_fail(INFC_IS_SESSION_PROXY(proxy), NULL); return INFC_SESSION_PROXY_PRIVATE(proxy)->session; } /** * infc_session_proxy_get_connection: * @proxy: A #InfcSessionProxy. * * Returns the connection that is used to transmit requests to the publisher * of the session, or %NULL if the session is not subscribed. * * Returns: A #InfXmlConnection, or %NULL. **/ InfXmlConnection* infc_session_proxy_get_connection(InfcSessionProxy* proxy) { g_return_val_if_fail(INFC_IS_SESSION_PROXY(proxy), NULL); return INFC_SESSION_PROXY_PRIVATE(proxy)->connection; } /** * infc_session_proxy_get_group: * @proxy: A #InfcSessionProxy. * * Returns the group with all subscribed connections to the session, or %NULL * if the session is not subscribed. * * Returns: A #InfCommunicationJoinedGroup, or %NULL. **/ InfCommunicationJoinedGroup* infc_session_proxy_get_subscription_group(InfcSessionProxy* proxy) { g_return_val_if_fail(INFC_IS_SESSION_PROXY(proxy), NULL); return INFC_SESSION_PROXY_PRIVATE(proxy)->subscription_group; } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/client/infc-browser.c0000644000175000017500000042202412264763732017344 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ /** * SECTION:infc-browser * @short_description: Browse remote directories * @see_also: #InfdDirectory * @include: libinfinity/client/infc-browser.h * @stability: Unstable * * The #InfcBrowser is used to browse a remote directory and can be used * to subscribe to sessions. **/ #include #include #include #include #include #include #include #include #include #include #include /* Some Windows header #defines error for no good */ #ifdef G_OS_WIN32 # ifdef ERROR # undef ERROR # endif #endif typedef enum _InfcBrowserNodeType { INFC_BROWSER_NODE_SUBDIRECTORY = 1 << 0, /* We found a plugin to handle the note type */ INFC_BROWSER_NODE_NOTE_KNOWN = 1 << 1, /* There was no plugin registered to handle the note's type */ INFC_BROWSER_NODE_NOTE_UNKNOWN = 1 << 2 } InfcBrowserNodeType; typedef struct _InfcBrowserIterGetExploreRequestForeachData InfcBrowserIterGetExploreRequestForeachData; struct _InfcBrowserIterGetExploreRequestForeachData { const InfcBrowserIter* iter; InfcExploreRequest* result; }; typedef struct _InfcBrowserIterGetNodeRequestForeachData InfcBrowserIterGetNodeRequestForeachData; struct _InfcBrowserIterGetNodeRequestForeachData { const InfcBrowserIter* iter; InfcNodeRequest* result; }; typedef struct _InfcBrowserIterGetSyncInRequestsForeachData InfcBrowserIterGetSyncInRequestsForeachData; struct _InfcBrowserIterGetSyncInRequestsForeachData { const InfcBrowserIter* iter; GSList* result; }; typedef struct _InfcBrowserNode InfcBrowserNode; struct _InfcBrowserNode { InfcBrowserNode* parent; InfcBrowserNode* prev; InfcBrowserNode* next; guint id; gchar* name; InfcBrowserNodeType type; /*InfcBrowserNodeStatus status;*/ union { struct { InfcSessionProxy* session; const InfcNotePlugin* plugin; } known; struct { gchar* type; } unknown; struct { /* First child node */ InfcBrowserNode* child; /* Whether we requested the node already from the server. * This is required because the child field may be NULL due to an empty * subdirectory or due to an unexplored subdirectory. */ gboolean explored; } subdir; } shared; }; typedef struct _InfcBrowserSyncIn InfcBrowserSyncIn; struct _InfcBrowserSyncIn { InfcBrowser* browser; InfcBrowserNode* node; InfXmlConnection* connection; /* The connection we are synchronizing to */ /*const InfcNotePlugin* plugin;*/ InfcSessionProxy* proxy; }; typedef enum _InfcBrowserSubreqType { INFC_BROWSER_SUBREQ_CHAT, INFC_BROWSER_SUBREQ_SESSION, INFC_BROWSER_SUBREQ_ADD_NODE, INFC_BROWSER_SUBREQ_SYNC_IN } InfcBrowserSubreqType; typedef struct _InfcBrowserSubreq InfcBrowserSubreq; struct _InfcBrowserSubreq { InfcBrowserSubreqType type; /* TODO: This should maybe go to shared, as not required for chat: */ guint node_id; union { struct { InfcNodeRequest* request; InfCommunicationJoinedGroup* subscription_group; } chat; struct { InfcBrowserNode* node; InfcNodeRequest* request; InfCommunicationJoinedGroup* subscription_group; } session; struct { InfcBrowserNode* parent; const InfcNotePlugin* plugin; gchar* name; InfcNodeRequest* request; InfCommunicationJoinedGroup* subscription_group; } add_node; struct { InfcBrowserNode* parent; const InfcNotePlugin* plugin; gchar* name; InfcNodeRequest* request; InfCommunicationJoinedGroup* synchronization_group; InfCommunicationJoinedGroup* subscription_group; /* can be NULL */ InfSession* session; } sync_in; } shared; }; typedef struct _InfcBrowserPrivate InfcBrowserPrivate; struct _InfcBrowserPrivate { InfIo* io; InfCommunicationManager* communication_manager; InfCommunicationJoinedGroup* group; InfXmlConnection* connection; guint seq_id; InfIoTimeout* welcome_timeout; InfcRequestManager* request_manager; GHashTable* plugins; /* Registered plugins */ InfcBrowserStatus status; GHashTable* nodes; /* Mapping from id to node */ InfcBrowserNode* root; GSList* sync_ins; GSList* subscription_requests; InfcSessionProxy* chat_session; }; #define INFC_BROWSER_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), INFC_TYPE_BROWSER, InfcBrowserPrivate)) enum { PROP_0, PROP_IO, PROP_COMMUNICATION_MANAGER, PROP_CONNECTION, /* read only */ PROP_STATUS, PROP_CHAT_SESSION }; enum { ERROR, NODE_ADDED, NODE_REMOVED, SUBSCRIBE_SESSION, BEGIN_EXPLORE, BEGIN_SUBSCRIBE, LAST_SIGNAL }; /* These make sure that the node iter points to is contained in browser */ #define infc_browser_return_if_iter_fail(browser, iter) \ g_return_if_fail( \ iter != NULL && \ g_hash_table_lookup( \ INFC_BROWSER_PRIVATE(INFC_BROWSER(browser))->nodes, \ GUINT_TO_POINTER((iter)->node_id) \ ) == (iter)->node \ ) #define infc_browser_return_val_if_iter_fail(browser, iter, val) \ g_return_val_if_fail( \ iter != NULL && \ g_hash_table_lookup( \ INFC_BROWSER_PRIVATE(INFC_BROWSER(browser))->nodes, \ GUINT_TO_POINTER((iter)->node_id) \ ) == (iter)->node, \ val \ ) /* These make sure that node is a subdirectory node */ #define infc_browser_return_if_subdir_fail(node) \ g_return_if_fail( \ ((InfcBrowserNode*)node)->type == INFC_BROWSER_NODE_SUBDIRECTORY \ ) #define infc_browser_return_val_if_subdir_fail(node, val) \ g_return_val_if_fail( \ ((InfcBrowserNode*)node)->type == INFC_BROWSER_NODE_SUBDIRECTORY, \ val \ ) static GObjectClass* parent_class; static guint browser_signals[LAST_SIGNAL]; static GQuark infc_browser_session_proxy_quark; static GQuark infc_browser_sync_in_session_quark; static GQuark infc_browser_sync_in_plugin_quark; /* * Callbacks */ static void infc_browser_iter_get_explore_request_foreach_func(InfcRequest* request, gpointer user_data) { InfcBrowserIterGetExploreRequestForeachData* data; InfcExploreRequest* explore_request; guint node_id; data = (InfcBrowserIterGetExploreRequestForeachData*)user_data; g_assert(INFC_IS_EXPLORE_REQUEST(request)); explore_request = INFC_EXPLORE_REQUEST(request); g_object_get(G_OBJECT(explore_request), "node-id", &node_id, NULL); /* TODO: Stop foreach when we found the request. Requires changes in * InfcRequestManager. */ if(node_id == data->iter->node_id) data->result = explore_request; } static void infc_browser_iter_get_node_request_foreach_func(InfcRequest* request, gpointer user_data) { InfcBrowserIterGetNodeRequestForeachData* data; InfcNodeRequest* node_request; guint node_id; data = (InfcBrowserIterGetNodeRequestForeachData*)user_data; g_assert(INFC_IS_NODE_REQUEST(request)); node_request = INFC_NODE_REQUEST(request); g_object_get(G_OBJECT(node_request), "node-id", &node_id, NULL); /* TODO: Stop foreach when we found the request. Requires changes in * InfcRequestManager. */ if(node_id == data->iter->node_id) data->result = node_request; } static void infc_browser_iter_get_sync_in_requests_foreach_func(InfcRequest* request, gpointer user_data) { InfcBrowserIterGetSyncInRequestsForeachData* data; InfcNodeRequest* node_request; InfSession* session; guint node_id; data = (InfcBrowserIterGetSyncInRequestsForeachData*)user_data; g_assert(INFC_IS_NODE_REQUEST(request)); /* This is only a sync-in request if we assigned a session to sync with */ node_request = INFC_NODE_REQUEST(request); session = g_object_get_qdata( G_OBJECT(node_request), infc_browser_sync_in_session_quark ); if(session) { g_object_get(G_OBJECT(node_request), "node-id", &node_id, NULL); if(node_id == data->iter->node_id) data->result = g_slist_prepend(data->result, node_request); } } static void infc_browser_get_chat_request_foreach_func(InfcRequest* request, gpointer user_data) { InfcBrowserIterGetNodeRequestForeachData* data; data = (InfcBrowserIterGetNodeRequestForeachData*)user_data; g_assert(INFC_IS_NODE_REQUEST(request)); /* There can only be one such request: */ g_assert(data->result == NULL); /* TODO: Stop foreach when we found the request. Requires changes in * InfcRequestManager. */ data->result = INFC_NODE_REQUEST(request); } /* * Path handling */ /* Returns the complete path to this node in the given GString */ static void infc_browser_node_get_path_string(InfcBrowserNode* node, GString* string) { g_return_if_fail(node != NULL); g_return_if_fail(string != NULL); if(node->parent != NULL) { /* Each node except the root node has a name */ g_assert(node->name != NULL); /* Make sure to not recurse if our parent is the root node because * this would add an additional slash */ if(node->parent->parent != NULL) infc_browser_node_get_path_string(node->parent, string); g_string_append_c(string, '/'); g_string_append(string, node->name); } else { /* This node has no parent, so it is the root node */ g_assert(node->name == NULL); g_string_append_c(string, '/'); } } static void infc_browser_node_get_path(InfcBrowserNode* node, gchar** path, gsize* len) { GString* str; g_return_if_fail(node != NULL); g_return_if_fail(path != NULL); str = g_string_sized_new(128); infc_browser_node_get_path_string(node, str); *path = str->str; if(len != NULL) *len = str->len; g_string_free(str, FALSE); } /* * Tree handling */ static void infc_browser_node_link(InfcBrowserNode* node, InfcBrowserNode* parent) { g_assert(parent != NULL); g_assert(parent->type == INFC_BROWSER_NODE_SUBDIRECTORY); node->prev = NULL; if(parent->shared.subdir.child != NULL) { parent->shared.subdir.child->prev = node; node->next = parent->shared.subdir.child; } else { node->next = NULL; } parent->shared.subdir.child = node; } static void infc_browser_node_unlink(InfcBrowserNode* node) { g_assert(node->parent != NULL); g_assert(node->parent->type == INFC_BROWSER_NODE_SUBDIRECTORY); if(node->prev != NULL) node->prev->next = node->next; else node->parent->shared.subdir.child = node->next; if(node->next != NULL) node->next->prev = node->prev; } static InfcBrowserNode* infc_browser_node_new_common(InfcBrowser* browser, InfcBrowserNode* parent, guint id, InfcBrowserNodeType type, const gchar* name) { InfcBrowserPrivate* priv; InfcBrowserNode* node; priv = INFC_BROWSER_PRIVATE(browser); node = g_slice_new(InfcBrowserNode); node->parent = parent; node->type = type; node->id = id; node->name = g_strdup(name); if(parent != NULL) { /*node->status = INFC_BROWSER_NODE_INHERIT;*/ infc_browser_node_link(node, parent); } else { /*node->status = INFC_BROWSER_NODE_SYNC;*/ node->prev = NULL; node->next = NULL; } g_assert( g_hash_table_lookup(priv->nodes, GUINT_TO_POINTER(node->id)) == NULL ); g_hash_table_insert(priv->nodes, GUINT_TO_POINTER(node->id), node); return node; } static InfcBrowserNode* infc_browser_node_new_subdirectory(InfcBrowser* browser, InfcBrowserNode* parent, guint id, const gchar* name) { InfcBrowserNode* node; node = infc_browser_node_new_common( browser, parent, id, INFC_BROWSER_NODE_SUBDIRECTORY, name ); node->shared.subdir.explored = FALSE; node->shared.subdir.child = NULL; return node; } static InfcBrowserNode* infc_browser_node_new_note(InfcBrowser* browser, InfcBrowserNode* parent, guint id, const gchar* name, const gchar* type) { InfcBrowserPrivate* priv; InfcBrowserNode* node; InfcNotePlugin* plugin; priv = INFC_BROWSER_PRIVATE(browser); plugin = g_hash_table_lookup(priv->plugins, type); node = infc_browser_node_new_common( browser, parent, id, (plugin != NULL) ? INFC_BROWSER_NODE_NOTE_KNOWN : INFC_BROWSER_NODE_NOTE_UNKNOWN, name ); if(plugin != NULL) { node->shared.known.plugin = plugin; node->shared.known.session = NULL; } else { node->shared.unknown.type = g_strdup(type); } return node; } /* Required by infc_browser_session_remove_session */ static void infc_browser_session_close_cb(InfSession* session, gpointer user_data); static void infc_browser_session_remove_session(InfcBrowser* browser, InfcBrowserNode* node) { InfSession* session; g_assert(node->type == INFC_BROWSER_NODE_NOTE_KNOWN); g_assert(node->shared.known.session != NULL); session = infc_session_proxy_get_session(node->shared.known.session); inf_signal_handlers_disconnect_by_func( session, G_CALLBACK(infc_browser_session_close_cb), browser ); g_object_set_qdata( G_OBJECT(session), infc_browser_session_proxy_quark, NULL ); g_object_unref(node->shared.known.session); node->shared.known.session = NULL; } static void infc_browser_node_register(InfcBrowser* browser, InfcBrowserNode* node) { InfcBrowserIter iter; iter.node_id = node->id; iter.node = node; g_signal_emit(G_OBJECT(browser), browser_signals[NODE_ADDED], 0, &iter); } static void infc_browser_node_unregister(InfcBrowser* browser, InfcBrowserNode* node) { InfcBrowserIter iter; iter.node_id = node->id; iter.node = node; g_signal_emit(G_OBJECT(browser), browser_signals[NODE_REMOVED], 0, &iter); } /* Required by infc_browser_node_free */ static void infc_browser_remove_sync_in(InfcBrowser* browser, InfcBrowserSyncIn* sync_in); static void infc_browser_remove_subreq(InfcBrowser* browser, InfcBrowserSubreq* request); static void infc_browser_node_free(InfcBrowser* browser, InfcBrowserNode* node) { InfcBrowserPrivate* priv; gboolean removed; GSList* item; InfcBrowserSyncIn* sync_in; InfcBrowserSubreq* request; GError* error; priv = INFC_BROWSER_PRIVATE(browser); switch(node->type) { case INFC_BROWSER_NODE_SUBDIRECTORY: if(node->shared.subdir.explored == TRUE) while(node->shared.subdir.child != NULL) infc_browser_node_free(browser, node->shared.subdir.child); break; case INFC_BROWSER_NODE_NOTE_KNOWN: if(node->shared.known.session != NULL) infc_browser_session_remove_session(browser, node); break; case INFC_BROWSER_NODE_NOTE_UNKNOWN: g_free(node->shared.unknown.type); break; default: g_assert_not_reached(); break; } /* Remove sync-ins that sync into this node */ for(item = priv->sync_ins; item != NULL; ) { sync_in = (InfcBrowserSyncIn*)item->data; item = item->next; if(sync_in->node == node) infc_browser_remove_sync_in(browser, sync_in); } /* Check subscription requests for this node */ for(item = priv->subscription_requests; item != NULL; ) { request = (InfcBrowserSubreq*)item->data; item = item->next; /* TODO: Can't we remove the subscription requests here already, and * assert that a request exists in * infc_browser_communication_object_sent()? Or is there something that * needs to be done in infc_browser_communication_object_sent() even if * the corresponding node has been removed? */ switch(request->type) { case INFC_BROWSER_SUBREQ_SESSION: if(request->shared.session.node == node) { request->shared.session.node = NULL; if(request->shared.session.request != NULL) { error = g_error_new_literal( inf_directory_error_quark(), INF_DIRECTORY_ERROR_NO_SUCH_NODE, _("The node to subscribe to has been removed") ); infc_request_manager_fail_request( priv->request_manager, INFC_REQUEST(request->shared.session.request), error ); g_error_free(error); request->shared.session.request = NULL; } } break; case INFC_BROWSER_SUBREQ_ADD_NODE: if(request->shared.add_node.parent == node) { request->shared.add_node.parent = NULL; if(request->shared.add_node.request != NULL) { error = g_error_new_literal( inf_directory_error_quark(), INF_DIRECTORY_ERROR_NO_SUCH_NODE, _("The subdirectory into which the new node should have been " "created has been removed") ); infc_request_manager_fail_request( priv->request_manager, INFC_REQUEST(request->shared.add_node.request), error ); g_error_free(error); request->shared.add_node.request = NULL; } } break; case INFC_BROWSER_SUBREQ_SYNC_IN: if(request->shared.sync_in.parent == node) { request->shared.sync_in.parent = NULL; g_assert(request->shared.sync_in.request != NULL); error = g_error_new_literal( inf_directory_error_quark(), INF_DIRECTORY_ERROR_NO_SUCH_NODE, _("The subdirectory into which the new node should have been " "created has been removed") ); infc_request_manager_fail_request( priv->request_manager, INFC_REQUEST(request->shared.sync_in.request), error ); g_error_free(error); request->shared.sync_in.request = NULL; } break; default: g_assert_not_reached(); break; } } if(node->parent != NULL) infc_browser_node_unlink(node); removed = g_hash_table_remove(priv->nodes, GUINT_TO_POINTER(node->id)); g_assert(removed == TRUE); g_free(node->name); g_slice_free(InfcBrowserNode, node); } static gboolean infc_browser_node_remove(InfcBrowser* browser, InfcBrowserNode* node, GError** error) { infc_browser_node_unregister(browser, node); infc_browser_node_free(browser, node); return TRUE; } /* * Signal handlers */ static void infc_browser_session_close_cb(InfSession* session, gpointer user_data) { InfcBrowser* browser; InfcBrowserPrivate* priv; InfcBrowserIter* iter; InfcBrowserNode* node; browser = INFC_BROWSER(user_data); priv = INFC_BROWSER_PRIVATE(browser); iter = (InfcBrowserIter*)g_object_get_qdata( G_OBJECT(session), infc_browser_session_proxy_quark ); if(iter != NULL) { g_assert( g_hash_table_lookup( INFC_BROWSER_PRIVATE(browser)->nodes, GUINT_TO_POINTER(iter->node_id) ) == iter->node ); node = (InfcBrowserNode*)iter->node; g_assert(node->type == INFC_BROWSER_NODE_NOTE_KNOWN); g_assert(node->shared.known.session != NULL); g_assert( infc_session_proxy_get_session(node->shared.known.session) == session ); infc_browser_session_remove_session(browser, node); } else { g_assert(priv->chat_session != NULL); g_assert(infc_session_proxy_get_session(priv->chat_session) == session); inf_signal_handlers_disconnect_by_func( infc_session_proxy_get_session(priv->chat_session), G_CALLBACK(infc_browser_session_close_cb), browser ); g_object_unref(priv->chat_session); priv->chat_session = NULL; g_object_notify(G_OBJECT(browser), "chat-session"); } } static void infc_browser_welcome_timeout_func(gpointer user_data) { InfcBrowser* browser; InfcBrowserPrivate* priv; GError* error; browser = INFC_BROWSER(user_data); priv = INFC_BROWSER_PRIVATE(browser); priv->welcome_timeout = NULL; error = NULL; g_set_error( &error, inf_directory_error_quark(), INF_DIRECTORY_ERROR_NO_WELCOME_MESSAGE, "%s", _("The server did not send an initial welcome message. This means that " "the server is running a lower version of the software which is " "incompatible to the client. Consider downgrading the client, or ask " "the server maintainers to upgrade their software.") ); g_signal_emit(G_OBJECT(browser), browser_signals[ERROR], 0, error); g_error_free(error); g_assert(priv->status != INFC_BROWSER_DISCONNECTED); priv->status = INFC_BROWSER_DISCONNECTED; g_object_notify(G_OBJECT(browser), "status"); } /* Required by infc_browser_disconnected */ static void infc_browser_member_removed_cb(InfCommunicationGroup* group, InfXmlConnection* connection, gpointer user_data); static void infc_browser_connected(InfcBrowser* browser) { InfcBrowserPrivate* priv; priv = INFC_BROWSER_PRIVATE(browser); g_assert(priv->group == NULL); /* Join directory group of server */ /* directory group always uses central method */ priv->group = inf_communication_manager_join_group( priv->communication_manager, "InfDirectory", priv->connection, "central" ); /* "central" method should always be available */ g_assert(priv->group != NULL); inf_communication_group_set_target( INF_COMMUNICATION_GROUP(priv->group), INF_COMMUNICATION_OBJECT(browser) ); g_signal_connect( priv->group, "member-removed", G_CALLBACK(infc_browser_member_removed_cb), browser ); /* Wait for welcome message */ if(priv->status != INFC_BROWSER_CONNECTING) { priv->status = INFC_BROWSER_CONNECTING; g_object_notify(G_OBJECT(browser), "status"); } /* TODO: We have a relatively low timeout here to easily recognize when * we try to connect to a server which does not yet send a welcome * message. We can set it somewhat higher later when there are fewer * old servers around. */ g_assert(priv->welcome_timeout == NULL); priv->welcome_timeout = inf_io_add_timeout( priv->io, 5*1000, infc_browser_welcome_timeout_func, browser, NULL ); } static void infc_browser_disconnected(InfcBrowser* browser) { InfcBrowserPrivate* priv; InfcBrowserNode* child; InfcBrowserNode* next; priv = INFC_BROWSER_PRIVATE(browser); /* Note that we do not remove the corresponding node that we sync in. We * lost the connection to the server anyway, so we do not care whether * that node exists on the server or not. */ while(priv->sync_ins != NULL) infc_browser_remove_sync_in(browser, priv->sync_ins->data); while(priv->subscription_requests != NULL) infc_browser_remove_subreq(browser, priv->subscription_requests->data); /* TODO: Emit failed signal with some "disconnected" error */ if(priv->request_manager) { infc_request_manager_clear(priv->request_manager); g_object_unref(priv->request_manager); priv->request_manager = NULL; } inf_signal_handlers_disconnect_by_func( G_OBJECT(priv->group), G_CALLBACK(infc_browser_member_removed_cb), browser ); /* Reset group since the browser's connection is always the publisher. */ g_object_unref(priv->group); priv->group = NULL; /* Remove tree */ for(child = priv->root->shared.subdir.child; child != NULL; child = next) { next = child->next; infc_browser_node_unregister(browser, child); infc_browser_node_free(browser, child); } g_assert(priv->root->shared.subdir.child == NULL); priv->root->shared.subdir.explored = FALSE; g_object_freeze_notify(G_OBJECT(browser)); if(priv->chat_session != NULL) { inf_signal_handlers_disconnect_by_func( infc_session_proxy_get_session(priv->chat_session), G_CALLBACK(infc_browser_session_close_cb), browser ); g_object_unref(priv->chat_session); priv->chat_session = NULL; g_object_notify(G_OBJECT(browser), "chat-session"); } priv->status = INFC_BROWSER_DISCONNECTED; g_object_notify(G_OBJECT(browser), "status"); g_object_thaw_notify(G_OBJECT(browser)); } static void infc_browser_member_removed_cb(InfCommunicationGroup* group, InfXmlConnection* connection, gpointer user_data) { InfcBrowser* browser; InfcBrowserPrivate* priv; browser = INFC_BROWSER(user_data); priv = INFC_BROWSER_PRIVATE(browser); g_assert(INF_COMMUNICATION_GROUP(priv->group) == group); if(connection == priv->connection) infc_browser_disconnected(browser); } static void infc_browser_connection_notify_status_cb(GObject* object, GParamSpec* pspec, gpointer user_data) { InfcBrowser* browser; InfcBrowserPrivate* priv; InfXmlConnectionStatus status; browser = INFC_BROWSER(user_data); priv = INFC_BROWSER_PRIVATE(browser); g_object_get(object, "status", &status, NULL); switch(status) { case INF_XML_CONNECTION_OPENING: if(priv->status != INFC_BROWSER_CONNECTING) { priv->status = INFC_BROWSER_CONNECTING; g_object_notify(G_OBJECT(browser), "status"); } break; case INF_XML_CONNECTION_OPEN: infc_browser_connected(browser); break; case INF_XML_CONNECTION_CLOSING: case INF_XML_CONNECTION_CLOSED: /* The group will emit ::member-removed in this case in which we * do some cleanup. If we got here from INF_XML_CONNECTION_OPENING then * that cleanup is not required, but remember to reset status. */ if(priv->group == NULL && priv->status != INFC_BROWSER_DISCONNECTED) { g_assert(priv->request_manager == NULL); priv->status = INFC_BROWSER_DISCONNECTED; g_object_notify(G_OBJECT(browser), "status"); } break; default: g_assert_not_reached(); break; } } static void infc_browser_connection_error_cb(InfXmlConnection* connection, const GError* error, gpointer user_data) { InfcBrowser* browser; browser = INFC_BROWSER(user_data); /* Just relay to save others some work */ g_signal_emit(G_OBJECT(browser), browser_signals[ERROR], 0, error); } /* * Helper functions */ static xmlNodePtr infc_browser_request_to_xml(InfcRequest* request) { xmlNodePtr xml; gchar seq_buffer[16]; xml = xmlNewNode(NULL, (const xmlChar*)infc_request_get_name(request)); sprintf(seq_buffer, "%u", infc_request_get_seq(request)); xmlNewProp(xml, (const xmlChar*)"seq", (const xmlChar*)seq_buffer); return xml; } static GError* infc_browser_method_unsupported_error(const gchar* method_name, InfXmlConnection* connection) { GError* error; gchar* network; g_object_get(G_OBJECT(connection), "network", &network, NULL); error = g_error_new( inf_directory_error_quark(), INF_DIRECTORY_ERROR_METHOD_UNSUPPORTED, _("This session requires communication method `%s' which is not " "installed for network `%s'"), method_name, network ); g_free(network); return error; } /* * GObject overrides. */ static void infc_browser_init(GTypeInstance* instance, gpointer g_class) { InfcBrowser* browser; InfcBrowserPrivate* priv; browser = INFC_BROWSER(instance); priv = INFC_BROWSER_PRIVATE(browser); priv->io = NULL; priv->communication_manager = NULL; priv->group = NULL; priv->connection = NULL; priv->seq_id = 0; priv->welcome_timeout = NULL; priv->request_manager = NULL; priv->plugins = g_hash_table_new(g_str_hash, g_str_equal); priv->status = INFC_BROWSER_DISCONNECTED; priv->nodes = g_hash_table_new(NULL, NULL); priv->root = infc_browser_node_new_subdirectory(browser, NULL, 0, NULL); priv->sync_ins = NULL; priv->subscription_requests = NULL; priv->chat_session = NULL; } static GObject* infc_browser_constructor(GType type, guint n_construct_properties, GObjectConstructParam* construct_properties) { GObject* object; InfcBrowser* browser; InfcBrowserPrivate* priv; object = G_OBJECT_CLASS(parent_class)->constructor( type, n_construct_properties, construct_properties ); browser = INFC_BROWSER(object); priv = INFC_BROWSER_PRIVATE(browser); g_assert(priv->communication_manager != NULL); g_assert(priv->io != NULL); return object; } static void infc_browser_dispose(GObject* object) { InfcBrowser* browser; InfcBrowserPrivate* priv; browser = INFC_BROWSER(object); priv = INFC_BROWSER_PRIVATE(browser); /* TODO: Use infc_browser_set_connection() as soon as it is available - * should be trivial to implement now. Remember to make the "connection" * property writable also. */ #if 0 infc_browser_set_connection(browser, NULL); #else if(priv->group != NULL) infc_browser_disconnected(browser); g_assert(priv->group == NULL); /* Should have been freed by infc_browser_disconnected */ g_assert(priv->sync_ins == NULL); g_assert(priv->subscription_requests == NULL); if(priv->connection != NULL) { inf_signal_handlers_disconnect_by_func( priv->connection, G_CALLBACK(infc_browser_connection_notify_status_cb), browser ); inf_signal_handlers_disconnect_by_func( priv->connection, G_CALLBACK(infc_browser_connection_error_cb), browser ); g_object_unref(priv->connection); priv->connection = NULL; } #endif /* Close chat session if it is open */ if(priv->chat_session != NULL) inf_session_close(infc_session_proxy_get_session(priv->chat_session)); g_assert(priv->chat_session == NULL); g_object_unref(priv->communication_manager); priv->communication_manager = NULL; g_hash_table_destroy(priv->plugins); priv->plugins = NULL; g_assert(priv->request_manager == NULL); if(priv->welcome_timeout != NULL) { inf_io_remove_timeout(priv->io, priv->welcome_timeout); priv->welcome_timeout = NULL; } if(priv->io != NULL) { g_object_unref(G_OBJECT(priv->io)); priv->io = NULL; } G_OBJECT_CLASS(parent_class)->dispose(object); } static void infc_browser_finalize(GObject* object) { InfcBrowser* browser; InfcBrowserPrivate* priv; browser = INFC_BROWSER(object); priv = INFC_BROWSER_PRIVATE(browser); infc_browser_node_free(browser, priv->root); priv->root = NULL; g_hash_table_destroy(priv->nodes); priv->nodes = NULL; G_OBJECT_CLASS(parent_class)->finalize(object); } static void infc_browser_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec) { InfcBrowser* browser; InfcBrowserPrivate* priv; InfXmlConnectionStatus status; browser = INFC_BROWSER(object); priv = INFC_BROWSER_PRIVATE(browser); switch(prop_id) { case PROP_IO: g_assert(priv->io == NULL); /* construct only */ priv->io = INF_IO(g_value_dup_object(value)); break; case PROP_COMMUNICATION_MANAGER: g_assert(priv->communication_manager == NULL); /* construct/only */ priv->communication_manager = INF_COMMUNICATION_MANAGER(g_value_dup_object(value)); break; case PROP_CONNECTION: if(priv->connection != NULL) { if(priv->group != NULL) infc_browser_disconnected(browser); inf_signal_handlers_disconnect_by_func( priv->connection, G_CALLBACK(infc_browser_connection_notify_status_cb), browser ); inf_signal_handlers_disconnect_by_func( priv->connection, G_CALLBACK(infc_browser_connection_error_cb), browser ); g_object_unref(priv->connection); } priv->connection = INF_XML_CONNECTION(g_value_get_object(value)); if(priv->connection) { g_object_ref(priv->connection); g_object_get(G_OBJECT(priv->connection), "status", &status, NULL); g_signal_connect( G_OBJECT(priv->connection), "notify::status", G_CALLBACK(infc_browser_connection_notify_status_cb), browser ); g_signal_connect( G_OBJECT(priv->connection), "error", G_CALLBACK(infc_browser_connection_error_cb), browser ); switch(status) { case INF_XML_CONNECTION_OPENING: if(priv->status != INFC_BROWSER_CONNECTING) { priv->status = INFC_BROWSER_CONNECTING; g_object_notify(G_OBJECT(browser), "status"); } break; case INF_XML_CONNECTION_OPEN: infc_browser_connected(browser); break; case INF_XML_CONNECTION_CLOSING: case INF_XML_CONNECTION_CLOSED: if(priv->status != INFC_BROWSER_DISCONNECTED) { priv->status = INFC_BROWSER_DISCONNECTED; g_object_notify(G_OBJECT(browser), "status"); } break; } } else { if(priv->status != INFC_BROWSER_DISCONNECTED) { priv->status = INFC_BROWSER_DISCONNECTED; g_object_notify(G_OBJECT(browser), "status"); } } break; case PROP_STATUS: case PROP_CHAT_SESSION: /* read only */ default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void infc_browser_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec) { InfcBrowser* browser; InfcBrowserPrivate* priv; browser = INFC_BROWSER(object); priv = INFC_BROWSER_PRIVATE(browser); switch(prop_id) { case PROP_IO: g_value_set_object(value, G_OBJECT(priv->io)); break; case PROP_COMMUNICATION_MANAGER: g_value_set_object(value, G_OBJECT(priv->communication_manager)); break; case PROP_CONNECTION: g_value_set_object(value, G_OBJECT(priv->connection)); break; case PROP_STATUS: g_value_set_enum(value, priv->status); break; case PROP_CHAT_SESSION: g_value_set_object(value, G_OBJECT(priv->chat_session)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } /* * Subscription requests */ static InfcBrowserSubreq* infc_browser_add_subreq_common(InfcBrowser* browser, InfcBrowserSubreqType type, guint node_id) { InfcBrowserPrivate* priv; InfcBrowserSubreq* request; priv = INFC_BROWSER_PRIVATE(browser); request = g_slice_new(InfcBrowserSubreq); request->type = type; request->node_id = node_id; priv->subscription_requests = g_slist_prepend(priv->subscription_requests, request); return request; } static InfcBrowserSubreq* infc_browser_add_subreq_chat(InfcBrowser* browser, InfcNodeRequest* request, InfCommunicationJoinedGroup* group) { InfcBrowserSubreq* subreq; subreq = infc_browser_add_subreq_common( browser, INFC_BROWSER_SUBREQ_CHAT, 0 ); subreq->shared.chat.request = request; subreq->shared.chat.subscription_group = group; /* Request can be NULL if the server subscribed us to the chat without * us asking about it. */ if(request != NULL) g_object_ref(request); g_object_ref(group); return subreq; } static InfcBrowserSubreq* infc_browser_add_subreq_session(InfcBrowser* browser, InfcBrowserNode* node, InfcNodeRequest* request, InfCommunicationJoinedGroup* group) { InfcBrowserSubreq* subreq; subreq = infc_browser_add_subreq_common( browser, INFC_BROWSER_SUBREQ_SESSION, node->id ); subreq->shared.session.node = node; subreq->shared.session.request = request; subreq->shared.session.subscription_group = group; /* TODO: Document in what case request can be NULL, or assert if it can't */ if(request != NULL) g_object_ref(request); g_object_ref(group); return subreq; } static InfcBrowserSubreq* infc_browser_add_subreq_add_node(InfcBrowser* browser, guint node_id, InfcBrowserNode* parent, const InfcNotePlugin* plugin, const gchar* name, InfcNodeRequest* request, InfCommunicationJoinedGroup* group) { InfcBrowserSubreq* subreq; subreq = infc_browser_add_subreq_common( browser, INFC_BROWSER_SUBREQ_ADD_NODE, node_id ); subreq->shared.add_node.parent = parent; subreq->shared.add_node.plugin = plugin; subreq->shared.add_node.name = g_strdup(name); subreq->shared.add_node.request = request; subreq->shared.add_node.subscription_group = group; if(request != NULL) g_object_ref(request); g_object_ref(group); return subreq; } static InfcBrowserSubreq* infc_browser_add_subreq_sync_in(InfcBrowser* browser, guint node_id, InfcBrowserNode* parent, const InfcNotePlugin* plugin, const gchar* name, InfcNodeRequest* request, InfSession* session, InfCommunicationJoinedGroup* sync_group, InfCommunicationJoinedGroup* sub_group) { InfcBrowserSubreq* subreq; /* Request must be available for sync-in: We can't sync-in something we * didn't request, because we don't have any data to sync. */ g_assert(request != NULL); g_assert(sync_group != NULL); g_assert(session != NULL); subreq = infc_browser_add_subreq_common( browser, INFC_BROWSER_SUBREQ_SYNC_IN, node_id ); subreq->shared.sync_in.parent = parent; subreq->shared.sync_in.plugin = plugin; subreq->shared.sync_in.name = g_strdup(name); subreq->shared.sync_in.request = request; subreq->shared.sync_in.session = session; subreq->shared.sync_in.synchronization_group = sync_group; subreq->shared.sync_in.subscription_group = sub_group; g_object_ref(request); g_object_ref(session); g_object_ref(sync_group); if(sub_group != NULL) g_object_ref(sub_group); return subreq; } static void infc_browser_free_subreq(InfcBrowserSubreq* request) { switch(request->type) { case INFC_BROWSER_SUBREQ_CHAT: g_object_unref(request->shared.chat.subscription_group); if(request->shared.chat.request != NULL) g_object_unref(request->shared.chat.request); break; case INFC_BROWSER_SUBREQ_SESSION: g_object_unref(request->shared.session.subscription_group); if(request->shared.session.request != NULL) g_object_unref(request->shared.session.request); break; case INFC_BROWSER_SUBREQ_ADD_NODE: g_object_unref(request->shared.add_node.subscription_group); if(request->shared.add_node.request != NULL) g_object_unref(request->shared.add_node.request); g_free(request->shared.add_node.name); break; case INFC_BROWSER_SUBREQ_SYNC_IN: if(request->shared.sync_in.subscription_group != NULL) g_object_unref(request->shared.sync_in.subscription_group); g_object_unref(request->shared.sync_in.synchronization_group); g_object_unref(request->shared.sync_in.session); /* Can be NULL if the corresponding node (parent) has been freed */ if(request->shared.sync_in.request != NULL) g_object_unref(request->shared.sync_in.request); g_free(request->shared.sync_in.name); break; default: g_assert_not_reached(); break; } g_slice_free(InfcBrowserSubreq, request); } static void infc_browser_unlink_subreq(InfcBrowser* browser, InfcBrowserSubreq* request) { InfcBrowserPrivate* priv; priv = INFC_BROWSER_PRIVATE(browser); priv->subscription_requests = g_slist_remove(priv->subscription_requests, request); } static void infc_browser_remove_subreq(InfcBrowser* browser, InfcBrowserSubreq* request) { infc_browser_unlink_subreq(browser, request); infc_browser_free_subreq(request); } /* Find a subscription request which will create a node with the given ID * upon completion. */ static InfcBrowserSubreq* infc_browser_find_subreq(InfcBrowser* browser, guint node_id) { InfcBrowserPrivate* priv; GSList* item; InfcBrowserSubreq* subreq; priv = INFC_BROWSER_PRIVATE(browser); for(item = priv->subscription_requests; item != NULL; item = item->next) { subreq = (InfcBrowserSubreq*)item->data; switch(subreq->type) { case INFC_BROWSER_SUBREQ_CHAT: case INFC_BROWSER_SUBREQ_SESSION: /* These do not create a note */ break; case INFC_BROWSER_SUBREQ_ADD_NODE: if(subreq->node_id == node_id) return subreq; break; case INFC_BROWSER_SUBREQ_SYNC_IN: if(subreq->node_id == node_id) return subreq; break; default: g_assert_not_reached(); break; } } return NULL; } /* * Sync-In */ static void infc_browser_sync_in_synchronization_failed_cb(InfSession* session, InfXmlConnection* connection, GError* error, gpointer user_data) { InfcBrowserSyncIn* sync_in; sync_in = (InfcBrowserSyncIn*)user_data; /* Ignore if this affects the synchronization to another connection */ if(connection != sync_in->connection) return; infc_browser_node_remove(sync_in->browser, sync_in->node, NULL); infc_browser_remove_sync_in(sync_in->browser, sync_in); } static void infc_browser_sync_in_synchronization_complete_cb(InfSession* session, InfXmlConnection* connection, gpointer user_data) { InfcBrowserSyncIn* sync_in; sync_in = (InfcBrowserSyncIn*)user_data; /* Ignore if this affects the synchronization to another connection */ if(connection != sync_in->connection) return; infc_browser_remove_sync_in(sync_in->browser, sync_in); } static InfcBrowserSyncIn* infc_browser_add_sync_in(InfcBrowser* browser, InfcBrowserNode* node, InfXmlConnection* connection, InfcSessionProxy* proxy) { InfcBrowserPrivate* priv; InfcBrowserSyncIn* sync_in; priv = INFC_BROWSER_PRIVATE(browser); sync_in = g_slice_new(InfcBrowserSyncIn); sync_in->browser = browser; sync_in->node = node; /* Actually the same as browser's connection: */ sync_in->connection = connection; sync_in->proxy = proxy; g_object_ref(proxy); g_signal_connect( G_OBJECT(infc_session_proxy_get_session(proxy)), "synchronization-failed", G_CALLBACK(infc_browser_sync_in_synchronization_failed_cb), sync_in ); g_signal_connect( G_OBJECT(infc_session_proxy_get_session(proxy)), "synchronization-complete", G_CALLBACK(infc_browser_sync_in_synchronization_complete_cb), sync_in ); priv->sync_ins = g_slist_prepend(priv->sync_ins, sync_in); return sync_in; } static void infc_browser_remove_sync_in(InfcBrowser* browser, InfcBrowserSyncIn* sync_in) { InfcBrowserPrivate* priv; priv = INFC_BROWSER_PRIVATE(browser); inf_signal_handlers_disconnect_by_func( G_OBJECT(infc_session_proxy_get_session(sync_in->proxy)), G_CALLBACK(infc_browser_sync_in_synchronization_complete_cb), sync_in ); inf_signal_handlers_disconnect_by_func( G_OBJECT(infc_session_proxy_get_session(sync_in->proxy)), G_CALLBACK(infc_browser_sync_in_synchronization_failed_cb), sync_in ); g_object_unref(sync_in->proxy); g_slice_free(InfcBrowserSyncIn, sync_in); priv->sync_ins = g_slist_remove(priv->sync_ins, sync_in); } /* * Node creation */ static InfcBrowserNode* infc_browser_node_add_subdirectory(InfcBrowser* browser, InfcBrowserNode* parent, guint id, const gchar* name) { InfcBrowserPrivate* priv; InfcBrowserNode* node; g_assert(parent->type == INFC_BROWSER_NODE_SUBDIRECTORY); g_assert(parent->shared.subdir.explored == TRUE); priv = INFC_BROWSER_PRIVATE(browser); node = infc_browser_node_new_subdirectory(browser, parent, id, name); infc_browser_node_register(browser, node); return node; } static InfcBrowserNode* infc_browser_node_add_note(InfcBrowser* browser, InfcBrowserNode* parent, guint id, const gchar* name, const gchar* type, InfcSessionProxy* sync_in_session) { InfcBrowserPrivate* priv; InfcBrowserNode* node; g_assert(parent->type == INFC_BROWSER_NODE_SUBDIRECTORY); g_assert(parent->shared.subdir.explored == TRUE); priv = INFC_BROWSER_PRIVATE(browser); g_assert(priv->connection != NULL); node = infc_browser_node_new_note(browser, parent, id, name, type); if(sync_in_session != NULL) { infc_browser_add_sync_in( browser, node, priv->connection, sync_in_session ); } infc_browser_node_register(browser, node); return node; } /* * Network command handling. */ static void infc_browser_subscribe_ack(InfcBrowser* browser, InfXmlConnection* connection, InfcBrowserSubreq* request) { InfcBrowserPrivate* priv; xmlNodePtr xml; priv = INFC_BROWSER_PRIVATE(browser); xml = xmlNewNode(NULL, (const xmlChar*)"subscribe-ack"); if(request->type != INFC_BROWSER_SUBREQ_CHAT) inf_xml_util_set_attribute_uint(xml, "id", request->node_id); inf_communication_group_send_message( INF_COMMUNICATION_GROUP(priv->group), connection, xml ); } static void infc_browser_subscribe_nack(InfcBrowser* browser, InfXmlConnection* connection, guint node_id) { InfcBrowserPrivate* priv; xmlNodePtr xml; priv = INFC_BROWSER_PRIVATE(browser); xml = xmlNewNode(NULL, (const xmlChar*)"subscribe-nack"); if(node_id > 0) inf_xml_util_set_attribute_uint(xml, "id", node_id); inf_communication_group_send_message( INF_COMMUNICATION_GROUP(priv->group), connection, xml ); } static InfcBrowserNode* infc_browser_get_node_from_xml(InfcBrowser* browser, xmlNodePtr xml, const gchar* attrib, GError** error) { InfcBrowserPrivate* priv; InfcBrowserNode* node; guint node_id; gboolean has_node; priv = INFC_BROWSER_PRIVATE(browser); has_node = inf_xml_util_get_attribute_uint_required( xml, attrib, &node_id, error ); if(has_node == FALSE) return NULL; node = g_hash_table_lookup(priv->nodes, GUINT_TO_POINTER(node_id)); if(node == NULL) { g_set_error( error, inf_directory_error_quark(), INF_DIRECTORY_ERROR_NO_SUCH_NODE, "%s", inf_directory_strerror(INF_DIRECTORY_ERROR_NO_SUCH_NODE) ); return NULL; } else { return node; } } static InfcBrowserNode* infc_browser_get_node_from_xml_typed(InfcBrowser* browser, xmlNodePtr xml, const gchar* attrib, InfcBrowserNodeType mask, GError** error) { InfcBrowserNode* node; g_assert(mask != 0); node = infc_browser_get_node_from_xml(browser, xml, attrib, error); if(node != NULL && (node->type & mask) == 0) { if(mask & INFC_BROWSER_NODE_SUBDIRECTORY) { g_set_error( error, inf_directory_error_quark(), INF_DIRECTORY_ERROR_NOT_A_SUBDIRECTORY, "%s", inf_directory_strerror(INF_DIRECTORY_ERROR_NOT_A_SUBDIRECTORY) ); } else { g_set_error( error, inf_directory_error_quark(), INF_DIRECTORY_ERROR_NOT_A_NOTE, "%s", inf_directory_strerror(INF_DIRECTORY_ERROR_NOT_A_NOTE) ); } return NULL; } else { return node; } } /* TODO: Change to InfcNodeRequest as soon as InfcExploreRequest inherits * from InfcNodeRequest */ static InfcRequest* infc_browser_get_add_node_request_from_xml(InfcBrowser* browser, xmlNodePtr xml, GError** error) { InfcBrowserPrivate* priv; InfcRequest* request; priv = INFC_BROWSER_PRIVATE(browser); request = infc_request_manager_get_request_by_xml( priv->request_manager, NULL, xml, NULL ); /* If no seq was set, then this add-node request was not issued by us */ if(request != NULL) { /* when seq was set, then we issued that add-node. We might * either do this implicitly by exploring a folder or explicitely by * sending an add-node request. */ if(!INFC_IS_EXPLORE_REQUEST(request) && !INFC_IS_NODE_REQUEST(request)) { g_set_error( error, inf_request_error_quark(), INF_REQUEST_ERROR_INVALID_SEQ, _("The request contains a sequence number refering to a request of " "type '%s', but a request of either 'explore' or 'add-node' was " "expected."), infc_request_get_name(request) ); return NULL; } /* TODO: If EXPLORE_REQUEST, then check whether we can add a node at this * point. Means: initiated && current < total. Remove error from * infc_explore_request_progress() and _finished(), check in browser * instead. */ } return request; } /* TODO: Remove error from this function as soon as * infc_explore_request_progress can't fail anymore (it should assert * instead). */ static gboolean infc_browser_process_add_node_request(InfcBrowser* browser, InfcRequest* request, InfcBrowserNode* node, GError** error) { InfcBrowserPrivate* priv; InfcBrowserIter iter; priv = INFC_BROWSER_PRIVATE(browser); if(INFC_IS_EXPLORE_REQUEST(request)) { return infc_explore_request_progress( INFC_EXPLORE_REQUEST(request), error ); } else if(INFC_IS_NODE_REQUEST(request)) { iter.node_id = node->id; iter.node = node; infc_node_request_finished(INFC_NODE_REQUEST(request), &iter); infc_request_manager_remove_request(priv->request_manager, request); return TRUE; } else { g_assert_not_reached(); return FALSE; } } static InfCommunicationJoinedGroup* infc_browser_create_group_from_xml(InfcBrowser* browser, InfXmlConnection* connection, xmlNodePtr xml, GError** error) { InfcBrowserPrivate* priv; xmlChar* method_name; xmlChar* group_name; InfCommunicationJoinedGroup* group; priv = INFC_BROWSER_PRIVATE(browser); method_name = inf_xml_util_get_attribute_required(xml, "method", error); if(method_name == NULL) return FALSE; group_name = inf_xml_util_get_attribute_required(xml, "group", error); if(group_name == NULL) { xmlFree(method_name); return FALSE; } /* Server is publisher */ group = inf_communication_manager_join_group( priv->communication_manager, (const gchar*)group_name, connection, (const gchar*)method_name ); if(!group) { g_propagate_error( error, infc_browser_method_unsupported_error( (const gchar*)method_name, connection ) ); } xmlFree(group_name); xmlFree(method_name); return group; } /* If initial_sync is TRUE, then the session is initially synchronized in the * subscription group. Otherwise, an empty session is used. */ static gboolean infc_browser_subscribe_session(InfcBrowser* browser, InfcBrowserNode* node, InfCommunicationJoinedGroup* group, InfXmlConnection* connection, gboolean initial_sync) { InfcBrowserPrivate* priv; InfcSessionProxy* proxy; InfcBrowserIter iter; InfSession* session; priv = INFC_BROWSER_PRIVATE(browser); g_assert(node->type == INFC_BROWSER_NODE_NOTE_KNOWN); g_assert(node->shared.known.plugin != NULL); g_assert(node->shared.known.session == NULL); if(initial_sync) { session = node->shared.known.plugin->session_new( priv->io, priv->communication_manager, INF_SESSION_SYNCHRONIZING, group, connection, node->shared.known.plugin->user_data ); } else { session = node->shared.known.plugin->session_new( priv->io, priv->communication_manager, INF_SESSION_RUNNING, NULL, NULL, node->shared.known.plugin->user_data ); } proxy = g_object_new(INFC_TYPE_SESSION_PROXY, "session", session, NULL); inf_communication_group_set_target( INF_COMMUNICATION_GROUP(group), INF_COMMUNICATION_OBJECT(proxy) ); infc_session_proxy_set_connection(proxy, group, connection, priv->seq_id); g_object_unref(session); iter.node_id = node->id; iter.node = node; g_signal_emit( G_OBJECT(browser), browser_signals[SUBSCRIBE_SESSION], 0, &iter, proxy ); /* The default handler refs the proxy */ g_object_unref(proxy); return TRUE; } static gboolean infc_browser_handle_welcome(InfcBrowser* browser, InfXmlConnection* connection, xmlNodePtr xml, GError** error) { InfcBrowserPrivate* priv; xmlChar* version; guint server_major; guint server_minor; guint own_major; guint own_minor; gboolean result; priv = INFC_BROWSER_PRIVATE(browser); version = inf_xml_util_get_attribute_required( xml, "protocol-version", error); if(!version) return FALSE; result = inf_protocol_parse_version( (const gchar*)version, &server_major, &server_minor, error ); xmlFree(version); if(!result) return FALSE; result = inf_protocol_parse_version( inf_protocol_get_version(), &own_major, &own_minor, NULL ); g_assert(result == TRUE); if(server_major < own_major || server_minor < own_minor) { g_set_error( error, inf_directory_error_quark(), INF_DIRECTORY_ERROR_VERSION_MISMATCH, "%s", _("The server uses an older version of the protocol which is no longer " "supported by this client. Consider using an earlier version of it, " "or ask the server maintainers to upgrade their software.") ); return FALSE; } if(server_major > own_major) { g_set_error( error, inf_directory_error_quark(), INF_DIRECTORY_ERROR_VERSION_MISMATCH, "%s", _("The server uses a newer version. Consider upgrading your client.") ); return FALSE; } result = inf_xml_util_get_attribute_uint_required( xml, "sequence-id", &priv->seq_id, error ); if(!result) return FALSE; g_assert(priv->request_manager == NULL); priv->request_manager = infc_request_manager_new(priv->seq_id); priv->status = INFC_BROWSER_CONNECTED; g_object_notify(G_OBJECT(browser), "status"); return TRUE; } static gboolean infc_browser_handle_explore_begin(InfcBrowser* browser, InfXmlConnection* connection, xmlNodePtr xml, GError** error) { InfcBrowserPrivate* priv; InfcRequest* request; xmlChar* total_attr; guint total; guint node_id; InfcBrowserNode* node; priv = INFC_BROWSER_PRIVATE(browser); /* TODO: Allow exploration without us asking */ request = infc_request_manager_get_request_by_xml_required( priv->request_manager, "explore-node", xml, error ); if(request == NULL) return FALSE; g_assert(INFC_IS_EXPLORE_REQUEST(request)); /* TODO: Consider non-given total attribute as an error */ total_attr = xmlGetProp(xml, (const xmlChar*)"total"); total = 0; if(total_attr != NULL) { total = strtoul((const char*)total_attr, NULL, 10); xmlFree(total_attr); } node_id = infc_explore_request_get_node_id(INFC_EXPLORE_REQUEST(request)); node = g_hash_table_lookup(priv->nodes, GUINT_TO_POINTER(node_id)); if(node == NULL) { g_set_error( error, inf_directory_error_quark(), INF_DIRECTORY_ERROR_NO_SUCH_NODE, "%s", _("Node to explore does no longer exist") ); return FALSE; } else if(node->type != INFC_BROWSER_NODE_SUBDIRECTORY) { g_set_error( error, inf_directory_error_quark(), INF_DIRECTORY_ERROR_NOT_A_SUBDIRECTORY, "%s", _("Node to explore is not a subdirectory") ); return FALSE; } else if(node->shared.subdir.explored == TRUE) { g_set_error( error, inf_directory_error_quark(), INF_DIRECTORY_ERROR_ALREADY_EXPLORED, "%s", _("Node to explore is already explored") ); return FALSE; } else { node->shared.subdir.explored = TRUE; infc_explore_request_initiated(INFC_EXPLORE_REQUEST(request), total); return TRUE; } } static gboolean infc_browser_handle_explore_end(InfcBrowser* browser, InfXmlConnection* connection, xmlNodePtr xml, GError** error) { InfcBrowserPrivate* priv; InfcRequest* request; gboolean result; priv = INFC_BROWSER_PRIVATE(browser); /* TODO: Allow exploration without us asking */ request = infc_request_manager_get_request_by_xml_required( priv->request_manager, "explore-node", xml, error ); if(request == NULL) return FALSE; g_assert(INFC_IS_EXPLORE_REQUEST(request)); result = infc_explore_request_finished( INFC_EXPLORE_REQUEST(request), error ); infc_request_manager_remove_request(priv->request_manager, request); return result; } static gboolean infc_browser_handle_add_node(InfcBrowser* browser, InfXmlConnection* connection, xmlNodePtr xml, GError** error) { InfcBrowserPrivate* priv; InfcBrowserNode* parent; InfcBrowserNode* node; guint id; xmlChar* name; xmlChar* type; InfcRequest* request; GError* local_error; xmlNodePtr child; const InfcNotePlugin* plugin; InfCommunicationJoinedGroup* group; InfcBrowserSubreq* subreq; gboolean result; priv = INFC_BROWSER_PRIVATE(browser); if(inf_xml_util_get_attribute_uint_required(xml, "id", &id, error) == FALSE) return FALSE; if(g_hash_table_lookup(priv->nodes, GUINT_TO_POINTER(id)) != NULL || infc_browser_find_subreq(browser, id) != NULL) { g_set_error( error, inf_directory_error_quark(), INF_DIRECTORY_ERROR_NODE_EXISTS, _("Node with ID \"%u\" exists already"), id ); return FALSE; } parent = infc_browser_get_node_from_xml_typed( browser, xml, "parent", INFC_BROWSER_NODE_SUBDIRECTORY, error ); if(parent == NULL) return FALSE; local_error = NULL; request = infc_browser_get_add_node_request_from_xml(browser, xml, &local_error); if(local_error != NULL) { g_propagate_error(error, local_error); return FALSE; } type = inf_xml_util_get_attribute_required(xml, "type", error); if(type == NULL) return FALSE; name = inf_xml_util_get_attribute_required(xml, "name", error); if(name == NULL) { xmlFree(type); return FALSE; } if(strcmp((const gchar*)type, "InfSubdirectory") == 0) { node = infc_browser_node_add_subdirectory( browser, parent, id, (const gchar*)name ); if(request != NULL) { result = infc_browser_process_add_node_request( browser, request, node, error ); } else { result = TRUE; } } else { for(child = xml->children; child != NULL; child = child->next) if(strcmp((const char*)child->name, "subscribe") == 0) break; if(child != NULL) { /* Subscribe to the newly added node */ /* Request must be a node-request at this point. messages * resulting from a node exploration cannot yield subscription. */ if(request != NULL && !INFC_IS_NODE_REQUEST(request)) { g_set_error( error, inf_request_error_quark(), INF_REQUEST_ERROR_INVALID_SEQ, "%s", _("Explored nodes cannot be initially be subscribed to") ); result = FALSE; } else { /* Can't subscribe if we don't know the note type */ plugin = g_hash_table_lookup(priv->plugins, type); if(plugin == NULL) { g_set_error( error, inf_directory_error_quark(), INF_DIRECTORY_ERROR_TYPE_UNKNOWN, _("Note type \"%s\" not known"), (const gchar*)type ); infc_browser_subscribe_nack(browser, connection, id); result = FALSE; } else { group = infc_browser_create_group_from_xml( browser, connection, child, error ); if(group == NULL) { infc_browser_subscribe_nack(browser, connection, id); result = FALSE; } else { subreq = infc_browser_add_subreq_add_node( browser, id, parent, plugin, (const gchar*)name, INFC_NODE_REQUEST(request), group ); g_object_unref(group); infc_browser_subscribe_ack(browser, connection, subreq); result = TRUE; } } } } else { node = infc_browser_node_add_note( browser, parent, id, (const gchar*)name, (const gchar*)type, NULL ); if(request != NULL) { result = infc_browser_process_add_node_request( browser, request, node, error ); } else { result = TRUE; } } } xmlFree(type); xmlFree(name); return result; } static gboolean infc_browser_handle_sync_in(InfcBrowser* browser, InfXmlConnection* connection, xmlNodePtr xml, GError** error) { InfcBrowserPrivate* priv; guint id; InfcBrowserNode* parent; InfcRequest* request; InfSession* session; const InfcNotePlugin* plugin; InfCommunicationJoinedGroup* sync_group; xmlChar* type; xmlChar* name; xmlNodePtr child; InfcBrowserSubreq* subreq; gboolean result; priv = INFC_BROWSER_PRIVATE(browser); if(inf_xml_util_get_attribute_uint_required(xml, "id", &id, error) == FALSE) return FALSE; if(g_hash_table_lookup(priv->nodes, GUINT_TO_POINTER(id)) != NULL || infc_browser_find_subreq(browser, id) != NULL) { g_set_error( error, inf_directory_error_quark(), INF_DIRECTORY_ERROR_NODE_EXISTS, _("Node with ID \"%u\" exists already"), id ); return FALSE; } parent = infc_browser_get_node_from_xml_typed( browser, xml, "parent", INFC_BROWSER_NODE_SUBDIRECTORY, error ); if(parent == NULL) return FALSE; request = infc_request_manager_get_request_by_xml_required( priv->request_manager, "add-node", xml, error ); /* Note that such a request MUST exist. We cannot sync something in without * knowing where to get the data to sync from. */ if(!request) return FALSE; session = g_object_steal_qdata( G_OBJECT(request), infc_browser_sync_in_session_quark ); plugin = g_object_steal_qdata( G_OBJECT(request), infc_browser_sync_in_plugin_quark ); if(session == NULL) { g_set_error( error, inf_directory_error_quark(), INF_DIRECTORY_ERROR_UNEXPECTED_SYNC_IN, "%s", _("Received sync-in without having requested one") ); return FALSE; } /* We always set both session and plugin quark: */ g_assert(plugin != NULL); /* We only set this on node requests */ g_assert(INFC_IS_NODE_REQUEST(request)); result = FALSE; type = inf_xml_util_get_attribute_required(xml, "type", error); if(type != NULL) { if(strcmp((const char*)type, plugin->note_type) != 0) { g_set_error( error, inf_directory_error_quark(), INF_DIRECTORY_ERROR_UNEXPECTED_SYNC_IN, _("Expected note type \"%s\" for sync-in, but received \"%s\""), plugin->note_type, (const gchar*)type ); } else { name = inf_xml_util_get_attribute_required(xml, "name", error); if(name != NULL) { /* Note that all the errors which could have occured up to this point * are the server's fault. If one of those occured, then the server * sent us crap and could have known better. We therefore don't reply * with subscribe-nack on these errors. */ sync_group = infc_browser_create_group_from_xml( browser, connection, xml, error ); if(sync_group == NULL) { infc_browser_subscribe_nack(browser, connection, id); } else { /* TODO: The server might specify a different * subscription group */ for(child = xml->children; child != NULL; child = child->next) if(strcmp((const char*)child->name, "subscribe") == 0) break; subreq = infc_browser_add_subreq_sync_in( browser, id, parent, plugin, (const gchar*)name, INFC_NODE_REQUEST(request), session, sync_group, child != NULL ? sync_group : NULL ); g_object_unref(sync_group); infc_browser_subscribe_ack(browser, connection, subreq); result = TRUE; } xmlFree(name); } } xmlFree(type); } g_object_unref(session); return result; } static gboolean infc_browser_handle_remove_node(InfcBrowser* browser, InfXmlConnection* connection, xmlNodePtr xml, GError** error) { InfcBrowserPrivate* priv; InfcBrowserNode* node; InfcRequest* request; InfcBrowserIter iter; priv = INFC_BROWSER_PRIVATE(browser); node = infc_browser_get_node_from_xml(browser, xml, "id", error); if(node == NULL) return FALSE; request = infc_request_manager_get_request_by_xml( priv->request_manager, "remove-node", xml, NULL ); if(request != NULL) { g_assert(INFC_IS_NODE_REQUEST(request)); iter.node_id = node->id; iter.node = node; infc_node_request_finished(INFC_NODE_REQUEST(request), &iter); infc_request_manager_remove_request(priv->request_manager, request); } /* TODO: Make sure to not finish the request successfully before being * sure this returned TRUE. However, when the node is removed we no longer * can have an iter to it. */ if(infc_browser_node_remove(browser, node, error) == FALSE) return FALSE; return TRUE; } static gboolean infc_browser_handle_subscribe_session(InfcBrowser* browser, InfXmlConnection* connection, xmlNodePtr xml, GError** error) { InfcBrowserPrivate* priv; InfcBrowserNode* node; InfcRequest* request; InfCommunicationJoinedGroup* group; InfcBrowserSubreq* subreq; priv = INFC_BROWSER_PRIVATE(browser); node = infc_browser_get_node_from_xml_typed( browser, xml, "id", INFC_BROWSER_NODE_NOTE_KNOWN | INFC_BROWSER_NODE_NOTE_UNKNOWN, error ); /* TODO: Send subscribe-nack with the id the server sent, even if we could * not find the node. */ if(node == NULL) return FALSE; if(node->type == INFC_BROWSER_NODE_NOTE_UNKNOWN) { g_set_error( error, inf_directory_error_quark(), INF_DIRECTORY_ERROR_TYPE_UNKNOWN, _("Note type '%s' is not supported"), node->shared.unknown.type ); infc_browser_subscribe_nack(browser, connection, node->id); return FALSE; } if(node->shared.known.session != NULL) { g_set_error( error, inf_directory_error_quark(), INF_DIRECTORY_ERROR_ALREADY_SUBSCRIBED, "%s", _("Already subscribed to this session") ); /* Don't send subscribe-nack here, it is the server's job not to send us * subscribe-session if we are already subscribed. */ return FALSE; } group = infc_browser_create_group_from_xml( browser, connection, xml, error ); if(!group) { infc_browser_subscribe_nack(browser, connection, node->id); return FALSE; } request = infc_request_manager_get_request_by_xml( priv->request_manager, "subscribe-session", xml, NULL ); g_assert(INFC_IS_NODE_REQUEST(request)); subreq = infc_browser_add_subreq_session( browser, node, INFC_NODE_REQUEST(request), group ); g_object_unref(group); infc_browser_subscribe_ack(browser, connection, subreq); return TRUE; } static gboolean infc_browser_handle_subscribe_chat(InfcBrowser* browser, InfXmlConnection* connection, xmlNodePtr xml, GError** error) { InfcBrowserPrivate* priv; InfcRequest* request; InfCommunicationJoinedGroup* group; InfcBrowserSubreq* subreq; priv = INFC_BROWSER_PRIVATE(browser); if(priv->chat_session != NULL) { g_set_error( error, inf_directory_error_quark(), INF_DIRECTORY_ERROR_ALREADY_SUBSCRIBED, "%s", _("Already subscribed to the chat session") ); /* Don't send subscribe-nack here, it is the server's job not to send us * subscribe-session if we are already subscribed. */ return FALSE; } group = infc_browser_create_group_from_xml( browser, connection, xml, error ); if(!group) { infc_browser_subscribe_nack(browser, connection, 0); return FALSE; } request = infc_request_manager_get_request_by_xml( priv->request_manager, "subscribe-chat", xml, NULL ); g_assert(request == NULL || INFC_IS_NODE_REQUEST(request)); subreq = infc_browser_add_subreq_chat( browser, INFC_NODE_REQUEST(request), group ); g_object_unref(group); infc_browser_subscribe_ack(browser, connection, subreq); return TRUE; } static gboolean infc_browser_handle_save_session_in_progress(InfcBrowser* browser, InfXmlConnection* connection, xmlNodePtr xml, GError** error) { InfcBrowserPrivate* priv; InfcBrowserNode* node; InfcRequest* request; priv = INFC_BROWSER_PRIVATE(browser); node = infc_browser_get_node_from_xml_typed( browser, xml, "id", INFC_BROWSER_NODE_NOTE_KNOWN, error ); if(node == NULL) return FALSE; request = infc_request_manager_get_request_by_xml( priv->request_manager, "save-session", xml, NULL ); if(request != NULL) { g_assert(INFC_IS_NODE_REQUEST(request)); /* TODO: Make a special save request that could now emit * an in-progress signal */ } return TRUE; } static gboolean infc_browser_handle_saved_session(InfcBrowser* browser, InfXmlConnection* connection, xmlNodePtr xml, GError** error) { InfcBrowserPrivate* priv; InfcBrowserNode* node; InfcRequest* request; InfcBrowserIter iter; priv = INFC_BROWSER_PRIVATE(browser); node = infc_browser_get_node_from_xml_typed( browser, xml, "id", INFC_BROWSER_NODE_NOTE_KNOWN, error ); if(node == NULL) return FALSE; request = infc_request_manager_get_request_by_xml( priv->request_manager, "save-session", xml, NULL ); if(request != NULL) { g_assert(INFC_IS_NODE_REQUEST(request)); iter.node_id = node->id; iter.node = node; infc_node_request_finished(INFC_NODE_REQUEST(request), &iter); infc_request_manager_remove_request(priv->request_manager, request); } return TRUE; } static gboolean infc_browser_handle_request_failed(InfcBrowser* browser, InfXmlConnection* connection, xmlNodePtr xml, GError** error) { InfcBrowserPrivate* priv; InfcBrowserClass* browserc_class; InfcRequest* request; xmlChar* domain; gboolean has_code; guint code; GError* req_error; priv = INFC_BROWSER_PRIVATE(browser); browserc_class = INFC_BROWSER_GET_CLASS(browser); request = infc_request_manager_get_request_by_xml_required( priv->request_manager, NULL, xml, error ); if(request == NULL) return FALSE; has_code = inf_xml_util_get_attribute_uint_required( xml, "code", &code, error ); if(has_code == FALSE) return FALSE; domain = inf_xml_util_get_attribute_required(xml, "domain", error); if(domain == NULL) return FALSE; req_error = NULL; if(g_quark_from_string((gchar*)domain) == inf_directory_error_quark()) { g_set_error( &req_error, inf_directory_error_quark(), code, "%s", inf_directory_strerror(code) ); } /* TODO: Can errors from the inf_request_error_quark() domain occur? */ else { /* TODO: Look whether server has sent a human-readable error message * (which we cannot localize in that case, of course, but it is * probably better than nothing). */ g_set_error( &req_error, inf_request_error_quark(), INF_REQUEST_ERROR_UNKNOWN_DOMAIN, _("Error comes from unknown error domain '%s' (code %u)"), (const gchar*)domain, code ); } xmlFree(domain); infc_request_manager_fail_request( priv->request_manager, request, req_error ); g_error_free(req_error); return TRUE; } /* * InfNetObject implementation */ static InfCommunicationScope infc_browser_communication_object_received(InfCommunicationObject* object, InfXmlConnection* connection, xmlNodePtr node, GError** error) { InfcBrowser* browser; InfcBrowserPrivate* priv; GError* local_error; GError* seq_error; InfcRequest* request; browser = INFC_BROWSER(object); priv = INFC_BROWSER_PRIVATE(browser); local_error = NULL; if(priv->status == INFC_BROWSER_CONNECTING && strcmp((const gchar*)node->name, "welcome") == 0) { if(priv->welcome_timeout) { inf_io_remove_timeout(priv->io, priv->welcome_timeout); priv->welcome_timeout = NULL; } if(!infc_browser_handle_welcome(browser, connection, node, &local_error)) { g_signal_emit(browser, browser_signals[ERROR], 0, local_error); g_error_free(local_error); local_error = NULL; priv->status = INFC_BROWSER_DISCONNECTED; g_object_notify(G_OBJECT(browser), "status"); } } else if(strcmp((const gchar*)node->name, "request-failed") == 0) { infc_browser_handle_request_failed( browser, connection, node, &local_error ); } else if(strcmp((const gchar*)node->name, "explore-begin") == 0) { infc_browser_handle_explore_begin( browser, connection, node, &local_error ); } else if(strcmp((const gchar*)node->name, "explore-end") == 0) { infc_browser_handle_explore_end( browser, connection, node, &local_error ); } else if(strcmp((const gchar*)node->name, "add-node") == 0) { infc_browser_handle_add_node( browser, connection, node, &local_error ); } else if(strcmp((const gchar*)node->name, "sync-in") == 0) { infc_browser_handle_sync_in( browser, connection, node, &local_error ); } else if(strcmp((const gchar*)node->name, "remove-node") == 0) { infc_browser_handle_remove_node( browser, connection, node, &local_error ); } else if(strcmp((const gchar*)node->name, "subscribe-session") == 0) { infc_browser_handle_subscribe_session( browser, connection, node, &local_error ); } else if(strcmp((const gchar*)node->name, "subscribe-chat") == 0) { infc_browser_handle_subscribe_chat( browser, connection, node, &local_error ); } else if(strcmp((const gchar*)node->name, "save-session-in-progress") == 0) { infc_browser_handle_save_session_in_progress( browser, connection, node, &local_error ); } else if(strcmp((const gchar*)node->name, "saved-session") == 0) { infc_browser_handle_saved_session( browser, connection, node, &local_error ); } else { g_set_error( &local_error, inf_directory_error_quark(), INF_DIRECTORY_ERROR_UNEXPECTED_MESSAGE, "%s", inf_directory_strerror(INF_DIRECTORY_ERROR_UNEXPECTED_MESSAGE) ); } if(local_error != NULL) { /* If the request had a (valid) seq set, we cancel the corresponding * request because the reply could not be processed. */ request = infc_request_manager_get_request_by_xml( priv->request_manager, NULL, node, NULL ); if(request != NULL) { seq_error = NULL; g_set_error( &seq_error, inf_request_error_quark(), INF_REQUEST_ERROR_REPLY_UNPROCESSED, _("Server reply could not be processed: %s"), local_error->message ); infc_request_manager_fail_request( priv->request_manager, request, seq_error ); g_error_free(seq_error); } /* TODO: We might just want to emit error instead... */ g_propagate_error(error, local_error); } /* Browser is client-side anyway, so we should not even need to forward * anything. */ return INF_COMMUNICATION_SCOPE_PTP; } static void infc_browser_communication_object_sent(InfCommunicationObject* object, InfXmlConnection* connection, xmlNodePtr xml) { InfcBrowser* browser; InfcBrowserPrivate* priv; InfcBrowserNode* node; gboolean has_id; guint node_id; GSList* item; InfCommunicationJoinedGroup* sync_group; InfcBrowserSubreq* subreq; InfChatSession* session; InfcSessionProxy* proxy; InfcBrowserIter iter; /* TODO: Can we do this in enqueued already? */ if(strcmp((const char*)xml->name, "subscribe-ack") == 0) { browser = INFC_BROWSER(object); priv = INFC_BROWSER_PRIVATE(browser); has_id = inf_xml_util_get_attribute_uint(xml, "id", &node_id, NULL); for(item = priv->subscription_requests; item != NULL; item = item->next) { subreq = (InfcBrowserSubreq*)item->data; if( (has_id && subreq->node_id == node_id) || (!has_id && subreq->node_id == 0)) { break; } } /* TODO: Only Assert here, and remove the subreq in * infc_browser_node_free() */ if(item == NULL) return; /*g_assert(item != NULL);*/ infc_browser_unlink_subreq(browser, subreq); switch(subreq->type) { case INFC_BROWSER_SUBREQ_CHAT: g_assert(has_id == FALSE); /* OK, do the subscription */ g_assert(priv->chat_session == NULL); /* Synchronize in subscription group: */ session = inf_chat_session_new( priv->communication_manager, 256, INF_SESSION_SYNCHRONIZING, INF_COMMUNICATION_GROUP(subreq->shared.chat.subscription_group), connection ); proxy = g_object_new(INFC_TYPE_SESSION_PROXY, "session", session, NULL); inf_communication_group_set_target( INF_COMMUNICATION_GROUP(subreq->shared.chat.subscription_group), INF_COMMUNICATION_OBJECT(proxy) ); infc_session_proxy_set_connection( proxy, subreq->shared.chat.subscription_group, connection, priv->seq_id ); g_object_unref(session); g_signal_emit( G_OBJECT(browser), browser_signals[SUBSCRIBE_SESSION], 0, NULL, proxy ); /* The default handler refs the proxy */ g_object_unref(proxy); if(subreq->shared.chat.request != NULL) { infc_node_request_finished(subreq->shared.chat.request, NULL); infc_request_manager_remove_request( priv->request_manager, INFC_REQUEST(subreq->shared.chat.request) ); } break; case INFC_BROWSER_SUBREQ_SESSION: g_assert(has_id == TRUE); if(subreq->shared.session.node != NULL) { g_assert(subreq->shared.session.node->id == node_id); infc_browser_subscribe_session( browser, subreq->shared.session.node, subreq->shared.session.subscription_group, connection, TRUE ); if(subreq->shared.session.request != NULL) { iter.node = subreq->shared.session.node; iter.node_id = node_id; infc_node_request_finished(subreq->shared.session.request, &iter); infc_request_manager_remove_request( priv->request_manager, INFC_REQUEST(subreq->shared.session.request) ); } } break; case INFC_BROWSER_SUBREQ_ADD_NODE: g_assert(has_id == TRUE); if(subreq->shared.add_node.parent != NULL) { /* Any other attempt at creating a node with this ID should have * failed already. */ g_assert( g_hash_table_lookup(priv->nodes, GUINT_TO_POINTER(node_id)) == NULL ); g_assert(infc_browser_find_subreq(browser, node_id) == NULL); node = infc_browser_node_add_note( browser, subreq->shared.add_node.parent, node_id, subreq->shared.add_node.name, subreq->shared.add_node.plugin->note_type, NULL ); g_assert(node->type == INFC_BROWSER_NODE_NOTE_KNOWN); /* Newly added nodes are normally newly created, so don't sync */ infc_browser_subscribe_session( browser, node, subreq->shared.add_node.subscription_group, connection, FALSE ); /* Finish request */ if(subreq->shared.add_node.request != NULL) { iter.node = node; iter.node_id = node_id; infc_node_request_finished(subreq->shared.add_node.request, &iter); infc_request_manager_remove_request( priv->request_manager, INFC_REQUEST(subreq->shared.add_node.request) ); } } break; case INFC_BROWSER_SUBREQ_SYNC_IN: g_assert(has_id == TRUE); if(subreq->shared.sync_in.parent != NULL) { /* Any other attempt at creating a node with this ID should have * failed already. */ g_assert( g_hash_table_lookup(priv->nodes, GUINT_TO_POINTER(node_id)) == NULL ); g_assert(infc_browser_find_subreq(browser, node_id) == NULL); proxy = g_object_new( INFC_TYPE_SESSION_PROXY, "session", subreq->shared.sync_in.session, NULL ); sync_group = subreq->shared.sync_in.synchronization_group; inf_communication_group_set_target( INF_COMMUNICATION_GROUP(sync_group), INF_COMMUNICATION_OBJECT(proxy) ); inf_session_synchronize_to( subreq->shared.sync_in.session, INF_COMMUNICATION_GROUP(sync_group), connection ); node = infc_browser_node_add_note( browser, subreq->shared.sync_in.parent, node_id, subreq->shared.sync_in.name, subreq->shared.sync_in.plugin->note_type, proxy ); g_assert(node->type == INFC_BROWSER_NODE_NOTE_KNOWN); iter.node_id = node->id; iter.node = node; if(subreq->shared.sync_in.subscription_group != NULL) { /* Make sure the session is not yet subscribed */ g_assert( inf_session_get_subscription_group( subreq->shared.sync_in.session ) == NULL ); if(subreq->shared.sync_in.subscription_group != sync_group) { inf_communication_group_set_target( INF_COMMUNICATION_GROUP( subreq->shared.sync_in.subscription_group ), INF_COMMUNICATION_OBJECT(proxy) ); } /* Subscribe to the newly created node. We don't need to do all the * stuff infc_browser_subscribe_session() does since we already * created the session and proxy. */ infc_session_proxy_set_connection( proxy, subreq->shared.sync_in.subscription_group, connection, priv->seq_id ); g_signal_emit( G_OBJECT(browser), browser_signals[SUBSCRIBE_SESSION], 0, &iter, proxy ); } g_object_unref(proxy); /* TODO: Emit a signal, so that others are notified that a sync-in * begins and can show progress or something. */ g_assert(subreq->shared.sync_in.request != NULL); infc_node_request_finished(subreq->shared.sync_in.request, &iter); infc_request_manager_remove_request( priv->request_manager, INFC_REQUEST(subreq->shared.sync_in.request) ); } break; default: g_assert_not_reached(); break; } infc_browser_free_subreq(subreq); } } /* * Default signal handlers */ static void infc_browser_subscribe_session_impl(InfcBrowser* browser, InfcBrowserIter* iter, InfcSessionProxy* proxy) { InfcBrowserPrivate* priv; InfcBrowserNode* node; InfSession* session; priv = INFC_BROWSER_PRIVATE(browser); session = infc_session_proxy_get_session(proxy); if(iter != NULL) { node = (InfcBrowserNode*)iter->node; g_assert( g_hash_table_lookup(priv->nodes, GUINT_TO_POINTER(iter->node_id)) == node ); g_assert(node->type == INFC_BROWSER_NODE_NOTE_KNOWN); g_assert(node->shared.known.session == NULL); node->shared.known.session = proxy; g_object_ref(proxy); /* Associate the iter to the session so that we can remove the proxy * from that item when the session is closed. */ g_object_set_qdata_full( G_OBJECT(session), infc_browser_session_proxy_quark, infc_browser_iter_copy(iter), (GDestroyNotify)infc_browser_iter_free ); } else { g_assert(priv->chat_session == NULL); g_object_ref(proxy); priv->chat_session = proxy; g_object_notify(G_OBJECT(browser), "chat-session"); } /* connect_after so that we release the reference to the object after it * was closed. Otherwise, we would trigger another close signal when * disposing the session before the default handler of the "close" signal * ran. */ g_signal_connect_after( session, "close", G_CALLBACK(infc_browser_session_close_cb), browser ); } /* * GType registration. */ static void infc_browser_class_init(gpointer g_class, gpointer class_data) { GObjectClass* object_class; InfcBrowserClass* browser_class; object_class = G_OBJECT_CLASS(g_class); browser_class = INFC_BROWSER_CLASS(g_class); parent_class = G_OBJECT_CLASS(g_type_class_peek_parent(g_class)); g_type_class_add_private(g_class, sizeof(InfcBrowserPrivate)); object_class->constructor = infc_browser_constructor; object_class->dispose = infc_browser_dispose; object_class->finalize = infc_browser_finalize; object_class->set_property = infc_browser_set_property; object_class->get_property = infc_browser_get_property; browser_class->error = NULL; browser_class->node_added = NULL; browser_class->node_removed = NULL; browser_class->begin_explore = NULL; browser_class->begin_subscribe = NULL; browser_class->subscribe_session = infc_browser_subscribe_session_impl; infc_browser_session_proxy_quark = g_quark_from_static_string( "infc-browser-session-proxy-quark" ); infc_browser_sync_in_session_quark = g_quark_from_static_string( "infc-browser-sync-in-session-quark" ); infc_browser_sync_in_plugin_quark = g_quark_from_static_string( "infc-browser-sync-in-plugin-quark" ); g_object_class_install_property( object_class, PROP_IO, g_param_spec_object( "io", "IO", "The InfIo to schedule timeouts", INF_TYPE_IO, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); g_object_class_install_property( object_class, PROP_COMMUNICATION_MANAGER, g_param_spec_object( "communication-manager", "Communication manager", "The communication manager for the browser", INF_COMMUNICATION_TYPE_MANAGER, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); g_object_class_install_property( object_class, PROP_CONNECTION, g_param_spec_object( "connection", "Server connection", "Connection to the server exposing the directory to browse", INF_TYPE_XML_CONNECTION, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); g_object_class_install_property( object_class, PROP_STATUS, g_param_spec_enum( "status", "Status", "The current connectivity status of the browser", INFC_TYPE_BROWSER_STATUS, INFC_BROWSER_DISCONNECTED, G_PARAM_READABLE ) ); g_object_class_install_property( object_class, PROP_CHAT_SESSION, g_param_spec_object( "chat-session", "Chat session", "Active chat session", INFC_TYPE_SESSION_PROXY, G_PARAM_READABLE ) ); /** * InfcBrowser::error: * @browser: The #InfcBrowser emitting the signal. * @error: A @GError* saying what's wrong. * * This signal is emitted whenever an error occured. If the browser's * underlying #InfXmlConnection produces emits #InfXmlConnection::error, * then this signal will be emitted with the corresponding error as well. * Also, if another error occurs on the browser level this signal is * emitted. It may or may not be fatal. If it is fatal then the browser's * status will change to %INFC_BROWSER_DISCONNECTED. */ browser_signals[ERROR] = g_signal_new( "error", G_OBJECT_CLASS_TYPE(object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(InfcBrowserClass, error), NULL, NULL, inf_marshal_VOID__POINTER, G_TYPE_NONE, 1, G_TYPE_POINTER /* actually a GError* */ ); /** * InfcBrowser::node-added: * @browser: The #InfcBrowser emitting the siganl. * @iter: A #InfcBrowserIter pointing to the created node. * * Emitted when a new node was added in the browser. This can happen either * while exploring a subdirectory, or when a new node was added on the * server. In the latter case the signal is only emitted when the * parent directory of the newly created node is already explored. **/ browser_signals[NODE_ADDED] = g_signal_new( "node-added", G_OBJECT_CLASS_TYPE(object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(InfcBrowserClass, node_added), NULL, NULL, inf_marshal_VOID__BOXED, G_TYPE_NONE, 1, INFC_TYPE_BROWSER_ITER | G_SIGNAL_TYPE_STATIC_SCOPE ); /** * InfcBrowser::node-removed: * @browser: The #InfcBrowser emitting the siganl. * @iter: A #InfcBrowserIter pointing to the removed node. * * This signal is emitted every time a node is removed from the browser. * This happens when the corresponding node is removed at the server. The * signal is emitted only when the parent directory of the removed node * is already explored. The signal can also be emitted on non-empty * subdirectory nodes in which case all children are also removed. **/ browser_signals[NODE_REMOVED] = g_signal_new( "node-removed", G_OBJECT_CLASS_TYPE(object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(InfcBrowserClass, node_removed), NULL, NULL, inf_marshal_VOID__BOXED, G_TYPE_NONE, 1, INFC_TYPE_BROWSER_ITER | G_SIGNAL_TYPE_STATIC_SCOPE ); /** * InfcBrowser::subscribe-session: * @browser: The #InfcBrowser emitting the siganl. * @iter: A #InfcBrowserIter pointing to the subscribed node, or %NULL. * @proxy: A #InfcSessionProxy for the subscribed session. * * Emitted when subscribed to a session. The subscription was successful, * but the synchronization (the server sending the initial session state) * might still fail. Use #InfSession::synchronization-complete and * #InfSession::synchronization-failed to be notified. * * If @iter is %NULL this is a subscription to the chat. This guarantees * @proxy's session to be a #InfChatSession. If @iter is non-%NULL this is a * subscription to the session of the node pointed to by @iter. **/ browser_signals[SUBSCRIBE_SESSION] = g_signal_new( "subscribe-session", G_OBJECT_CLASS_TYPE(object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(InfcBrowserClass, subscribe_session), NULL, NULL, inf_marshal_VOID__BOXED_OBJECT, G_TYPE_NONE, 2, INFC_TYPE_BROWSER_ITER | G_SIGNAL_TYPE_STATIC_SCOPE, INFC_TYPE_SESSION_PROXY ); /** * InfcBrowser::begin-explore: * @browser: The #InfcBrowser emitting the siganl. * @iter: A #InfcBrowserIter pointing to the node being explored. * @request: A #InfcExploreRequest for the operation. * * This signal is emitted when a subdirectory is started to be explored. * @request can be used to get notified when the exploration was finished. **/ browser_signals[BEGIN_EXPLORE] = g_signal_new( "begin-explore", G_OBJECT_CLASS_TYPE(object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(InfcBrowserClass, begin_explore), NULL, NULL, inf_marshal_VOID__BOXED_OBJECT, G_TYPE_NONE, 2, INFC_TYPE_BROWSER_ITER | G_SIGNAL_TYPE_STATIC_SCOPE, INFC_TYPE_EXPLORE_REQUEST ); /** * InfcBrowser::begin-subscribe: * @browser: The #InfcBrowser emitting the signal. * @iter: A #InfcBrowserIter pointing to the node to which the subscription * starts, or %NULL. * @request: A #InfcNodeRequest for the operation. * * This signal is emitted whenever a subscription request for a * (non-subdirectory) node is made. Note that the subscription may still * fail (connect to #InfcNodeRequest::finished and #InfcRequest::failed * to be notified). * * If @iter is %NULL the signal refers to the chat session, otherwise it * points to the node to whose session the client requested a subscription. **/ browser_signals[BEGIN_SUBSCRIBE] = g_signal_new( "begin-subscribe", G_OBJECT_CLASS_TYPE(object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(InfcBrowserClass, begin_subscribe), NULL, NULL, inf_marshal_VOID__BOXED_OBJECT, G_TYPE_NONE, 2, INFC_TYPE_BROWSER_ITER | G_SIGNAL_TYPE_STATIC_SCOPE, INFC_TYPE_NODE_REQUEST ); } static void infc_browser_communication_object_init(gpointer g_iface, gpointer iface_data) { InfCommunicationObjectIface* iface; iface = (InfCommunicationObjectIface*)g_iface; iface->received = infc_browser_communication_object_received; iface->sent = infc_browser_communication_object_sent; } GType infc_browser_status_get_type(void) { static GType browser_status_type = 0; if(!browser_status_type) { static const GEnumValue browser_status_values[] = { { INFC_BROWSER_DISCONNECTED, "INFC_BROWSER_DISCONNECTED", "disconnected" }, { INFC_BROWSER_CONNECTING, "INFC_BROWSER_CONNECTING", "connecting" }, { INFC_BROWSER_CONNECTED, "INFC_BROWSER_CONNECTED", "connected" }, { 0, NULL, NULL } }; browser_status_type = g_enum_register_static( "InfcBrowserStatus", browser_status_values ); } return browser_status_type; } GType infc_browser_get_type(void) { static GType browser_type = 0; if(!browser_type) { static const GTypeInfo browser_type_info = { sizeof(InfcBrowserClass), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ infc_browser_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InfcBrowser), /* instance_size */ 0, /* n_preallocs */ infc_browser_init, /* instance_init */ NULL /* value_table */ }; static const GInterfaceInfo communication_object_info = { infc_browser_communication_object_init, NULL, NULL }; browser_type = g_type_register_static( G_TYPE_OBJECT, "InfcBrowser", &browser_type_info, 0 ); g_type_add_interface_static( browser_type, INF_COMMUNICATION_TYPE_OBJECT, &communication_object_info ); } return browser_type; } /* * Public API. */ /** * infc_browser_new: * @io: A #InfIo object used to schedule timeouts. * @comm_manager: A #InfCommunicationManager to register the server connection * and which forwards incoming data to the browser or running sessions. * @connection: Connection to the server. * * Creates a new #InfcBrowser. * * Return Value: A new #InfcBrowser. **/ InfcBrowser* infc_browser_new(InfIo* io, InfCommunicationManager* comm_manager, InfXmlConnection* connection) { GObject* object; g_return_val_if_fail(INF_IS_IO(io), NULL); g_return_val_if_fail(INF_COMMUNICATION_IS_MANAGER(comm_manager), NULL); g_return_val_if_fail(INF_IS_XML_CONNECTION(connection), NULL); object = g_object_new( INFC_TYPE_BROWSER, "io", io, "communication-manager", comm_manager, "connection", connection, NULL ); return INFC_BROWSER(object); } /** * infc_browser_get_communication_manager: * @browser: A #InfcBrowser. * * Returns the communication manager of this browser. * * Return Value: A #InfCommunicationManager. **/ InfCommunicationManager* infc_browser_get_communication_manager(InfcBrowser* browser) { g_return_val_if_fail(INFC_IS_BROWSER(browser), NULL); return INFC_BROWSER_PRIVATE(browser)->communication_manager; } /** * infc_browser_get_connection: * @browser: A #InfcBrowser. * * Returns the connection to the server. * * Return Value: A #InfXmlConnection. **/ InfXmlConnection* infc_browser_get_connection(InfcBrowser* browser) { g_return_val_if_fail(INFC_IS_BROWSER(browser), NULL); return INFC_BROWSER_PRIVATE(browser)->connection; } /** * infc_browser_get_status: * @browser: A #InfcBrowser. * * Returns the browser's status. Note that the browser status can be * %INFC_BROWSER_DISCONNECTED even if browser's connection is still open. This * can happen if a fatal error on the browser layer happens, for example when * it does not understand the server's messages. * * Returns: The browser's status. */ InfcBrowserStatus infc_browser_get_status(InfcBrowser* browser) { g_return_val_if_fail(INFC_IS_BROWSER(browser), INFC_BROWSER_DISCONNECTED); return INFC_BROWSER_PRIVATE(browser)->status; } /** * infc_browser_add_plugin: * @browser: A #InfcBrowser. * @plugin: A #InfcNotePlugin. * * Adds @plugin to @browser. This allows the browser to create sessions of * the plugin's type. Only one plugin of each type can be added to the * directory. * * Return Value: Whether the plugin was added successfully. **/ gboolean infc_browser_add_plugin(InfcBrowser* browser, const InfcNotePlugin* plugin) { InfcBrowserPrivate* priv; g_return_val_if_fail(INFC_IS_BROWSER(browser), FALSE); g_return_val_if_fail(plugin != NULL, FALSE); priv = INFC_BROWSER_PRIVATE(browser); if(g_hash_table_lookup(priv->plugins, plugin->note_type) != NULL) return FALSE; g_hash_table_insert( priv->plugins, /* cast const away without warning */ /* take addr -> char const * const * * cast -> void const * * cast -> void * const * * deref -> void * const */ *(const gpointer*)(gconstpointer)&plugin->note_type, *(gpointer*)(gpointer)&plugin ); /* TODO: Check for yet unknown note types and make them known if they * match this plugin. */ return TRUE; } /** * infc_browser_lookup_plugin: * @browser: A #InfcBrowser. * @note_type: A note type, such as "InfText". * * Returns a previously registered plugin (see infc_browser_add_plugin()) for * the given note type, or %NULL if there is no such plugin. * * Return Value: A #InfcNotePlugin, or %NULL. **/ const InfcNotePlugin* infc_browser_lookup_plugin(InfcBrowser* browser, const gchar* note_type) { InfcBrowserPrivate* priv; g_return_val_if_fail(INFC_IS_BROWSER(browser), NULL); g_return_val_if_fail(note_type != NULL, NULL); priv = INFC_BROWSER_PRIVATE(browser); return (const InfcNotePlugin*)g_hash_table_lookup(priv->plugins, note_type); } /** * infc_browser_iter_get_root: * @browser: A #InfcBrowser. * @iter: An uninitialized #InfcBrowserIter. * * Sets @iter to point to the root node of the browser tree. **/ void infc_browser_iter_get_root(InfcBrowser* browser, InfcBrowserIter* iter) { InfcBrowserPrivate* priv; g_return_if_fail(INFC_IS_BROWSER(browser)); g_return_if_fail(iter != NULL); priv = INFC_BROWSER_PRIVATE(browser); g_assert(priv->root != NULL); iter->node_id = priv->root->id; iter->node = priv->root; } /** * infc_browser_iter_get_next: * @browser: A #InfcBrowser * @iter: A #InfcBrowserIter pointing to a node in @browser. * * Sets @iter to point to the next node within the same subdirectory. If * @iter already points to the last node, @iter is left untouched and * %FALSE is returned. * * Return Value: %TRUE if iter was set, %FALSE otherwise. **/ gboolean infc_browser_iter_get_next(InfcBrowser* browser, InfcBrowserIter* iter) { InfcBrowserNode* node; g_return_val_if_fail(INFC_IS_BROWSER(browser), FALSE); infc_browser_return_val_if_iter_fail(browser, iter, FALSE); node = (InfcBrowserNode*)iter->node; if(node->next != NULL) { iter->node_id = node->next->id; iter->node = node->next; return TRUE; } else { return FALSE; } } /** * infc_browser_iter_get_prev: * @browser: A #InfcBrowser * @iter: A #InfcBrowserIter pointing to a node in @browser. * * Sets @iter to point to the provious node within the same subdirectory. If * @iter already points to the first node, @iter is left untouched and * %FALSE is returned. * * Return Value: %TRUE if iter was set, %FALSE otherwise. **/ gboolean infc_browser_iter_get_prev(InfcBrowser* browser, InfcBrowserIter* iter) { InfcBrowserNode* node; g_return_val_if_fail(INFC_IS_BROWSER(browser), FALSE); infc_browser_return_val_if_iter_fail(browser, iter, FALSE); node = (InfcBrowserNode*)iter->node; if(node->prev != NULL) { iter->node_id = node->prev->id; iter->node = node->prev; return TRUE; } else { return FALSE; } } /** * infc_browser_iter_get_parent: * @browser: A #InfcBrowser. * @iter: A #InfcBrowserIter pointing to a node in @browser. * * Sets @iter to point to the parent node. If @iter already points to the * root node, @iter is left untouched and the function returns %FALSE. * * Return Value: %TRUE if iter was set, %FALSE otherwise. **/ gboolean infc_browser_iter_get_parent(InfcBrowser* browser, InfcBrowserIter* iter) { InfcBrowserNode* node; g_return_val_if_fail(INFC_IS_BROWSER(browser), FALSE); infc_browser_return_val_if_iter_fail(browser, iter, FALSE); node = (InfcBrowserNode*)iter->node; if(node->parent != NULL) { iter->node_id = node->parent->id; iter->node = node->parent; return TRUE; } else { return FALSE; } } /** * infc_browser_iter_get_explored: * @browser: A #InfcBrowser. * @iter: A #InfcBrowserIter pointing to a subdirectory node in @browser. * * Returns whether the subdirectory node @iter points to has been explored. * * Return Value: %TRUE if the subdirectory has been explored and %FALSE * otherwise. **/ gboolean infc_browser_iter_get_explored(InfcBrowser* browser, const InfcBrowserIter* iter) { InfcBrowserNode* node; g_return_val_if_fail(INFC_IS_BROWSER(browser), FALSE); infc_browser_return_val_if_iter_fail(browser, iter, FALSE); node = (InfcBrowserNode*)iter->node; infc_browser_return_val_if_subdir_fail(node, FALSE); return node->shared.subdir.explored; } /** * infc_browser_iter_get_child: * @browser: A #InfcBrowser. * @iter: A #InfcBrowserIter pointing to a subdirectory node in @brwoser that * has already been explored. * * Sets @iter to point to the first child of the subdirectory it is currently * pointing to. The subdirectory must already have been explored. If the * subdirectory has no children, @iter is left untouched and %FALSE is * returned. * * Return Value: %TRUE if @iter was set, %FALSE otherwise. **/ gboolean infc_browser_iter_get_child(InfcBrowser* browser, InfcBrowserIter* iter) { InfcBrowserNode* node; g_return_val_if_fail(INFC_IS_BROWSER(browser), FALSE); infc_browser_return_val_if_iter_fail(browser, iter, FALSE); node = (InfcBrowserNode*)iter->node; infc_browser_return_val_if_subdir_fail(node, FALSE); g_return_val_if_fail(node->shared.subdir.explored == TRUE, FALSE); if(node->shared.subdir.child != NULL) { iter->node_id = node->shared.subdir.child->id; iter->node = node->shared.subdir.child; return TRUE; } else { return FALSE; } } /** * infc_browser_iter_explore: * @browser: A #InfcBrowser. * @iter: A #InfcBrowserIter pointing to a subdirectory node in @browser that * has not yet been explored. * * Explores the given subdirectory node. The returned request may be used * to get informed about exploration progress and completion. When the * exploration has been initiated, infc_browser_iter_get_child() may be called * to get the content that has been explored so far. When the request has * finished, all content is available. * * Return Value: A #InfcExploreRequest to watch the exploration process. **/ InfcExploreRequest* infc_browser_iter_explore(InfcBrowser* browser, const InfcBrowserIter* iter) { InfcBrowserPrivate* priv; InfcBrowserNode* node; InfcRequest* request; xmlNodePtr xml; g_return_val_if_fail(INFC_IS_BROWSER(browser), NULL); infc_browser_return_val_if_iter_fail(browser, iter, NULL); node = (InfcBrowserNode*)iter->node; infc_browser_return_val_if_subdir_fail(node, NULL); g_return_val_if_fail(node->shared.subdir.explored == FALSE, NULL); g_assert(infc_browser_iter_get_explore_request(browser, iter) == NULL); priv = INFC_BROWSER_PRIVATE(browser); g_return_val_if_fail(priv->connection != NULL, NULL); g_return_val_if_fail(priv->status == INFC_BROWSER_CONNECTED, NULL); request = infc_request_manager_add_request( priv->request_manager, INFC_TYPE_EXPLORE_REQUEST, "explore-node", "node_id", node->id, NULL ); xml = infc_browser_request_to_xml(request); inf_xml_util_set_attribute_uint(xml, "id", node->id); g_signal_emit( G_OBJECT(browser), browser_signals[BEGIN_EXPLORE], 0, iter, request ); inf_communication_group_send_message( INF_COMMUNICATION_GROUP(priv->group), priv->connection, xml ); return INFC_EXPLORE_REQUEST(request); } /** * infc_browser_iter_get_name: * @browser: A #InfcBrowser. * @iter: A #InfcBrowserIter pointing to a node in @browser. * * Returns the name of the node @iter points to. * * Return Value: The node's name. The returned string must not be freed. **/ const gchar* infc_browser_iter_get_name(InfcBrowser* browser, const InfcBrowserIter* iter) { InfcBrowserNode* node; g_return_val_if_fail(INFC_IS_BROWSER(browser), NULL); infc_browser_return_val_if_iter_fail(browser, iter, NULL); node = (InfcBrowserNode*)iter->node; return node->name; } /** * infc_browser_iter_get_path: * @browser: A #InfcBrowser. * @iter: A #InfcBrowserIter pointing to a node in @browser. * * Returns the complete path to the node @iter points to. The path to a node * is the name of the node and the name of all parent nodes separated by '/', * as a filesystem path on Unix. * * Return Value: The node's path. Free with g_free() when no longer in use. **/ gchar* infc_browser_iter_get_path(InfcBrowser* browser, const InfcBrowserIter* iter) { InfcBrowserNode* node; gchar* path; g_return_val_if_fail(INFC_IS_BROWSER(browser), NULL); infc_browser_return_val_if_iter_fail(browser, iter, NULL); node = (InfcBrowserNode*)iter->node; infc_browser_node_get_path(node, &path, NULL); return path; } /** * infc_browser_iter_is_subdirectory: * @browser: A #InfcBrowser. * @iter: A #InfcBrowserIter pointing to a node in @browser. * * Returns whether @iter points to a subdirectory node or not. * * Return Value: Whether the node @iter points to is a subdirectory node. **/ gboolean infc_browser_iter_is_subdirectory(InfcBrowser* browser, const InfcBrowserIter* iter) { InfcBrowserNode* node; g_return_val_if_fail(INFC_IS_BROWSER(browser), FALSE); infc_browser_return_val_if_iter_fail(browser, iter, FALSE); node = (InfcBrowserNode*)iter->node; if(node->type == INFC_BROWSER_NODE_SUBDIRECTORY) return TRUE; return FALSE; } /** * infc_browser_add_subdirectory: * @browser: A #InfcBrowser. * @parent: A #InfcBrowserIter pointing to an explored subdirectory in which * to create the new subdirectory. * @name: The name for the new subdirectory. * * Creates a new request that asks the server to create a new subdirectory. * Note that the parent subdirectory must already have been explored. * * Return Value: A #InfcNodeRequest to be notified when the request * finishes or fails. **/ InfcNodeRequest* infc_browser_add_subdirectory(InfcBrowser* browser, const InfcBrowserIter* parent, const gchar* name) { InfcBrowserPrivate* priv; InfcBrowserNode* node; InfcRequest* request; xmlNodePtr xml; g_return_val_if_fail(INFC_IS_BROWSER(browser), NULL); infc_browser_return_val_if_iter_fail(browser, parent, NULL); g_return_val_if_fail(name != NULL, NULL); node = (InfcBrowserNode*)parent->node; infc_browser_return_val_if_subdir_fail(node, NULL); g_return_val_if_fail(node->shared.subdir.explored == TRUE, NULL); priv = INFC_BROWSER_PRIVATE(browser); g_return_val_if_fail(priv->connection != NULL, NULL); g_return_val_if_fail(priv->status == INFC_BROWSER_CONNECTED, NULL); request = infc_request_manager_add_request( priv->request_manager, INFC_TYPE_NODE_REQUEST, "add-node", "node-id", parent->node_id, NULL ); xml = infc_browser_request_to_xml(request); inf_xml_util_set_attribute_uint(xml, "parent", node->id); inf_xml_util_set_attribute(xml, "type", "InfSubdirectory"); inf_xml_util_set_attribute(xml, "name", name); inf_communication_group_send_message( INF_COMMUNICATION_GROUP(priv->group), priv->connection, xml ); return INFC_NODE_REQUEST(request); } /** * infc_browser_add_note: * @browser: A #InfcBrowser. * @parent: A #InfcBrowserIter pointing to an explored subdirectory. * @name: Name for the new node. * @plugin: Type of the new node. * @initial_subscribe: Whether to automatically subscribe to the newly created * node. * * Asks the server to create a new note with the given type. The returned * request may be used to be notified when the request finishes or fails. * * If @initial_subscribe is set, then, when the returned request finishes, * you might call infc_browser_iter_get_session() on the resulting * #InfcBrowserIter. However, that function is not guaranteed to return * non-%NULL in this case since the node might have been created, but the * subscription could have failed. * * Return Value: A #InfcNodeRequest. **/ InfcNodeRequest* infc_browser_add_note(InfcBrowser* browser, const InfcBrowserIter* parent, const gchar* name, const InfcNotePlugin* plugin, gboolean initial_subscribe) { InfcBrowserPrivate* priv; InfcBrowserNode* node; InfcRequest* request; xmlNodePtr xml; g_return_val_if_fail(INFC_IS_BROWSER(browser), NULL); infc_browser_return_val_if_iter_fail(browser, parent, NULL); g_return_val_if_fail(name != NULL, NULL); g_return_val_if_fail(plugin != NULL, NULL); node = (InfcBrowserNode*)parent->node; infc_browser_return_val_if_subdir_fail(node, NULL); g_return_val_if_fail(node->shared.subdir.explored == TRUE, NULL); priv = INFC_BROWSER_PRIVATE(browser); g_return_val_if_fail(priv->connection != NULL, NULL); g_return_val_if_fail(priv->status == INFC_BROWSER_CONNECTED, NULL); request = infc_request_manager_add_request( priv->request_manager, INFC_TYPE_NODE_REQUEST, "add-node", "node-id", parent->node_id, NULL ); xml = infc_browser_request_to_xml(request); inf_xml_util_set_attribute_uint(xml, "parent", node->id); inf_xml_util_set_attribute(xml, "type", plugin->note_type); inf_xml_util_set_attribute(xml, "name", name); if(initial_subscribe != FALSE) xmlNewChild(xml, NULL, (const xmlChar*)"subscribe", NULL); inf_communication_group_send_message( INF_COMMUNICATION_GROUP(priv->group), priv->connection, xml ); return INFC_NODE_REQUEST(request); } /** * infc_browser_add_note_with_content: * @browser: A #InfcBrowser. * @parent: A #InfcBrowserIter pointing to an explored subdirectory. * @name: Name for the new node. * @plugin: Type of the new node. * @session: A session that is copied to the server and used as initial * content for the new node. * @initial_subscribe: Whether to automatically subscribe to the newly created * node. * * Asks the server to create a new note with the given type. The returned * request may be used to be notified when the request finishes or fails. * * The returned request finishes as soon as the server acknowledges the * creation of the node, which is before the content is transmitted. If, * during transmission, an error occurs, then the node is removed again. To * get notified when the transmission fails, finishes or changes in progress, * you can connect to the InfSession::synchronization-failed, * InfSession::synchronization-complete and * InfSession::synchronization-progress signals. Note that a single session * might be synchronized to multiple servers at the same time, you will have * to check the connection parameter in the signal hander to find out to * which server the session is synchronized. * * You can safely unref session after having called this function. If the * request or the synchronization fails, the session will be discarded in * that case. When the returned request finishes, you can use * infc_browser_iter_get_sync_in() to get the session again. * * If @initial_subscribe is set, then, when the returned request finishes, * you might call infc_browser_iter_get_session() on the resulting * #InfcBrowserIter. However, that function is not guaranteed to return * non-%NULL in this case since the node might have been created, but the * subscription could have failed. * * Return Value: A #InfcNodeRequest. **/ InfcNodeRequest* infc_browser_add_note_with_content(InfcBrowser* browser, const InfcBrowserIter* parent, const gchar* name, const InfcNotePlugin* plugin, InfSession* session, gboolean initial_subscribe) { InfcBrowserPrivate* priv; InfcBrowserNode* node; InfcRequest* request; xmlNodePtr xml; g_return_val_if_fail(INFC_IS_BROWSER(browser), NULL); infc_browser_return_val_if_iter_fail(browser, parent, NULL); g_return_val_if_fail(name != NULL, NULL); g_return_val_if_fail(plugin != NULL, NULL); g_return_val_if_fail(INF_IS_SESSION(session), NULL); g_return_val_if_fail( inf_session_get_status(session) == INF_SESSION_RUNNING, NULL ); /* Can only subscribe if that session is not already subscribed elsewhere */ g_return_val_if_fail( !initial_subscribe || inf_session_get_subscription_group(session) == NULL, NULL ); node = (InfcBrowserNode*)parent->node; infc_browser_return_val_if_subdir_fail(node, NULL); g_return_val_if_fail(node->shared.subdir.explored == TRUE, NULL); priv = INFC_BROWSER_PRIVATE(browser); g_return_val_if_fail(priv->connection != NULL, NULL); g_return_val_if_fail(priv->status == INFC_BROWSER_CONNECTED, NULL); /* TODO: Add a InfcSyncInRequest, deriving from InfcNodeRequest that * carries session and plugin, so we don't need g_object_set_qdata for the * session and plugin. */ request = infc_request_manager_add_request( priv->request_manager, INFC_TYPE_NODE_REQUEST, "add-node", "node-id", parent->node_id, NULL ); g_object_ref(session); g_object_set_qdata_full( G_OBJECT(request), infc_browser_sync_in_session_quark, session, g_object_unref ); g_object_set_qdata( G_OBJECT(request), infc_browser_sync_in_plugin_quark, /* cast away const without warning */ *(gpointer*)(gpointer)&plugin ); xml = infc_browser_request_to_xml(request); inf_xml_util_set_attribute_uint(xml, "parent", node->id); inf_xml_util_set_attribute(xml, "type", plugin->note_type); inf_xml_util_set_attribute(xml, "name", name); if(initial_subscribe != FALSE) xmlNewChild(xml, NULL, (const xmlChar*)"subscribe", NULL); xmlNewChild(xml, NULL, (const xmlChar*)"sync-in", NULL); inf_communication_group_send_message( INF_COMMUNICATION_GROUP(priv->group), priv->connection, xml ); return INFC_NODE_REQUEST(request); } /** * infc_browser_remove_node: * @browser: A #InfcBrowser. * @iter: A #InfcBrowserIter pointing to a node in @browser. * * Asks the server to remove the node @iter points to. * * Return Value: A #InfcNodeRequest that may be used to get notified when * the request finishes or fails. **/ InfcNodeRequest* infc_browser_remove_node(InfcBrowser* browser, const InfcBrowserIter* iter) { InfcBrowserPrivate* priv; InfcBrowserNode* node; InfcRequest* request; xmlNodePtr xml; g_return_val_if_fail(INFC_IS_BROWSER(browser), NULL); infc_browser_return_val_if_iter_fail(browser, iter, NULL); priv = INFC_BROWSER_PRIVATE(browser); node = (InfcBrowserNode*)iter->node; /* The root node cannot be removed */ g_return_val_if_fail(node->parent != NULL, NULL); /* TODO: Check that there is not a remove-node request already enqueued. */ g_return_val_if_fail(priv->connection != NULL, NULL); g_return_val_if_fail(priv->status == INFC_BROWSER_CONNECTED, NULL); request = infc_request_manager_add_request( priv->request_manager, INFC_TYPE_NODE_REQUEST, "remove-node", "node-id", iter->node_id, NULL ); xml = infc_browser_request_to_xml(request); inf_xml_util_set_attribute_uint(xml, "id", node->id); inf_communication_group_send_message( INF_COMMUNICATION_GROUP(priv->group), priv->connection, xml ); return INFC_NODE_REQUEST(request); } /** * infc_browser_iter_get_note_type: * @browser: A #InfcBrowser. * @iter: A #InfcBrowserIter pointing to a note inside @browser. * * Returns the type of the note @iter points to. This must not be a * subdirectory node. * * Return Value: The note's type. **/ const gchar* infc_browser_iter_get_note_type(InfcBrowser* browser, const InfcBrowserIter* iter) { InfcBrowserPrivate* priv; InfcBrowserNode* node; g_return_val_if_fail(INFC_IS_BROWSER(browser), NULL); infc_browser_return_val_if_iter_fail(browser, iter, NULL); priv = INFC_BROWSER_PRIVATE(browser); node = (InfcBrowserNode*)iter->node; switch(node->type) { case INFC_BROWSER_NODE_SUBDIRECTORY: g_return_val_if_reached(NULL); return NULL; case INFC_BROWSER_NODE_NOTE_KNOWN: return node->shared.known.plugin->note_type; case INFC_BROWSER_NODE_NOTE_UNKNOWN: return node->shared.unknown.type; default: g_assert_not_reached(); return NULL; } } /** * infc_browser_iter_get_plugin: * @browser: A #InfcBrowser. * @iter: A #InfcBrowserIter pointing to a note inside @browser. * * Returns the #InfcNotePlugin that is used for subscriptions to the note * @iter points to, or %NULL if no plugin for the note's type has been * registered. * * Return Value: A #InfcNotePlugin, or %NULL. **/ const InfcNotePlugin* infc_browser_iter_get_plugin(InfcBrowser* browser, const InfcBrowserIter* iter) { InfcBrowserPrivate* priv; InfcBrowserNode* node; g_return_val_if_fail(INFC_IS_BROWSER(browser), NULL); infc_browser_return_val_if_iter_fail(browser, iter, NULL); priv = INFC_BROWSER_PRIVATE(browser); node = (InfcBrowserNode*)iter->node; switch(node->type) { case INFC_BROWSER_NODE_SUBDIRECTORY: g_return_val_if_reached(NULL); return NULL; case INFC_BROWSER_NODE_NOTE_KNOWN: return node->shared.known.plugin; case INFC_BROWSER_NODE_NOTE_UNKNOWN: return NULL; default: g_assert_not_reached(); return NULL; } } /** * infc_browser_iter_subscribe_session: * @browser: A #InfcBrowser. * @iter: A #InfcBrowserIter pointing to a note inside @browser. * * Subscribes to the given note. When the request has finished (which does * not mean that the subscription has finished, but the server is ready to * perform the subscription), infc_browser_iter_get_session() can be used * to access the #InfcSessionProxy object representing the subscription. * * Return Value: A #InfcNodeRequest that may be used to get notified when * the request finishes or fails. **/ InfcNodeRequest* infc_browser_iter_subscribe_session(InfcBrowser* browser, const InfcBrowserIter* iter) { InfcBrowserPrivate* priv; InfcBrowserNode* node; InfcRequest* request; xmlNodePtr xml; g_return_val_if_fail(INFC_IS_BROWSER(browser), NULL); infc_browser_return_val_if_iter_fail(browser, iter, NULL); priv = INFC_BROWSER_PRIVATE(browser); node = (InfcBrowserNode*)iter->node; g_return_val_if_fail(priv->connection != NULL, NULL); g_return_val_if_fail(priv->status == INFC_BROWSER_CONNECTED, NULL); g_return_val_if_fail(node->type == INFC_BROWSER_NODE_NOTE_KNOWN, NULL); g_return_val_if_fail(node->shared.known.session == NULL, NULL); g_return_val_if_fail( infc_browser_iter_get_subscribe_request(browser, iter) == NULL, NULL ); request = infc_request_manager_add_request( priv->request_manager, INFC_TYPE_NODE_REQUEST, "subscribe-session", "node-id", iter->node_id, NULL ); xml = infc_browser_request_to_xml(request); inf_xml_util_set_attribute_uint(xml, "id", node->id); g_signal_emit( G_OBJECT(browser), browser_signals[BEGIN_SUBSCRIBE], 0, iter, request ); inf_communication_group_send_message( INF_COMMUNICATION_GROUP(priv->group), priv->connection, xml ); return INFC_NODE_REQUEST(request); } /** * infc_browser_iter_save_session: * @browser: A #InfcBrowser. * @iter: A #InfcBrowserIter pointing to a note in @browser. * * Requests that the server saves the note pointed to by @iter into its * background storage. Normally, the server only does this when it is either * shut down or when the there are no more subscriptions to the note. Note that * this is merely a request and the server might decide not to save the * session for whatever reason. * * Return Value: A #InfcNodeRequest that may be used to get notified when * the request finishes or fails. **/ InfcNodeRequest* infc_browser_iter_save_session(InfcBrowser* browser, const InfcBrowserIter* iter) { InfcBrowserPrivate* priv; InfcBrowserNode* node; InfcRequest* request; xmlNodePtr xml; g_return_val_if_fail(INFC_IS_BROWSER(browser), NULL); infc_browser_return_val_if_iter_fail(browser, iter, NULL); priv = INFC_BROWSER_PRIVATE(browser); node = (InfcBrowserNode*)iter->node; g_return_val_if_fail(priv->connection != NULL, NULL); g_return_val_if_fail(node->type == INFC_BROWSER_NODE_NOTE_KNOWN, NULL); request = infc_request_manager_add_request( priv->request_manager, INFC_TYPE_NODE_REQUEST, "save-session", "node-id", iter->node_id, NULL ); xml = infc_browser_request_to_xml(request); inf_xml_util_set_attribute_uint(xml, "id", node->id); inf_communication_group_send_message( INF_COMMUNICATION_GROUP(priv->group), priv->connection, xml ); return INFC_NODE_REQUEST(request); } /** * infc_browser_iter_get_session: * @browser: A #InfcBrowser. * @iter: A #InfcBrowserIter pointing to a note in @browser. * * Returns the #InfcSessionProxy representing the subscription to the given * note, if the client is subscribed, and %NULL otherwise. * * Return Value: A #InfcSessionProxy, or %NULL if not subscribed. **/ InfcSessionProxy* infc_browser_iter_get_session(InfcBrowser* browser, const InfcBrowserIter* iter) { InfcBrowserPrivate* priv; InfcBrowserNode* node; g_return_val_if_fail(INFC_IS_BROWSER(browser), NULL); infc_browser_return_val_if_iter_fail(browser, iter, NULL); priv = INFC_BROWSER_PRIVATE(browser); node = (InfcBrowserNode*)iter->node; if(node->type != INFC_BROWSER_NODE_NOTE_KNOWN) return NULL; return node->shared.known.session; } /** * infc_browser_iter_get_sync_in: * @browser: A #InfcBrowser. * @iter: A #InfcBrowserIter pointing to a note in @browser. * * Returns the #InfcSessionProxy that is used to synchronize the note @iter * points to to the server. Such a node is created by * infc_browser_add_note_with_content(). If the client is subscribed to * this note, then this returns the same session as * infc_browser_iter_get_session(). However, it is possible that we * synchronize this node to the server without being subscribed to it. In * this case, this function returns the session that does the synchronization, * while infc_browser_iter_get_session() would return %NULL. * * Return Value: A #InfcSessionProxy, or %NULL if we are currently not * synchronizing this node to the server. **/ InfcSessionProxy* infc_browser_iter_get_sync_in(InfcBrowser* browser, const InfcBrowserIter* iter) { InfcBrowserPrivate* priv; GSList* item; InfcBrowserSyncIn* sync_in; g_return_val_if_fail(INFC_IS_BROWSER(browser), NULL); infc_browser_return_val_if_iter_fail(browser, iter, NULL); priv = INFC_BROWSER_PRIVATE(browser); for(item = priv->sync_ins; item != NULL; item = item->next) { sync_in = (InfcBrowserSyncIn*)item->data; if(sync_in->node == iter->node) return sync_in->proxy; } return NULL; } /** * infc_browser_iter_get_subscribe_request: * @browser: A #InfcBrowser. * @iter: A #InfcBrowserIter pointing to a note in @browser. * * Returns the #InfcNodeRequest that represents the subscription request sent * for the note @iter points to. Returns %NULL if we are already subscribed * to that node, or no subscription request has been sent. In the former * case infc_browser_iter_get_session() will return the #InfcSessionProxy for * the subscription. * * Return Value: A #InfcNodeRequest, or %NULL. **/ InfcNodeRequest* infc_browser_iter_get_subscribe_request(InfcBrowser* browser, const InfcBrowserIter* iter) { InfcBrowserPrivate* priv; InfcBrowserNode* node; InfcBrowserIterGetNodeRequestForeachData data; data.iter = iter; data.result = NULL; g_return_val_if_fail(INFC_IS_BROWSER(browser), NULL); infc_browser_return_val_if_iter_fail(browser, iter, NULL); node = (InfcBrowserNode*)iter->node; priv = INFC_BROWSER_PRIVATE(browser); if(priv->request_manager != NULL) { infc_request_manager_foreach_named_request( priv->request_manager, "subscribe-session", infc_browser_iter_get_node_request_foreach_func, &data ); } return data.result; } /** * infc_browser_iter_get_explore_request: * @browser: A #InfcBrowser. * @iter: A #InfcBrowserIter pointing to a subdirectory node in @browser. * * Returns the #InfcExploreRequest with which the node @iter points to is * currenty explored. Returns %NULL if that node is already explored or is * not currently explored. * * Return Value: A #InfcExploreRequest, or %NULL. **/ InfcExploreRequest* infc_browser_iter_get_explore_request(InfcBrowser* browser, const InfcBrowserIter* iter) { InfcBrowserPrivate* priv; InfcBrowserNode* node; InfcBrowserIterGetExploreRequestForeachData data; data.iter = iter; data.result = NULL; g_return_val_if_fail(INFC_IS_BROWSER(browser), NULL); infc_browser_return_val_if_iter_fail(browser, iter, NULL); node = (InfcBrowserNode*)iter->node; infc_browser_return_val_if_subdir_fail(node, NULL); priv = INFC_BROWSER_PRIVATE(browser); if(priv->request_manager != NULL) { infc_request_manager_foreach_named_request( priv->request_manager, "explore-node", infc_browser_iter_get_explore_request_foreach_func, &data ); } return data.result; } /** * infc_browser_iter_get_sync_in_requests: * @browser: A #InfcBrowser. * @iter: A #InfcBrowserIter pointing to a subdirectory node in @browser. * * Returns a list of all #InfcNodeRequest created with * infc_browser_add_note_with_content() with the node @iter points to as * parent. Such requests begin a synchronization to the server when they * have finished. * * Return Value: A list of #InfcNodeRequests. Free with g_slist_free() * when done. **/ GSList* infc_browser_iter_get_sync_in_requests(InfcBrowser* browser, const InfcBrowserIter* iter) { InfcBrowserPrivate* priv; InfcBrowserNode* node; InfcBrowserIterGetSyncInRequestsForeachData data; data.iter = iter; data.result = NULL; g_return_val_if_fail(INFC_IS_BROWSER(browser), NULL); infc_browser_return_val_if_iter_fail(browser, iter, NULL); node = (InfcBrowserNode*)iter->node; infc_browser_return_val_if_subdir_fail(node, NULL); priv = INFC_BROWSER_PRIVATE(browser); if(priv->request_manager != NULL) { infc_request_manager_foreach_named_request( priv->request_manager, "add-node", infc_browser_iter_get_sync_in_requests_foreach_func, &data ); } return data.result; } /** * infc_browser_iter_from_node_request: * @browser: A #InfcBrowser. * @request: A #InfcNodeRequest issued by @browser. * @iter: A #InfcBrowserIter. * * Sets @iter to point to the node @request is related to. If there is no such * node (someone could have deleted it while the request is still running), * the function returns %FALSE and @iter is unchanged. * * Return Value: %TRUE if @iter was set, %FALSE otherwise. **/ gboolean infc_browser_iter_from_node_request(InfcBrowser* browser, InfcNodeRequest* request, InfcBrowserIter* iter) { InfcBrowserPrivate* priv; InfcBrowserNode* node; guint node_id; g_return_val_if_fail(INFC_IS_BROWSER(browser), FALSE); g_return_val_if_fail(INFC_IS_NODE_REQUEST(request), FALSE); g_return_val_if_fail(iter != NULL, FALSE); priv = INFC_BROWSER_PRIVATE(browser); g_object_get(G_OBJECT(request), "node-id", &node_id, NULL); node = g_hash_table_lookup(priv->nodes, GUINT_TO_POINTER(node_id)); if(node == NULL) return FALSE; iter->node_id = node_id; iter->node = node; return TRUE; } /** * infc_browser_iter_from_explore_request: * @browser: A #InfcBrowser. * @request: A #InfcExploreRequest exploring a node in @browser. * @iter: A #InfcBrowserIter. * * Sets @iter to the node @request is currently exploring. If there is no such * node (someone could have deleted it while exploring), the function returns * %FALSE and lets @iter untouched. * * Return Value: %TRUE if @iter was set, %FALSE otherwise. **/ gboolean infc_browser_iter_from_explore_request(InfcBrowser* browser, InfcExploreRequest* request, InfcBrowserIter* iter) { InfcBrowserPrivate* priv; InfcBrowserNode* node; guint node_id; g_return_val_if_fail(INFC_IS_BROWSER(browser), FALSE); g_return_val_if_fail(INFC_IS_EXPLORE_REQUEST(request), FALSE); g_return_val_if_fail(iter != NULL, FALSE); priv = INFC_BROWSER_PRIVATE(browser); g_object_get(G_OBJECT(request), "node-id", &node_id, NULL); node = g_hash_table_lookup(priv->nodes, GUINT_TO_POINTER(node_id)); if(node == NULL) return FALSE; iter->node_id = node_id; iter->node = node; return TRUE; } /** * infc_browser_iter_is_valid: * @browser: A #InfcBrowser. * @iter: A #InfcBrowserIter. * * Returns whether @iter points to a valid node in @browser. This is * generally the case for any #InfcBrowserIter returned by one of the * InfcBrowser functions, it gets invalid however as soon as the node it * points to is removed. * * Returns: Whether @iter points to a node in @browser. */ gboolean infc_browser_iter_is_valid(InfcBrowser* browser, const InfcBrowserIter* iter) { InfcBrowserPrivate* priv; gpointer node; g_return_val_if_fail(INFC_IS_BROWSER(browser), FALSE); if(!iter) return FALSE; priv = INFC_BROWSER_PRIVATE(browser); node = g_hash_table_lookup(priv->nodes, GUINT_TO_POINTER(iter->node_id)); return node != NULL && node == iter->node; } /** * infc_browser_subscribe_chat: * @browser: A #InfcBrowser. * * Attempts to subscribe to the server's chat. When the operation finishes * infc_browser_get_chat_session() will return a #InfcSessionProxy * representing the chat session. It can be used to read the chat's content. * The request can fail in case the server chat is disabled. * * Returns: A #InfcNodeRequest that may be used to get notified when * the request finishes or fails. */ InfcNodeRequest* infc_browser_subscribe_chat(InfcBrowser* browser) { InfcBrowserPrivate* priv; InfcRequest* request; xmlNodePtr xml; g_return_val_if_fail(INFC_IS_BROWSER(browser), NULL); g_return_val_if_fail(infc_browser_get_chat_session(browser) == NULL, NULL); g_return_val_if_fail( infc_browser_get_subscribe_chat_request(browser) == NULL, NULL ); priv = INFC_BROWSER_PRIVATE(browser); /* This should really be a separate request type */ request = infc_request_manager_add_request( priv->request_manager, INFC_TYPE_NODE_REQUEST, "subscribe-chat", "node-id", 0, NULL ); xml = infc_browser_request_to_xml(request); g_signal_emit( G_OBJECT(browser), browser_signals[BEGIN_SUBSCRIBE], 0, NULL, request ); inf_communication_group_send_message( INF_COMMUNICATION_GROUP(priv->group), priv->connection, xml ); return INFC_NODE_REQUEST(request); } /** * infc_browser_get_subscribe_chat_request: * @browser: A #InfcBrowser. * * Returns the #InfcNodeRequest that represests the request sent to the server * which attempts to subscribe to its chat. If there is no such request * running, then the function returns %NULL. After such a request finishes, * call infc_browser_get_chat_session() to get the #InfcSessionProxy for the * chat session. To initiate the request, call infc_browser_subscribe_chat(). * * Returns: A #InfcNodeRequest, or %NULL. */ InfcNodeRequest* infc_browser_get_subscribe_chat_request(InfcBrowser* browser) { InfcBrowserPrivate* priv; InfcBrowserIterGetNodeRequestForeachData data; data.result = NULL; g_return_val_if_fail(INFC_IS_BROWSER(browser), NULL); priv = INFC_BROWSER_PRIVATE(browser); if(priv->request_manager != NULL) { infc_request_manager_foreach_named_request( priv->request_manager, "subscribe-chat", infc_browser_get_chat_request_foreach_func, &data ); } return data.result; } /** * infc_browser_get_chat_session: * @browser: A #InfcBrowser. * * Returns the #InfcSessionProxy representing the running chat session if the * local client is subscribed to it, or %NULL otherwise. * * Returns: A #InfcSessionProxy for the chat, or %NULL. */ InfcSessionProxy* infc_browser_get_chat_session(InfcBrowser* browser) { g_return_val_if_fail(INFC_IS_BROWSER(browser), NULL); return INFC_BROWSER_PRIVATE(browser)->chat_session; } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/client/infc-request.c0000644000175000017500000001627612264763732017361 00000000000000/* infcinote - Collaborative notetaking application * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ /** * SECTION:infc-request * @short_description: Requests sent to server * @see_also: #InfcUserRequest, #InfcNodeRequest, #InfcExploreRequest * @include: libinfinity/client/infc-request.h * @stability: Unstable * * A #InfcRequest represents a request that was sent to the server. It can * be used to get information related to that request and to be notified * when the request fails or finishes. * * #InfcRequest is the base class for other requests and only has the * #InfcRequest::failed signal. Use signals from specific requests such as * #InfcNodeRequest to get further notification. Every request has a name * and a sequence number. The sequence number is used in the server reply to * refer to a specific request and normally of no use for developers using * the infinote API. **/ #include #include typedef struct _InfcRequestPrivate InfcRequestPrivate; struct _InfcRequestPrivate { guint seq; gchar* name; }; enum { PROP_0, PROP_SEQ, PROP_NAME }; enum { FAILED, LAST_SIGNAL }; #define INFC_REQUEST_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), INFC_TYPE_REQUEST, InfcRequestPrivate)) static GObjectClass* parent_class; static guint request_signals[LAST_SIGNAL]; static void infc_request_init(GTypeInstance* instance, gpointer g_class) { InfcRequest* request; InfcRequestPrivate* priv; request = INFC_REQUEST(instance); priv = INFC_REQUEST_PRIVATE(request); priv->seq = 0; priv->name = NULL; } static void infc_request_finalize(GObject* object) { InfcRequest* request; InfcRequestPrivate* priv; request = INFC_REQUEST(object); priv = INFC_REQUEST_PRIVATE(request); g_free(priv->name); if(parent_class->finalize != NULL) parent_class->finalize(object); } static void infc_request_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec) { InfcRequest* request; InfcRequestPrivate* priv; request = INFC_REQUEST(object); priv = INFC_REQUEST_PRIVATE(request); switch(prop_id) { case PROP_SEQ: priv->seq = g_value_get_uint(value); break; case PROP_NAME: g_free(priv->name); priv->name = g_value_dup_string(value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void infc_request_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec) { InfcRequest* request; InfcRequestPrivate* priv; request = INFC_REQUEST(object); priv = INFC_REQUEST_PRIVATE(request); switch(prop_id) { case PROP_SEQ: g_value_set_uint(value, priv->seq); break; case PROP_NAME: g_value_set_string(value, priv->name); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void infc_request_class_init(gpointer g_class, gpointer class_data) { GObjectClass* object_class; InfcRequestClass* request_class; object_class = G_OBJECT_CLASS(g_class); request_class = INFC_REQUEST_CLASS(g_class); parent_class = G_OBJECT_CLASS(g_type_class_peek_parent(g_class)); g_type_class_add_private(g_class, sizeof(InfcRequestPrivate)); object_class->finalize = infc_request_finalize; object_class->set_property = infc_request_set_property; object_class->get_property = infc_request_get_property; request_class->failed = NULL; g_object_class_install_property( object_class, PROP_SEQ, g_param_spec_uint( "seq", "Sequence identifier", "Identifier for this request", 0, G_MAXUINT, 0, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); g_object_class_install_property( object_class, PROP_NAME, g_param_spec_string( "name", "Request name", "Name of the request", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); /** * InfcRequest::failed: * @request: The failed #InfcRequest. * @error: A pointer to a #GError object with details on the error. * * Emitted when the request could not be processed on the server side. * @error holds additional information on why the request failed. **/ request_signals[FAILED] = g_signal_new( "failed", G_OBJECT_CLASS_TYPE(object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(InfcRequestClass, failed), NULL, NULL, inf_marshal_VOID__POINTER, G_TYPE_NONE, 1, G_TYPE_POINTER /* actually a GError* */ ); } GType infc_request_get_type(void) { static GType request_type = 0; if(!request_type) { static const GTypeInfo request_type_info = { sizeof(InfcRequestClass), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ infc_request_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InfcRequest), /* instance_size */ 0, /* n_preallocs */ infc_request_init, /* instance_init */ NULL /* value_table */ }; request_type = g_type_register_static( G_TYPE_OBJECT, "InfcRequest", &request_type_info, 0 ); } return request_type; } /** * infc_request_get_seq: * @request: A #InfcRequest. * * Returns the sequence identifier for this request. * * Returns: The sequence number for #request. **/ guint infc_request_get_seq(InfcRequest* request) { g_return_val_if_fail(INFC_IS_REQUEST(request), 0); return INFC_REQUEST_PRIVATE(request)->seq; } /** * infc_request_get_name: * @request: A #InfcRequest. * * Returns the name of the request. * * Returns: The name of @request. **/ const gchar* infc_request_get_name(InfcRequest* request) { g_return_val_if_fail(INFC_IS_REQUEST(request), NULL); return INFC_REQUEST_PRIVATE(request)->name; } /** * infc_request_failed: * @request: A #InfcRequest. * @error: A #GError. * * Emits the "failed" signal on @request. **/ void infc_request_failed(InfcRequest* request, GError* error) { g_return_if_fail(INFC_IS_REQUEST(request)); g_return_if_fail(error != NULL); g_signal_emit(G_OBJECT(request), request_signals[FAILED], 0, error); } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/client/infc-node-request.h0000644000175000017500000000443312264763732020301 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INFC_NODE_REQUEST_H__ #define __INFC_NODE_REQUEST_H__ #include #include #include G_BEGIN_DECLS #define INFC_TYPE_NODE_REQUEST (infc_node_request_get_type()) #define INFC_NODE_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INFC_TYPE_NODE_REQUEST, InfcNodeRequest)) #define INFC_NODE_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INFC_TYPE_NODE_REQUEST, InfcNodeRequestClass)) #define INFC_IS_NODE_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INFC_TYPE_NODE_REQUEST)) #define INFC_IS_NODE_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INFC_TYPE_NODE_REQUEST)) #define INFC_NODE_REQUEST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), INFC_TYPE_NODE_REQUEST, InfcNodeRequestClass)) typedef struct _InfcNodeRequest InfcNodeRequest; typedef struct _InfcNodeRequestClass InfcNodeRequestClass; struct _InfcNodeRequestClass { InfcRequestClass parent_class; /* Signals */ void (*finished)(InfcNodeRequest* node_request, const InfcBrowserIter* iter); }; struct _InfcNodeRequest { InfcRequest parent; }; GType infc_node_request_get_type(void) G_GNUC_CONST; void infc_node_request_finished(InfcNodeRequest* request, const InfcBrowserIter* iter); G_END_DECLS #endif /* __INFC_NODE_REQUEST_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/client/infc-request.h0000644000175000017500000000422512264763732017355 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INFC_REQUEST_H__ #define __INFC_REQUEST_H__ #include G_BEGIN_DECLS #define INFC_TYPE_REQUEST (infc_request_get_type()) #define INFC_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INFC_TYPE_REQUEST, InfcRequest)) #define INFC_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INFC_TYPE_REQUEST, InfcRequestClass)) #define INFC_IS_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INFC_TYPE_REQUEST)) #define INFC_IS_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INFC_TYPE_REQUEST)) #define INFC_REQUEST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), INFC_TYPE_REQUEST, InfcRequestClass)) typedef struct _InfcRequest InfcRequest; typedef struct _InfcRequestClass InfcRequestClass; struct _InfcRequestClass { GObjectClass parent_class; /* Signals */ void (*failed)(InfcRequest* request, GError* error); void (*unused1)(void); void (*usused2)(void); }; struct _InfcRequest { GObject parent; }; GType infc_request_get_type(void) G_GNUC_CONST; guint infc_request_get_seq(InfcRequest* request); const gchar* infc_request_get_name(InfcRequest* request); void infc_request_failed(InfcRequest* request, GError* error); G_END_DECLS #endif /* __INFC_REQUEST_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/client/infc-explore-request.c0000644000175000017500000003436712264763732021036 00000000000000/* infcinote - Collaborative notetaking application * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ /** * SECTION:infc-explore-request * @title: InfcExploreRequest * @short_description: Watch progess of node exploration * @include: libinfinity/client/infc-explore-request.h * @stability: Unstable * * When starting a node exploration using infc_browser_iter_explore() then * it returns an #InfcExploreRequest. This object can be used to get notified * when there is progress in exploration (for example to show a progress bar * in the GUI) or when the operation finished, that is all child nodes of the * explored subdirectory are known to the browser. * * When the exploration starts the #InfcExploreRequest::initiated signal is * emitted. Then, for each node being explored #InfcExploreRequest::progress * is emitted. Eventually, #InfcExploreRequest::finished is emitted when the * exploration has finished. Before each step the request can also fail, in * which case #InfcRequest::failed is emitted. When this happens then none of * the other signals will be emitted anymore. */ #include #include #include typedef struct _InfcExploreRequestPrivate InfcExploreRequestPrivate; struct _InfcExploreRequestPrivate { guint node_id; guint current; guint total; /* TODO: Use an enum instead? */ gboolean initiated; gboolean finished; }; enum { PROP_0, PROP_NODE_ID, PROP_CURRENT, PROP_TOTAL, PROP_INITIATED, PROP_FINISHED }; enum { INITIATED, PROGRESS, FINISHED, LAST_SIGNAL }; #define INFC_EXPLORE_REQUEST_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), INFC_TYPE_EXPLORE_REQUEST, InfcExploreRequestPrivate)) static InfcRequestClass* parent_class; static guint explore_request_signals[LAST_SIGNAL]; static void infc_explore_request_init(GTypeInstance* instance, gpointer g_class) { InfcExploreRequest* request; InfcExploreRequestPrivate* priv; request = INFC_EXPLORE_REQUEST(instance); priv = INFC_EXPLORE_REQUEST_PRIVATE(request); priv->node_id = 0; priv->current = 0; priv->total = 0; priv->initiated = FALSE; priv->finished = FALSE; } static void infc_explore_request_finalize(GObject* object) { InfcExploreRequest* request; InfcExploreRequestPrivate* priv; request = INFC_EXPLORE_REQUEST(object); priv = INFC_EXPLORE_REQUEST_PRIVATE(request); if(G_OBJECT_CLASS(parent_class)->finalize != NULL) G_OBJECT_CLASS(parent_class)->finalize(object); } static void infc_explore_request_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec) { InfcExploreRequest* request; InfcExploreRequestPrivate* priv; request = INFC_EXPLORE_REQUEST(object); priv = INFC_EXPLORE_REQUEST_PRIVATE(request); switch(prop_id) { case PROP_NODE_ID: priv->node_id = g_value_get_uint(value); break; case PROP_TOTAL: priv->total = g_value_get_uint(value); break; case PROP_CURRENT: priv->total = g_value_get_uint(value); break; case PROP_INITIATED: case PROP_FINISHED: /* readonly */ default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void infc_explore_request_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec) { InfcExploreRequest* explore_request; InfcExploreRequestPrivate* priv; explore_request = INFC_EXPLORE_REQUEST(object); priv = INFC_EXPLORE_REQUEST_PRIVATE(explore_request); switch(prop_id) { case PROP_NODE_ID: g_value_set_uint(value, priv->node_id); break; case PROP_TOTAL: g_value_set_uint(value, priv->total); break; case PROP_CURRENT: g_value_set_uint(value, priv->current); break; case PROP_INITIATED: g_value_set_boolean(value, priv->initiated); break; case PROP_FINISHED: g_value_set_boolean(value, priv->finished); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void infc_explore_request_initiated_impl(InfcExploreRequest* request, guint total) { InfcExploreRequestPrivate* priv; priv = INFC_EXPLORE_REQUEST_PRIVATE(request); g_assert(priv->initiated == FALSE); g_assert(priv->finished == FALSE); priv->total = total; priv->initiated = TRUE; g_object_notify(G_OBJECT(request), "total"); g_object_notify(G_OBJECT(request), "initiated"); } static void infc_explore_request_progress_impl(InfcExploreRequest* request, guint current, guint total) { InfcExploreRequestPrivate* priv; priv = INFC_EXPLORE_REQUEST_PRIVATE(request); g_assert(priv->initiated == TRUE); g_assert(priv->finished == FALSE); g_assert(total == priv->total); priv->current = current; g_object_notify(G_OBJECT(request), "current"); } static void infc_explore_request_finished_impl(InfcExploreRequest* request) { InfcExploreRequestPrivate* priv; priv = INFC_EXPLORE_REQUEST_PRIVATE(request); g_assert(priv->initiated == TRUE); g_assert(priv->finished == FALSE); priv->finished = TRUE; g_object_notify(G_OBJECT(request), "finished"); } static void infc_explore_request_class_init(gpointer g_class, gpointer class_data) { GObjectClass* object_class; InfcExploreRequestClass* request_class; object_class = G_OBJECT_CLASS(g_class); request_class = INFC_EXPLORE_REQUEST_CLASS(g_class); parent_class = INFC_REQUEST_CLASS(g_type_class_peek_parent(g_class)); g_type_class_add_private(g_class, sizeof(InfcExploreRequestPrivate)); object_class->finalize = infc_explore_request_finalize; object_class->set_property = infc_explore_request_set_property; object_class->get_property = infc_explore_request_get_property; request_class->initiated = infc_explore_request_initiated_impl; request_class->progress = infc_explore_request_progress_impl; request_class->finished = infc_explore_request_finished_impl; g_object_class_install_property( object_class, PROP_NODE_ID, g_param_spec_uint( "node_id", "Node ID", "ID of the node to explore", 0, G_MAXUINT, 0, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); g_object_class_install_property( object_class, PROP_TOTAL, g_param_spec_uint( "total", "Total", "Total number of nodes that are explored", 0, G_MAXUINT, 0, G_PARAM_READWRITE ) ); g_object_class_install_property( object_class, PROP_CURRENT, g_param_spec_uint( "current", "Current", "Node that has just been explored", 0, G_MAXUINT, 0, G_PARAM_READWRITE ) ); g_object_class_install_property( object_class, PROP_INITIATED, g_param_spec_boolean( "initiated", "Initiated", "Whether the exploration process was already initiated", FALSE, G_PARAM_READABLE ) ); g_object_class_install_property( object_class, PROP_FINISHED, g_param_spec_boolean( "finished", "Finished", "Whether the exploration process has finished", FALSE, G_PARAM_READABLE ) ); /** * InfcExploreRequest::initiated: * @request: The #InfcExploreRequest that is being initiated. * @total: Total number of the directory's child nodes. * * This signal is emitted once the exploration has been initiated, that is * when it is known how many child nodes are going to be explored. The * number of nodes is provided in the @total parameter. */ explore_request_signals[INITIATED] = g_signal_new( "initiated", G_OBJECT_CLASS_TYPE(object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(InfcExploreRequestClass, initiated), NULL, NULL, inf_marshal_VOID__UINT, G_TYPE_NONE, 1, G_TYPE_UINT ); /** * InfcExploreRequest::progress: * @request: The #InfcExploreRequest that made progress. * @current: The number of child nodes retrieved so far. * @total: The total number of child nodes. * * This signal is emitted for each child node that is added to the * subdirectory being explored. This can for example be used to update a * progress bar in the GUI. */ explore_request_signals[PROGRESS] = g_signal_new( "progress", G_OBJECT_CLASS_TYPE(object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(InfcExploreRequestClass, progress), NULL, NULL, inf_marshal_VOID__UINT_UINT, G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT ); /** * InfcExploreRequest::finished: * @request: The #InfcExploreRequest which finished. * * This signal is emitted when the exploration finished successfully and all * child nodes of the subdirectory being explored are known. */ explore_request_signals[FINISHED] = g_signal_new( "finished", G_OBJECT_CLASS_TYPE(object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(InfcExploreRequestClass, finished), NULL, NULL, inf_marshal_VOID__VOID, G_TYPE_NONE, 0 ); } GType infc_explore_request_get_type(void) { static GType explore_request_type = 0; if(!explore_request_type) { static const GTypeInfo explore_request_type_info = { sizeof(InfcExploreRequestClass), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ infc_explore_request_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InfcExploreRequest), /* instance_size */ 0, /* n_preallocs */ infc_explore_request_init, /* instance_init */ NULL /* value_table */ }; explore_request_type = g_type_register_static( INFC_TYPE_REQUEST, "InfcExploreRequest", &explore_request_type_info, 0 ); } return explore_request_type; } /** * infc_explore_request_get_node_id: * @request: An #InfcExploreRequest. * * Returns the ID of the node to be explored. * * Return Value: ID of the node to be explored. **/ guint infc_explore_request_get_node_id(InfcExploreRequest* request) { return INFC_EXPLORE_REQUEST_PRIVATE(request)->node_id; } /** * infc_explore_request_initiated: * @request: An #InfcExploreRequest. * @total: The total number of children of the node which is being explored. * * Emits the "initiated" signal on @request. An explore request is considered * initiated as soon as the total amount of child nodes is known. **/ void infc_explore_request_initiated(InfcExploreRequest* request, guint total) { g_signal_emit( G_OBJECT(request), explore_request_signals[INITIATED], 0, total ); } /** * infc_explore_request_progress: * @request: A #InfcExploreRequest. * @error: Location to store error information. * * Emits the "progress" signal on @request. * * Return Value: %TRUE when the signal was emitted, %FALSE on error. **/ gboolean infc_explore_request_progress(InfcExploreRequest* request, GError** error) { InfcExploreRequestPrivate* priv; priv = INFC_EXPLORE_REQUEST_PRIVATE(request); if(priv->current == priv->total) { g_set_error( error, inf_directory_error_quark(), INF_DIRECTORY_ERROR_TOO_MUCH_CHILDREN, "%s", inf_directory_strerror(INF_DIRECTORY_ERROR_TOO_MUCH_CHILDREN) ); return FALSE; } else { g_signal_emit( G_OBJECT(request), explore_request_signals[PROGRESS], 0, priv->current + 1, priv->total ); return TRUE; } } /** * infc_explore_request_finished: * @request: A #InfcExploreRequest. * @error: Location to store error information. * * Emits the "finished" signal on @request. * * Return Value: %TRUE when the signal was emitted, %FALSE on error. **/ gboolean infc_explore_request_finished(InfcExploreRequest* request, GError** error) { InfcExploreRequestPrivate* priv; priv = INFC_EXPLORE_REQUEST_PRIVATE(request); if(priv->current < priv->total) { g_set_error( error, inf_directory_error_quark(), INF_DIRECTORY_ERROR_TOO_FEW_CHILDREN, "%s", inf_directory_strerror(INF_DIRECTORY_ERROR_TOO_FEW_CHILDREN) ); return FALSE; } else { g_signal_emit( G_OBJECT(request), explore_request_signals[FINISHED], 0 ); return TRUE; } } /** * infc_explore_request_get_initiated: * @request: A #InfcExploreRequest. * * Returns whether the exploration process was already initiated, i.e. the * total number of nodes to explore is known. * * Return Value: Whether the exploration was initiated. **/ gboolean infc_explore_request_get_initiated(InfcExploreRequest* request) { g_return_val_if_fail(INFC_IS_EXPLORE_REQUEST(request), FALSE); return INFC_EXPLORE_REQUEST_PRIVATE(request)->initiated; } /** * infc_explore_request_get_finished: * @request: A #InfcExploreRequest. * * Returns whether the exploration process has finished, i.e. the "finished" * signal was emitted. * * Return Value: Whether the exploration has finished. **/ gboolean infc_explore_request_get_finished(InfcExploreRequest* request) { g_return_val_if_fail(INFC_IS_EXPLORE_REQUEST(request), FALSE); return INFC_EXPLORE_REQUEST_PRIVATE(request)->finished; } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/client/infc-node-request.c0000644000175000017500000001266212264763732020277 00000000000000/* infcinote - Collaborative notetaking application * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include typedef struct _InfcNodeRequestPrivate InfcNodeRequestPrivate; struct _InfcNodeRequestPrivate { guint node_id; }; enum { PROP_0, PROP_NODE_ID }; enum { FINISHED, LAST_SIGNAL }; #define INFC_NODE_REQUEST_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), INFC_TYPE_NODE_REQUEST, InfcNodeRequestPrivate)) static InfcRequestClass* parent_class; static guint node_request_signals[LAST_SIGNAL]; static void infc_node_request_init(GTypeInstance* instance, gpointer g_class) { InfcNodeRequest* node_request; InfcNodeRequestPrivate* priv; node_request = INFC_NODE_REQUEST(instance); priv = INFC_NODE_REQUEST_PRIVATE(node_request); priv->node_id = 0; } static void infc_node_request_finalize(GObject* object) { InfcNodeRequest* request; request = INFC_NODE_REQUEST(object); if(G_OBJECT_CLASS(parent_class)->finalize != NULL) G_OBJECT_CLASS(parent_class)->finalize(object); } static void infc_node_request_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec) { InfcNodeRequest* request; InfcNodeRequestPrivate* priv; request = INFC_NODE_REQUEST(object); priv = INFC_NODE_REQUEST_PRIVATE(request); switch(prop_id) { case PROP_NODE_ID: priv->node_id = g_value_get_uint(value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void infc_node_request_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec) { InfcNodeRequest* request; InfcNodeRequestPrivate* priv; request = INFC_NODE_REQUEST(object); priv = INFC_NODE_REQUEST_PRIVATE(request); switch(prop_id) { case PROP_NODE_ID: g_value_set_uint(value, priv->node_id); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void infc_node_request_class_init(gpointer g_class, gpointer class_data) { GObjectClass* object_class; InfcNodeRequestClass* request_class; object_class = G_OBJECT_CLASS(g_class); request_class = INFC_NODE_REQUEST_CLASS(g_class); parent_class = INFC_REQUEST_CLASS(g_type_class_peek_parent(g_class)); g_type_class_add_private(g_class, sizeof(InfcNodeRequestPrivate)); object_class->finalize = infc_node_request_finalize; object_class->set_property = infc_node_request_set_property; object_class->get_property = infc_node_request_get_property; request_class->finished = NULL; g_object_class_install_property( object_class, PROP_NODE_ID, g_param_spec_uint( "node-id", "Node ID", "The ID of the node affected by the request", 0, G_MAXUINT, 0, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); node_request_signals[FINISHED] = g_signal_new( "finished", G_OBJECT_CLASS_TYPE(object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(InfcNodeRequestClass, finished), NULL, NULL, inf_marshal_VOID__BOXED, G_TYPE_NONE, 1, INFC_TYPE_BROWSER_ITER | G_SIGNAL_TYPE_STATIC_SCOPE ); } GType infc_node_request_get_type(void) { static GType node_request_type = 0; if(!node_request_type) { static const GTypeInfo node_request_type_info = { sizeof(InfcNodeRequestClass), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ infc_node_request_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InfcNodeRequest), /* instance_size */ 0, /* n_preallocs */ infc_node_request_init, /* instance_init */ NULL /* value_table */ }; node_request_type = g_type_register_static( INFC_TYPE_REQUEST, "InfcNodeRequest", &node_request_type_info, 0 ); } return node_request_type; } /** * infc_node_request_finished: * @request: A #InfcNodeRequest. * @iter: A #InfcBrowserIter pointing to a node affected by the request. * * Emits the "finished" signal on @request. **/ void infc_node_request_finished(InfcNodeRequest* request, const InfcBrowserIter* iter) { g_signal_emit(G_OBJECT(request), node_request_signals[FINISHED], 0, iter); } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/client/infc-request-manager.c0000644000175000017500000005376212264763732020772 00000000000000/* infcinote - Collaborative notetaking application * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include #include #include #include #include #include typedef struct _InfcRequestManagerForeachData InfcRequestManagerForeachData; struct _InfcRequestManagerForeachData { InfcRequestManagerForeachFunc func; gpointer user_data; const gchar* name; }; typedef struct _InfcRequestManagerPrivate InfcRequestManagerPrivate; struct _InfcRequestManagerPrivate { GHashTable* requests; guint seq_id; guint seq_counter; }; enum { PROP_0, PROP_SEQUENCE_ID }; enum { REQUEST_ADD, REQUEST_REMOVE, LAST_SIGNAL }; #define INFC_REQUEST_MANAGER_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), INFC_TYPE_REQUEST_MANAGER, InfcRequestManagerPrivate)) static GObjectClass* parent_class; static guint request_manager_signals[LAST_SIGNAL]; static void infc_request_manager_foreach_request_func(gpointer key, gpointer value, gpointer user_data) { InfcRequest* request; InfcRequestManagerForeachData* foreach_data; request = INFC_REQUEST(value); foreach_data = (InfcRequestManagerForeachData*)user_data; if(foreach_data->name == NULL || strcmp(foreach_data->name, infc_request_get_name(request)) == 0) { foreach_data->func(request, foreach_data->user_data); } } /* TODO: inf_protocol_version_parse() uses a very similar routine. We should * avoid the code duplication. */ static gboolean infc_request_manager_parse_seq(const gchar* seq, guint* seq_id, guint* seq_num, GError** error) { gchar* endptr; unsigned long sid; unsigned long snum; errno = 0; sid = strtoul(seq, &endptr, 10); if(errno == ERANGE || sid > (unsigned long)G_MAXUINT) { g_set_error( error, inf_request_error_quark(), INF_REQUEST_ERROR_INVALID_SEQ, "%s", _("Sequence identifier causes overflow") ); return FALSE; } if(*endptr != '/') { g_set_error( error, inf_request_error_quark(), INF_REQUEST_ERROR_INVALID_SEQ, "%s", _("Sequence components are not separated by '/'") ); return FALSE; } errno = 0; snum = strtoul(endptr + 1, &endptr, 10); if(errno == ERANGE || snum > (unsigned long)G_MAXUINT) { g_set_error( error, inf_request_error_quark(), INF_REQUEST_ERROR_INVALID_SEQ, "%s", _("Sequence number causes overflow") ); return FALSE; } if(*endptr != '\0') { g_set_error( error, inf_request_error_quark(), INF_REQUEST_ERROR_INVALID_SEQ, "%s", _("Trailing characters after sequence number") ); return FALSE; } if(seq_id) *seq_id = sid; if(seq_num) *seq_num = snum; return TRUE; } static void infc_request_manager_init(GTypeInstance* instance, gpointer g_class) { InfcRequestManager* request_manager; InfcRequestManagerPrivate* priv; request_manager = INFC_REQUEST_MANAGER(instance); priv = INFC_REQUEST_MANAGER_PRIVATE(request_manager); priv->requests = g_hash_table_new_full( NULL, NULL, NULL, (GDestroyNotify)g_object_unref ); priv->seq_id = 0; priv->seq_counter = 0; } static void infc_request_manager_dispose(GObject* object) { InfcRequestManager* request_manager; InfcRequestManagerPrivate* priv; request_manager = INFC_REQUEST_MANAGER(object); priv = INFC_REQUEST_MANAGER_PRIVATE(request_manager); g_hash_table_destroy(priv->requests); priv->requests = NULL; if(parent_class->dispose != NULL) parent_class->dispose(object); } static void infc_request_manager_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec) { InfcRequestManager* request_manager; InfcRequestManagerPrivate* priv; request_manager = INFC_REQUEST_MANAGER(object); priv = INFC_REQUEST_MANAGER_PRIVATE(request_manager); switch(prop_id) { case PROP_SEQUENCE_ID: priv->seq_id = g_value_get_uint(value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void infc_request_manager_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec) { InfcRequestManager* request_manager; InfcRequestManagerPrivate* priv; request_manager = INFC_REQUEST_MANAGER(object); priv = INFC_REQUEST_MANAGER_PRIVATE(request_manager); switch(prop_id) { case PROP_SEQUENCE_ID: g_value_set_uint(value, priv->seq_id); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void infc_request_manager_request_add(InfcRequestManager* manager, InfcRequest* request) { InfcRequestManagerPrivate* priv; gpointer seq; priv = INFC_REQUEST_MANAGER_PRIVATE(manager); seq = GUINT_TO_POINTER(infc_request_get_seq(request)); g_assert(g_hash_table_lookup(priv->requests, seq) == NULL); g_hash_table_insert(priv->requests, seq, request); g_object_ref(G_OBJECT(request)); } static void infc_request_manager_request_remove(InfcRequestManager* manager, InfcRequest* request) { InfcRequestManagerPrivate* priv; gpointer seq; priv = INFC_REQUEST_MANAGER_PRIVATE(manager); seq = GUINT_TO_POINTER(infc_request_get_seq(request)); g_assert(g_hash_table_lookup(priv->requests, seq) != NULL); g_hash_table_remove(priv->requests, seq); } static void infc_request_manager_class_init(gpointer g_class, gpointer class_data) { GObjectClass* object_class; InfcRequestManagerClass* request_manager_class; object_class = G_OBJECT_CLASS(g_class); request_manager_class = INFC_REQUEST_MANAGER_CLASS(g_class); parent_class = G_OBJECT_CLASS(g_type_class_peek_parent(g_class)); g_type_class_add_private(g_class, sizeof(InfcRequestManagerPrivate)); object_class->dispose = infc_request_manager_dispose; object_class->set_property = infc_request_manager_set_property; object_class->get_property = infc_request_manager_get_property; request_manager_class->request_add = infc_request_manager_request_add; request_manager_class->request_remove = infc_request_manager_request_remove; g_object_class_install_property( object_class, PROP_SEQUENCE_ID, g_param_spec_uint( "sequence-id", "Sequence ID", "The local sequence identifier", 0, G_MAXUINT, 0, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); request_manager_signals[REQUEST_ADD] = g_signal_new( "request-add", G_OBJECT_CLASS_TYPE(object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(InfcRequestManagerClass, request_add), NULL, NULL, inf_marshal_VOID__OBJECT, G_TYPE_NONE, 1, INFC_TYPE_REQUEST ); request_manager_signals[REQUEST_REMOVE] = g_signal_new( "request-remove", G_OBJECT_CLASS_TYPE(object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(InfcRequestManagerClass, request_remove), NULL, NULL, inf_marshal_VOID__OBJECT, G_TYPE_NONE, 1, INFC_TYPE_REQUEST ); } GType infc_request_manager_get_type(void) { static GType request_manager_type = 0; if(!request_manager_type) { static const GTypeInfo request_manager_type_info = { sizeof(InfcRequestManagerClass), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ infc_request_manager_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InfcRequestManager), /* instance_size */ 0, /* n_preallocs */ infc_request_manager_init, /* instance_init */ NULL /* value_table */ }; request_manager_type = g_type_register_static( G_TYPE_OBJECT, "InfcRequestManager", &request_manager_type_info, 0 ); } return request_manager_type; } /** * infc_request_manager_new: * @seq_id: The local sequence ID. * * Creates a new #InfcRequestManager. * * Return Value: A newly allocated #InfcRequestManager. **/ InfcRequestManager* infc_request_manager_new(guint seq_id) { GObject* object; object = g_object_new(INFC_TYPE_REQUEST_MANAGER, "sequence-id", seq_id, NULL); return INFC_REQUEST_MANAGER(object); } /** * infc_request_manager_add_request: * @manager: A #InfcRequestManager. * @request_type: The type of request to add, such as %INFC_TYPE_NODE_REQUEST. * @request_name: The name of the request, such as "explore-node" or * "subscribe-session". * @first_property_name: The first property name apart from name and seq to * set for the new request. * @...: The value of the first property, followed optionally by more * name/value pairs, followed by %NULL. * * Adds a request to the request manager. * * Return Value: The generated #InfcRequest (actually of type @request_type). **/ InfcRequest* infc_request_manager_add_request(InfcRequestManager* manager, GType request_type, const gchar* request_name, const gchar* first_property_name, ...) { InfcRequest* request; va_list arglist; va_start(arglist, first_property_name); request = infc_request_manager_add_request_valist( manager, request_type, request_name, first_property_name, arglist ); va_end(arglist); return request; } /** * infc_request_manager_add_request_valist: * @manager: A #InfcRequestManager. * @request_type: The type of request to add, such as %INFC_TYPE_NODE_REQUEST. * @request_name: The name of the request, such as "explore-node" or * "subscribe-session" * @first_property_name: The first property name apart from name and seq to * set for the new request. * @arglist: The value of the first property, followed optionally by more * name/value pairs, followed by %NULL. * * Adds a request to the request manager. * * Return Value: The generated #InfcRequest (actually of type @request_type). */ InfcRequest* infc_request_manager_add_request_valist(InfcRequestManager* manager, GType request_type, const gchar* request_name, const gchar* first_property_name, va_list arglist) { InfcRequestManagerPrivate* priv; GObjectClass* request_class; InfcRequest* request; GParameter* params; const gchar* prop_name; gsize param_size; gsize param_alloc; guint seq; gchar* error; GParamSpec* pspec; guint i; g_return_val_if_fail(INFC_IS_REQUEST_MANAGER(manager), NULL); g_return_val_if_fail(request_name != NULL, NULL); request_class = g_type_class_ref(request_type); g_return_val_if_fail(request_class != NULL, NULL); priv = INFC_REQUEST_MANAGER_PRIVATE(manager); seq = priv->seq_counter; g_assert( g_hash_table_lookup(priv->requests, GUINT_TO_POINTER(seq)) == NULL ); param_size = 0; param_alloc = 16; params = g_malloc0(param_alloc * sizeof(GParameter)); params[param_size].name = "name"; g_value_init(¶ms[param_size].value, G_TYPE_STRING); g_value_set_static_string(¶ms[param_size].value, request_name); ++ param_size; params[param_size].name = "seq"; g_value_init(¶ms[param_size].value, G_TYPE_UINT); g_value_set_uint(¶ms[param_size].value, seq); ++ param_size; prop_name = first_property_name; error = NULL; while(prop_name != NULL) { pspec = g_object_class_find_property(request_class, prop_name); if(pspec == NULL) { g_warning( "%s: object class `%s' has no attribute named `%s'", G_STRFUNC, g_type_name(request_type), prop_name ); break; } if(param_size >= param_alloc) { param_alloc += 16; params = g_realloc(params, param_alloc * sizeof(GParameter)); } params[param_size].name = prop_name; g_value_init(¶ms[param_size].value, G_PARAM_SPEC_VALUE_TYPE(pspec)); G_VALUE_COLLECT(¶ms[param_size].value, arglist, 0, &error); if(error != NULL) { g_warning("%s: %s", G_STRFUNC, error); g_value_unset(¶ms[param_size].value); g_free(error); break; } ++ param_size; prop_name = va_arg(arglist, const gchar*); } if(prop_name == NULL) { request = INFC_REQUEST(g_object_newv(request_type, param_size, params)); g_hash_table_insert(priv->requests, GUINT_TO_POINTER(seq), request); ++ priv->seq_counter; } else { /* An error occured. We do not use GError here tough, because this is a * most likely a bug in someone's code (if not, it is one in * libinfinity's code). */ request = NULL; } for(i = 0; i < param_size; ++ i) g_value_unset(¶ms[i].value); g_free(params); g_type_class_unref(request_class); return request; } /** * infc_request_manager_remove_request: * @manager: A #InfcRequestManager. * @request: A #InfcRequest that has previously been added to @manager. * * Removes a request from the request manager. **/ void infc_request_manager_remove_request(InfcRequestManager* manager, InfcRequest* request) { g_return_if_fail(INFC_IS_REQUEST_MANAGER(manager)); g_return_if_fail(INFC_IS_REQUEST(request)); g_object_ref(G_OBJECT(request)); g_signal_emit( G_OBJECT(manager), request_manager_signals[REQUEST_REMOVE], 0, request ); g_object_unref(G_OBJECT(request)); } /** * infc_request_manager_fail_request: * @manager: A #InfcRequestManager. * @request: A #InfcRequest that has previously been added to @manager. * @error: Error information why the request failed. * * Emits the "failed" signal on @request and then removes the request from * the manager. **/ void infc_request_manager_fail_request(InfcRequestManager* manager, InfcRequest* request, GError* error) { g_return_if_fail(INFC_IS_REQUEST_MANAGER(manager)); g_return_if_fail(INFC_IS_REQUEST(request)); g_return_if_fail(error != NULL); infc_request_failed(request, error); infc_request_manager_remove_request(manager, request); } /** * infc_request_manager_clear: * @manager: A #InfcRequestManager. * * Removes all the requests in @manager. **/ void infc_request_manager_clear(InfcRequestManager* manager) { g_return_if_fail(INFC_IS_REQUEST_MANAGER(manager)); g_hash_table_remove_all(INFC_REQUEST_MANAGER_PRIVATE(manager)->requests); } /** * infc_request_manager_get_request_by_seq: * @manager: A #InfcRequestManager. * @seq: The sequence number to which the request should be retrieved. * * Returns a previously-added request that has the given seq. * * Return Value: The request with the given seq, or %NULL if there is no such * request. **/ InfcRequest* infc_request_manager_get_request_by_seq(InfcRequestManager* manager, guint seq) { InfcRequestManagerPrivate* priv; g_return_val_if_fail(INFC_IS_REQUEST_MANAGER(manager), NULL); priv = INFC_REQUEST_MANAGER_PRIVATE(manager); return INFC_REQUEST( g_hash_table_lookup(priv->requests, GUINT_TO_POINTER(seq)) ); } /** * infc_request_manager_get_request_by_xml: * @manager: A #InfcRequestManager. * @name: Name of the expected request. May be %NULL to allow all requests. * @xml: XML node that is supposed to contain a "seq" attribute. * @error: Location to store error information. * * Looks whether there is a "seq" attribute in @xml. If not, the function * returns %NULL (without setting @error). Otherwise, it returns the request * with the given seq and name, if the sequence ID matches. If the "seq" * attribute is set but the actual request is not present (or has another * name), the function returns %NULL and @error is set. * * Return Value: The resulting request, or %NULL if the "seq" attribute was * not present or an error occured. **/ InfcRequest* infc_request_manager_get_request_by_xml(InfcRequestManager* manager, const gchar* name, xmlNodePtr xml, GError** error) { InfcRequestManagerPrivate* priv; InfcRequest* request; xmlChar* seq_attr; gboolean has_seq; guint seq_id; guint seq; g_return_val_if_fail(INFC_IS_REQUEST_MANAGER(manager), NULL); g_return_val_if_fail(xml != NULL, NULL); priv = INFC_REQUEST_MANAGER_PRIVATE(manager); request = NULL; seq_attr = inf_xml_util_get_attribute(xml, "seq"); if(!seq_attr) return NULL; has_seq = infc_request_manager_parse_seq( (const gchar*)seq_attr, &seq_id, &seq, error ); if(!has_seq) return NULL; /* Not our seq ID */ if(seq_id != priv->seq_id) return NULL; request = infc_request_manager_get_request_by_seq(manager, seq); if(request == NULL) { g_set_error( error, inf_request_error_quark(), INF_REQUEST_ERROR_INVALID_SEQ, "%s", _("The request contains an unknown sequence number") ); } else { if(name != NULL && strcmp(name, infc_request_get_name(request)) != 0) { g_set_error( error, inf_request_error_quark(), INF_REQUEST_ERROR_INVALID_SEQ, _("The request contains a sequence number refering to a request of " "type '%s', but a request of type '%s' was expected"), infc_request_get_name(request), name ); request = NULL; } } return request; } /** * infc_request_manager_get_request_by_xml_required: * @manager: A #InfcRequestManager. * @name: Name of the expected request. May be %NULL to allow all requests. * @xml: XML node that is supposed to contain a "seq" attribute. * @error: Location to store error information. * * Looks whether there is a "seq" attribute in @xml. If so, it returns the * request with the given seq and name, if the sequence ID matches. If the * "seq" attribute is not set or the actual request is not present (or has * another name), the function returns %NULL and @error is set. * * Return Value: The resulting request, or %NULL if an error occured. **/ InfcRequest* infc_request_manager_get_request_by_xml_required(InfcRequestManager* manager, const gchar* name, xmlNodePtr xml, GError** error) { InfcRequest* request; GError* own_error; own_error = NULL; request = infc_request_manager_get_request_by_xml( manager, name, xml, &own_error ); if(request == NULL) { if(own_error == NULL) { g_set_error( error, inf_request_error_quark(), INF_REQUEST_ERROR_INVALID_SEQ, "%s", _("The request does not contain a sequence number, but one " "is required") ); } else { g_propagate_error(error, own_error); } } return request; } /** * infc_request_manager_foreach_request: * @manager: A #InfcRequestManager. * @func: The function to be called. * @user_data: Arbitrary data to be passed to @func. * * Calls the given function for each request that has been added to the * request manager. **/ void infc_request_manager_foreach_request(InfcRequestManager* manager, InfcRequestManagerForeachFunc func, gpointer user_data) { InfcRequestManagerPrivate* priv; InfcRequestManagerForeachData data; g_return_if_fail(INFC_IS_REQUEST_MANAGER(manager)); g_return_if_fail(func != NULL); priv = INFC_REQUEST_MANAGER_PRIVATE(manager); data.func = func; data.user_data = user_data; data.name = NULL; g_hash_table_foreach( priv->requests, infc_request_manager_foreach_request_func, &data ); } /** * infc_request_manager_foreach_named_request: * @manager: A #InfcRequestManager. * @name: The name of the request to look for. * @func: The function to be called. * @user_data: Arbitrary data to be passed to @func. * * Calls the given function for each request that has been added to the * request manager that has the name @name. **/ void infc_request_manager_foreach_named_request(InfcRequestManager* manager, const gchar* name, InfcRequestManagerForeachFunc func, gpointer user_data) { InfcRequestManagerPrivate* priv; InfcRequestManagerForeachData data; g_return_if_fail(INFC_IS_REQUEST_MANAGER(manager)); g_return_if_fail(func != NULL); priv = INFC_REQUEST_MANAGER_PRIVATE(manager); data.func = func; data.user_data = user_data; data.name = name; g_hash_table_foreach( priv->requests, infc_request_manager_foreach_request_func, &data ); } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/client/infc-browser-iter.c0000644000175000017500000000554012264763732020305 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ /** * SECTION:infc-browser-iter * @title: InfcBrowserIter * @short_description: Iterating through browsed nodes * @see_also: #InfcBrowser * @include: libinfinity/client/infc-browser-iter.h * @stability: Unstable * * The #InfcBrowserIter is used to iterate through the nodes of a * #InfcBrowser. Normally, #InfcBrowserIter is allocated on the stack and * initialized by a #InfcBrowser API call, such as * infc_browser_iter_get_root(). You can also safely copy the struct by * value to create a copy. It is not necessary to free it. * * Most operations are done via the #InfcBrowser API. These methods could be * useful to language bindings. * * An initialized #InfcBrowserIter always points to a node within the * #InfcBrowser. It stays valid as long as the node it points to is not * removed from the browser (if it is, the #InfcBrowser::node-removed) signal * is emitted. **/ #include GType infc_browser_iter_get_type(void) { static GType browser_iter_type = 0; if(!browser_iter_type) { browser_iter_type = g_boxed_type_register_static( "InfcBrowserIter", (GBoxedCopyFunc)infc_browser_iter_copy, (GBoxedFreeFunc)infc_browser_iter_free ); } return browser_iter_type; } /** * infc_browser_iter_copy: * @iter: A #InfcBrowserIter. * * Makes a dynamically allocated copy of @iter. This should not be used by * applications because you can copy the structs by value. * * Return Value: A newly-allocated copy of @iter. */ InfcBrowserIter* infc_browser_iter_copy(InfcBrowserIter* iter) { InfcBrowserIter* new_iter; g_return_val_if_fail(iter != NULL, NULL); new_iter = g_slice_new(InfcBrowserIter); *new_iter = *iter; return new_iter; } /** * infc_browser_iter_free: * @iter: A #InfcBrowserIter. * * Frees a #InfcBrowserIter allocated by infc_browser_iter_copy(). **/ void infc_browser_iter_free(InfcBrowserIter* iter) { g_return_if_fail(iter != NULL); g_slice_free(InfcBrowserIter, iter); } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/inf-dll.c0000644000175000017500000000250112264763732015005 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ /* This code saves the DLL Handle of the libinfinity DLL, for use * with g_win32_get_package_installation_directory_of_module */ #include #ifdef G_OS_WIN32 #include HMODULE _inf_dll_handle = NULL; BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved) { switch(fdwReason) { case DLL_PROCESS_ATTACH: _inf_dll_handle = (HMODULE)hinstDLL; break; } return TRUE; } #endif /* G_OS_WIN32 */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/inf-marshal.h0000644000175000017500000002113112264764552015667 00000000000000 #ifndef __inf_marshal_MARSHAL_H__ #define __inf_marshal_MARSHAL_H__ #include G_BEGIN_DECLS /* VOID:VOID (inf-marshal.in:1) */ #define inf_marshal_VOID__VOID g_cclosure_marshal_VOID__VOID /* VOID:BOXED (inf-marshal.in:2) */ #define inf_marshal_VOID__BOXED g_cclosure_marshal_VOID__BOXED /* VOID:BOXED,DOUBLE,DOUBLE (inf-marshal.in:3) */ extern void inf_marshal_VOID__BOXED_DOUBLE_DOUBLE (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); /* VOID:OBJECT (inf-marshal.in:4) */ #define inf_marshal_VOID__OBJECT g_cclosure_marshal_VOID__OBJECT /* VOID:POINTER (inf-marshal.in:5) */ #define inf_marshal_VOID__POINTER g_cclosure_marshal_VOID__POINTER /* VOID:OBJECT,DOUBLE (inf-marshal.in:6) */ extern void inf_marshal_VOID__OBJECT_DOUBLE (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); /* VOID:OBJECT,POINTER (inf-marshal.in:7) */ extern void inf_marshal_VOID__OBJECT_POINTER (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); /* VOID:POINTER,UINT (inf-marshal.in:8) */ extern void inf_marshal_VOID__POINTER_UINT (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); /* VOID:UINT (inf-marshal.in:9) */ #define inf_marshal_VOID__UINT g_cclosure_marshal_VOID__UINT /* VOID:UINT,UINT (inf-marshal.in:10) */ extern void inf_marshal_VOID__UINT_UINT (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); /* VOID:OBJECT,BOOLEAN (inf-marshal.in:11) */ extern void inf_marshal_VOID__OBJECT_BOOLEAN (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); /* VOID:UINT,BOXED,OBJECT (inf-marshal.in:12) */ extern void inf_marshal_VOID__UINT_BOXED_OBJECT (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); /* VOID:UINT,INT,BOOLEAN (inf-marshal.in:13) */ extern void inf_marshal_VOID__UINT_INT_BOOLEAN (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); /* VOID:OBJECT,OBJECT (inf-marshal.in:14) */ extern void inf_marshal_VOID__OBJECT_OBJECT (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); /* VOID:BOXED,OBJECT (inf-marshal.in:15) */ extern void inf_marshal_VOID__BOXED_OBJECT (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); /* VOID:BOXED,BOXED,OBJECT (inf-marshal.in:16) */ extern void inf_marshal_VOID__BOXED_BOXED_OBJECT (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); /* VOID:OBJECT,OBJECT,BOOLEAN (inf-marshal.in:17) */ extern void inf_marshal_VOID__OBJECT_OBJECT_BOOLEAN (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); /* VOID:DOUBLE (inf-marshal.in:18) */ #define inf_marshal_VOID__DOUBLE g_cclosure_marshal_VOID__DOUBLE /* VOID:ENUM (inf-marshal.in:19) */ #define inf_marshal_VOID__ENUM g_cclosure_marshal_VOID__ENUM /* BOOLEAN:OBJECT,OBJECT (inf-marshal.in:20) */ extern void inf_marshal_BOOLEAN__OBJECT_OBJECT (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); /* VOID:OBJECT,UINT (inf-marshal.in:21) */ extern void inf_marshal_VOID__OBJECT_UINT (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); /* POINTER:POINTER (inf-marshal.in:22) */ extern void inf_marshal_POINTER__POINTER (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); /* POINTER:OBJECT,POINTER (inf-marshal.in:23) */ extern void inf_marshal_POINTER__OBJECT_POINTER (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); G_END_DECLS #endif /* __inf_marshal_MARSHAL_H__ */ libinfinity-0.5.5/libinfinity/inf-i18n.c0000644000175000017500000000327212264763732015017 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include #include "config.h" static gchar* _inf_gettext_get_locale_dir(void) { #ifdef G_OS_WIN32 gchar* root; gchar* temp; gchar* result; root = g_win32_get_package_installation_directory_of_module(_inf_dll_handle); temp = g_build_filename(root, "share", "locale", NULL); g_free(root); result = g_win32_locale_filename_from_utf8(temp); g_free(temp); return result; #else return g_strdup(INF_LOCALEDIR); #endif } void _inf_gettext_init(void) { gchar* localedir; localedir = _inf_gettext_get_locale_dir(); bindtextdomain(GETTEXT_PACKAGE, localedir); g_free(localedir); bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8"); } const char* _inf_gettext(const char* msgid) { return dgettext(GETTEXT_PACKAGE, msgid); } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/Makefile.am0000644000175000017500000000272312264763732015356 00000000000000SUBDIRS = communication common adopted server client . # TODO: Find a way to have the version number set automatically. lib_LTLIBRARIES = libinfinity-0.5.la libinfinity_0_5_la_CPPFLAGS = \ -I$(top_srcdir) \ $(infinity_CFLAGS) libinfinity_0_5_la_LDFLAGS = \ -no-undefined \ -version-info $(LIBINFINITY_LIBTOOL_VERSION) libinfinity_0_5_la_LIBADD = \ server/libinfinity_server.la \ client/libinfinity_client.la \ adopted/libinfinity_adopted.la \ common/libinfinity_common.la \ communication/libinfinity_communication.la \ $(infinity_LIBS) \ $(glib_LIBS) \ $(avahi_LIBS) inf-marshal.h: inf-marshal.in glib-genmarshal --header --prefix=inf_marshal $< > $@ # rewrite the output to avoid a warning for casting gpointer to a function # pointer type inf-marshal.c: inf-marshal.in echo '#include ' > $@ glib-genmarshal --body --prefix=inf_marshal $< | perl -pe 's/^ callback = \((GMarshalFunc_[^)]+)\) \(marshal_data \? marshal_data : cc->callback\);/ callback = *($$1*) (marshal_data ? &marshal_data : &cc->callback);/' >> $@ BUILT_SOURCES = inf-marshal.h inf-marshal.c CLEANFILES = inf-marshal.h inf-marshal.c libinfinity_0_5_ladir = \ $(includedir)/libinfinity-$(LIBINFINITY_API_VERSION)/libinfinity libinfinity_0_5_la_HEADERS = \ inf-config.h noinst_HEADERS = \ inf-dll.h \ inf-i18n.h \ inf-marshal.h \ inf-signals.h libinfinity_0_5_la_SOURCES = \ inf-dll.c \ inf-i18n.c \ inf-marshal.c \ inf-signals.c EXTRA_DIST = inf-marshal.in libinfinity-0.5.5/libinfinity/communication/0000755000175000017500000000000012264766266016250 500000000000000libinfinity-0.5.5/libinfinity/communication/inf-communication-method.c0000644000175000017500000002647412264763732023241 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ /** * SECTION:inf-communication-method * @title: InfCommunicationMethod * @short_description: Network communication method * @see_also: #InfCommunicationManager * @include: libinfinity/communication/inf-communication-method.h * @stability: Unstable * * A #InfCommunicationMethod specifies how messages are transferred between * group members on the same network. So one method handles all connections * on a specific network for the group. **/ #include #include enum { ADD_MEMBER, REMOVE_MEMBER, LAST_SIGNAL }; static guint method_signals[LAST_SIGNAL]; static void inf_communication_method_base_init(gpointer class) { static gboolean initialized = FALSE; if(!initialized) { /** * InfCommunicationMethod::add-member: * @method: The #InfCommunicationMethod emitting the signal. * @connection: The #InfXmlConnection that was added. * * This signal is emitted whenever a new connection has been added to the * group on the network this method handles. */ method_signals[ADD_MEMBER] = g_signal_new( "add-member", INF_COMMUNICATION_TYPE_METHOD, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(InfCommunicationMethodIface, add_member), NULL, NULL, inf_marshal_VOID__OBJECT, G_TYPE_NONE, 1, INF_TYPE_XML_CONNECTION ); /** * InfCommunicationMethod::remove-member: * @method: The #InfCommunicationMethod emitting the signal. * @connection: The #InfXmlConnection that was removed. * * This signal is emitted whenever a connection has been removed from the * group on the network this method handles. */ method_signals[REMOVE_MEMBER] = g_signal_new( "remove-member", INF_COMMUNICATION_TYPE_METHOD, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(InfCommunicationMethodIface, remove_member), NULL, NULL, inf_marshal_VOID__OBJECT, G_TYPE_NONE, 1, INF_TYPE_XML_CONNECTION ); initialized = TRUE; } } GType inf_communication_method_get_type(void) { static GType communication_method_type = 0; if(!communication_method_type) { static const GTypeInfo communication_method_info = { sizeof(InfCommunicationMethodIface), /* class_size */ inf_communication_method_base_init, /* base_init */ NULL, /* base_finalize */ NULL, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ 0, /* instance_size */ 0, /* n_preallocs */ NULL, /* instance_init */ NULL /* value_table */ }; communication_method_type = g_type_register_static( G_TYPE_INTERFACE, "InfCommunicationMethod", &communication_method_info, 0 ); g_type_interface_add_prerequisite( communication_method_type, G_TYPE_OBJECT ); } return communication_method_type; } /** * inf_communication_method_add_member: * @method: A #InfCommunicationMethod. * @connection: The #InfXmlConnection to add. * * Adds a new connection to the group. The network of @connection must match * the network the method is handling, and @connection must not already be * a member of the group (see inf_communication_method_is_member()). */ void inf_communication_method_add_member(InfCommunicationMethod* method, InfXmlConnection* connection) { g_return_if_fail(INF_COMMUNICATION_IS_METHOD(method)); g_return_if_fail(INF_IS_XML_CONNECTION(connection)); g_return_if_fail(!inf_communication_method_is_member(method, connection)); g_signal_emit( G_OBJECT(method), method_signals[ADD_MEMBER], 0, connection ); } /** * inf_communication_method_remove_member: * @method: A #InfCommunicationMethod. * @connection: The #InfXmlConnection to remove. * * Removes a connection from the group. @connection needs to be a member of * the group (see inf_communication_method_is_member()). */ void inf_communication_method_remove_member(InfCommunicationMethod* method, InfXmlConnection* connection) { g_return_if_fail(INF_COMMUNICATION_IS_METHOD(method)); g_return_if_fail(INF_IS_XML_CONNECTION(connection)); g_return_if_fail(inf_communication_method_is_member(method, connection)); g_signal_emit( G_OBJECT(method), method_signals[REMOVE_MEMBER], 0, connection ); } /** * inf_communication_method_is_member: * @method: A #InfCommunicationMethod. * @connection: A #InfXmlConnection. * * Returns whether @connection was added to the group via * inf_communication_method_add_member(). * * Returns: Whether @connection is a member of the group. */ gboolean inf_communication_method_is_member(InfCommunicationMethod* method, InfXmlConnection* connection) { InfCommunicationMethodIface* iface; g_return_val_if_fail(INF_COMMUNICATION_IS_METHOD(method), FALSE); g_return_val_if_fail(INF_IS_XML_CONNECTION(connection), FALSE); iface = INF_COMMUNICATION_METHOD_GET_IFACE(method); g_return_val_if_fail(iface->is_member != NULL, FALSE); return iface->is_member(method, connection); } /** * inf_communication_method_send_single: * @method: A #InfCommunicationMethod. * @connection: A #InfXmlConnection that is a group member. * @xml: The message to send. * * Sends an XML message to @connection. This function takes ownership of @xml. */ void inf_communication_method_send_single(InfCommunicationMethod* method, InfXmlConnection* connection, xmlNodePtr xml) { InfCommunicationMethodIface* iface; g_return_if_fail(INF_COMMUNICATION_IS_METHOD(method)); g_return_if_fail(INF_IS_XML_CONNECTION(connection)); g_return_if_fail(inf_communication_method_is_member(method, connection)); g_return_if_fail(xml != NULL); iface = INF_COMMUNICATION_METHOD_GET_IFACE(method); g_return_if_fail(iface->send_single != NULL); iface->send_single(method, connection, xml); } /** * inf_communication_method_send_all: * @method: A #InfCommunicationMethod. * @xml: The message to send. * * Sends an XML message to all group members on this network. This function * takes ownership of @xml. */ void inf_communication_method_send_all(InfCommunicationMethod* method, xmlNodePtr xml) { InfCommunicationMethodIface* iface; g_return_if_fail(INF_COMMUNICATION_IS_METHOD(method)); g_return_if_fail(xml != NULL); iface = INF_COMMUNICATION_METHOD_GET_IFACE(method); g_return_if_fail(iface->send_all != NULL); iface->send_all(method, xml); } /** * inf_communication_method_cancel_messages: * @method: A #InfCommunicationMethod. * @connection: A #InfXmlConnection that is a group member. * * This function stops all messages to be sent to @connection that have not * yet been sent. */ void inf_communication_method_cancel_messages(InfCommunicationMethod* method, InfXmlConnection* connection) { InfCommunicationMethodIface* iface; g_return_if_fail(INF_COMMUNICATION_IS_METHOD(method)); g_return_if_fail(INF_IS_XML_CONNECTION(connection)); iface = INF_COMMUNICATION_METHOD_GET_IFACE(method); g_return_if_fail(iface->cancel_messages != NULL); iface->cancel_messages(method, connection); } /** * inf_communication_method_received: * @method: A #InfCommunicationMethod. * @connection: A #InfXmlConnection that is a group member. * @xml: The received message. * * This function is called by the #InfCommunicationRegistry if data has been * received on registered connections * (see inf_communication_registry_register()). * * This function returns the scope of the message. If the scope is * %INF_COMMUNICATION_SCOPE_GROUP then the registry relays the message to * other connections on different networks (if any). * * Returns: The scope of the message. */ InfCommunicationScope inf_communication_method_received(InfCommunicationMethod* method, InfXmlConnection* connection, xmlNodePtr xml) { InfCommunicationMethodIface* iface; g_return_if_fail(INF_COMMUNICATION_IS_METHOD(method)); g_return_if_fail(INF_IS_XML_CONNECTION(connection)); g_return_if_fail(inf_communication_method_is_member(method, connection)); g_return_if_fail(xml != NULL); iface = INF_COMMUNICATION_METHOD_GET_IFACE(method); g_return_if_fail(iface->received != NULL); return iface->received(method, connection, xml); } /** * inf_communication_method_enqueued: * @method: A #InfCommunicationMethod. * @connection: A #InfXmlConnection. * @xml: The enqueued message. * * This function is called by the #InfCommunicationRegistry if data has been * enqueued on registered connections * (see inf_communication_registry_register()). */ void inf_communication_method_enqueued(InfCommunicationMethod* method, InfXmlConnection* connection, xmlNodePtr xml) { InfCommunicationMethodIface* iface; g_return_if_fail(INF_COMMUNICATION_IS_METHOD(method)); g_return_if_fail(INF_IS_XML_CONNECTION(connection)); g_return_if_fail(inf_communication_method_is_member(method, connection)); g_return_if_fail(xml != NULL); iface = INF_COMMUNICATION_METHOD_GET_IFACE(method); g_return_if_fail(iface->enqueued != NULL); iface->enqueued(method, connection, xml); } /** * inf_communication_method_sent: * @method: A #InfCommunicationMethod. * @connection: A #InfXmlConnection. * @xml: The sent message. * * This function is called by the #InfCommunicationRegistry if data has been * sent on registered connections (see inf_communication_registry_register()). */ void inf_communication_method_sent(InfCommunicationMethod* method, InfXmlConnection* connection, xmlNodePtr xml) { InfCommunicationMethodIface* iface; g_return_if_fail(INF_COMMUNICATION_IS_METHOD(method)); g_return_if_fail(INF_IS_XML_CONNECTION(connection)); g_return_if_fail(inf_communication_method_is_member(method, connection)); g_return_if_fail(xml != NULL); iface = INF_COMMUNICATION_METHOD_GET_IFACE(method); g_return_if_fail(iface->sent != NULL); iface->sent(method, connection, xml); } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/communication/inf-communication-joined-group.c0000644000175000017500000003036512264763732024355 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ /** * SECTION:inf-communication-joined-group * @title: InfCommunicationJoinedGroup * @short_description: Communication group opened by a remote host * @include: libinfinity/communication/inf-communication-joined-group.h * @stability: Unstable * @see_also: #InfCommunicationGroup, #InfCommunicationManager * * #InfCommunicationJoinedGroup represents membership of the local host on a * #InfCommunicationGroup opened on a remote host. * * There is no API to add a member to a joined group. This is because new * members can only join via the group's publisher. It is the job of the * #InfCommunicationMethod to tell the joined group about the new member in * which case, the #InfCommunicationGroup::member-added signal will be * emitted. **/ #include #include #include typedef struct _InfCommunicationJoinedGroupPrivate InfCommunicationJoinedGroupPrivate; struct _InfCommunicationJoinedGroupPrivate { InfXmlConnection* publisher_conn; gchar* publisher_id; gchar* method; }; enum { PROP_0, PROP_PUBLISHER, PROP_METHOD }; #define INF_COMMUNICATION_JOINED_GROUP_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), INF_COMMUNICATION_TYPE_JOINED_GROUP, InfCommunicationJoinedGroupPrivate)) static GObjectClass* parent_class; /* Required by inf_communication_joined_group_publisher_notify_status_cb() */ static void inf_communication_joined_group_set_publisher(InfCommunicationJoinedGroup* grp, InfXmlConnection* connection); static void inf_communication_joined_group_publisher_notify_status_cb(GObject* object, GParamSpec* pspec, gpointer user_data) { InfXmlConnectionStatus status; g_object_get(G_OBJECT(object), "status", &status, NULL); if(status == INF_XML_CONNECTION_CLOSING || status == INF_XML_CONNECTION_CLOSED) { /* Don't remove from group, the method will do this by itself */ inf_communication_joined_group_set_publisher( INF_COMMUNICATION_JOINED_GROUP(user_data), NULL ); } } static void inf_communication_joined_group_set_publisher(InfCommunicationJoinedGroup* grp, InfXmlConnection* connection) { InfCommunicationJoinedGroupPrivate* priv; priv = INF_COMMUNICATION_JOINED_GROUP_PRIVATE(grp); if(priv->publisher_conn != NULL) { inf_signal_handlers_disconnect_by_func( G_OBJECT(priv->publisher_conn), G_CALLBACK(inf_communication_joined_group_publisher_notify_status_cb), grp ); g_object_unref(priv->publisher_conn); } priv->publisher_conn = connection; if(connection != NULL) { g_object_ref(connection); g_signal_connect( G_OBJECT(connection), "notify::status", G_CALLBACK(inf_communication_joined_group_publisher_notify_status_cb), grp ); } g_object_notify(G_OBJECT(grp), "publisher"); } static const gchar* inf_communication_joined_group_get_method(InfCommunicationGroup* group, unsigned int index) { InfCommunicationJoinedGroup* joined_group; InfCommunicationJoinedGroupPrivate* priv; joined_group = INF_COMMUNICATION_JOINED_GROUP(group); priv = INF_COMMUNICATION_JOINED_GROUP_PRIVATE(joined_group); if(index == 0) return priv->method; return NULL; } static gchar* inf_communication_joined_group_get_publisher_id(InfCommunicationGroup* group, InfXmlConnection* for_conn) { InfCommunicationJoinedGroup* joined_group; InfCommunicationJoinedGroupPrivate* priv; joined_group = INF_COMMUNICATION_JOINED_GROUP(group); priv = INF_COMMUNICATION_JOINED_GROUP_PRIVATE(joined_group); return g_strdup(priv->publisher_id); } /* * GObject overrides. */ static void inf_communication_joined_group_init(GTypeInstance* instance, gpointer g_class) { InfCommunicationJoinedGroup* group; InfCommunicationJoinedGroupPrivate* priv; group = INF_COMMUNICATION_JOINED_GROUP(instance); priv = INF_COMMUNICATION_JOINED_GROUP_PRIVATE(group); priv->publisher_conn = NULL; priv->publisher_id = NULL; priv->method = NULL; } static GObject* inf_communication_joined_group_constructor(GType type, guint n_construct_properties, GObjectConstructParam* properties) { GObject* object; InfCommunicationJoinedGroupPrivate* priv; object = G_OBJECT_CLASS(parent_class)->constructor( type, n_construct_properties, properties ); priv = INF_COMMUNICATION_JOINED_GROUP_PRIVATE(object); g_assert(priv->publisher_conn != NULL); g_assert(priv->method != NULL); g_object_get( G_OBJECT(priv->publisher_conn), "remote-id", &priv->publisher_id, NULL ); /* method on publisher_conn's network must be supported, otherwise this * call will fail. */ _inf_communication_group_add_member( INF_COMMUNICATION_GROUP(object), priv->publisher_conn ); return object; } static void inf_communication_joined_group_dispose(GObject* object) { InfCommunicationJoinedGroup* group; InfCommunicationJoinedGroupPrivate* priv; group = INF_COMMUNICATION_JOINED_GROUP(object); priv = INF_COMMUNICATION_JOINED_GROUP_PRIVATE(group); inf_communication_joined_group_set_publisher(group, NULL); G_OBJECT_CLASS(parent_class)->dispose(object); } static void inf_communication_joined_group_finalize(GObject* object) { InfCommunicationJoinedGroup* group; InfCommunicationJoinedGroupPrivate* priv; group = INF_COMMUNICATION_JOINED_GROUP(object); priv = INF_COMMUNICATION_JOINED_GROUP_PRIVATE(group); g_free(priv->publisher_id); g_free(priv->method); G_OBJECT_CLASS(parent_class)->finalize(object); } static void inf_communication_joined_group_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec) { InfCommunicationJoinedGroup* group; InfCommunicationJoinedGroupPrivate* priv; group = INF_COMMUNICATION_JOINED_GROUP(object); priv = INF_COMMUNICATION_JOINED_GROUP_PRIVATE(group); switch(prop_id) { case PROP_PUBLISHER: g_assert(priv->publisher_conn == NULL); /* construct only */ inf_communication_joined_group_set_publisher( group, INF_XML_CONNECTION(g_value_get_object(value)) ); break; case PROP_METHOD: g_assert(priv->method == NULL); /* construct only */ priv->method = g_value_dup_string(value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void inf_communication_joined_group_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec) { InfCommunicationJoinedGroup* group; InfCommunicationJoinedGroupPrivate* priv; group = INF_COMMUNICATION_JOINED_GROUP(object); priv = INF_COMMUNICATION_JOINED_GROUP_PRIVATE(group); switch(prop_id) { case PROP_PUBLISHER: g_value_set_object(value, priv->publisher_conn); break; case PROP_METHOD: g_value_set_string(value, priv->method); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } /* * GType registration. */ static void inf_communication_joined_group_class_init(gpointer g_class, gpointer class_data) { GObjectClass* object_class; InfCommunicationGroupClass* group_class; object_class = G_OBJECT_CLASS(g_class); group_class = INF_COMMUNICATION_GROUP_CLASS(g_class); parent_class = G_OBJECT_CLASS(g_type_class_peek_parent(g_class)); g_type_class_add_private( g_class, sizeof(InfCommunicationJoinedGroupPrivate) ); object_class->constructor = inf_communication_joined_group_constructor; object_class->dispose = inf_communication_joined_group_dispose; object_class->finalize = inf_communication_joined_group_finalize; object_class->set_property = inf_communication_joined_group_set_property; object_class->get_property = inf_communication_joined_group_get_property; group_class->get_method = inf_communication_joined_group_get_method; group_class->get_publisher_id = inf_communication_joined_group_get_publisher_id; g_object_class_install_property( object_class, PROP_PUBLISHER, g_param_spec_object( "publisher", "Publisher", "A connection to the group's publisher", INF_TYPE_XML_CONNECTION, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); g_object_class_install_property( object_class, PROP_METHOD, g_param_spec_string( "method", "Method", "The communication method to use for this group", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); } GType inf_communication_joined_group_get_type(void) { static GType joined_group_type = 0; if(!joined_group_type) { static const GTypeInfo joined_group_type_info = { sizeof(InfCommunicationJoinedGroupClass), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ inf_communication_joined_group_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InfCommunicationJoinedGroup), /* instance_size */ 0, /* n_preallocs */ inf_communication_joined_group_init, /* instance_init */ NULL /* value_table */ }; joined_group_type = g_type_register_static( INF_COMMUNICATION_TYPE_GROUP, "InfCommunicationJoinedGroup", &joined_group_type_info, 0 ); } return joined_group_type; } /* * Public API. */ /** * inf_communication_joined_group_remove_member: * @grp: A #InfCommunicationJoinedGroup. * @connection: A connection to a member of @grp. * * Removes @connection as @grp's member. On the remote site, the * corresponding #InfCommunicationGroup needs to be freed (which may be a * #InfCommunicationJoinedGroup or a #InfCommunicationHostedGroup). */ void inf_communication_joined_group_remove_member(InfCommunicationJoinedGroup* grp, InfXmlConnection* connection) { g_return_if_fail(INF_COMMUNICATION_IS_JOINED_GROUP(grp)); g_return_if_fail(INF_IS_XML_CONNECTION(connection)); g_return_if_fail( inf_communication_group_is_member( INF_COMMUNICATION_GROUP(grp), connection ) ); _inf_communication_group_remove_member( INF_COMMUNICATION_GROUP(grp), connection ); } /** * inf_communication_joined_group_get_publisher: * @g: A #InfCommunicationJoinedGroup. * * Returns a #InfXmlConnection to the group's publisher, or %NULL if the * publisher is no longer a group member. * * Returns: A #InfXmlConnection, or %NULL. */ InfXmlConnection* inf_communication_joined_group_get_publisher(InfCommunicationJoinedGroup* g) { g_return_val_if_fail(INF_COMMUNICATION_IS_JOINED_GROUP(g), NULL); return INF_COMMUNICATION_JOINED_GROUP_PRIVATE(g)->publisher_conn; } libinfinity-0.5.5/libinfinity/communication/inf-communication-factory.c0000644000175000017500000001263312264763732023420 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ /** * SECTION:inf-communication-factory * @title: InfCommunicationFactory * @short_description: Creation of communication methods * @see_also: #InfCommunicationManager * @include: libinfinity/communication/inf-communication-factory.h * @stability: Unstable * * A #InfCommunicationFactory is used by the communication manager to create * #InfCommunicationMethods. All a factory has to do is to tell * whether it supports a specific network and method name combination, and * create a corresponding #InfCommunicationMethod if it does. * * #InfCommunicationFactorys are added to a communication manager via * inf_communication_manager_add_factory(). The communication manager will * automatically use the factory if it needs to create a method it supports. **/ #include GType inf_communication_factory_get_type(void) { static GType communication_factory_type = 0; if(!communication_factory_type) { static const GTypeInfo communication_factory_info = { sizeof(InfCommunicationFactoryIface), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ NULL, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ 0, /* instance_size */ 0, /* n_preallocs */ NULL, /* instance_init */ NULL /* value_table */ }; communication_factory_type = g_type_register_static( G_TYPE_INTERFACE, "InfCommunicationFactory", &communication_factory_info, 0 ); g_type_interface_add_prerequisite( communication_factory_type, G_TYPE_OBJECT ); } return communication_factory_type; } /** * inf_communication_factory_supports_method: * @factory: A #InfCommunicationFactory. * @network: A network specifier, such as "tcp/ip" or "jabber". * @method_name: A method identifier, such as "central" or "groupchat". * * Returns whether @factory supports creating methods that implement * @method_name as communication method for connections on @network * (see #InfXmlConnection:network). * * Returns: Whether @factory supports the given network and method name. */ gboolean inf_communication_factory_supports_method(InfCommunicationFactory* factory, const gchar* network, const gchar* method_name) { InfCommunicationFactoryIface* iface; g_return_val_if_fail(INF_COMMUNICATION_IS_FACTORY(factory), FALSE); g_return_val_if_fail(network != NULL, FALSE); g_return_val_if_fail(method_name != NULL, FALSE); iface = INF_COMMUNICATION_FACTORY_GET_IFACE(factory); g_return_val_if_fail(iface->supports_method != NULL, FALSE); return iface->supports_method(factory, network, method_name); } /** * inf_communication_factory_instantiate: * @factory: A #InfCommunicationFactory. * @network: A network specifier, such as "tcp/ip" or "jabber". * @method_name: A method identifier, such as "central" or "groupchat". * @registry: A #InfCommunicationRegistry at which the created method can * register connections. * @group: The #InfCommunicationGroup for which to create the method. * * Creates a new #InfCommunicationMethod for @network and @method_name. The * factory needs to support that method, see * inf_communication_factory_supports_method(). * * Returns: A new #InfCommunicationMethod. */ InfCommunicationMethod* inf_communication_factory_instantiate(InfCommunicationFactory* factory, const gchar* network, const gchar* method_name, InfCommunicationRegistry* registry, InfCommunicationGroup* group) { InfCommunicationFactoryIface* iface; g_return_val_if_fail(INF_COMMUNICATION_IS_FACTORY(factory), NULL); g_return_val_if_fail(network != NULL, NULL); g_return_val_if_fail(method_name != NULL, NULL); g_return_val_if_fail(INF_COMMUNICATION_IS_REGISTRY(registry), NULL); g_return_val_if_fail(INF_COMMUNICATION_IS_GROUP(group), NULL); iface = INF_COMMUNICATION_FACTORY_GET_IFACE(factory); g_return_val_if_fail(iface->instantiate != NULL, NULL); return iface->instantiate(factory, network, method_name, registry, group); } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/communication/Makefile.am0000644000175000017500000000205311204026376020204 00000000000000libinfinity_communication_la_CPPFLAGS = \ -I$(top_srcdir) \ $(infinity_CFLAGS) \ $(avahi_CFLAGS) noinst_LTLIBRARIES = libinfinity_communication.la libinfinity_communication_ladir = \ $(includedir)/libinfinity-$(LIBINFINITY_API_VERSION)/libinfinity/communication libinfinity_communication_la_SOURCES = \ inf-communication-central-factory.c \ inf-communication-central-method.c \ inf-communication-factory.c \ inf-communication-group.c \ inf-communication-hosted-group.c \ inf-communication-joined-group.c \ inf-communication-manager.c \ inf-communication-method.c \ inf-communication-object.c \ inf-communication-registry.c libinfinity_communication_la_HEADERS = \ inf-communication-central-factory.h \ inf-communication-central-method.h \ inf-communication-factory.h \ inf-communication-group.h \ inf-communication-hosted-group.h \ inf-communication-joined-group.h \ inf-communication-manager.h \ inf-communication-method.h \ inf-communication-object.h \ inf-communication-registry.h noinst_HEADERS = \ inf-communication-group-private.h libinfinity-0.5.5/libinfinity/communication/inf-communication-hosted-group.c0000644000175000017500000002026712264763732024373 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ /** * SECTION:inf-communication-hosted-group * @title: InfCommunicationHostedGroup * @short_description: Communication group opened by the local host * @include: libinfinity/communication/inf-communication-hosted-group.h * @stability: Unstable * @see_also: #InfCommunicationGroup, #InfCommunicationManager * * #InfCommunicationHostedGroup is a #InfCommunicationHostedGroup opened on * the local host. It allows adding other hosts to the group via * inf_communication_hosted_group_add_member(), and to remove hosts via * inf_communication_hosted_group_remove_member(). **/ #include #include typedef struct _InfCommunicationHostedGroupPrivate InfCommunicationHostedGroupPrivate; struct _InfCommunicationHostedGroupPrivate { GPtrArray* methods; }; #define INF_COMMUNICATION_HOSTED_GROUP_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), INF_COMMUNICATION_TYPE_HOSTED_GROUP, InfCommunicationHostedGroupPrivate)) static GObjectClass* parent_class; static const gchar* inf_communication_hosted_group_get_method(InfCommunicationGroup* group, unsigned int index) { InfCommunicationHostedGroup* hosted_group; InfCommunicationHostedGroupPrivate* priv; hosted_group = INF_COMMUNICATION_HOSTED_GROUP(group); priv = INF_COMMUNICATION_HOSTED_GROUP_PRIVATE(hosted_group); if(index < priv->methods->len) return g_ptr_array_index(priv->methods, index); /* fallback to central method */ if(index == priv->methods->len) return "central"; return NULL; } static gchar* inf_communication_hosted_group_get_publisher_id(InfCommunicationGroup* group, InfXmlConnection* for_conn) { gchar* local_id; g_object_get(G_OBJECT(for_conn), "local-id", &local_id, NULL); return local_id; } /* * GObject overrides. */ static void inf_communication_hosted_group_init(GTypeInstance* instance, gpointer g_class) { InfCommunicationHostedGroup* group; InfCommunicationHostedGroupPrivate* priv; group = INF_COMMUNICATION_HOSTED_GROUP(instance); priv = INF_COMMUNICATION_HOSTED_GROUP_PRIVATE(group); priv->methods = g_ptr_array_new(); } static void inf_communication_hosted_group_finalize(GObject* object) { InfCommunicationHostedGroup* group; InfCommunicationHostedGroupPrivate* priv; guint i; group = INF_COMMUNICATION_HOSTED_GROUP(object); priv = INF_COMMUNICATION_HOSTED_GROUP_PRIVATE(group); for(i = 0; i < priv->methods->len; ++ i) g_free(g_ptr_array_index(priv->methods, i)); g_ptr_array_free(priv->methods, TRUE); G_OBJECT_CLASS(parent_class)->finalize(object); } /* * GType registration. */ static void inf_communication_hosted_group_class_init(gpointer g_class, gpointer class_data) { GObjectClass* object_class; InfCommunicationGroupClass* group_class; object_class = G_OBJECT_CLASS(g_class); group_class = INF_COMMUNICATION_GROUP_CLASS(g_class); parent_class = G_OBJECT_CLASS(g_type_class_peek_parent(g_class)); g_type_class_add_private( g_class, sizeof(InfCommunicationHostedGroupPrivate) ); object_class->finalize = inf_communication_hosted_group_finalize; group_class->get_method = inf_communication_hosted_group_get_method; group_class->get_publisher_id = inf_communication_hosted_group_get_publisher_id; } GType inf_communication_hosted_group_get_type(void) { static GType hosted_group_type = 0; if(!hosted_group_type) { static const GTypeInfo hosted_group_type_info = { sizeof(InfCommunicationHostedGroupClass), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ inf_communication_hosted_group_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InfCommunicationHostedGroup), /* instance_size */ 0, /* n_preallocs */ inf_communication_hosted_group_init, /* instance_init */ NULL /* value_table */ }; hosted_group_type = g_type_register_static( INF_COMMUNICATION_TYPE_GROUP, "InfCommunicationHostedGroup", &hosted_group_type_info, 0 ); } return hosted_group_type; } /* * Public API. */ /** * inf_communication_hosted_group_add_method: * @group: A #InfCommunicationHostedGroup. * @method: The method name to add. * * Adds a method to the hosted group. When a connection from a given network * is added to the group the first time, a #InfCommunicationMethod is * instantiated to handle messaging for the group within this network. * The first method added will be tried first. If the communication manager * does support it (meaning inf_communication_manager_get_factory_for() for * the connection's network and the chosen method returns non-%NULL), then it * will be used, otherwise the next method will be tried, etc. If no method * is supported, or no methods are added to the group, then the "central" * method will be used as a fallback. */ void inf_communication_hosted_group_add_method(InfCommunicationHostedGroup* group, const gchar* method) { InfCommunicationHostedGroupPrivate* priv; g_return_if_fail(INF_COMMUNICATION_IS_HOSTED_GROUP(group)); g_return_if_fail(method != NULL); priv = INF_COMMUNICATION_HOSTED_GROUP_PRIVATE(group); g_ptr_array_add(priv->methods, g_strdup(method)); } /** * inf_communication_hosted_group_add_member: * @group: A #InfCommunicationGroup. * @connection: A #InfXmlConnection to add to group. * * Adds @connection as a member to @group. On the remote site, a * #InfCommunicationJoinedGroup with the same name and method used for * @connection (see inf_communication_group_get_method_for_connection()) * needs to be created for successful communication. */ void inf_communication_hosted_group_add_member(InfCommunicationHostedGroup* group, InfXmlConnection* connection) { g_return_if_fail(INF_COMMUNICATION_IS_HOSTED_GROUP(group)); g_return_if_fail(INF_IS_XML_CONNECTION(connection)); g_return_if_fail( !inf_communication_group_is_member( INF_COMMUNICATION_GROUP(group), connection ) ); _inf_communication_group_add_member( INF_COMMUNICATION_GROUP(group), connection ); } /** * inf_communication_hosted_group_remove_member: * @grp: A #InfCommunicationGroup. * @connection: The @InfXmlConnection to remove from the group. * * Removes @connection's membership from @group. On the remote site, the * corresponding #InfCommunicationJoinedGroup needs to be freed. */ void inf_communication_hosted_group_remove_member(InfCommunicationHostedGroup* grp, InfXmlConnection* connection) { g_return_if_fail(INF_COMMUNICATION_IS_HOSTED_GROUP(grp)); g_return_if_fail(INF_IS_XML_CONNECTION(connection)); g_return_if_fail( inf_communication_group_is_member( INF_COMMUNICATION_GROUP(grp), connection ) ); _inf_communication_group_remove_member( INF_COMMUNICATION_GROUP(grp), connection ); } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/communication/inf-communication-hosted-group.h0000644000175000017500000000614312264763732024375 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_COMMUNICATION_HOSTED_GROUP_H__ #define __INF_COMMUNICATION_HOSTED_GROUP_H__ #include #include G_BEGIN_DECLS #define INF_COMMUNICATION_TYPE_HOSTED_GROUP (inf_communication_hosted_group_get_type()) #define INF_COMMUNICATION_HOSTED_GROUP(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INF_COMMUNICATION_TYPE_HOSTED_GROUP, InfCommunicationHostedGroup)) #define INF_COMMUNICATION_HOSTED_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INF_COMMUNICATION_TYPE_HOSTED_GROUP, InfCommunicationHostedGroupClass)) #define INF_COMMUNICATION_IS_HOSTED_GROUP(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INF_COMMUNICATION_TYPE_HOSTED_GROUP)) #define INF_COMMUNICATION_IS_HOSTED_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INF_COMMUNICATION_TYPE_HOSTED_GROUP)) #define INF_COMMUNICATION_HOSTED_GROUP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), INF_COMMUNICATION_TYPE_HOSTED_GROUP, InfCommunicationHostedGroupClass)) typedef struct _InfCommunicationHostedGroup InfCommunicationHostedGroup; typedef struct _InfCommunicationHostedGroupClass InfCommunicationHostedGroupClass; /** * InfCommunicationHostedGroupClass: * * This structure does not contain any public fields. */ struct _InfCommunicationHostedGroupClass { /*< private >*/ InfCommunicationGroupClass parent; }; /** * InfCommunicationHostedGroup: * * #InfCommunicationHostedGroup is an opaque data type. You should only * access it via the public API functions. */ struct _InfCommunicationHostedGroup { /*< private >*/ InfCommunicationGroup parent_instance; }; GType inf_communication_hosted_group_get_type(void) G_GNUC_CONST; void inf_communication_hosted_group_add_method(InfCommunicationHostedGroup* group, const gchar* method); void inf_communication_hosted_group_add_member(InfCommunicationHostedGroup* group, InfXmlConnection* connection); void inf_communication_hosted_group_remove_member(InfCommunicationHostedGroup* grp, InfXmlConnection* connection); G_END_DECLS #endif /* __INF_COMMUNICATION_HOSTED_GROUP_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/communication/inf-communication-factory.h0000644000175000017500000000721412264763732023424 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_COMMUNICATION_FACTORY_H__ #define __INF_COMMUNICATION_FACTORY_H__ #include #include #include G_BEGIN_DECLS #define INF_COMMUNICATION_TYPE_FACTORY (inf_communication_factory_get_type()) #define INF_COMMUNICATION_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INF_COMMUNICATION_TYPE_FACTORY, InfCommunicationFactory)) #define INF_COMMUNICATION_IS_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INF_COMMUNICATION_TYPE_FACTORY)) #define INF_COMMUNICATION_FACTORY_GET_IFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE((inst), INF_COMMUNICATION_TYPE_FACTORY, InfCommunicationFactoryIface)) /** * InfCommunicationFactory: * * #InfCommunicationFactory is an opaque data type. You should only access it * via the public API functions. */ typedef struct _InfCommunicationFactory InfCommunicationFactory; typedef struct _InfCommunicationFactoryIface InfCommunicationFactoryIface; /** * InfCommunicationFactoryIface: * @supports_method: Returns whether the given method_name is supported for * the network in question by the factory. * @instantiate: Instantiates a communication method for the given method * name, handling communication for the passed group. * * The virtual methods of #InfCommunicationFactory. These handle instantiating * a #InfCommunicationMethod for a #InfCommunicationGroup. */ struct _InfCommunicationFactoryIface { /*< private >*/ GTypeInterface parent; /*< public >*/ gboolean (*supports_method)(InfCommunicationFactory* factory, const gchar* network, const gchar* method_name); InfCommunicationMethod* (*instantiate)(InfCommunicationFactory* factory, const gchar* network, const gchar* method_name, InfCommunicationRegistry* registry, InfCommunicationGroup* group); }; GType inf_communication_factory_get_type(void) G_GNUC_CONST; gboolean inf_communication_factory_supports_method(InfCommunicationFactory* factory, const gchar* network, const gchar* method_name); InfCommunicationMethod* inf_communication_factory_instantiate(InfCommunicationFactory* factory, const gchar* network, const gchar* method_name, InfCommunicationRegistry* registry, InfCommunicationGroup* group); G_END_DECLS #endif /* __INF_COMMUNICATION_FACTORY_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/communication/inf-communication-method.h0000644000175000017500000001341712264763732023237 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_COMMUNICATION_METHOD_H__ #define __INF_COMMUNICATION_METHOD_H__ #include #include #include #include G_BEGIN_DECLS #define INF_COMMUNICATION_TYPE_METHOD (inf_communication_method_get_type()) #define INF_COMMUNICATION_METHOD(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INF_COMMUNICATION_TYPE_METHOD, InfCommunicationMethod)) #define INF_COMMUNICATION_IS_METHOD(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INF_COMMUNICATION_TYPE_METHOD)) #define INF_COMMUNICATION_METHOD_GET_IFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE((inst), INF_COMMUNICATION_TYPE_METHOD, InfCommunicationMethodIface)) /** * InfCommunicationMethod: * * #InfCommunicationMethod is an opaque data type. You should only access it * via the public API functions. */ typedef struct _InfCommunicationMethod InfCommunicationMethod; typedef struct _InfCommunicationMethodIface InfCommunicationMethodIface; /** * InfCommunicationMethodIface: * @add_member: Default signal handler of the * #InfCommunicationMethod::add-member signal. * @remove_member: Default signal handler of the * #InfCommunicationMethod::remove-member signal. * @is_member: Returns whether the given connection is a member of the group. * @send_single: Sends a message to a single connection. Takes ownership of * @xml. * @send_all: Sends a message to all group members, except @except. Takes * ownership of @xml. * @cancel_messages: Cancel sending messages that have not yet been sent * to the given connection. * @received: Handles reception of a message from a registered connection. * This normally includes informing a group's NetObject and forwarding the * message to other group members. * @enqueued: Handles when a message has been enqueued to be sent on a * registered connection. * @sent: Handles when a message has been sent to a registered connection. * * The default signal handlers of virtual methods of #InfCommunicationMethod. * These implement communication within a #InfCommunicationGroup. */ struct _InfCommunicationMethodIface { /*< private >*/ GTypeInterface parent; /*< public >*/ /* Signals */ void (*add_member)(InfCommunicationMethod* method, InfXmlConnection* connection); void (*remove_member)(InfCommunicationMethod* method, InfXmlConnection* connection); /* Virtual functions */ gboolean (*is_member)(InfCommunicationMethod* method, InfXmlConnection* connection); void (*send_single)(InfCommunicationMethod* method, InfXmlConnection* connection, xmlNodePtr xml); void (*send_all)(InfCommunicationMethod* method, xmlNodePtr xml); void (*cancel_messages)(InfCommunicationMethod* method, InfXmlConnection* connection); InfCommunicationScope (*received)(InfCommunicationMethod* method, InfXmlConnection* connection, xmlNodePtr xml); void (*enqueued)(InfCommunicationMethod* method, InfXmlConnection* connection, xmlNodePtr xml); void (*sent)(InfCommunicationMethod* method, InfXmlConnection* connection, xmlNodePtr xml); }; GType inf_communication_method_get_type(void) G_GNUC_CONST; void inf_communication_method_add_member(InfCommunicationMethod* method, InfXmlConnection* connection); void inf_communication_method_remove_member(InfCommunicationMethod* method, InfXmlConnection* connection); gboolean inf_communication_method_is_member(InfCommunicationMethod* method, InfXmlConnection* connection); void inf_communication_method_send_single(InfCommunicationMethod* method, InfXmlConnection* connection, xmlNodePtr xml); void inf_communication_method_send_all(InfCommunicationMethod* method, xmlNodePtr xml); void inf_communication_method_cancel_messages(InfCommunicationMethod* method, InfXmlConnection* connection); InfCommunicationScope inf_communication_method_received(InfCommunicationMethod* method, InfXmlConnection* connection, xmlNodePtr xml); void inf_communication_method_enqueued(InfCommunicationMethod* method, InfXmlConnection* connection, xmlNodePtr xml); void inf_communication_method_sent(InfCommunicationMethod* method, InfXmlConnection* connection, xmlNodePtr xml); G_END_DECLS #endif /* __INF_COMMUNICATION_METHOD_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/communication/inf-communication-group.c0000644000175000017500000006642612264763732023116 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ /** * SECTION:inf-communication-group * @title: InfCommunicationGroup * @short_description: Communication channel for mulitple connections * @include: libinfinity/communication/inf-communication-group.h * @stability: Unstable * * #InfCommunicationGroup represents a group of different hosts. The group * supports sending messages between group members and to the whole group. * * A communication group supports multiple networks. Each connection belongs * to a network, identified by the #InfXmlConnection:network property. It is * assumed that hosts on different networks can't directly communicate with * each other. Examples for networks are "tcp/ip" or "jabber". * * All communication for a given network is performed by a * #InfCommunicationMethod. The method defines how data is sent is sent * to the group. For example, a method could choose to relay all data via * a central server, or to send all data directly between the hosts, or in * case of a jabber network, use jabber groupchat functionality. **/ /* TODO: Add private API to query the registry from the manager, and use this * instead of an own group property */ #include #include #include #include #include typedef struct _InfCommunicationGroupPrivate InfCommunicationGroupPrivate; struct _InfCommunicationGroupPrivate { InfCommunicationManager* communication_manager; InfCommunicationRegistry* communication_registry; gchar* name; InfCommunicationObject* target; GHashTable* methods; }; enum { PROP_0, /* construct only */ PROP_COMMUNICATION_MANAGER, PROP_COMMUNICATION_REGISTRY, PROP_NAME, PROP_TARGET }; enum { MEMBER_ADDED, MEMBER_REMOVED, LAST_SIGNAL }; #define INF_COMMUNICATION_GROUP_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), INF_COMMUNICATION_TYPE_GROUP, InfCommunicationGroupPrivate)) static GObjectClass* parent_class; static guint group_signals[LAST_SIGNAL]; /* * Signal handlers */ static void inf_communication_group_method_add_member_cb(InfCommunicationMethod* method, InfXmlConnection* connection, gpointer user_data) { InfCommunicationGroup* group; group = INF_COMMUNICATION_GROUP(user_data); g_signal_emit(G_OBJECT(group), group_signals[MEMBER_ADDED], 0, connection); } static void inf_communication_group_method_remove_member_cb(InfCommunicationMethod* meth, InfXmlConnection* conn, gpointer user_data) { InfCommunicationGroup* group; group = INF_COMMUNICATION_GROUP(user_data); g_signal_emit(G_OBJECT(group), group_signals[MEMBER_REMOVED], 0, conn); } static InfCommunicationFactory* inf_communication_group_get_factory_for_network(InfCommunicationGroup* group, const gchar* network, const gchar** method) { InfCommunicationGroupPrivate* priv; InfCommunicationGroupClass* klass; const gchar* method_name; const gchar* split_pos; unsigned int i; InfCommunicationFactory* factory; priv = INF_COMMUNICATION_GROUP_PRIVATE(group); klass = INF_COMMUNICATION_GROUP_GET_CLASS(group); g_assert(klass->get_method != NULL); i = 0; for(i = 0; (method_name = klass->get_method(group, i)) != NULL; ++ i) { split_pos = strstr(method_name, "::"); if(split_pos != NULL) { if(strncmp(method_name, network, split_pos - method_name) != 0) continue; method_name = split_pos + 2; } /* Check for support */ factory = inf_communication_manager_get_factory_for( priv->communication_manager, network, method_name ); if(factory != NULL) { if(method != NULL) *method = method_name; return factory; } } return NULL; } /* * Utility functions */ static InfCommunicationMethod* inf_communication_group_lookup_method_for_network(InfCommunicationGroup* grp, const gchar* network) { InfCommunicationGroupPrivate* priv; InfCommunicationMethod* method; priv = INF_COMMUNICATION_GROUP_PRIVATE(grp); method = g_hash_table_lookup(priv->methods, network); return method; } static InfCommunicationMethod* inf_communication_group_lookup_method_for_connection(InfCommunicationGroup* g, InfXmlConnection* conn) { InfCommunicationMethod* method; gchar* network; g_object_get(G_OBJECT(conn), "network", &network, NULL); method = inf_communication_group_lookup_method_for_network(g, network); g_free(network); return method; } /* * Weak ref handling */ /* TODO: Can we strong-ref the communicationmanager and registry? */ static void inf_communication_group_target_unrefed(gpointer data, GObject* where_the_object_was) { InfCommunicationGroup* group; InfCommunicationGroupPrivate* priv; group = INF_COMMUNICATION_GROUP(data); priv = INF_COMMUNICATION_GROUP_PRIVATE(group); g_warning( "The target of communication group \"%s\" was released before the group " "itself was released.", priv->name ); priv->target = NULL; g_object_notify(G_OBJECT(group), "target"); } static void inf_communication_group_manager_unrefed(gpointer data, GObject* where_the_object_was) { InfCommunicationGroup* group; InfCommunicationGroupPrivate* priv; group = INF_COMMUNICATION_GROUP(data); priv = INF_COMMUNICATION_GROUP_PRIVATE(group); g_warning( "The communication manager of group \"%s\" was released before the group " "itself was released.", priv->name ); priv->communication_manager = NULL; g_object_notify(G_OBJECT(group), "communication-manager"); } static void inf_communication_group_registry_unrefed(gpointer data, GObject* where_the_object_was) { InfCommunicationGroup* group; InfCommunicationGroupPrivate* priv; group = INF_COMMUNICATION_GROUP(data); priv = INF_COMMUNICATION_GROUP_PRIVATE(group); g_warning( "The communication registry of group \"%s\" was released before the " "group itself was released.", priv->name ); priv->communication_registry = NULL; g_object_notify(G_OBJECT(group), "communication-registry"); } static void inf_communication_group_set_manager(InfCommunicationGroup* group, InfCommunicationManager* manager) { InfCommunicationGroupPrivate* priv; priv = INF_COMMUNICATION_GROUP_PRIVATE(group); if(priv->communication_manager != NULL) { g_object_weak_unref( G_OBJECT(priv->communication_manager), inf_communication_group_manager_unrefed, group ); } priv->communication_manager = manager; if(manager != NULL) { g_object_weak_ref( G_OBJECT(manager), inf_communication_group_manager_unrefed, group ); } g_object_notify(G_OBJECT(group), "communication-manager"); } static void inf_communication_group_set_registry(InfCommunicationGroup* group, InfCommunicationRegistry* registry) { InfCommunicationGroupPrivate* priv; priv = INF_COMMUNICATION_GROUP_PRIVATE(group); if(priv->communication_registry != NULL) { g_object_weak_unref( G_OBJECT(priv->communication_registry), inf_communication_group_registry_unrefed, group ); } priv->communication_registry = registry; if(registry != NULL) { g_object_weak_ref( G_OBJECT(registry), inf_communication_group_registry_unrefed, group ); } g_object_notify(G_OBJECT(group), "communication-registry"); } /* * GObject overrides. */ static void inf_communication_group_init(GTypeInstance* instance, gpointer g_class) { InfCommunicationGroup* group; InfCommunicationGroupPrivate* priv; group = INF_COMMUNICATION_GROUP(instance); priv = INF_COMMUNICATION_GROUP_PRIVATE(group); priv->communication_manager = NULL; priv->communication_registry = NULL; priv->name = NULL; priv->target = NULL; priv->methods = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_object_unref); } static void inf_communication_group_dispose(GObject* object) { InfCommunicationGroup* group; InfCommunicationGroupPrivate* priv; group = INF_COMMUNICATION_GROUP(object); priv = INF_COMMUNICATION_GROUP_PRIVATE(group); if(priv->methods != NULL) { g_hash_table_unref(priv->methods); priv->methods = NULL; } inf_communication_group_set_registry(group, NULL); inf_communication_group_set_manager(group, NULL); inf_communication_group_set_target(group, NULL); G_OBJECT_CLASS(parent_class)->dispose(object); } static void inf_communication_group_finalize(GObject* object) { InfCommunicationGroup* group; InfCommunicationGroupPrivate* priv; group = INF_COMMUNICATION_GROUP(object); priv = INF_COMMUNICATION_GROUP_PRIVATE(group); g_free(priv->name); G_OBJECT_CLASS(parent_class)->finalize(object); } static void inf_communication_group_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec) { InfCommunicationGroup* group; InfCommunicationGroupPrivate* priv; group = INF_COMMUNICATION_GROUP(object); priv = INF_COMMUNICATION_GROUP_PRIVATE(group); switch(prop_id) { case PROP_COMMUNICATION_MANAGER: g_assert(priv->communication_manager == NULL); /* construct only */ inf_communication_group_set_manager( group, INF_COMMUNICATION_MANAGER(g_value_get_object(value)) ); break; case PROP_COMMUNICATION_REGISTRY: g_assert(priv->communication_registry == NULL); /* construct only */ inf_communication_group_set_registry( group, INF_COMMUNICATION_REGISTRY(g_value_get_object(value)) ); break; case PROP_NAME: g_assert(priv->name == NULL); /* construct only */ priv->name = g_value_dup_string(value); break; case PROP_TARGET: inf_communication_group_set_target( group, INF_COMMUNICATION_OBJECT(g_value_get_object(value)) ); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void inf_communication_group_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec) { InfCommunicationGroup* group; InfCommunicationGroupPrivate* priv; group = INF_COMMUNICATION_GROUP(object); priv = INF_COMMUNICATION_GROUP_PRIVATE(group); switch(prop_id) { case PROP_NAME: g_value_set_string(value, priv->name); break; case PROP_TARGET: g_value_set_object(value, G_OBJECT(priv->target)); break; case PROP_COMMUNICATION_MANAGER: /* write-only: */ /*g_value_set_object(value, G_OBJECT(priv->communication_manager)); break;*/ case PROP_COMMUNICATION_REGISTRY: /* write-only: */ /*g_value_set_object(value, G_OBJECT(priv->communication_registry)); break;*/ default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } /* * GType registration. */ static void inf_communication_group_class_init(gpointer g_class, gpointer class_data) { GObjectClass* object_class; InfCommunicationGroupClass* group_class; object_class = G_OBJECT_CLASS(g_class); group_class = INF_COMMUNICATION_GROUP_CLASS(g_class); parent_class = G_OBJECT_CLASS(g_type_class_peek_parent(g_class)); g_type_class_add_private(g_class, sizeof(InfCommunicationGroupPrivate)); object_class->dispose = inf_communication_group_dispose; object_class->finalize = inf_communication_group_finalize; object_class->set_property = inf_communication_group_set_property; object_class->get_property = inf_communication_group_get_property; group_class->member_added = NULL; group_class->member_removed = NULL; group_class->get_method = NULL; group_class->get_publisher_id = NULL; g_object_class_install_property( object_class, PROP_COMMUNICATION_MANAGER, g_param_spec_object( "communication-manager", "Communication manager", "The communication manager used for sending requests", INF_COMMUNICATION_TYPE_MANAGER, G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY ) ); g_object_class_install_property( object_class, PROP_COMMUNICATION_REGISTRY, g_param_spec_object( "communication-registry", "Communication registry", "The registry to register connections with", INF_COMMUNICATION_TYPE_REGISTRY, G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY ) ); g_object_class_install_property( object_class, PROP_NAME, g_param_spec_string( "name", "Name", "The name of the group", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); g_object_class_install_property( object_class, PROP_TARGET, g_param_spec_object( "target", "Target", "The communication object to call on received and sent data", INF_COMMUNICATION_TYPE_OBJECT, G_PARAM_READWRITE ) ); /** * InfCommunicationGroup::member-added: * @group: The #InfCommunicationGroup emitting the signal. * @connection: The newly joined connection. * * This signal is emitted when a connection has been added to the group. */ group_signals[MEMBER_ADDED] = g_signal_new( "member-added", G_OBJECT_CLASS_TYPE(object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(InfCommunicationGroupClass, member_added), NULL, NULL, inf_marshal_VOID__OBJECT, G_TYPE_NONE, 1, INF_TYPE_XML_CONNECTION ); /** * InfCommunicationGroup::member-removed: * @group: The #InfCommunicationGroup emitting the signal. * @connection: The connection that was removed * * This signal is emitted when a connection has been removed from the group. */ group_signals[MEMBER_REMOVED] = g_signal_new( "member-removed", G_OBJECT_CLASS_TYPE(object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(InfCommunicationGroupClass, member_removed), NULL, NULL, inf_marshal_VOID__OBJECT, G_TYPE_NONE, 1, INF_TYPE_XML_CONNECTION ); } GType inf_communication_group_get_type(void) { static GType group_type = 0; if(!group_type) { static const GTypeInfo group_type_info = { sizeof(InfCommunicationGroupClass), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ inf_communication_group_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InfCommunicationGroup), /* instance_size */ 0, /* n_preallocs */ inf_communication_group_init, /* instance_init */ NULL /* value_table */ }; group_type = g_type_register_static( G_TYPE_OBJECT, "InfCommunicationGroup", &group_type_info, G_TYPE_FLAG_ABSTRACT ); } return group_type; } /* * Public API. */ /** * inf_communication_group_get_name: * @group: A #InfCommunicationGroup. * * Returns the name of the group. * * Returns: The name of the group. The returned string is owned by the group, * you don't need to free it. */ const gchar* inf_communication_group_get_name(InfCommunicationGroup* group) { g_return_val_if_fail(INF_COMMUNICATION_IS_GROUP(group), NULL); return INF_COMMUNICATION_GROUP_PRIVATE(group)->name; } /** * inf_communication_group_get_target: * @group: A #InfCommunicationGroup. * * Returns the group's target. The target of a group is the * #InfCommunicationObject to which received and sent messages are reported. * * Returns: A #InfCommunicationGroup, or %NULL. */ InfCommunicationObject* inf_communication_group_get_target(InfCommunicationGroup* group) { g_return_val_if_fail(INF_COMMUNICATION_IS_GROUP(group), NULL); return INF_COMMUNICATION_GROUP_PRIVATE(group)->target; } /** * inf_communication_group_set_target: * @group: A #InfCommunicationGroup. * @target: A #InfCommunicationObject, or %NULL. * * Sets the group's target. The target of a group is the * #InfCommunicationObject to which received and sent messages are reported. * If @target is %NULL, then the target will be unset. * * You can safely call this function with an object that holds a reference on * the group since the #InfCommunicationGroup only holds a weak reference to * its @target. This means that you need to keep a reference on @target * yourself. */ void inf_communication_group_set_target(InfCommunicationGroup* group, InfCommunicationObject* object) { InfCommunicationGroupPrivate* priv; g_return_if_fail(INF_COMMUNICATION_IS_GROUP(group)); g_return_if_fail(object == NULL || INF_COMMUNICATION_IS_OBJECT(object)); priv = INF_COMMUNICATION_GROUP_PRIVATE(group); if(priv->target != object) { if(priv->target != NULL) { g_object_weak_unref( G_OBJECT(priv->target), inf_communication_group_target_unrefed, group ); } priv->target = object; if(object != NULL) { g_object_weak_ref( G_OBJECT(object), inf_communication_group_target_unrefed, group ); } g_object_notify(G_OBJECT(group), "target"); } } /** * inf_communication_group_is_member: * @group: A #InfCommunicationGroup. * @connection: A #InfXmlConnection. * * Returns whether @connection is a member of @group. * * Returns: %TRUE if @connection is a member of @group, %FALSE otherwise. */ gboolean inf_communication_group_is_member(InfCommunicationGroup* group, InfXmlConnection* connection) { InfCommunicationMethod* method; g_return_val_if_fail(INF_COMMUNICATION_IS_GROUP(group), FALSE); g_return_val_if_fail(INF_IS_XML_CONNECTION(connection), FALSE); method = inf_communication_group_lookup_method_for_connection( group, connection ); if(method != NULL) return inf_communication_method_is_member(method, connection); else return FALSE; } /** * inf_communication_group_send_message: * @group: A #InfCommunicationGroup. * @connection: The #InfXmlConnection to which to send the message. * @xml: The message to send. * * Sends a message @connection which must be a member of @group. @connection * needs to be a member of this group. This function takes ownership of @xml. */ void inf_communication_group_send_message(InfCommunicationGroup* group, InfXmlConnection* connection, xmlNodePtr xml) { InfCommunicationMethod* method; g_return_if_fail(INF_COMMUNICATION_IS_GROUP(group)); g_return_if_fail(INF_IS_XML_CONNECTION(connection)); g_return_if_fail(xml != NULL); method = inf_communication_group_lookup_method_for_connection( group, connection ); g_return_if_fail(method != NULL); inf_communication_method_send_single(method, connection, xml); } /** * inf_communication_group_send_group_message: * @group: A #InfCommunicationGroup. * @xml: The message to send. * * Sends a message to all members of @group. This function takes ownership * of @xml. */ void inf_communication_group_send_group_message(InfCommunicationGroup* group, xmlNodePtr xml) { InfCommunicationGroupPrivate* priv; GHashTableIter iter; gpointer value; InfCommunicationMethod* method; gboolean has_next; g_return_if_fail(INF_COMMUNICATION_IS_GROUP(group)); g_return_if_fail(xml != NULL); priv = INF_COMMUNICATION_GROUP_PRIVATE(group); g_hash_table_iter_init(&iter, priv->methods); has_next = g_hash_table_iter_next(&iter, NULL, &value); if(!has_next) { xmlFreeNode(xml); } else { do { method = INF_COMMUNICATION_METHOD(value); has_next = g_hash_table_iter_next(&iter, NULL, &value); inf_communication_method_send_all( method, has_next ? xmlCopyNode(xml, 1) : xml ); } while(has_next); } } /** * inf_communication_group_cancel_messages: * @group: A #InfCommunicationGroup. * @connection: The #InfXmlConnection for which to cancel messages. * * Stops all messages scheduled to be sent to @connection from being sent. * Messages for which inf_communication_object_enqueued() has already been * called cannot be cancelled anymore. */ void inf_communication_group_cancel_messages(InfCommunicationGroup* group, InfXmlConnection* connection) { InfCommunicationMethod* method; g_return_if_fail(INF_COMMUNICATION_IS_GROUP(group)); g_return_if_fail(INF_IS_XML_CONNECTION(connection)); method = inf_communication_group_lookup_method_for_connection( group, connection ); g_return_if_fail(method != NULL); inf_communication_method_cancel_messages(method, connection); } /** * inf_communication_group_get_method_for_network: * @group: A #InfCommunicationGroup. * @network: A network specifier, such as "tcp/ip" or "jabber". * * Returns the method name of the method used for communication on @network * within @group. * * Returns: A method name. The string is owned by the group, you don't need * to free it. */ const gchar* inf_communication_group_get_method_for_network(InfCommunicationGroup* group, const gchar* network) { InfCommunicationFactory* factory; const gchar* method_name; g_return_val_if_fail(INF_COMMUNICATION_IS_GROUP(group), NULL); g_return_val_if_fail(network != NULL, NULL); factory = inf_communication_group_get_factory_for_network( group, network, &method_name ); if(factory == NULL) return NULL; return method_name; } /** * inf_communication_group_get_method_for_connection: * @grp: A #InfCommunicationGroup. * @conn: The #InfXmlConnection for which to retrieve the method. * * Returns the method name of the method used for communication on @conn's * network within @group. @conn does not need to be a member of @grp for this * function to be called. * * Returns: A method name. The string is owned by the group, you don't need * to free it. */ const gchar* inf_communication_group_get_method_for_connection(InfCommunicationGroup* grp, InfXmlConnection* conn) { gchar* network; const gchar* method; g_return_val_if_fail(INF_COMMUNICATION_IS_GROUP(grp), NULL); g_return_val_if_fail(INF_IS_XML_CONNECTION(conn), NULL); g_object_get(G_OBJECT(conn), "network", &network, NULL); method = inf_communication_group_get_method_for_network(grp, network); g_free(network); return method; } /** * inf_communication_group_get_publisher_id: * @group: A #InfCommunicationGroup. * @for_connection: A #InfXmlConnection. * * Returns a host identifier for the group's publisher (see * #InfXmlConnection:local-id and #InfXmlConnection:remote-id). If the local * host is the publisher, then this will simply return @for_connection's * local ID, otherwise the remote ID of the connection to the publisher on * @for_connection's network is returned. * * Returns: The publisher's host ID. Free with g_free(). */ gchar* inf_communication_group_get_publisher_id(InfCommunicationGroup* group, InfXmlConnection* for_connection) { InfCommunicationGroupClass* group_class; g_return_val_if_fail(INF_COMMUNICATION_IS_GROUP(group), NULL); g_return_val_if_fail(INF_IS_XML_CONNECTION(for_connection), NULL); group_class = INF_COMMUNICATION_GROUP_GET_CLASS(group); g_return_val_if_fail(group_class->get_publisher_id != NULL, NULL); return group_class->get_publisher_id(group, for_connection); } /* * Private API. Don't wrap this in language bindings. */ void _inf_communication_group_add_member(InfCommunicationGroup* group, InfXmlConnection* connection) { InfCommunicationGroupPrivate *priv; InfCommunicationMethod* method; gchar* network; const gchar* method_name; InfCommunicationFactory* factory; priv = INF_COMMUNICATION_GROUP_PRIVATE(group); g_object_get(G_OBJECT(connection), "network", &network, NULL); method = g_hash_table_lookup(priv->methods, network); if(!method) { factory = inf_communication_group_get_factory_for_network( group, network, &method_name ); /* The caller needs to make sure that we have at least one method for * connection's network. */ g_assert(factory != NULL); method = inf_communication_factory_instantiate( factory, network, method_name, priv->communication_registry, group ); g_signal_connect_after( G_OBJECT(method), "add-member", G_CALLBACK(inf_communication_group_method_add_member_cb), group ); g_signal_connect_after( G_OBJECT(method), "remove-member", G_CALLBACK(inf_communication_group_method_remove_member_cb), group ); g_hash_table_insert( priv->methods, network, method ); } else { g_free(network); } inf_communication_method_add_member(method, connection); } void _inf_communication_group_remove_member(InfCommunicationGroup* group, InfXmlConnection* connection) { InfCommunicationGroupPrivate* priv; gchar* network; InfCommunicationMethod* method; priv = INF_COMMUNICATION_GROUP_PRIVATE(group); g_object_get(G_OBJECT(connection), "network", &network, NULL); method = g_hash_table_lookup(priv->methods, network); g_free(network); g_assert(method != NULL); inf_communication_method_remove_member(method, connection); } void _inf_communication_group_foreach_method(InfCommunicationGroup* group, InfCommunicationGroupForeachFunc func, gpointer user_data) { InfCommunicationGroupPrivate* priv; GHashTableIter iter; gpointer value; InfCommunicationMethod* method; gboolean has_next; priv = INF_COMMUNICATION_GROUP_PRIVATE(group); g_hash_table_iter_init(&iter, priv->methods); has_next = g_hash_table_iter_next(&iter, NULL, &value); while(has_next) { method = INF_COMMUNICATION_METHOD(value); has_next = g_hash_table_iter_next(&iter, NULL, &value); func(method, user_data); } } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/communication/inf-communication-registry.c0000644000175000017500000010217012264763732023615 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ /** * SECTION:inf-communication-registry * @title: InfCommunicationRegistry * @short_description: Sharing connections between multiple groups * @include: libinfinity/communication/inf-communication-registry.h * @stability: Unstable * * #InfCommunicationRegistry provides a way for #InfCommunicationMethod * implementations to share connections with other groups. Before using a * connection, call inf_communication_registry_register(). Then, messages can * be sent to the group via inf_communication_registry_send(). * * The #InfCommunicationRegistry calls inf_communication_method_received() * on your method when it received a message for the group, * inf_communication_method_enqueued() when sending the message cannot be * cancelled anymore via inf_communication_registry_cancel_messages() and * inf_communication_method_sent() when the message has been sent. **/ #include #include #include #include /* TODO: Store connection->InfCommunicationRegistryConnection hashtable, * store network and remote_id there, only point to in key. */ typedef struct _InfCommunicationRegistryKey InfCommunicationRegistryKey; struct _InfCommunicationRegistryKey { InfXmlConnection* connection; gchar* publisher_id; const gchar* group_name; }; typedef struct _InfCommunicationRegistryEntry InfCommunicationRegistryEntry; struct _InfCommunicationRegistryEntry { InfCommunicationRegistry* registry; InfCommunicationRegistryKey key; const gchar* publisher_string; InfCommunicationGroup* group; InfCommunicationMethod* method; /* Queue of messages to send */ guint inner_count; xmlNodePtr queue_begin; xmlNodePtr queue_end; /* Activation status */ gboolean registered; guint activation_count; /* # messages to be sent until activation */ xmlNodePtr enqueued_list; xmlNodePtr sent_list; }; typedef struct _InfCommunicationRegistryForeachMethodData InfCommunicationRegistryForeachMethodData; struct _InfCommunicationRegistryForeachMethodData { InfCommunicationMethod* original_method; xmlNodePtr xml; }; typedef struct _InfCommunicationRegistryPrivate InfCommunicationRegistryPrivate; struct _InfCommunicationRegistryPrivate { GHashTable* connections; GHashTable* entries; }; #define INF_COMMUNICATION_REGISTRY_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), INF_COMMUNICATION_TYPE_REGISTRY, InfCommunicationRegistryPrivate)) static GObjectClass* parent_class; /* Maximum number of messages enqueued at the same time */ static const guint INF_COMMUNICATION_REGISTRY_INNER_QUEUE_LIMIT = 5; static void inf_communication_registry_send_real(InfCommunicationRegistryEntry* entry, guint num_messages) { xmlNodePtr container; xmlNodePtr child; xmlNodePtr xml; guint i; container = xmlNewNode(NULL, (const xmlChar*)"group"); if(entry->publisher_string != NULL) { inf_xml_util_set_attribute( container, "publisher", entry->publisher_string ); } inf_xml_util_set_attribute(container, "name", entry->key.group_name); for(i = 0; i < num_messages && ((xml = entry->queue_begin) != NULL); ++ i) { entry->queue_begin = entry->queue_begin->next; if(entry->queue_begin == NULL) entry->queue_end = NULL; ++ entry->inner_count; xmlUnlinkNode(xml); xmlAddChild(container, xml); } /* Keep order of enqueued() calls and inf_xml_connection_send() calls * intact even if this function is run recursively in one of the * functions mentioned above. */ if(entry->enqueued_list != NULL) { entry->enqueued_list->next = container; entry->enqueued_list = container; } else { entry->enqueued_list = container; child = container; while(child != NULL) { /* TODO: The group could be unset at this point if called from * inf_communication_registry_entry_free() in turn called by * inf_communication_registry_group_unrefed(). This can be removed if * we keep the group alive in that case, refer to the comment below in * inf_communication_registry_entry_free(). */ if(entry->group != NULL) { for(xml = child->children; xml != NULL; xml = xml->next) { inf_communication_method_enqueued( entry->method, entry->key.connection, xml ); } } if(child == entry->enqueued_list) entry->enqueued_list = NULL; xml = child; child = child->next; /* There are two possible cases at this point: * 1) We reached the end of the list. In that case, entry->enqueued_list * has been reset to NULL. This also means that we have sent everything * successfully. We will terminate this function after this call, so * a recursive call can just begin from scratch. * 2) entry->enqueued_list is not NULL. In this case, a recursive call * will simply append to entry->enqueued_list, and we will enqueue and * send the messages within the next iteration(s). */ inf_xml_connection_send(entry->key.connection, xml); } } } /* Required by inf_communication_registry_entry_free() */ static void inf_communication_registry_group_unrefed(gpointer user_data, GObject* where_the_object_was); static void inf_communication_registry_entry_free(gpointer data) { InfCommunicationRegistryEntry* entry; InfXmlConnectionStatus status; entry = (InfCommunicationRegistryEntry*)data; /* Send all messages directly as we are freed and can't keep them around * any longer. */ /* TODO: Ref the group on unregistration, so that the group stays alive * until all scheduled messages have been sent. In this case, the entry * will in no cases be freed, ane we can assert() here. When we do this, * we need to take into account the following: * 1) Assert in inf_communication_registry_group_unrefed() that the entry * is registered, as the group cannot be unrefed as long as we hold a * reference. * 2) Unref the group here, as we do with the connection. Do this after the * weak unref. * 3) Allow connection manager to return existing groups on join or host, * as the groups can live longer than people expect. */ g_object_get(G_OBJECT(entry->key.connection), "status", &status, NULL); if(status != INF_XML_CONNECTION_CLOSING && status != INF_XML_CONNECTION_CLOSED) { if(entry->queue_begin != NULL) inf_communication_registry_send_real(entry, G_MAXUINT); } if(entry->group) { g_object_weak_unref( G_OBJECT(entry->group), inf_communication_registry_group_unrefed, entry ); } if(!entry->registered) g_object_unref(entry->key.connection); g_free(entry->key.publisher_id); g_slice_free(InfCommunicationRegistryEntry, entry); } static guint inf_communication_registry_key_hash(gconstpointer key_) { const InfCommunicationRegistryKey* key; key = (const InfCommunicationRegistryKey*)key_; /* TODO: Is this a good hash function? */ return g_direct_hash(key->connection) ^ g_str_hash(key->publisher_id) ^ g_str_hash(key->group_name); } static int inf_communication_registry_key_cmp(gconstpointer first, gconstpointer second) { const InfCommunicationRegistryKey* first_key; const InfCommunicationRegistryKey* second_key; int res; first_key = (const InfCommunicationRegistryKey*)first; second_key = (const InfCommunicationRegistryKey*)second; if(first_key->connection < second_key->connection) return -1; if(first_key->connection > second_key->connection) return 1; res = strcmp(first_key->group_name, second_key->group_name); if(res != 0) return res; return strcmp(first_key->publisher_id, second_key->publisher_id); } static gboolean inf_communication_registry_key_equal(gconstpointer first, gconstpointer second) { return inf_communication_registry_key_cmp(first, second) == 0; } static void inf_communication_registry_foreach_method_func(InfCommunicationMethod* method, gpointer user_data) { InfCommunicationRegistryForeachMethodData* data; data = (InfCommunicationRegistryForeachMethodData*)user_data; /* TODO: Make sure that any callbacks in the send functions do not alter * the hash table which holds the methods in InfCommunicationGroup. */ if(method != data->original_method) inf_communication_method_send_all(method, xmlCopyNode(data->xml, 1)); } static void inf_communication_registry_received_cb(InfXmlConnection* connection, xmlNodePtr xml, gpointer user_data) { InfCommunicationRegistry* registry; InfCommunicationRegistryPrivate* priv; InfCommunicationRegistryKey key; InfCommunicationRegistryEntry* entry; xmlChar* group_name; xmlChar* publisher; xmlNodePtr child; InfCommunicationScope scope; InfCommunicationRegistryForeachMethodData data; registry = INF_COMMUNICATION_REGISTRY(user_data); priv = INF_COMMUNICATION_REGISTRY_PRIVATE(registry); group_name = xmlGetProp(xml, (const xmlChar*)"name"); if(group_name == NULL) return; publisher = xmlGetProp(xml, (const xmlChar*)"publisher"); if(publisher == NULL) { g_object_get(G_OBJECT(connection), "remote-id", &key.publisher_id, NULL); } else if(strcmp((const char*)publisher, "me") == 0) { g_object_get(G_OBJECT(connection), "remote-id", &key.publisher_id, NULL); xmlFree(publisher); publisher = NULL; } else if(strcmp((const char*)publisher, "you") == 0) { g_object_get(G_OBJECT(connection), "local-id", &key.publisher_id, NULL); xmlFree(publisher); publisher = NULL; } else { key.publisher_id = (gchar*)publisher; } key.connection = connection; key.group_name = (const gchar*)group_name; /* Relookup for each child to make sure the entry stays alive */ for(child = xml->children; child != NULL; child = child->next) { entry = g_hash_table_lookup(priv->entries, &key); if(entry != NULL && entry->registered == TRUE) { scope = inf_communication_method_received( entry->method, entry->key.connection, child ); /* If this was a group message then we relay it to any * other networks group is in. */ if(scope == INF_COMMUNICATION_SCOPE_GROUP) { data.original_method = entry->method; data.xml = child; _inf_communication_group_foreach_method( entry->group, inf_communication_registry_foreach_method_func, &data ); } } } if(publisher != NULL) xmlFree(publisher); else g_free(key.publisher_id); xmlFree(group_name); } static void inf_communication_registry_sent_cb(InfXmlConnection* connection, xmlNodePtr xml, gpointer user_data) { InfCommunicationRegistry* registry; InfCommunicationRegistryPrivate* priv; InfCommunicationRegistryEntry* entry; InfCommunicationRegistryKey key; xmlChar* publisher; xmlChar* group_name; xmlNodePtr child; xmlNodePtr cur; registry = INF_COMMUNICATION_REGISTRY(user_data); priv = INF_COMMUNICATION_REGISTRY_PRIVATE(registry); group_name = xmlGetProp(xml, (const xmlChar*)"name"); g_assert(group_name != NULL); publisher = xmlGetProp(xml, (const xmlChar*)"publisher"); if(publisher == NULL) { g_object_get(G_OBJECT(connection), "local-id", &key.publisher_id, NULL); } else if(strcmp((const char*)publisher, "me") == 0) { g_object_get(G_OBJECT(connection), "local-id", &key.publisher_id, NULL); xmlFree(publisher); publisher = NULL; } else if(strcmp((const char*)publisher, "you") == 0) { g_object_get(G_OBJECT(connection), "remote-id", &key.publisher_id, NULL); xmlFree(publisher); publisher = NULL; } else { key.publisher_id = (gchar*)publisher; } key.connection = connection; key.group_name = (const gchar*)group_name; entry = g_hash_table_lookup(priv->entries, &key); if(entry != NULL) { if(entry->sent_list != NULL) { entry->sent_list->next = xmlCopyNode(xml, 1); entry->sent_list = entry->sent_list->next; } else { entry->sent_list = xml; child = xml; while(child != NULL) { for(cur = child->children; cur != NULL; cur = cur->next) { g_assert(entry->inner_count > 0); /* Still registered */ if(entry->activation_count > 0) { -- entry->activation_count; } else { /* Must be registered if activation count is 0 */ g_assert(entry->registered == TRUE); inf_communication_method_sent( entry->method, entry->key.connection, cur ); /* If the callback did unregister us, then the activation count * was set (counting the message for which the callback was * called, since inner_count has not yet been decreased). We do * correct this here. */ if(entry->activation_count > 0) -- entry->activation_count; } -- entry->inner_count; } cur = child; child = child->next; if(cur == entry->sent_list) entry->sent_list = NULL; if(cur != xml) xmlFreeNode(cur); } } /* Messages have been sent, meaning the number of queued messages has * decreased, so we can send more messages now. */ /* Send next bunch of messages if inner_count reached zero, meaning no * more messages have been enqueued, for better packing. */ if(entry->inner_count == 0 && entry->queue_end != NULL) { inf_communication_registry_send_real( entry, INF_COMMUNICATION_REGISTRY_INNER_QUEUE_LIMIT - entry->inner_count ); } /* Free the entry in case all scheduled messages have been sent after * unregistration. */ if(entry->registered == FALSE && entry->activation_count == 0) g_hash_table_remove(priv->entries, &key); } if(publisher == NULL) g_free(key.publisher_id); else xmlFree(publisher); xmlFree(group_name); } static void inf_communication_registry_notify_status_cb(GObject* object, GParamSpec* pspec, gpointer user_data) { InfCommunicationRegistry* registry; InfCommunicationRegistryPrivate* priv; InfXmlConnectionStatus status; InfXmlConnection* connection; GHashTableIter iter; gpointer value; InfCommunicationRegistryEntry* entry; InfCommunicationGroup* group; gboolean registered; registry = INF_COMMUNICATION_REGISTRY(user_data); priv = INF_COMMUNICATION_REGISTRY_PRIVATE(registry); connection = INF_XML_CONNECTION(object); g_object_get(object, "status", &status, NULL); /* Free all entries that have been unregistered if the connection was * closed. */ if(status == INF_XML_CONNECTION_CLOSING || status == INF_XML_CONNECTION_CLOSED) { g_hash_table_iter_init(&iter, priv->entries); while(g_hash_table_iter_next(&iter, NULL, &value)) { entry = (InfCommunicationRegistryEntry*)value; if(entry->key.connection == connection) { group = g_object_ref(entry->group); registered = entry->registered; if(entry->registered == FALSE) g_hash_table_iter_remove(&iter); g_object_unref(group); } } } } static void inf_communication_registry_add_connection(InfCommunicationRegistry* registry, InfXmlConnection* connection) { InfCommunicationRegistryPrivate* priv; gpointer reg; priv = INF_COMMUNICATION_REGISTRY_PRIVATE(registry); reg = g_hash_table_lookup(priv->connections, connection); g_hash_table_steal(priv->connections, connection); if(reg == NULL) { g_hash_table_insert( priv->connections, connection, GUINT_TO_POINTER(1) ); g_object_ref(connection); g_signal_connect( G_OBJECT(connection), "received", G_CALLBACK(inf_communication_registry_received_cb), registry ); g_signal_connect( G_OBJECT(connection), "sent", G_CALLBACK(inf_communication_registry_sent_cb), registry ); g_signal_connect( G_OBJECT(connection), "notify::status", G_CALLBACK(inf_communication_registry_notify_status_cb), registry ); } else { g_hash_table_insert( priv->connections, connection, GUINT_TO_POINTER(1+GPOINTER_TO_UINT(reg)) ); } } static void inf_communication_registry_remove_connection(InfCommunicationRegistry* rgstry, InfXmlConnection* connection) { InfCommunicationRegistryPrivate* priv; gpointer reg; guint count; priv = INF_COMMUNICATION_REGISTRY_PRIVATE(rgstry); reg = g_hash_table_lookup(priv->connections, connection); g_assert(reg != NULL); g_hash_table_steal(priv->connections, connection); count = GPOINTER_TO_UINT(reg); if(--count > 0) { g_hash_table_insert( priv->connections, connection, GUINT_TO_POINTER(count) ); } else { inf_signal_handlers_disconnect_by_func( G_OBJECT(connection), G_CALLBACK(inf_communication_registry_received_cb), rgstry ); inf_signal_handlers_disconnect_by_func( G_OBJECT(connection), G_CALLBACK(inf_communication_registry_sent_cb), rgstry ); inf_signal_handlers_disconnect_by_func( G_OBJECT(connection), G_CALLBACK(inf_communication_registry_notify_status_cb), rgstry ); g_object_unref(connection); } } static void inf_communication_registry_group_unrefed(gpointer user_data, GObject* where_the_object_was) { InfCommunicationRegistryEntry* entry; InfCommunicationRegistry* registry; InfCommunicationRegistryPrivate* priv; GHashTableIter iter; gpointer value; InfXmlConnection* connection; gboolean registered; entry = (InfCommunicationRegistryEntry*)user_data; registry = entry->registry; priv = INF_COMMUNICATION_REGISTRY_PRIVATE(registry); /* This is completely valid if the connection was unregistered, only * sending final scheduled messages. */ if(entry->registered == TRUE) g_warning("An unrefed group still had registered connections"); /* The group has already been finalized, so we can't remove the group by * key since group_name in the entry's key pointed to group's memory. */ g_hash_table_iter_init(&iter, priv->entries); while(g_hash_table_iter_next(&iter, NULL, &value)) { if(value == entry) { connection = entry->key.connection; registered = entry->registered; /* So inf_communication_registry_entry_free() does not try to weak unref * the non-existing group: */ entry->group = NULL; /* TODO: This relies on entry->key.group_name being still valid. * valgrind suggests it is. However, I don't feel confident with this. * I this can be properly fixed when we keep the group alive for * unregistered connections, refer to the comment in * inf_communication_registry_entry_free(). */ g_hash_table_iter_remove(&iter); if(registered == TRUE) inf_communication_registry_remove_connection(registry, connection); break; } } } /* * GObject overrides. */ static void inf_communication_registry_init(GTypeInstance* instance, gpointer g_class) { InfCommunicationRegistry* registry; InfCommunicationRegistryPrivate* priv; registry = INF_COMMUNICATION_REGISTRY(instance); priv = INF_COMMUNICATION_REGISTRY_PRIVATE(registry); priv->connections = g_hash_table_new(NULL, NULL); priv->entries = g_hash_table_new_full( inf_communication_registry_key_hash, inf_communication_registry_key_equal, NULL, inf_communication_registry_entry_free ); } static void inf_communication_registry_dispose(GObject* object) { InfCommunicationRegistry* registry; InfCommunicationRegistryPrivate* priv; GHashTableIter iter; gpointer key; registry = INF_COMMUNICATION_REGISTRY(object); priv = INF_COMMUNICATION_REGISTRY_PRIVATE(registry); if(g_hash_table_size(priv->connections)) { g_warning( "There are still registered connections on communication " "registry dispose" ); /* Release all connections. We can't rely on a key FreeFunc since * the signal handlers cannot be disconnected easily this way as we * don't have access to the registry in the FreeFunc. */ g_hash_table_iter_init(&iter, priv->connections); while(g_hash_table_iter_next(&iter, &key, NULL)) { inf_signal_handlers_disconnect_by_func( G_OBJECT(key), G_CALLBACK(inf_communication_registry_received_cb), registry ); inf_signal_handlers_disconnect_by_func( G_OBJECT(key), G_CALLBACK(inf_communication_registry_sent_cb), registry ); inf_signal_handlers_disconnect_by_func( G_OBJECT(key), G_CALLBACK(inf_communication_registry_notify_status_cb), registry ); g_object_unref(key); } } g_hash_table_unref(priv->connections); g_hash_table_unref(priv->entries); G_OBJECT_CLASS(parent_class)->dispose(object); } /* * GType registration. */ static void inf_communication_registry_class_init(gpointer g_class, gpointer class_data) { GObjectClass* object_class; object_class = G_OBJECT_CLASS(g_class); parent_class = G_OBJECT_CLASS(g_type_class_peek_parent(g_class)); g_type_class_add_private(g_class, sizeof(InfCommunicationRegistryPrivate)); object_class->dispose = inf_communication_registry_dispose; } GType inf_communication_registry_get_type(void) { static GType registry_type = 0; if(!registry_type) { static const GTypeInfo registry_type_info = { sizeof(InfCommunicationRegistryClass), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ inf_communication_registry_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InfCommunicationRegistry), /* instance_size */ 0, /* n_preallocs */ inf_communication_registry_init, /* instance_init */ NULL /* value_table */ }; registry_type = g_type_register_static( G_TYPE_OBJECT, "InfCommunicationRegistry", ®istry_type_info, 0 ); } return registry_type; } /* * Public API. */ /** * inf_communication_registry_register: * @registry: A #InfCommunicationRegistry. * @group: The group for which to register a connection. * @method: The #InfCommunicationMethod used. * @connection: The connection to register. * * Registers connection with @group. This allows sending messages to * @connection via inf_communication_registry_send(). For received messages, * inf_communication_method_received() is called on @method. * * @connection must have status %INF_XML_CONNECTION_OPEN. */ void inf_communication_registry_register(InfCommunicationRegistry* registry, InfCommunicationGroup* group, InfCommunicationMethod* method, InfXmlConnection* connection) { InfCommunicationRegistryPrivate* priv; InfCommunicationRegistryKey key; InfCommunicationRegistryEntry* entry; InfXmlConnectionStatus status; gchar* local_id; gchar* remote_id; g_return_if_fail(INF_COMMUNICATION_IS_REGISTRY(registry)); g_return_if_fail(INF_COMMUNICATION_IS_GROUP(group)); g_return_if_fail(INF_COMMUNICATION_IS_METHOD(method)); g_return_if_fail(INF_IS_XML_CONNECTION(connection)); g_object_get(G_OBJECT(connection), "status", &status, NULL); g_return_if_fail(status == INF_XML_CONNECTION_OPEN); priv = INF_COMMUNICATION_REGISTRY_PRIVATE(registry); key.connection = connection; key.publisher_id = inf_communication_group_get_publisher_id(group, connection); key.group_name = inf_communication_group_get_name(group); inf_communication_registry_add_connection(registry, connection); entry = g_hash_table_lookup(priv->entries, &key); if(entry != NULL) { /* Reactivation */ g_assert(entry->registered == FALSE); entry->registered = TRUE; } else { entry = g_slice_new(InfCommunicationRegistryEntry); entry->registry = registry; entry->key = key; g_object_get( G_OBJECT(connection), "remote-id", &remote_id, "local-id", &local_id, NULL ); if(strcmp(remote_id, key.publisher_id) == 0) entry->publisher_string = "you"; else if(strcmp(local_id, key.publisher_id) == 0) entry->publisher_string = NULL; /* "me" */ else entry->publisher_string = entry->key.publisher_id; g_free(remote_id); g_free(local_id); entry->group = group; entry->method = method; entry->inner_count = 0; entry->queue_begin = NULL; entry->queue_end = NULL; entry->registered = TRUE; entry->activation_count = 0; entry->enqueued_list = NULL; entry->sent_list = NULL; g_object_weak_ref( G_OBJECT(group), inf_communication_registry_group_unrefed, entry ); g_hash_table_insert(priv->entries, &entry->key, entry); } } /** * inf_communication_registry_unregister: * @registry: A #InfCommunicationRegistry. * @group: The group for which to unregister a connection. * @connection: The connection to unregister. * * Unregisters @connection from @group. Incoming messages are no longer * reported to group's method, and inf_communication_registry_send() can * no longer be called for @connection. */ void inf_communication_registry_unregister(InfCommunicationRegistry* registry, InfCommunicationGroup* group, InfXmlConnection* connection) { InfCommunicationRegistryPrivate* priv; InfCommunicationRegistryKey key; InfCommunicationRegistryEntry* entry; InfXmlConnectionStatus status; xmlNodePtr xml; g_return_if_fail(INF_COMMUNICATION_IS_REGISTRY(registry)); g_return_if_fail(INF_COMMUNICATION_IS_GROUP(group)); g_return_if_fail(INF_IS_XML_CONNECTION(connection)); g_object_get(G_OBJECT(connection), "status", &status, NULL); priv = INF_COMMUNICATION_REGISTRY_PRIVATE(registry); key.connection = connection; key.publisher_id = inf_communication_group_get_publisher_id(group, connection); key.group_name = inf_communication_group_get_name(group); entry = g_hash_table_lookup(priv->entries, &key); g_assert(entry != NULL && entry->registered == TRUE); if( (entry->queue_end != NULL || entry->inner_count > 0) && status != INF_XML_CONNECTION_CLOSING && status != INF_XML_CONNECTION_CLOSED) { /* The entry has still messages to send, so don't remove it right now * but wait until all scheduled messages have been sent. */ entry->registered = FALSE; entry->activation_count = entry->inner_count; for(xml = entry->queue_begin; xml != NULL; xml = xml->next) ++ entry->activation_count; g_assert(entry->activation_count > 0); /* Keep an additional reference on the connection as the connection will * be unregistered below. */ g_object_ref(connection); } else { /* No scheduled messages, remove entry */ g_hash_table_remove(priv->entries, &key); } g_free(key.publisher_id); inf_communication_registry_remove_connection(registry, connection); } /** * inf_communication_registry_is_registered: * @registry: A #InfCommunicationRegistry. * @group: The group for which to check whether @connection is registered. * @connection: The connection to check for registration. * * Returns whether @connection has been registered for @group with * inf_communication_registry_register(). * * Returns: %TRUE if @connection has been registered, or %FALSE otherwise. */ gboolean inf_communication_registry_is_registered(InfCommunicationRegistry* registry, InfCommunicationGroup* group, InfXmlConnection* connection) { InfCommunicationRegistryPrivate* priv; InfCommunicationRegistryKey key; InfCommunicationRegistryEntry* entry; g_return_val_if_fail(INF_COMMUNICATION_IS_REGISTRY(registry), FALSE); g_return_val_if_fail(INF_COMMUNICATION_IS_GROUP(group), FALSE); g_return_val_if_fail(INF_IS_XML_CONNECTION(connection), FALSE); priv = INF_COMMUNICATION_REGISTRY_PRIVATE(registry); key.connection = connection; key.publisher_id = inf_communication_group_get_publisher_id(group, connection); key.group_name = inf_communication_group_get_name(group); entry = g_hash_table_lookup(priv->entries, &key); g_free(key.publisher_id); return entry != NULL && entry->registered == TRUE; } /** * inf_communication_registry_send: * @registry: A #InfCommunicationRegistry. * @group: The group for which to send the message #InfCommunicationGroup. * @connection: A registered #InfXmlConnection. * @xml: The message to send. * * Sends an XML message to @connection. @connection must have been registered * with inf_communication_registry_register() before. If the message has been * sent, inf_communication_method_sent() is called on the method the * connection was registered with. inf_communication_method_enqueued() is * called when sending the message can no longer be cancelled via * inf_communication_registry_cancel_messages(). * * This function takes ownership of @xml. */ void inf_communication_registry_send(InfCommunicationRegistry* registry, InfCommunicationGroup* group, InfXmlConnection* connection, xmlNodePtr xml) { InfCommunicationRegistryPrivate* priv; InfCommunicationRegistryKey key; InfCommunicationRegistryEntry* entry; g_return_if_fail(INF_COMMUNICATION_IS_REGISTRY(registry)); g_return_if_fail(INF_COMMUNICATION_IS_GROUP(group)); g_return_if_fail(INF_IS_XML_CONNECTION(connection)); g_return_if_fail(xml != NULL); priv = INF_COMMUNICATION_REGISTRY_PRIVATE(registry); key.connection = connection; key.publisher_id = inf_communication_group_get_publisher_id(group, connection); key.group_name = inf_communication_group_get_name(group); entry = g_hash_table_lookup(priv->entries, &key); g_assert(entry != NULL && entry->registered == TRUE); xmlUnlinkNode(xml); if(entry->queue_end == NULL) { entry->queue_begin = xml; entry->queue_end = xml; } else { entry->queue_end->next = xml; entry->queue_end = xml; } /* If there is something in the inner queue, don't send directly but wait * until the message has been sent, for better packing. */ if(entry->inner_count == 0) { inf_communication_registry_send_real( entry, INF_COMMUNICATION_REGISTRY_INNER_QUEUE_LIMIT - entry->inner_count ); } g_free(key.publisher_id); } /** * inf_communication_registry_cancel_messages: * @registry: A #InfCommunicationRegistry. * @group: The group for which to cancel messages. * @connection: A registered #InfXmlConnection. * * Stops all messages scheduled to be sent to @connection in @group from being * sent. */ void inf_communication_registry_cancel_messages(InfCommunicationRegistry* registry, InfCommunicationGroup* group, InfXmlConnection* connection) { InfCommunicationRegistryPrivate* priv; InfCommunicationRegistryKey key; InfCommunicationRegistryEntry* entry; g_return_if_fail(INF_COMMUNICATION_IS_REGISTRY(registry)); g_return_if_fail(INF_COMMUNICATION_IS_GROUP(group)); g_return_if_fail(INF_IS_XML_CONNECTION(connection)); priv = INF_COMMUNICATION_REGISTRY_PRIVATE(registry); key.connection = connection; key.publisher_id = inf_communication_group_get_publisher_id(group, connection); key.group_name = inf_communication_group_get_name(group); entry = g_hash_table_lookup(priv->entries, &key); g_assert(entry != NULL && entry->registered == TRUE); /* TODO: Don't cancel messages prior activation? */ xmlFreeNodeList(entry->queue_begin); entry->queue_begin = NULL; entry->queue_end = NULL; g_free(key.publisher_id); } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/communication/inf-communication-group-private.h0000644000175000017500000000336212264763732024561 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_COMMUNICATION_GROUP_PRIVATE_H__ #define __INF_COMMUNICATION_GROUP_PRIVATE_H__ #include #include typedef void(*InfCommunicationGroupForeachFunc)(InfCommunicationMethod* meth, gpointer user_data); void _inf_communication_group_add_member(InfCommunicationGroup* group, InfXmlConnection* connection); void _inf_communication_group_remove_member(InfCommunicationGroup* group, InfXmlConnection* connection); void _inf_communication_group_foreach_method(InfCommunicationGroup* group, InfCommunicationGroupForeachFunc func, gpointer user_data); #endif /* __INF_COMMUNICATION_GROUP_PRIVATE_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/communication/inf-communication-central-factory.h0000644000175000017500000000543412264763732025054 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_COMMUNICATION_CENTRAL_FACTORY_H__ #define __INF_COMMUNICATION_CENTRAL_FACTORY_H__ #include #include G_BEGIN_DECLS #define INF_COMMUNICATION_TYPE_CENTRAL_FACTORY (inf_communication_central_factory_get_type()) #define INF_COMMUNICATION_CENTRAL_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INF_COMMUNICATION_TYPE_CENTRAL_FACTORY, InfCommunicationCentralFactory)) #define INF_COMMUNICATION_CENTRAL_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INF_COMMUNICATION_TYPE_CENTRAL_FACTORY, InfCommunicationCentralFactoryClass)) #define INF_COMMUNICATION_IS_CENTRAL_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INF_COMMUNICATION_TYPE_CENTRAL_FACTORY)) #define INF_COMMUNICATION_IS_CENTRAL_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INF_COMMUNICATION_TYPE_CENTRAL_FACTORY)) #define INF_COMMUNICATION_CENTRAL_FACTORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), INF_COMMUNICATION_TYPE_CENTRAL_FACTORY, InfCommunicationCentralFactoryClass)) typedef struct _InfCommunicationCentralFactory InfCommunicationCentralFactory; typedef struct _InfCommunicationCentralFactoryClass InfCommunicationCentralFactoryClass; /** * InfCommunicationCentralFactoryClass: * * This structure does not contain any public fields. */ struct _InfCommunicationCentralFactoryClass { /*< private >*/ GObjectClass parent; }; /** * InfCommunicationCentralFactory: * * #InfCommunicationCentralFactory is an opaque data type. You should only * access it * via the public API functions. */ struct _InfCommunicationCentralFactory { /*< private >*/ GObject parent_instance; }; GType inf_communication_central_factory_get_type(void) G_GNUC_CONST; InfCommunicationFactory* inf_communication_central_factory_get_default(void); G_END_DECLS #endif /* __INF_COMMUNICATION_CENTRAL_FACTORY_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/communication/inf-communication-group.h0000644000175000017500000001155612264763732023115 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_COMMUNICATION_GROUP_H__ #define __INF_COMMUNICATION_GROUP_H__ #include #include #include #include G_BEGIN_DECLS #define INF_COMMUNICATION_TYPE_GROUP (inf_communication_group_get_type()) #define INF_COMMUNICATION_GROUP(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INF_COMMUNICATION_TYPE_GROUP, InfCommunicationGroup)) #define INF_COMMUNICATION_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INF_COMMUNICATION_TYPE_GROUP, InfCommunicationGroupClass)) #define INF_COMMUNICATION_IS_GROUP(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INF_COMMUNICATION_TYPE_GROUP)) #define INF_COMMUNICATION_IS_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INF_COMMUNICATION_TYPE_GROUP)) #define INF_COMMUNICATION_GROUP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), INF_COMMUNICATION_TYPE_GROUP, InfCommunicationGroupClass)) typedef struct _InfCommunicationGroup InfCommunicationGroup; typedef struct _InfCommunicationGroupClass InfCommunicationGroupClass; /** * InfCommunicationGroupClass: * @member_added: Default signal handler of the * #InfCommunicationGroup::member-added signal. * @member_removed: Default signal handler of the * #InfCommunicationGroup::member-removed signal. * @get_method: Virtual function to determine the methods to use for the * group, in order of priority. * @get_publisher_id: Virtual function to obtain the ID of the publishing * host of this group. * * The virtual methods and default signal handlers of #InfCommunicationGroup. */ struct _InfCommunicationGroupClass { /*< private >*/ GObjectClass parent; /*< public >*/ /* Signals */ void (*member_added)(InfCommunicationGroup* group, InfXmlConnection* connection); void (*member_removed)(InfCommunicationGroup* group, InfXmlConnection* connection); /* Virtual functions */ /* TODO: Should this be const gchar* const* get_methods? */ const gchar* (*get_method)(InfCommunicationGroup* group, unsigned int index); gchar* (*get_publisher_id)(InfCommunicationGroup* group, InfXmlConnection* for_connection); }; /** * InfCommunicationGroup: * * #InfCommunicationGroup is an opaque data type. You should only access it * via the public API functions. */ struct _InfCommunicationGroup { /*< private >*/ GObject parent_instance; }; GType inf_communication_group_get_type(void) G_GNUC_CONST; const gchar* inf_communication_group_get_name(InfCommunicationGroup* group); InfCommunicationObject* inf_communication_group_get_target(InfCommunicationGroup* group); void inf_communication_group_set_target(InfCommunicationGroup* group, InfCommunicationObject* target); gboolean inf_communication_group_is_member(InfCommunicationGroup* group, InfXmlConnection* connection); void inf_communication_group_send_message(InfCommunicationGroup* group, InfXmlConnection* connection, xmlNodePtr xml); void inf_communication_group_send_group_message(InfCommunicationGroup* group, xmlNodePtr xml); void inf_communication_group_cancel_messages(InfCommunicationGroup* group, InfXmlConnection* connection); const gchar* inf_communication_group_get_method_for_network(InfCommunicationGroup* group, const gchar* network); const gchar* inf_communication_group_get_method_for_connection(InfCommunicationGroup* grp, InfXmlConnection* conn); gchar* inf_communication_group_get_publisher_id(InfCommunicationGroup* group, InfXmlConnection* for_connection); G_END_DECLS #endif /* __INF_COMMUNICATION_GROUP_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/communication/Makefile.in0000644000175000017500000011511512264766066020237 00000000000000# Makefile.in generated by automake 1.13.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = libinfinity/communication DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/mkinstalldirs $(top_srcdir)/depcomp \ $(libinfinity_communication_la_HEADERS) $(noinst_HEADERS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/libinfinity/inf-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libinfinity_communication_la_LIBADD = am_libinfinity_communication_la_OBJECTS = libinfinity_communication_la-inf-communication-central-factory.lo \ libinfinity_communication_la-inf-communication-central-method.lo \ libinfinity_communication_la-inf-communication-factory.lo \ libinfinity_communication_la-inf-communication-group.lo \ libinfinity_communication_la-inf-communication-hosted-group.lo \ libinfinity_communication_la-inf-communication-joined-group.lo \ libinfinity_communication_la-inf-communication-manager.lo \ libinfinity_communication_la-inf-communication-method.lo \ libinfinity_communication_la-inf-communication-object.lo \ libinfinity_communication_la-inf-communication-registry.lo libinfinity_communication_la_OBJECTS = \ $(am_libinfinity_communication_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -I$(top_builddir)/libinfinity 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) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libinfinity_communication_la_SOURCES) DIST_SOURCES = $(libinfinity_communication_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libinfinity_communication_ladir)" HEADERS = $(libinfinity_communication_la_HEADERS) $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBINFINITY_API_VERSION = @LIBINFINITY_API_VERSION@ LIBINFINITY_LIBTOOL_VERSION = @LIBINFINITY_LIBTOOL_VERSION@ LIBINFINITY_VERSION = @LIBINFINITY_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ avahi_CFLAGS = @avahi_CFLAGS@ avahi_LIBS = @avahi_LIBS@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gtk_requirement = @gtk_requirement@ gtk_version = @gtk_version@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infgtk_CFLAGS = @infgtk_CFLAGS@ infgtk_LIBS = @infgtk_LIBS@ infinity_CFLAGS = @infinity_CFLAGS@ infinity_LIBS = @infinity_LIBS@ infinoted_CFLAGS = @infinoted_CFLAGS@ infinoted_LIBS = @infinoted_LIBS@ infodir = @infodir@ inftext_CFLAGS = @inftext_CFLAGS@ inftext_LIBS = @inftext_LIBS@ inftextgtk_CFLAGS = @inftextgtk_CFLAGS@ inftextgtk_LIBS = @inftextgtk_LIBS@ install_sh = @install_sh@ libdaemon_CFLAGS = @libdaemon_CFLAGS@ libdaemon_LIBS = @libdaemon_LIBS@ 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@ libinfinity_communication_la_CPPFLAGS = \ -I$(top_srcdir) \ $(infinity_CFLAGS) \ $(avahi_CFLAGS) noinst_LTLIBRARIES = libinfinity_communication.la libinfinity_communication_ladir = \ $(includedir)/libinfinity-$(LIBINFINITY_API_VERSION)/libinfinity/communication libinfinity_communication_la_SOURCES = \ inf-communication-central-factory.c \ inf-communication-central-method.c \ inf-communication-factory.c \ inf-communication-group.c \ inf-communication-hosted-group.c \ inf-communication-joined-group.c \ inf-communication-manager.c \ inf-communication-method.c \ inf-communication-object.c \ inf-communication-registry.c libinfinity_communication_la_HEADERS = \ inf-communication-central-factory.h \ inf-communication-central-method.h \ inf-communication-factory.h \ inf-communication-group.h \ inf-communication-hosted-group.h \ inf-communication-joined-group.h \ inf-communication-manager.h \ inf-communication-method.h \ inf-communication-object.h \ inf-communication-registry.h noinst_HEADERS = \ inf-communication-group-private.h all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libinfinity/communication/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu libinfinity/communication/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libinfinity_communication.la: $(libinfinity_communication_la_OBJECTS) $(libinfinity_communication_la_DEPENDENCIES) $(EXTRA_libinfinity_communication_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libinfinity_communication_la_OBJECTS) $(libinfinity_communication_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_communication_la-inf-communication-central-factory.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_communication_la-inf-communication-central-method.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_communication_la-inf-communication-factory.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_communication_la-inf-communication-group.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_communication_la-inf-communication-hosted-group.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_communication_la-inf-communication-joined-group.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_communication_la-inf-communication-manager.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_communication_la-inf-communication-method.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_communication_la-inf-communication-object.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_communication_la-inf-communication-registry.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< libinfinity_communication_la-inf-communication-central-factory.lo: inf-communication-central-factory.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_communication_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_communication_la-inf-communication-central-factory.lo -MD -MP -MF $(DEPDIR)/libinfinity_communication_la-inf-communication-central-factory.Tpo -c -o libinfinity_communication_la-inf-communication-central-factory.lo `test -f 'inf-communication-central-factory.c' || echo '$(srcdir)/'`inf-communication-central-factory.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_communication_la-inf-communication-central-factory.Tpo $(DEPDIR)/libinfinity_communication_la-inf-communication-central-factory.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-communication-central-factory.c' object='libinfinity_communication_la-inf-communication-central-factory.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_communication_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_communication_la-inf-communication-central-factory.lo `test -f 'inf-communication-central-factory.c' || echo '$(srcdir)/'`inf-communication-central-factory.c libinfinity_communication_la-inf-communication-central-method.lo: inf-communication-central-method.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_communication_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_communication_la-inf-communication-central-method.lo -MD -MP -MF $(DEPDIR)/libinfinity_communication_la-inf-communication-central-method.Tpo -c -o libinfinity_communication_la-inf-communication-central-method.lo `test -f 'inf-communication-central-method.c' || echo '$(srcdir)/'`inf-communication-central-method.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_communication_la-inf-communication-central-method.Tpo $(DEPDIR)/libinfinity_communication_la-inf-communication-central-method.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-communication-central-method.c' object='libinfinity_communication_la-inf-communication-central-method.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_communication_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_communication_la-inf-communication-central-method.lo `test -f 'inf-communication-central-method.c' || echo '$(srcdir)/'`inf-communication-central-method.c libinfinity_communication_la-inf-communication-factory.lo: inf-communication-factory.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_communication_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_communication_la-inf-communication-factory.lo -MD -MP -MF $(DEPDIR)/libinfinity_communication_la-inf-communication-factory.Tpo -c -o libinfinity_communication_la-inf-communication-factory.lo `test -f 'inf-communication-factory.c' || echo '$(srcdir)/'`inf-communication-factory.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_communication_la-inf-communication-factory.Tpo $(DEPDIR)/libinfinity_communication_la-inf-communication-factory.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-communication-factory.c' object='libinfinity_communication_la-inf-communication-factory.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_communication_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_communication_la-inf-communication-factory.lo `test -f 'inf-communication-factory.c' || echo '$(srcdir)/'`inf-communication-factory.c libinfinity_communication_la-inf-communication-group.lo: inf-communication-group.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_communication_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_communication_la-inf-communication-group.lo -MD -MP -MF $(DEPDIR)/libinfinity_communication_la-inf-communication-group.Tpo -c -o libinfinity_communication_la-inf-communication-group.lo `test -f 'inf-communication-group.c' || echo '$(srcdir)/'`inf-communication-group.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_communication_la-inf-communication-group.Tpo $(DEPDIR)/libinfinity_communication_la-inf-communication-group.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-communication-group.c' object='libinfinity_communication_la-inf-communication-group.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_communication_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_communication_la-inf-communication-group.lo `test -f 'inf-communication-group.c' || echo '$(srcdir)/'`inf-communication-group.c libinfinity_communication_la-inf-communication-hosted-group.lo: inf-communication-hosted-group.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_communication_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_communication_la-inf-communication-hosted-group.lo -MD -MP -MF $(DEPDIR)/libinfinity_communication_la-inf-communication-hosted-group.Tpo -c -o libinfinity_communication_la-inf-communication-hosted-group.lo `test -f 'inf-communication-hosted-group.c' || echo '$(srcdir)/'`inf-communication-hosted-group.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_communication_la-inf-communication-hosted-group.Tpo $(DEPDIR)/libinfinity_communication_la-inf-communication-hosted-group.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-communication-hosted-group.c' object='libinfinity_communication_la-inf-communication-hosted-group.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_communication_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_communication_la-inf-communication-hosted-group.lo `test -f 'inf-communication-hosted-group.c' || echo '$(srcdir)/'`inf-communication-hosted-group.c libinfinity_communication_la-inf-communication-joined-group.lo: inf-communication-joined-group.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_communication_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_communication_la-inf-communication-joined-group.lo -MD -MP -MF $(DEPDIR)/libinfinity_communication_la-inf-communication-joined-group.Tpo -c -o libinfinity_communication_la-inf-communication-joined-group.lo `test -f 'inf-communication-joined-group.c' || echo '$(srcdir)/'`inf-communication-joined-group.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_communication_la-inf-communication-joined-group.Tpo $(DEPDIR)/libinfinity_communication_la-inf-communication-joined-group.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-communication-joined-group.c' object='libinfinity_communication_la-inf-communication-joined-group.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_communication_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_communication_la-inf-communication-joined-group.lo `test -f 'inf-communication-joined-group.c' || echo '$(srcdir)/'`inf-communication-joined-group.c libinfinity_communication_la-inf-communication-manager.lo: inf-communication-manager.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_communication_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_communication_la-inf-communication-manager.lo -MD -MP -MF $(DEPDIR)/libinfinity_communication_la-inf-communication-manager.Tpo -c -o libinfinity_communication_la-inf-communication-manager.lo `test -f 'inf-communication-manager.c' || echo '$(srcdir)/'`inf-communication-manager.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_communication_la-inf-communication-manager.Tpo $(DEPDIR)/libinfinity_communication_la-inf-communication-manager.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-communication-manager.c' object='libinfinity_communication_la-inf-communication-manager.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_communication_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_communication_la-inf-communication-manager.lo `test -f 'inf-communication-manager.c' || echo '$(srcdir)/'`inf-communication-manager.c libinfinity_communication_la-inf-communication-method.lo: inf-communication-method.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_communication_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_communication_la-inf-communication-method.lo -MD -MP -MF $(DEPDIR)/libinfinity_communication_la-inf-communication-method.Tpo -c -o libinfinity_communication_la-inf-communication-method.lo `test -f 'inf-communication-method.c' || echo '$(srcdir)/'`inf-communication-method.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_communication_la-inf-communication-method.Tpo $(DEPDIR)/libinfinity_communication_la-inf-communication-method.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-communication-method.c' object='libinfinity_communication_la-inf-communication-method.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_communication_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_communication_la-inf-communication-method.lo `test -f 'inf-communication-method.c' || echo '$(srcdir)/'`inf-communication-method.c libinfinity_communication_la-inf-communication-object.lo: inf-communication-object.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_communication_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_communication_la-inf-communication-object.lo -MD -MP -MF $(DEPDIR)/libinfinity_communication_la-inf-communication-object.Tpo -c -o libinfinity_communication_la-inf-communication-object.lo `test -f 'inf-communication-object.c' || echo '$(srcdir)/'`inf-communication-object.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_communication_la-inf-communication-object.Tpo $(DEPDIR)/libinfinity_communication_la-inf-communication-object.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-communication-object.c' object='libinfinity_communication_la-inf-communication-object.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_communication_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_communication_la-inf-communication-object.lo `test -f 'inf-communication-object.c' || echo '$(srcdir)/'`inf-communication-object.c libinfinity_communication_la-inf-communication-registry.lo: inf-communication-registry.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_communication_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_communication_la-inf-communication-registry.lo -MD -MP -MF $(DEPDIR)/libinfinity_communication_la-inf-communication-registry.Tpo -c -o libinfinity_communication_la-inf-communication-registry.lo `test -f 'inf-communication-registry.c' || echo '$(srcdir)/'`inf-communication-registry.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_communication_la-inf-communication-registry.Tpo $(DEPDIR)/libinfinity_communication_la-inf-communication-registry.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-communication-registry.c' object='libinfinity_communication_la-inf-communication-registry.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_communication_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_communication_la-inf-communication-registry.lo `test -f 'inf-communication-registry.c' || echo '$(srcdir)/'`inf-communication-registry.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-libinfinity_communication_laHEADERS: $(libinfinity_communication_la_HEADERS) @$(NORMAL_INSTALL) @list='$(libinfinity_communication_la_HEADERS)'; test -n "$(libinfinity_communication_ladir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(libinfinity_communication_ladir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libinfinity_communication_ladir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libinfinity_communication_ladir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(libinfinity_communication_ladir)" || exit $$?; \ done uninstall-libinfinity_communication_laHEADERS: @$(NORMAL_UNINSTALL) @list='$(libinfinity_communication_la_HEADERS)'; test -n "$(libinfinity_communication_ladir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(libinfinity_communication_ladir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libinfinity_communication_ladir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-libinfinity_communication_laHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libinfinity_communication_laHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-libinfinity_communication_laHEADERS \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-libinfinity_communication_laHEADERS # 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: libinfinity-0.5.5/libinfinity/communication/inf-communication-object.c0000644000175000017500000001570612264763732023223 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ /** * SECTION:inf-communication-object * @title: InfCommunicationObject * @short_description: Network message destinations * @see_also: #InfCommunicationManager * @include: libinfinity/communication/inf-communication-object.h * @stability: Unstable * * A #InfCommunicationObject is the destination of network messages sent * through the #InfCommunicationManager. Each #InfCommunicationGroup is * associated with #InfCommunicationObject. Requests received by that group * are reported to the #InfCommunicationObject by calling * inf_communication_object_received() on it. Messages sent to a member of * that group (via inf_communication_group_send_message()) are also reported * by calling inf_communication_object_sent(). **/ #include GType inf_communication_scope_get_type(void) { static GType scope_type = 0; if(!scope_type) { static const GEnumValue scope_values[] = { { INF_COMMUNICATION_SCOPE_PTP, "INF_COMMUNICATION_SCOPE_PTP", "ptp" }, { INF_COMMUNICATION_SCOPE_GROUP, "INF_COMMUNICATION_SCOPE_GROUP", "group", }, { 0, NULL, NULL } }; scope_type = g_enum_register_static( "InfCommunicationScope", scope_values ); } return scope_type; } GType inf_communication_object_get_type(void) { static GType communication_object_type = 0; if(!communication_object_type) { static const GTypeInfo communication_object_info = { sizeof(InfCommunicationObjectIface), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ NULL, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ 0, /* instance_size */ 0, /* n_preallocs */ NULL, /* instance_init */ NULL /* value_table */ }; communication_object_type = g_type_register_static( G_TYPE_INTERFACE, "InfCommunicationObject", &communication_object_info, 0 ); g_type_interface_add_prerequisite( communication_object_type, G_TYPE_OBJECT ); } return communication_object_type; } /** * inf_communication_object_received: * @object: A #InfCommunicationObject. * @conn: The #InfXmlConnection data was received from. * @node: The received data. * @error: Location to store error information, if any. * * This function is called when a #InfCommunicationManager received data from * @connection belonging to a group whose communication object is @object. * This function should process the incoming data. If it could not process it, * then it should set @error. * * It should return %INF_COMMUNICATION_SCOPE_GROUP if the message is allowed * to be forwarded to other group members. Since recipients of forwarded * messages don't see the original sender (but just the forwarding host), * forwarding arbitrary messages could lead to a security problem in the worst * case. * * For example, if, in central mode, a client sends an (invalid) * <add-node> request to the whole (InfDirectory) group, and the server * forwarded this to all clients, those clients would try to create a new node * although the server rejected the request. In decentral mode, this is not a * problem since all clients see where the message comes from, and can * themselves reject all messages not coming from the server. * * Return Value: %INF_COMMUNICATION_SCOPE_GROUP if the message is allowed to * be forwarded, %INF_COMMUNICATION_SCOPE_PTP if not. **/ InfCommunicationScope inf_communication_object_received(InfCommunicationObject* object, InfXmlConnection* conn, xmlNodePtr node, GError** error) { InfCommunicationObjectIface* iface; g_return_val_if_fail(INF_COMMUNICATION_IS_OBJECT(object), FALSE); /* temporarily commented-out: */ /*g_return_val_if_fail(INF_IS_XML_CONNECTION(conn), FALSE);*/ g_return_val_if_fail(node != NULL, FALSE); iface = INF_COMMUNICATION_OBJECT_GET_IFACE(object); if(iface->received != NULL) return (*iface->received)(object, conn, node, error); return FALSE; } /** * inf_communication_object_enqueued: * @object: A #InfCommunicationObject. * @conn: A #InfXmlConnection. * @node: The XML data. * * This function is called, when an XML message scheduled to be sent via * inf_communication_group_send_message() or * inf_communication_group_send_group_message() cannot be cancelled anymore, * because it was already passed to @conn. **/ void inf_communication_object_enqueued(InfCommunicationObject* object, InfXmlConnection* conn, xmlNodePtr node) { InfCommunicationObjectIface* iface; g_return_if_fail(INF_COMMUNICATION_IS_OBJECT(object)); g_return_if_fail(INF_IS_XML_CONNECTION(conn)); g_return_if_fail(node != NULL); iface = INF_COMMUNICATION_OBJECT_GET_IFACE(object); if(iface->enqueued != NULL) (*iface->enqueued)(object, conn, node); } /** * inf_communication_object_sent: * @object: A #InfCommunicationObject. * @conn: A #InfXmlConnection. * @node: The sent data. * * This function is called when a XML message sent via * inf_communication_group_send_message() or * inf_communication_group_send_group_message() has actually been sent out. **/ void inf_communication_object_sent(InfCommunicationObject* object, InfXmlConnection* conn, xmlNodePtr node) { InfCommunicationObjectIface* iface; g_return_if_fail(INF_COMMUNICATION_IS_OBJECT(object)); g_return_if_fail(INF_IS_XML_CONNECTION(conn)); g_return_if_fail(node != NULL); iface = INF_COMMUNICATION_OBJECT_GET_IFACE(object); if(iface->sent != NULL) (*iface->sent)(object, conn, node); } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/communication/inf-communication-manager.c0000644000175000017500000004102212264763732023355 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ /** * SECTION:inf-communication-manager * @title: InfCommunicationManager * @short_description: Handling multiple communication sessions * @include: libinfinity/communication/inf-communication-manager.h * @stability: Unstable * * #InfCommunicationManager manages multiple communication sessions * represented by #InfCommunicationGroup. A #InfCommunicationGroup provides an * easy way to send messages between group members, possibly sharing * connections with other groups handled by the same #InfCommunicationManager. **/ #include #include #include typedef struct _InfCommunicationManagerJoinedKey InfCommunicationManagerJoinedKey; struct _InfCommunicationManagerJoinedKey { /* We can uniquely identify joined groups by network, * publisher ID and group name. */ gchar* network; gchar* publisher_id; const gchar* group_name; }; typedef struct _InfCommunicationManagerPrivate InfCommunicationManagerPrivate; struct _InfCommunicationManagerPrivate { InfCommunicationRegistry* registry; GPtrArray* factories; GHashTable* hosted_groups; GHashTable* joined_groups; }; #define INF_COMMUNICATION_MANAGER_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), INF_COMMUNICATION_TYPE_MANAGER, InfCommunicationManagerPrivate)) static GObjectClass* parent_class; static void inf_communication_manager_joined_key_free(gpointer key_) { InfCommunicationManagerJoinedKey* key; key = (InfCommunicationManagerJoinedKey*)key_; g_free(key->network); g_free(key->publisher_id); g_slice_free(InfCommunicationManagerJoinedKey, key); } static int inf_communication_manager_joined_key_cmp(gconstpointer first, gconstpointer second) { const InfCommunicationManagerJoinedKey* first_key; const InfCommunicationManagerJoinedKey* second_key; int res; first_key = (const InfCommunicationManagerJoinedKey*)first; second_key = (const InfCommunicationManagerJoinedKey*)second; res = strcmp(first_key->group_name, second_key->group_name); if(res != 0) return res; res = strcmp(first_key->publisher_id, second_key->publisher_id); if(res != 0) return res; return strcmp(first_key->network, second_key->network); } static gboolean inf_communication_manager_joined_key_equal(gconstpointer first, gconstpointer second) { return inf_communication_manager_joined_key_cmp(first, second) == 0; } static guint inf_communication_manager_joined_key_hash(gconstpointer key_) { const InfCommunicationManagerJoinedKey* key; key = (const InfCommunicationManagerJoinedKey*)key_; /* TODO: Is this a good hash function? */ return g_str_hash(key->network) ^ g_str_hash(key->publisher_id) ^ g_str_hash(key->group_name); } static void inf_communication_manager_hosted_group_unrefed(gpointer data, GObject* where_the_object_was) { InfCommunicationManager* manager; InfCommunicationManagerPrivate* priv; GHashTableIter iter; gpointer value; manager = INF_COMMUNICATION_MANAGER(data); priv = INF_COMMUNICATION_MANAGER_PRIVATE(manager); g_hash_table_iter_init(&iter, priv->hosted_groups); /* We don't have the key here. If we had, then we could still not use it * because we wouldn't have the communication manager then. If we would * want to have both, we would need to dynamically allocate a structure * containing both, and also storing that somewhere to be able to * g_weak_unref in dispose() which is pretty much hassle. */ /* TODO: Let the groups strong-ref the manager, then dispose simply can't * run until all groups are freed. */ while(g_hash_table_iter_next(&iter, NULL, &value)) { if(value == where_the_object_was) { g_hash_table_iter_remove(&iter); break; } } } static void inf_communication_manager_joined_group_unrefed(gpointer data, GObject* where_the_object_was) { InfCommunicationManager* manager; InfCommunicationManagerPrivate* priv; GHashTableIter iter; gpointer value; manager = INF_COMMUNICATION_MANAGER(data); priv = INF_COMMUNICATION_MANAGER_PRIVATE(manager); g_hash_table_iter_init(&iter, priv->joined_groups); /* We don't have the key here. If we had, then we could still not use it * because we wouldn't have the communication manager then. If we would * want to have both, we would need to dynamically allocate a structure * containing both, and also storing that somewhere to be able to * g_weak_unref in dispose() which is pretty much hassle. */ /* TODO: Let the groups strong-ref the manager, then dispose simply can't * run until all groups are freed. */ while(g_hash_table_iter_next(&iter, NULL, &value)) { if(value == where_the_object_was) { g_hash_table_iter_remove(&iter); break; } } } /* * GObject overrides. */ static void inf_communication_manager_init(GTypeInstance* instance, gpointer g_class) { InfCommunicationManager* manager; InfCommunicationManagerPrivate* priv; manager = INF_COMMUNICATION_MANAGER(instance); priv = INF_COMMUNICATION_MANAGER_PRIVATE(manager); priv->registry = g_object_new(INF_COMMUNICATION_TYPE_REGISTRY, NULL); priv->factories = g_ptr_array_new(); priv->hosted_groups = g_hash_table_new(g_str_hash, g_str_equal); priv->joined_groups = g_hash_table_new_full( inf_communication_manager_joined_key_hash, inf_communication_manager_joined_key_equal, inf_communication_manager_joined_key_free, NULL ); /* We always support the "central" method. This is used as a fallback for * hosted groups. */ g_ptr_array_add( priv->factories, g_object_ref(inf_communication_central_factory_get_default()) ); } static void inf_communication_manager_dispose(GObject* object) { InfCommunicationManager* manager; InfCommunicationManagerPrivate* priv; manager = INF_COMMUNICATION_MANAGER(object); priv = INF_COMMUNICATION_MANAGER_PRIVATE(manager); /* TODO: weak unref the groups */ if(g_hash_table_size(priv->hosted_groups) > 0) { g_warning("Communication manager containing hosted groups was unrefed"); } if(g_hash_table_size(priv->joined_groups) > 0) { g_warning("Communication manager containing joined groups was unrefed"); } g_hash_table_unref(priv->hosted_groups); g_hash_table_unref(priv->joined_groups); g_ptr_array_foreach(priv->factories, (GFunc)g_object_unref, NULL); g_ptr_array_free(priv->factories, TRUE); if(priv->registry != NULL) { g_object_unref(priv->registry); priv->registry = NULL; } G_OBJECT_CLASS(parent_class)->dispose(object); } /* * GType registration. */ static void inf_communication_manager_class_init(gpointer g_class, gpointer class_data) { GObjectClass* object_class; object_class = G_OBJECT_CLASS(g_class); parent_class = G_OBJECT_CLASS(g_type_class_peek_parent(g_class)); g_type_class_add_private(g_class, sizeof(InfCommunicationManagerPrivate)); object_class->dispose = inf_communication_manager_dispose; } GType inf_communication_manager_get_type(void) { static GType manager_type = 0; if(!manager_type) { static const GTypeInfo manager_type_info = { sizeof(InfCommunicationManagerClass), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ inf_communication_manager_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InfCommunicationManager), /* instance_size */ 0, /* n_preallocs */ inf_communication_manager_init, /* instance_init */ NULL /* value_table */ }; manager_type = g_type_register_static( G_TYPE_OBJECT, "InfCommunicationManager", &manager_type_info, 0 ); } return manager_type; } /* * Public API. */ /** * inf_communication_manager_new: * * Creates a new #InfCommunicationManager. * * Returns: A new #InfCommunicationManager. */ InfCommunicationManager* inf_communication_manager_new(void) { return g_object_new(INF_COMMUNICATION_TYPE_MANAGER, NULL); } /** * inf_communication_manager_open_group: * @manager: A #InfCommunicationManager. * @group_name: A name for the new group. * @methods: Methods to support, or %NULL. * * Opens a new communication group published by the local host. @group_name * is an identifier for the group via which other hosts can join the group * using inf_communication_manager_join_group(). It needs to be unique among * all groups opened by the local host. * * @methods specifies what communication methods the group should use, in * order of priority. If a method is not supported for a given network, then * the next one in the array is tried. If none is supported, then the * "central" method will be used, which is guaranteed to be supported for * all networks. * * Returns: A #InfCommunicationHostedGroup. Free with g_object_unref() to * leave the group. */ InfCommunicationHostedGroup* inf_communication_manager_open_group(InfCommunicationManager* manager, const gchar* group_name, const gchar* const* methods) { InfCommunicationManagerPrivate* priv; InfCommunicationHostedGroup* group; const gchar* const* method; g_return_val_if_fail(INF_COMMUNICATION_IS_MANAGER(manager), NULL); g_return_val_if_fail(group_name != NULL, NULL); priv = INF_COMMUNICATION_MANAGER_PRIVATE(manager); g_return_val_if_fail( g_hash_table_lookup(priv->hosted_groups, group_name) == NULL, NULL ); group = g_object_new( INF_COMMUNICATION_TYPE_HOSTED_GROUP, "communication-manager", manager, "communication-registry", priv->registry, "name", group_name, NULL ); if(methods != NULL) { for(method = methods; *method != NULL; ++ method) inf_communication_hosted_group_add_method(group, *method); } g_hash_table_insert( priv->hosted_groups, *(gpointer*) (gpointer) &group_name, /* cast const away without warning */ group ); g_object_weak_ref( G_OBJECT(group), inf_communication_manager_hosted_group_unrefed, manager ); return group; } /** * inf_communication_manager_join_group: * @manager: A #InfCommunicationManager. * @group_name: The group to join. * @publisher_conn: A #InfXmlConnection to the publishing host. * @method: The communication method to use. * * Joins a communication group published by a remote host. @publisher_conn * needs to be a to the publishing host with status %INF_XML_CONNECTION_OPEN * or %INF_XML_CONNECTION_OPENING. @group_name specifies the name of the group * to join. * * @method specifies the communication method to use. It must match the * communication method the publisher has chosen for @publisher_conn's network * (see inf_communication_group_get_method_for_network()). The function * returns %NULL if @method is not supported (which means * inf_communication_manager_get_factory_for() for @publisher_conn's network * and @method returns %NULL). * * Returns: A new #InfCommunicationJoinedGroup, or %NULL. Free with * g_object_unref() to leave the group. */ InfCommunicationJoinedGroup* inf_communication_manager_join_group(InfCommunicationManager* manager, const gchar* group_name, InfXmlConnection* publisher_conn, const gchar* method) { InfCommunicationManagerPrivate* priv; InfCommunicationManagerJoinedKey* key; gchar* network; gchar* publisher_id; InfXmlConnectionStatus status; InfCommunicationJoinedGroup* group; g_return_val_if_fail(INF_COMMUNICATION_IS_MANAGER(manager), NULL); g_return_val_if_fail(group_name != NULL, NULL); g_return_val_if_fail(INF_IS_XML_CONNECTION(publisher_conn), NULL); g_return_val_if_fail(method != NULL, NULL); priv = INF_COMMUNICATION_MANAGER_PRIVATE(manager); g_object_get( G_OBJECT(publisher_conn), "network", &network, "remote-id", &publisher_id, "status", &status, NULL ); /* TODO: Do we need to support OPENING somewhere? I don't think it's a good * idea to do here. When we change this remember to change docs above. */ if(status == INF_XML_CONNECTION_CLOSING || status == INF_XML_CONNECTION_CLOSED) { g_free(network); g_free(publisher_id); g_return_val_if_reached(NULL); } key = g_slice_new(InfCommunicationManagerJoinedKey); key->network = network; key->publisher_id = publisher_id; key->group_name = group_name; group = g_hash_table_lookup(priv->joined_groups, key); if(group != NULL) { inf_communication_manager_joined_key_free(key); g_return_val_if_reached(NULL); } if(!inf_communication_manager_get_factory_for(manager, network, method)) { inf_communication_manager_joined_key_free(key); return NULL; /* ordinary failure for now */ } group = g_object_new( INF_COMMUNICATION_TYPE_JOINED_GROUP, "communication-manager", manager, "communication-registry", priv->registry, "name", group_name, "publisher", publisher_conn, "method", method, NULL ); key->group_name = inf_communication_group_get_name(INF_COMMUNICATION_GROUP(group)); g_hash_table_insert(priv->joined_groups, key, group); g_object_weak_ref( G_OBJECT(group), inf_communication_manager_joined_group_unrefed, manager ); return group; } /** * inf_communication_manager_add_factory: * @manager: A #InfCommunicationManager. * @factory: The #InfCommunicationFactory to add. * * Adds a new #InfCommunicationFactory to @manager. This makes @manager * support all method/network combinations that @factory supports. If multiple * added factories support the same combination, the one which was added first * will be used to instantiate the #InfCommunicationMethod. */ void inf_communication_manager_add_factory(InfCommunicationManager* manager, InfCommunicationFactory* factory) { InfCommunicationManagerPrivate* priv; g_return_if_fail(INF_COMMUNICATION_IS_MANAGER(manager)); g_return_if_fail(INF_COMMUNICATION_IS_FACTORY(factory)); priv = INF_COMMUNICATION_MANAGER_PRIVATE(manager); g_ptr_array_add(priv->factories, factory); g_object_ref(factory); } /** * inf_communication_manager_get_factory_for: * @manager: A #InfCommunicationManager. * @network: A network identifier. * @method_name: A method name. * * Returns the #InfCommunicationFactory that @manager will use to instantiate * a #InfCommunicationMethod for @method_name on @network, or %NULL if the * network/method combination is not supported. * * Returns: A #InfCommunicationFactory, or %NULL. */ InfCommunicationFactory* inf_communication_manager_get_factory_for(InfCommunicationManager* manager, const gchar* network, const gchar* method_name) { InfCommunicationManagerPrivate* priv; InfCommunicationFactory* factory; gboolean supported; guint i; g_return_val_if_fail(INF_COMMUNICATION_IS_MANAGER(manager), NULL); g_return_val_if_fail(network != NULL, NULL); g_return_val_if_fail(method_name != NULL, NULL); priv = INF_COMMUNICATION_MANAGER_PRIVATE(manager); for(i = 0; i < priv->factories->len; ++ i) { factory = g_ptr_array_index(priv->factories, i); supported = inf_communication_factory_supports_method( factory, network, method_name ); if(supported == TRUE) return factory; } return NULL; } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/communication/inf-communication-central-factory.c0000644000175000017500000001157612264763732025053 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ /** * SECTION:inf-communication-central-factory * @title: InfCommunicationCentralFactory * @short_description: Factory for #InfCommunicationCentralMethod methods * @include: libinfinity/communication/inf-communication-central-factory.h * @stability: Unstable * * #InfCommunicationCentralFactory implements #InfCommunicationFactory. It * supports the "central" method on all networks by instantiating * #InfCommunicationCentralMethod. **/ #include #include #include static GObjectClass* parent_class; static gboolean inf_communication_central_factory_supports_method(InfCommunicationFactory* fc, const gchar* network, const gchar* method_name) { return strcmp(method_name, "central") == 0; } static InfCommunicationMethod* inf_communication_central_factory_instantiate(InfCommunicationFactory* fc, const gchar* network, const gchar* method_name, InfCommunicationRegistry* reg, InfCommunicationGroup* group) { g_assert(strcmp(method_name, "central") == 0); return g_object_new( INF_COMMUNICATION_TYPE_CENTRAL_METHOD, "registry", reg, "group", group, NULL ); } /* * GType registration. */ static void inf_communication_central_factory_class_init(gpointer g_class, gpointer class_data) { parent_class = G_OBJECT_CLASS(g_type_class_peek_parent(g_class)); } static void inf_communication_central_factory_factory_init(gpointer g_iface, gpointer iface_data) { InfCommunicationFactoryIface* iface; iface = (InfCommunicationFactoryIface*)g_iface; iface->supports_method = inf_communication_central_factory_supports_method; iface->instantiate = inf_communication_central_factory_instantiate; } GType inf_communication_central_factory_get_type(void) { static GType central_factory_type = 0; if(!central_factory_type) { static const GTypeInfo central_factory_type_info = { sizeof(InfCommunicationCentralFactoryClass), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ inf_communication_central_factory_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InfCommunicationCentralFactory), /* instance_size */ 0, /* n_preallocs */ NULL, /* instance_init */ NULL /* value_table */ }; static const GInterfaceInfo factory_info = { inf_communication_central_factory_factory_init, NULL, NULL }; central_factory_type = g_type_register_static( G_TYPE_OBJECT, "InfCommunicationCentralFactory", ¢ral_factory_type_info, 0 ); g_type_add_interface_static( central_factory_type, INF_COMMUNICATION_TYPE_FACTORY, &factory_info ); } return central_factory_type; } /* * Public API */ /** * inf_communication_central_factory_get_default: * * Returns the default #InfCommunicationCentralFactory. * * Returns: A #InfCommunicationCentralFactory. It should not be unrefed or * freed. */ InfCommunicationFactory* inf_communication_central_factory_get_default(void) { /* TODO: Thread safety */ static InfCommunicationFactory* default_central_factory; if(default_central_factory == NULL) { default_central_factory = g_object_new(INF_COMMUNICATION_TYPE_CENTRAL_FACTORY, NULL); } return default_central_factory; } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/communication/inf-communication-central-method.c0000644000175000017500000004777312264763732024674 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ /** * SECTION:inf-communication-central-method * @title: InfCommunicationCentralMethod * @short_description: Relying group messages via the publisher * @include: libinfinity/communication/inf-communication-central-method.h * @stability: Unstable * * #InfCommunicationCentralMethod implements #InfCommunicationMethod by * relaying all messages via the group's publisher. If the connection to the * publisher is lost, so is the connection to all other group members. **/ #include #include #include #include #include typedef struct _InfCommunicationCentralMethodPrivate InfCommunicationCentralMethodPrivate; struct _InfCommunicationCentralMethodPrivate { InfCommunicationRegistry* registry; InfCommunicationGroup* group; gboolean is_publisher; /* Whether the local host is publisher of group */ GSList* connections; }; enum { PROP_0, /* construct only */ PROP_REGISTRY, PROP_GROUP }; #define INF_COMMUNICATION_CENTRAL_METHOD_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), INF_COMMUNICATION_TYPE_CENTRAL_METHOD, InfCommunicationCentralMethodPrivate)) static GObjectClass* parent_class; static void inf_communication_central_method_notify_status_cb(GObject* object, GParamSpec* pspec, gpointer user_data) { InfCommunicationCentralMethod* method; InfCommunicationCentralMethodPrivate* priv; InfXmlConnectionStatus status; method = INF_COMMUNICATION_CENTRAL_METHOD(user_data); priv = INF_COMMUNICATION_CENTRAL_METHOD_PRIVATE(method); g_object_get(object, "status", &status, NULL); switch(status) { case INF_XML_CONNECTION_CLOSED: case INF_XML_CONNECTION_CLOSING: g_object_ref(priv->group); inf_communication_method_remove_member( INF_COMMUNICATION_METHOD(method), INF_XML_CONNECTION(object) ); g_object_unref(priv->group); break; case INF_XML_CONNECTION_OPENING: break; case INF_XML_CONNECTION_OPEN: inf_communication_registry_register( priv->registry, priv->group, INF_COMMUNICATION_METHOD(method), INF_XML_CONNECTION(object) ); break; default: g_assert_not_reached(); break; } } static void inf_communication_central_method_add_member(InfCommunicationMethod* method, InfXmlConnection* connection) { InfCommunicationCentralMethodPrivate* priv; InfXmlConnectionStatus status; priv = INF_COMMUNICATION_CENTRAL_METHOD_PRIVATE(method); g_object_get(G_OBJECT(connection), "status", &status, NULL); g_assert(status != INF_XML_CONNECTION_CLOSING && status != INF_XML_CONNECTION_CLOSED); priv->connections = g_slist_prepend(priv->connections, connection); g_signal_connect( connection, "notify::status", G_CALLBACK(inf_communication_central_method_notify_status_cb), method ); if(status == INF_XML_CONNECTION_OPEN) { inf_communication_registry_register( priv->registry, priv->group, method, connection ); } } static void inf_communication_central_method_remove_member(InfCommunicationMethod* method, InfXmlConnection* connection) { InfCommunicationCentralMethodPrivate* priv; InfXmlConnectionStatus status; gboolean is_registered; priv = INF_COMMUNICATION_CENTRAL_METHOD_PRIVATE(method); g_object_get(G_OBJECT(connection), "status", &status, NULL); is_registered = inf_communication_registry_is_registered( priv->registry, priv->group, connection ); /* The connection might not be registered if it never was in * INF_XML_CONNECTION_OPEN status, but still is in * INF_XML_CONNECTION_OPENING, or changed from OPENING directly * to CLOSING or CLOSED. */ if(is_registered) { inf_communication_registry_unregister( priv->registry, priv->group, connection ); } inf_signal_handlers_disconnect_by_func( connection, G_CALLBACK(inf_communication_central_method_notify_status_cb), method ); priv->connections = g_slist_remove(priv->connections, connection); } static gboolean inf_communication_central_method_is_member(InfCommunicationMethod* method, InfXmlConnection* connection) { InfCommunicationCentralMethodPrivate* priv; priv = INF_COMMUNICATION_CENTRAL_METHOD_PRIVATE(method); if(g_slist_find(priv->connections, connection) == NULL) return FALSE; return TRUE; } static void inf_communication_central_method_send_single(InfCommunicationMethod* method, InfXmlConnection* connection, xmlNodePtr xml) { InfCommunicationCentralMethodPrivate* priv; priv = INF_COMMUNICATION_CENTRAL_METHOD_PRIVATE(method); inf_communication_registry_send( priv->registry, priv->group, connection, xml ); } static void inf_communication_central_method_send_all(InfCommunicationMethod* method, xmlNodePtr xml) { InfCommunicationCentralMethodPrivate* priv; InfCommunicationRegistry* registry; InfCommunicationGroup* group; GSList* connections; GSList* item; InfXmlConnection* connection; gboolean is_registered; priv = INF_COMMUNICATION_CENTRAL_METHOD_PRIVATE(method); /* Each of the inf_communication_registry_send() calls can do a callback * which might possibly screw up our connection list completely. So be safe * here by copying all relevant information on the stack. */ g_object_ref(method); registry = g_object_ref(priv->registry); group = g_object_ref(priv->group); connections = g_slist_copy(priv->connections); for(item = connections; item != NULL; item = item->next) g_object_ref(item->data); while(connections) { connection = INF_XML_CONNECTION(connections->data); /* A callback from a prior iteration might have unregistered the * connection. */ is_registered = inf_communication_registry_is_registered( registry, group, connection ); if(is_registered) { if(connections->next != NULL) { /* Keep ownership of XML if there might be more connections we should * send it to. */ inf_communication_registry_send( registry, group, connection, xmlCopyNode(xml, 1) ); } else { /* Pass ownership of XML if this is definitely the last connection * in the list. */ inf_communication_registry_send(registry, group, connection, xml); xml = NULL; } } g_object_unref(connection); connections = g_slist_delete_link(connections, connections); } g_object_unref(method); g_object_unref(registry); g_object_unref(group); if(xml != NULL) xmlFreeNode(xml); } static void inf_communication_central_method_cancel_messages(InfCommunicationMethod* meth, InfXmlConnection* connection) { InfCommunicationCentralMethodPrivate* priv; priv = INF_COMMUNICATION_CENTRAL_METHOD_PRIVATE(meth); inf_communication_registry_cancel_messages( priv->registry, priv->group, connection ); } static InfCommunicationScope inf_communication_central_method_received(InfCommunicationMethod* method, InfXmlConnection* connection, xmlNodePtr xml) { InfCommunicationCentralMethodPrivate* priv; InfCommunicationObject* target; GError* error; InfCommunicationScope scope; xmlBufferPtr buffer; xmlSaveCtxtPtr ctx; gchar* remote_id; gchar* publisher_id; GSList* item; priv = INF_COMMUNICATION_CENTRAL_METHOD_PRIVATE(method); error = NULL; target = inf_communication_group_get_target(priv->group); if(target != NULL) { scope = inf_communication_object_received( target, connection, xml, &error ); /* TODO: Find a better place to show this message, maybe in * InfCommunicationRegistry's received_cb. */ if(error != NULL) { buffer = xmlBufferCreate(); ctx = xmlSaveToBuffer(buffer, "UTF-8", XML_SAVE_FORMAT); xmlSaveTree(ctx, xml); xmlSaveClose(ctx); g_object_get(G_OBJECT(connection), "remote-id", &remote_id, NULL); publisher_id = inf_communication_group_get_publisher_id(priv->group, connection); g_warning( "Error in group \"%s\", publisher \"%s\" while processing a message " "from \"%s\":\n%s\n\nThe session might have lost consistency. The " "message was:\n\n%s\n\n", inf_communication_group_get_name(priv->group), publisher_id, remote_id, error->message, (const gchar*)xmlBufferContent(buffer) ); g_free(publisher_id); g_free(remote_id); g_error_free(error); xmlBufferFree(buffer); } if(priv->is_publisher && scope == INF_COMMUNICATION_SCOPE_GROUP) { for(item = priv->connections; item != NULL; item = item->next) { if(item->data != connection) { inf_communication_registry_send( priv->registry, priv->group, INF_XML_CONNECTION(item->data), xmlCopyNode(xml, 1) ); } } } return scope; } else { /* Without target we don't know what to do with the message, so better * don't relay. */ return INF_COMMUNICATION_SCOPE_PTP; } } static void inf_communication_central_method_enqueued(InfCommunicationMethod* method, InfXmlConnection* connection, xmlNodePtr xml) { InfCommunicationCentralMethodPrivate* priv; InfCommunicationObject* target; priv = INF_COMMUNICATION_CENTRAL_METHOD_PRIVATE(method); target = inf_communication_group_get_target(priv->group); if(target != NULL) inf_communication_object_enqueued(target, connection, xml); } static void inf_communication_central_method_sent(InfCommunicationMethod* method, InfXmlConnection* connection, xmlNodePtr xml) { InfCommunicationCentralMethodPrivate* priv; InfCommunicationObject* target; priv = INF_COMMUNICATION_CENTRAL_METHOD_PRIVATE(method); target = inf_communication_group_get_target(priv->group); if(target != NULL) inf_communication_object_sent(target, connection, xml); } /* Weakref handling. Both group and registry should never be unrefed before * the method is unrefed, but this can help debugging in case one of * them is. */ static void inf_communication_central_method_registry_unrefed(gpointer data, GObject* object) { InfCommunicationCentralMethod* method; InfCommunicationCentralMethodPrivate* priv; method = INF_COMMUNICATION_CENTRAL_METHOD(data); priv = INF_COMMUNICATION_CENTRAL_METHOD_PRIVATE(method); g_warning("A method's registry was unrefed before the method was unrefed"); priv->registry = NULL; } static void inf_communication_central_method_group_unrefed(gpointer data, GObject* where_the_object_was) { InfCommunicationCentralMethod* method; InfCommunicationCentralMethodPrivate* priv; method = INF_COMMUNICATION_CENTRAL_METHOD(data); priv = INF_COMMUNICATION_CENTRAL_METHOD_PRIVATE(method); g_warning("A method's group was unrefed before the method was unrefed"); priv->group = NULL; } static void inf_communication_central_method_set_registry(InfCommunicationCentralMethod* m, InfCommunicationRegistry* reg) { InfCommunicationCentralMethodPrivate* priv; priv = INF_COMMUNICATION_CENTRAL_METHOD_PRIVATE(m); if(priv->registry != NULL) { g_object_weak_unref( G_OBJECT(priv->registry), inf_communication_central_method_registry_unrefed, m ); } priv->registry = reg; if(reg != NULL) { g_object_weak_ref( G_OBJECT(reg), inf_communication_central_method_registry_unrefed, m ); } g_object_notify(G_OBJECT(m), "registry"); } static void inf_communication_central_method_set_group(InfCommunicationCentralMethod* m, InfCommunicationGroup* group) { InfCommunicationCentralMethodPrivate* priv; priv = INF_COMMUNICATION_CENTRAL_METHOD_PRIVATE(m); if(priv->group != NULL) { g_object_weak_unref( G_OBJECT(priv->group), inf_communication_central_method_group_unrefed, m ); priv->is_publisher = FALSE; } priv->group = group; if(group != NULL) { g_object_weak_ref( G_OBJECT(group), inf_communication_central_method_group_unrefed, m ); if(INF_COMMUNICATION_IS_HOSTED_GROUP(group)) priv->is_publisher = TRUE; else priv->is_publisher = FALSE; } g_object_notify(G_OBJECT(m), "group"); } /* * GObject overrides. */ static void inf_communication_central_method_init(GTypeInstance* instance, gpointer g_class) { InfCommunicationCentralMethod* method; InfCommunicationCentralMethodPrivate* priv; method = INF_COMMUNICATION_CENTRAL_METHOD(instance); priv = INF_COMMUNICATION_CENTRAL_METHOD_PRIVATE(method); priv->group = NULL; priv->registry = NULL; priv->is_publisher = FALSE; priv->connections = NULL; } static void inf_communication_central_method_dispose(GObject* object) { InfCommunicationCentralMethod* method; InfCommunicationCentralMethodPrivate* priv; method = INF_COMMUNICATION_CENTRAL_METHOD(object); priv = INF_COMMUNICATION_CENTRAL_METHOD_PRIVATE(method); while(priv->connections != NULL) { inf_communication_method_remove_member( INF_COMMUNICATION_METHOD(method), INF_XML_CONNECTION(priv->connections->data) ); } inf_communication_central_method_set_group(method, NULL); inf_communication_central_method_set_registry(method, NULL); G_OBJECT_CLASS(parent_class)->dispose(object); } static void inf_communication_central_method_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec) { InfCommunicationCentralMethod* method; InfCommunicationCentralMethodPrivate* priv; method = INF_COMMUNICATION_CENTRAL_METHOD(object); priv = INF_COMMUNICATION_CENTRAL_METHOD_PRIVATE(method); switch(prop_id) { case PROP_REGISTRY: g_assert(priv->registry == NULL); /* construct only */ inf_communication_central_method_set_registry( method, INF_COMMUNICATION_REGISTRY(g_value_get_object(value)) ); break; case PROP_GROUP: g_assert(priv->group == NULL); /* construct only */ inf_communication_central_method_set_group( method, INF_COMMUNICATION_GROUP(g_value_get_object(value)) ); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void inf_communication_central_method_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec) { InfCommunicationCentralMethod* method; InfCommunicationCentralMethodPrivate* priv; method = INF_COMMUNICATION_CENTRAL_METHOD(object); priv = INF_COMMUNICATION_CENTRAL_METHOD_PRIVATE(method); switch(prop_id) { case PROP_REGISTRY: g_value_set_object(value, priv->registry); break; case PROP_GROUP: g_value_set_object(value, priv->group); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } /* * GType registration. */ static void inf_communication_central_method_class_init(gpointer g_class, gpointer class_data) { GObjectClass* object_class; object_class = G_OBJECT_CLASS(g_class); parent_class = G_OBJECT_CLASS(g_type_class_peek_parent(g_class)); g_type_class_add_private( g_class, sizeof(InfCommunicationCentralMethodPrivate) ); object_class->dispose = inf_communication_central_method_dispose; object_class->set_property = inf_communication_central_method_set_property; object_class->get_property = inf_communication_central_method_get_property; g_object_class_install_property( object_class, PROP_REGISTRY, g_param_spec_object( "registry", "Registry", "The communication registry to register connections with", INF_COMMUNICATION_TYPE_REGISTRY, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); g_object_class_install_property( object_class, PROP_GROUP, g_param_spec_object( "group", "Group", "The communication group for which to handle messages", INF_COMMUNICATION_TYPE_GROUP, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); } static void inf_communication_central_method_method_init(gpointer g_iface, gpointer iface_data) { InfCommunicationMethodIface* iface; iface = (InfCommunicationMethodIface*)g_iface; iface->add_member = inf_communication_central_method_add_member; iface->remove_member = inf_communication_central_method_remove_member; iface->is_member = inf_communication_central_method_is_member; iface->send_single = inf_communication_central_method_send_single; iface->send_all = inf_communication_central_method_send_all; iface->cancel_messages = inf_communication_central_method_cancel_messages; iface->received = inf_communication_central_method_received; iface->enqueued = inf_communication_central_method_enqueued; iface->sent = inf_communication_central_method_sent; } GType inf_communication_central_method_get_type(void) { static GType central_method_type = 0; if(!central_method_type) { static const GTypeInfo central_method_type_info = { sizeof(InfCommunicationCentralMethodClass), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ inf_communication_central_method_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InfCommunicationCentralMethod), /* instance_size */ 0, /* n_preallocs */ inf_communication_central_method_init, /* instance_init */ NULL /* value_table */ }; static const GInterfaceInfo method_info = { inf_communication_central_method_method_init, NULL, NULL }; central_method_type = g_type_register_static( G_TYPE_OBJECT, "InfCommunicationCentralMethod", ¢ral_method_type_info, 0 ); g_type_add_interface_static( central_method_type, INF_COMMUNICATION_TYPE_METHOD, &method_info ); } return central_method_type; } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/communication/inf-communication-object.h0000644000175000017500000001036412264763732023223 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_COMMUNICATION_OBJECT_H__ #define __INF_COMMUNICATION_OBJECT_H__ #include #include #include G_BEGIN_DECLS #define INF_COMMUNICATION_TYPE_OBJECT (inf_communication_object_get_type()) #define INF_COMMUNICATION_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INF_COMMUNICATION_TYPE_OBJECT, InfCommunicationObject)) #define INF_COMMUNICATION_IS_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INF_COMMUNICATION_TYPE_OBJECT)) #define INF_COMMUNICATION_OBJECT_GET_IFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE((inst), INF_COMMUNICATION_TYPE_OBJECT, InfCommunicationObjectIface)) #define INF_COMMUNICATION_TYPE_SCOPE (inf_communication_scope_get_type()) /** * InfCommunicationScope: * @INF_COMMUNICATION_SCOPE_PTP: The message is sent from one group member to * another. * @INF_COMMUNICATION_SCOPE_GROUP: The message is sent to all group members. * * #InfCommunicationScope specifies to which hosts a message belongs. */ typedef enum _InfCommunicationScope { INF_COMMUNICATION_SCOPE_PTP, INF_COMMUNICATION_SCOPE_GROUP } InfCommunicationScope; /** * InfCommunicationObject: * * #InfCommunicationObject is an opaque data type. You should only access it * via the public API functions. */ typedef struct _InfCommunicationObject InfCommunicationObject; typedef struct _InfCommunicationObjectIface InfCommunicationObjectIface; /** * InfCommunicationObjectIface: * @received: Called when a message for the group related to this * #InfCommunicationObject was received. * @enqueued: Called when a message to be sent to another group member has * been enqueued, which means sending it can no longer be cancelled via * inf_communication_group_cancel_messages(). * @sent: Called when a message has been sent to another group member of the * group related no this #InfCommunicationObject. * * The virtual methods of #InfCommunicationObject. These are called by the * #InfCommunicationMethod when appropriate. */ struct _InfCommunicationObjectIface { /*< private >*/ GTypeInterface parent; /*< public >*/ InfCommunicationScope (*received)(InfCommunicationObject* object, InfXmlConnection* conn, xmlNodePtr node, GError** error); void (*enqueued)(InfCommunicationObject* object, InfXmlConnection* conn, xmlNodePtr node); void (*sent)(InfCommunicationObject* object, InfXmlConnection* conn, xmlNodePtr node); }; GType inf_communication_scope_get_type(void) G_GNUC_CONST; GType inf_communication_object_get_type(void) G_GNUC_CONST; InfCommunicationScope inf_communication_object_received(InfCommunicationObject* object, InfXmlConnection* conn, xmlNodePtr node, GError** error); void inf_communication_object_enqueued(InfCommunicationObject* object, InfXmlConnection* conn, xmlNodePtr node); void inf_communication_object_sent(InfCommunicationObject* object, InfXmlConnection* conn, xmlNodePtr node); G_END_DECLS #endif /* __INF_COMMUNICATION_OBJECT_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/communication/inf-communication-joined-group.h0000644000175000017500000000562312264763732024361 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_COMMUNICATION_JOINED_GROUP_H__ #define __INF_COMMUNICATION_JOINED_GROUP_H__ #include #include G_BEGIN_DECLS #define INF_COMMUNICATION_TYPE_JOINED_GROUP (inf_communication_joined_group_get_type()) #define INF_COMMUNICATION_JOINED_GROUP(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INF_COMMUNICATION_TYPE_JOINED_GROUP, InfCommunicationJoinedGroup)) #define INF_COMMUNICATION_JOINED_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INF_COMMUNICATION_TYPE_JOINED_GROUP, InfCommunicationJoinedGroupClass)) #define INF_COMMUNICATION_IS_JOINED_GROUP(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INF_COMMUNICATION_TYPE_JOINED_GROUP)) #define INF_COMMUNICATION_IS_JOINED_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INF_COMMUNICATION_TYPE_JOINED_GROUP)) #define INF_COMMUNICATION_JOINED_GROUP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), INF_COMMUNICATION_TYPE_JOINED_GROUP, InfCommunicationJoinedGroupClass)) typedef struct _InfCommunicationJoinedGroup InfCommunicationJoinedGroup; typedef struct _InfCommunicationJoinedGroupClass InfCommunicationJoinedGroupClass; /** * InfCommunicationJoinedGroupClass: * * This structure does not contain any public fields. */ struct _InfCommunicationJoinedGroupClass { /*< private >*/ InfCommunicationGroupClass parent; }; /** * InfCommunicationJoinedGroup: * * #InfCommunicationJoinedGroup is an opaque data type. You should only * access it via the public API functions. */ struct _InfCommunicationJoinedGroup { /*< private >*/ InfCommunicationGroup parent_instance; }; GType inf_communication_joined_group_get_type(void) G_GNUC_CONST; void inf_communication_joined_group_remove_member(InfCommunicationJoinedGroup* grp, InfXmlConnection* connection); InfXmlConnection* inf_communication_joined_group_get_publisher(InfCommunicationJoinedGroup* g); G_END_DECLS #endif /* __INF_COMMUNICATION_JOINED_GROUP_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/communication/inf-communication-central-method.h0000644000175000017500000000515712264763732024667 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_COMMUNICATION_CENTRAL_METHOD_H__ #define __INF_COMMUNICATION_CENTRAL_METHOD_H__ #include G_BEGIN_DECLS #define INF_COMMUNICATION_TYPE_CENTRAL_METHOD (inf_communication_central_method_get_type()) #define INF_COMMUNICATION_CENTRAL_METHOD(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INF_COMMUNICATION_TYPE_CENTRAL_METHOD, InfCommunicationCentralMethod)) #define INF_COMMUNICATION_CENTRAL_METHOD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INF_COMMUNICATION_TYPE_CENTRAL_METHOD, InfCommunicationCentralMethodClass)) #define INF_COMMUNICATION_IS_CENTRAL_METHOD(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INF_COMMUNICATION_TYPE_CENTRAL_METHOD)) #define INF_COMMUNICATION_IS_CENTRAL_METHOD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INF_COMMUNICATION_TYPE_CENTRAL_METHOD)) #define INF_COMMUNICATION_CENTRAL_METHOD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), INF_COMMUNICATION_TYPE_CENTRAL_METHOD, InfCommunicationCentralMethodClass)) typedef struct _InfCommunicationCentralMethod InfCommunicationCentralMethod; typedef struct _InfCommunicationCentralMethodClass InfCommunicationCentralMethodClass; /** * InfCommunicationCentralMethodClass: * * This structure does not contain any public fields. */ struct _InfCommunicationCentralMethodClass { /*< private >*/ GObjectClass parent; }; /** * InfCommunicationCentralMethod: * * #InfCommunicationCentralMethod is an opaque data type. You should only * access it * via the public API functions. */ struct _InfCommunicationCentralMethod { /*< private >*/ GObject parent_instance; }; GType inf_communication_central_method_get_type(void) G_GNUC_CONST; G_END_DECLS #endif /* __INF_COMMUNICATION_CENTRAL_METHOD_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/communication/inf-communication-registry.h0000644000175000017500000000740412264763732023626 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_COMMUNICATION_REGISTRY_H__ #define __INF_COMMUNICATION_REGISTRY_H__ #include #include #include G_BEGIN_DECLS #define INF_COMMUNICATION_TYPE_REGISTRY (inf_communication_registry_get_type()) #define INF_COMMUNICATION_REGISTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INF_COMMUNICATION_TYPE_REGISTRY, InfCommunicationRegistry)) #define INF_COMMUNICATION_REGISTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INF_COMMUNICATION_TYPE_REGISTRY, InfCommunicationRegistryClass)) #define INF_COMMUNICATION_IS_REGISTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INF_COMMUNICATION_TYPE_REGISTRY)) #define INF_COMMUNICATION_IS_REGISTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INF_COMMUNICATION_TYPE_REGISTRY)) #define INF_COMMUNICATION_REGISTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), INF_COMMUNICATION_TYPE_REGISTRY, InfCommunicationRegistryClass)) typedef struct _InfCommunicationRegistry InfCommunicationRegistry; typedef struct _InfCommunicationRegistryClass InfCommunicationRegistryClass; /** * InfCommunicationRegistryClass: * * This structure does not contain any public fields. */ struct _InfCommunicationRegistryClass { /*< private >*/ GObjectClass parent; }; /** * InfCommunicationRegistry: * * #InfCommunicationRegistry is an opaque data type. You should only access it * via the public API functions. */ struct _InfCommunicationRegistry { /*< private >*/ GObject parent_instance; }; GType inf_communication_registry_get_type(void) G_GNUC_CONST; void inf_communication_registry_register(InfCommunicationRegistry* registry, InfCommunicationGroup* group, InfCommunicationMethod* method, InfXmlConnection* connection); void inf_communication_registry_unregister(InfCommunicationRegistry* registry, InfCommunicationGroup* group, InfXmlConnection* connection); gboolean inf_communication_registry_is_registered(InfCommunicationRegistry* registry, InfCommunicationGroup* group, InfXmlConnection* connection); void inf_communication_registry_send(InfCommunicationRegistry* registry, InfCommunicationGroup* group, InfXmlConnection* connection, xmlNodePtr xml); void inf_communication_registry_cancel_messages(InfCommunicationRegistry* registry, InfCommunicationGroup* group, InfXmlConnection* connection); G_END_DECLS #endif /* __INF_COMMUNICATION_REGISTRY_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/communication/inf-communication-manager.h0000644000175000017500000000723412264763732023371 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_COMMUNICATION_MANAGER_H__ #define __INF_COMMUNICATION_MANAGER_H__ #include #include #include #include G_BEGIN_DECLS #define INF_COMMUNICATION_TYPE_MANAGER (inf_communication_manager_get_type()) #define INF_COMMUNICATION_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INF_COMMUNICATION_TYPE_MANAGER, InfCommunicationManager)) #define INF_COMMUNICATION_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INF_COMMUNICATION_TYPE_MANAGER, InfCommunicationManagerClass)) #define INF_COMMUNICATION_IS_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INF_COMMUNICATION_TYPE_MANAGER)) #define INF_COMMUNICATION_IS_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INF_COMMUNICATION_TYPE_MANAGER)) #define INF_COMMUNICATION_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), INF_COMMUNICATION_TYPE_MANAGER, InfCommunicationManagerClass)) typedef struct _InfCommunicationManager InfCommunicationManager; typedef struct _InfCommunicationManagerClass InfCommunicationManagerClass; /** * InfCommunicationManagerClass: * * This structure does not contain any public fields. */ struct _InfCommunicationManagerClass { /*< private >*/ GObjectClass parent; }; /** * InfCommunicationManager: * * #InfCommunicationManager is an opaque data type. You should only access it * via the public API functions. */ struct _InfCommunicationManager { /*< private >*/ GObject parent_instance; }; GType inf_communication_manager_get_type(void) G_GNUC_CONST; InfCommunicationManager* inf_communication_manager_new(void); InfCommunicationHostedGroup* inf_communication_manager_open_group(InfCommunicationManager* manager, const gchar* group_name, /* methods[0] primary, others fallback */ const gchar* const* methods); InfCommunicationJoinedGroup* inf_communication_manager_join_group(InfCommunicationManager* manager, const gchar* group_name, InfXmlConnection* publisher_conn, const gchar* method); void inf_communication_manager_add_factory(InfCommunicationManager* manager, InfCommunicationFactory* factory); InfCommunicationFactory* inf_communication_manager_get_factory_for(InfCommunicationManager* manager, const gchar* network, const gchar* method_name); G_END_DECLS #endif /* __INF_COMMUNICATION_MANAGER_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/Makefile.in0000644000175000017500000010317212264766065015371 00000000000000# Makefile.in generated by automake 1.13.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = libinfinity DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(srcdir)/inf-config.h.in $(top_srcdir)/mkinstalldirs \ $(top_srcdir)/depcomp $(libinfinity_0_5_la_HEADERS) \ $(noinst_HEADERS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h inf-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" \ "$(DESTDIR)$(libinfinity_0_5_ladir)" LTLIBRARIES = $(lib_LTLIBRARIES) am__DEPENDENCIES_1 = libinfinity_0_5_la_DEPENDENCIES = server/libinfinity_server.la \ client/libinfinity_client.la adopted/libinfinity_adopted.la \ common/libinfinity_common.la \ communication/libinfinity_communication.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_libinfinity_0_5_la_OBJECTS = libinfinity_0_5_la-inf-dll.lo \ libinfinity_0_5_la-inf-i18n.lo \ libinfinity_0_5_la-inf-marshal.lo \ libinfinity_0_5_la-inf-signals.lo libinfinity_0_5_la_OBJECTS = $(am_libinfinity_0_5_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libinfinity_0_5_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(libinfinity_0_5_la_LDFLAGS) \ $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libinfinity_0_5_la_SOURCES) DIST_SOURCES = $(libinfinity_0_5_la_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(libinfinity_0_5_la_HEADERS) $(noinst_HEADERS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ $(LISP)inf-config.h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBINFINITY_API_VERSION = @LIBINFINITY_API_VERSION@ LIBINFINITY_LIBTOOL_VERSION = @LIBINFINITY_LIBTOOL_VERSION@ LIBINFINITY_VERSION = @LIBINFINITY_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ avahi_CFLAGS = @avahi_CFLAGS@ avahi_LIBS = @avahi_LIBS@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gtk_requirement = @gtk_requirement@ gtk_version = @gtk_version@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infgtk_CFLAGS = @infgtk_CFLAGS@ infgtk_LIBS = @infgtk_LIBS@ infinity_CFLAGS = @infinity_CFLAGS@ infinity_LIBS = @infinity_LIBS@ infinoted_CFLAGS = @infinoted_CFLAGS@ infinoted_LIBS = @infinoted_LIBS@ infodir = @infodir@ inftext_CFLAGS = @inftext_CFLAGS@ inftext_LIBS = @inftext_LIBS@ inftextgtk_CFLAGS = @inftextgtk_CFLAGS@ inftextgtk_LIBS = @inftextgtk_LIBS@ install_sh = @install_sh@ libdaemon_CFLAGS = @libdaemon_CFLAGS@ libdaemon_LIBS = @libdaemon_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = communication common adopted server client . # TODO: Find a way to have the version number set automatically. lib_LTLIBRARIES = libinfinity-0.5.la libinfinity_0_5_la_CPPFLAGS = \ -I$(top_srcdir) \ $(infinity_CFLAGS) libinfinity_0_5_la_LDFLAGS = \ -no-undefined \ -version-info $(LIBINFINITY_LIBTOOL_VERSION) libinfinity_0_5_la_LIBADD = \ server/libinfinity_server.la \ client/libinfinity_client.la \ adopted/libinfinity_adopted.la \ common/libinfinity_common.la \ communication/libinfinity_communication.la \ $(infinity_LIBS) \ $(glib_LIBS) \ $(avahi_LIBS) BUILT_SOURCES = inf-marshal.h inf-marshal.c CLEANFILES = inf-marshal.h inf-marshal.c libinfinity_0_5_ladir = \ $(includedir)/libinfinity-$(LIBINFINITY_API_VERSION)/libinfinity libinfinity_0_5_la_HEADERS = \ inf-config.h noinst_HEADERS = \ inf-dll.h \ inf-i18n.h \ inf-marshal.h \ inf-signals.h libinfinity_0_5_la_SOURCES = \ inf-dll.c \ inf-i18n.c \ inf-marshal.c \ inf-signals.c EXTRA_DIST = inf-marshal.in all: $(BUILT_SOURCES) inf-config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libinfinity/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu libinfinity/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): inf-config.h: stamp-h2 @if test ! -f $@; then rm -f stamp-h2; else :; fi @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h2; else :; fi stamp-h2: $(srcdir)/inf-config.h.in $(top_builddir)/config.status @rm -f stamp-h2 cd $(top_builddir) && $(SHELL) ./config.status libinfinity/inf-config.h distclean-hdr: -rm -f inf-config.h stamp-h2 install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libinfinity-0.5.la: $(libinfinity_0_5_la_OBJECTS) $(libinfinity_0_5_la_DEPENDENCIES) $(EXTRA_libinfinity_0_5_la_DEPENDENCIES) $(AM_V_CCLD)$(libinfinity_0_5_la_LINK) -rpath $(libdir) $(libinfinity_0_5_la_OBJECTS) $(libinfinity_0_5_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_0_5_la-inf-dll.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_0_5_la-inf-i18n.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_0_5_la-inf-marshal.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_0_5_la-inf-signals.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< libinfinity_0_5_la-inf-dll.lo: inf-dll.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_0_5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_0_5_la-inf-dll.lo -MD -MP -MF $(DEPDIR)/libinfinity_0_5_la-inf-dll.Tpo -c -o libinfinity_0_5_la-inf-dll.lo `test -f 'inf-dll.c' || echo '$(srcdir)/'`inf-dll.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_0_5_la-inf-dll.Tpo $(DEPDIR)/libinfinity_0_5_la-inf-dll.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-dll.c' object='libinfinity_0_5_la-inf-dll.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_0_5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_0_5_la-inf-dll.lo `test -f 'inf-dll.c' || echo '$(srcdir)/'`inf-dll.c libinfinity_0_5_la-inf-i18n.lo: inf-i18n.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_0_5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_0_5_la-inf-i18n.lo -MD -MP -MF $(DEPDIR)/libinfinity_0_5_la-inf-i18n.Tpo -c -o libinfinity_0_5_la-inf-i18n.lo `test -f 'inf-i18n.c' || echo '$(srcdir)/'`inf-i18n.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_0_5_la-inf-i18n.Tpo $(DEPDIR)/libinfinity_0_5_la-inf-i18n.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-i18n.c' object='libinfinity_0_5_la-inf-i18n.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_0_5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_0_5_la-inf-i18n.lo `test -f 'inf-i18n.c' || echo '$(srcdir)/'`inf-i18n.c libinfinity_0_5_la-inf-marshal.lo: inf-marshal.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_0_5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_0_5_la-inf-marshal.lo -MD -MP -MF $(DEPDIR)/libinfinity_0_5_la-inf-marshal.Tpo -c -o libinfinity_0_5_la-inf-marshal.lo `test -f 'inf-marshal.c' || echo '$(srcdir)/'`inf-marshal.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_0_5_la-inf-marshal.Tpo $(DEPDIR)/libinfinity_0_5_la-inf-marshal.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-marshal.c' object='libinfinity_0_5_la-inf-marshal.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_0_5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_0_5_la-inf-marshal.lo `test -f 'inf-marshal.c' || echo '$(srcdir)/'`inf-marshal.c libinfinity_0_5_la-inf-signals.lo: inf-signals.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_0_5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_0_5_la-inf-signals.lo -MD -MP -MF $(DEPDIR)/libinfinity_0_5_la-inf-signals.Tpo -c -o libinfinity_0_5_la-inf-signals.lo `test -f 'inf-signals.c' || echo '$(srcdir)/'`inf-signals.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_0_5_la-inf-signals.Tpo $(DEPDIR)/libinfinity_0_5_la-inf-signals.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-signals.c' object='libinfinity_0_5_la-inf-signals.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_0_5_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_0_5_la-inf-signals.lo `test -f 'inf-signals.c' || echo '$(srcdir)/'`inf-signals.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-libinfinity_0_5_laHEADERS: $(libinfinity_0_5_la_HEADERS) @$(NORMAL_INSTALL) @list='$(libinfinity_0_5_la_HEADERS)'; test -n "$(libinfinity_0_5_ladir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(libinfinity_0_5_ladir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libinfinity_0_5_ladir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libinfinity_0_5_ladir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(libinfinity_0_5_ladir)" || exit $$?; \ done uninstall-libinfinity_0_5_laHEADERS: @$(NORMAL_UNINSTALL) @list='$(libinfinity_0_5_la_HEADERS)'; test -n "$(libinfinity_0_5_ladir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(libinfinity_0_5_ladir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-recursive all-am: Makefile $(LTLIBRARIES) $(HEADERS) inf-config.h installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(libinfinity_0_5_ladir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done 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: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -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 clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile 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-libinfinity_0_5_laHEADERS install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-libLTLIBRARIES 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 -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-libLTLIBRARIES \ uninstall-libinfinity_0_5_laHEADERS .MAKE: $(am__recursive_targets) all check install install-am \ install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libLTLIBRARIES \ clean-libtool cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-hdr \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-libLTLIBRARIES \ install-libinfinity_0_5_laHEADERS 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-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ uninstall-libLTLIBRARIES uninstall-libinfinity_0_5_laHEADERS inf-marshal.h: inf-marshal.in glib-genmarshal --header --prefix=inf_marshal $< > $@ # rewrite the output to avoid a warning for casting gpointer to a function # pointer type inf-marshal.c: inf-marshal.in echo '#include ' > $@ glib-genmarshal --body --prefix=inf_marshal $< | perl -pe 's/^ callback = \((GMarshalFunc_[^)]+)\) \(marshal_data \? marshal_data : cc->callback\);/ callback = *($$1*) (marshal_data ? &marshal_data : &cc->callback);/' >> $@ # 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: libinfinity-0.5.5/libinfinity/inf-signals.h0000644000175000017500000000277212264763732015711 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_SIGNALS_H__ #define __INF_SIGNALS_H__ #include G_BEGIN_DECLS guint inf_signal_handlers_disconnect_by_func(gpointer instance, GCallback func, gpointer data); guint inf_signal_handlers_block_by_func(gpointer instance, GCallback func, gpointer data); guint inf_signal_handlers_unblock_by_func(gpointer instance, GCallback func, gpointer data); G_END_DECLS #endif /* __INF_SIGNALS_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/adopted/0000755000175000017500000000000012264766267015024 500000000000000libinfinity-0.5.5/libinfinity/adopted/inf-adopted-state-vector.c0000644000175000017500000005666212264763732021731 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ /** * SECTION:inf-adopted-state-vector * @title: InfAdoptedStateVector * @short_description: Represents a state in the interaction model * @see_also: #InfAdoptedAlgorithm * @include: libinfinity/adopted/inf-adopted-state-vector.h * @stability: Unstable * * The #InfAdoptedStateVector represents a state in the current state space. * It basically maps user IDs to operation counts and states how many * operations of the corresponding user have already been performed. **/ #include #include #include #include #include /* NOTE: What the state vector actually counts is the amount of operations * performed by each user. This number is called a timestamp, although it has * nothing to do with actual time. */ typedef struct _InfAdoptedStateVectorComponent InfAdoptedStateVectorComponent; struct _InfAdoptedStateVectorComponent { guint id; guint n; /* timestamp */ }; typedef struct _InfAdoptedStateVectorForeachData InfAdoptedStateVectorForeachData; struct _InfAdoptedStateVectorForeachData { InfAdoptedStateVectorForeachFunc func; gpointer user_data; }; struct _InfAdoptedStateVector { gsize size; gsize max_size; InfAdoptedStateVectorComponent* data; }; static gsize inf_adopted_state_vector_find_insert_pos(InfAdoptedStateVector* vec, guint id) { gsize begin; gsize end; gsize middle; InfAdoptedStateVectorComponent* comp; if(vec->size == 0) return 0; begin = 0; end = vec->size; /* The vector is sorted, so we perform a binary search */ while(begin != end) { middle = begin + (end - begin) / 2; comp = vec->data + middle; if (comp->id == id) { return middle; } if (comp->id < id) { begin = middle + 1; } else { end = middle; } } return begin; } static InfAdoptedStateVectorComponent* inf_adopted_state_vector_lookup(InfAdoptedStateVector* vec, guint id) { gsize pos; pos = inf_adopted_state_vector_find_insert_pos(vec, id); if(pos < vec->size && vec->data[pos].id == id) return vec->data + pos; return NULL; } static InfAdoptedStateVectorComponent* inf_adopted_state_vector_insert(InfAdoptedStateVector* vec, guint id, guint value, gsize insert_pos) { InfAdoptedStateVectorComponent* comp; if(vec->max_size <= vec->size) { vec->max_size += 5; vec->data = g_realloc(vec->data, vec->max_size * sizeof(InfAdoptedStateVectorComponent)); } comp = vec->data + insert_pos; if(insert_pos < vec->size) { gsize move_count; g_assert(comp->id != id); move_count = (vec->size - insert_pos); g_memmove(comp + 1, comp, move_count * sizeof(InfAdoptedStateVectorComponent)); } ++vec->size; comp->id = id; comp->n = value; return comp; } GType inf_adopted_state_vector_get_type(void) { static GType state_vector_type = 0; if(!state_vector_type) { state_vector_type = g_boxed_type_register_static( "InfAdoptedStateVector", (GBoxedCopyFunc)inf_adopted_state_vector_copy, (GBoxedFreeFunc)inf_adopted_state_vector_free ); } return state_vector_type; } /** * inf_adopted_state_vector_error_quark: * * The domain for #InfAdoptedStateVectorError errors. * * Returns: A #GQuark for that domain. **/ GQuark inf_adopted_state_vector_error_quark(void) { return g_quark_from_static_string("INF_ADOPTED_STATE_VECTOR_ERROR"); } /** * inf_adopted_state_vector_new: * * Returns a new state vector with all components set to zero. * * Return Value: A new #InfAdoptedStateVector. **/ InfAdoptedStateVector* inf_adopted_state_vector_new(void) { InfAdoptedStateVector* vec; vec = g_slice_new(InfAdoptedStateVector); vec->size = 0; vec->max_size = 0; vec->data = NULL; return vec; } /** * inf_adopted_state_vector_copy: * @vec: The #InfAdoptedStateVector to copy * * Returns a copy of @vec. * * Return Value: A copy of @vec. **/ InfAdoptedStateVector* inf_adopted_state_vector_copy(InfAdoptedStateVector* vec) { InfAdoptedStateVector* new_vec; g_return_val_if_fail(vec != NULL, NULL); new_vec = g_slice_new(InfAdoptedStateVector); new_vec->size = vec->size; new_vec->max_size = vec->max_size; if(new_vec->max_size == 0) { new_vec->data = NULL; } else { new_vec->data = g_malloc(new_vec->max_size * sizeof(InfAdoptedStateVectorComponent)); memcpy(new_vec->data, vec->data, new_vec->size * sizeof(InfAdoptedStateVectorComponent)); } return new_vec; } /** * inf_adopted_state_vector_free: * @vec: A #InfAdoptedStateVector. * * Frees a state vector allocated by inf_adopted_state_vector_new() or * inf_adopted_state_vector_copy(). **/ void inf_adopted_state_vector_free(InfAdoptedStateVector* vec) { g_return_if_fail(vec != NULL); g_free(vec->data); g_slice_free(InfAdoptedStateVector, vec); } /** * inf_adopted_state_vector_get: * @vec: A #InfAdoptedStateVector. * @id: The component whose timestamp to look for. * * Returns the timestamp for the given component. Implicitely, all IDs * that the vector does not contain are assigned the timestamp 0. * * Return Value: The @component'th entry in the vector. */ guint inf_adopted_state_vector_get(InfAdoptedStateVector* vec, guint id) { InfAdoptedStateVectorComponent* comp; g_return_val_if_fail(vec != NULL, 0); comp = inf_adopted_state_vector_lookup(vec, id); if(comp == NULL) return 0; return comp->n; } /** * inf_adopted_state_vector_set: * @vec: A #InfAdoptedStateVector. * @id: The component to change. * @value: The value to set the component to. * * Sets the given component of @vec to @value. **/ void inf_adopted_state_vector_set(InfAdoptedStateVector* vec, guint id, guint value) { gsize pos; g_return_if_fail(vec != NULL); pos = inf_adopted_state_vector_find_insert_pos(vec, id); if(pos < vec->size && vec->data[pos].id == id) vec->data[pos].n = value; else inf_adopted_state_vector_insert(vec, id, value, pos); } /** * inf_adopted_state_vector_add: * @vec: A #InfAdoptedStateVector. * @id: The component to change. * @value: The value by which to change the component. * * Adds @value to the current value of @component. @value may be negative in * which case the current value is actually decreased. Make sure to not drop * below zero this way. **/ void inf_adopted_state_vector_add(InfAdoptedStateVector* vec, guint id, gint value) { InfAdoptedStateVectorComponent* comp; gsize pos; g_return_if_fail(vec != NULL); pos = inf_adopted_state_vector_find_insert_pos(vec, id); comp = vec->data + pos; if(pos == vec->size || comp->id != id) { g_assert(value > 0); comp = inf_adopted_state_vector_insert(vec, id, value, pos); } else { g_assert(value > 0 || comp->n >= (guint)-value); comp->n += value; } } /** * inf_adopted_state_vector_foreach: * @vec: A #InfAdoptedStateVector. * @func: The function to call. * @user_data: Additional data to pass to @func. * * Calls @func for each component in @vec. Note that there may be users for * which @func will not be called if their timestamp is 0. **/ void inf_adopted_state_vector_foreach(InfAdoptedStateVector* vec, InfAdoptedStateVectorForeachFunc func, gpointer user_data) { gsize pos; g_return_if_fail(vec != NULL); g_return_if_fail(func != NULL); for(pos = 0; pos < vec->size; ++pos) { func(vec->data[pos].id, vec->data[pos].n, user_data); } } /** * inf_adopted_state_vector_compare: * @first: A #InfAdoptedStateVector. * @second: Another #InfAdoptedStateVector. * * Performs a comparison suited for strict-weak ordering so that state vectors * can be sorted. This function returns -1 if @first compares before @second, * 0 if they compare equal and 1 if @first compares after @second. * * Return Value: -1, 0 or 1. **/ int inf_adopted_state_vector_compare(InfAdoptedStateVector* first, InfAdoptedStateVector* second) { gsize first_pos; gsize second_pos; InfAdoptedStateVectorComponent* first_comp; InfAdoptedStateVectorComponent* second_comp; g_return_val_if_fail(first != NULL, 0); g_return_val_if_fail(second != NULL, 0); first_pos = 0; second_pos = 0; /* TODO: Some test that verifies that this function * provides strict weak ordering */ for(;;) { /* Jump over components whose value is 0. This is necessary because * components that are not in the sequence are treated like having the * value zero and should be compared equal. */ while(first_pos < first->size) { first_comp = first->data + first_pos; if(first_comp->n > 0) break; ++first_pos; } while(second_pos < second->size) { second_comp = second->data + second_pos; if(second_comp->n > 0) break; ++second_pos; } if(first_pos == first->size || second_pos == second->size) { break; } /* first_comp and second_comp are set here */ if(first_comp->id < second_comp->id) { return -1; } else if(first_comp->id > second_comp->id) { return 1; } else if(first_comp->n < second_comp->n) { return -1; } else if(first_comp->n > second_comp->n) { return 1; } /* Component matches, check next */ ++first_pos; ++second_pos; } if(first_pos == first->size && second_pos == second->size) { return 0; } else if(first_pos == first->size) { return -1; } else { return 1; } } /** * inf_adopted_state_vector_causally_before: * @first: A #InfAdoptedStateVector. * @second: Another #InfAdoptedStateVector. * * Checks whether an event that occured at time @second is causally * dependant on an event that occured at time @first, that is all * components of @first are less or equal to the corresponding component in * @second. * * Return Value: Whether @second depends on @first. **/ gboolean inf_adopted_state_vector_causally_before(InfAdoptedStateVector* first, InfAdoptedStateVector* second) { gsize first_pos; gsize second_pos; InfAdoptedStateVectorComponent* first_comp; InfAdoptedStateVectorComponent* second_comp; g_return_val_if_fail(first != NULL, FALSE); g_return_val_if_fail(second != NULL, FALSE); first_pos = 0; second_pos = 0; while(first_pos < first->size) { first_comp = first->data + first_pos++; if(second_pos == second->size) { /* That component is not contained in second (thus 0) */ if(first_comp->n > 0) return FALSE; } else { second_comp = second->data + second_pos; while(second_comp != NULL && first_comp->id > second_comp->id) { ++second_pos; if(second_pos != second->size) second_comp = second->data + second_pos; else second_comp = NULL; } if(second_comp == NULL || first_comp->id < second_comp->id) { /* That component is not contained in second (thus 0) */ if(first_comp->n > 0) return FALSE; else /* 0 <= 0 */ continue; } g_assert(first_comp->id == second_comp->id); if(first_comp->n > second_comp->n) return FALSE; } } return TRUE; } /** * inf_adopted_state_vector_causally_before_inc: * @first: A #InfAdoptedStateVector. * @second: Another #InfAdoptedStateVector. * @inc_component: The component to increment before comparing. * * This function does the equivalent of * * |[ * inf_adopted_state_vector_add(first, inc_component, 1); * gboolean result = inf_adopted_state_vector_causally_before(first, second); * inf_adopted_state_vector_add(first, inc_component, -1); * return result; * ]| * * But it is more efficient. * * Return Value: Whether @second depends on @first with the * @inc_componentth component increased by one. **/ gboolean inf_adopted_state_vector_causally_before_inc(InfAdoptedStateVector* first, InfAdoptedStateVector* second, guint inc_component) { gsize first_pos; gsize second_pos; gboolean inc_comp_seen; InfAdoptedStateVectorComponent* first_comp; InfAdoptedStateVectorComponent* second_comp; InfAdoptedStateVectorComponent inc_comp; g_return_val_if_fail(first != NULL, FALSE); g_return_val_if_fail(second != NULL, FALSE); first_pos = 0; second_pos = 0; inc_comp.id = inc_component; inc_comp_seen = FALSE; while(first_pos < first->size || !inc_comp_seen) { /* Set first_comp as if there was inc_component increased by one */ if(!inc_comp_seen) { if(first_pos < first->size) { first_comp = first->data + first_pos; if(first_comp->id < inc_component) { ++ first_pos; } else if(first_comp->id == inc_component) { inc_comp.n = first_comp->n + 1; first_comp = &inc_comp; inc_comp_seen = TRUE; ++ first_pos; } else { inc_comp.n = 1; first_comp = &inc_comp; inc_comp_seen = TRUE; } } else { /* inc_comp is the only component of first */ inc_comp.n = 1; first_comp = &inc_comp; inc_comp_seen = TRUE; } } else { /* inc_comp already handled, business as usual */ first_comp = first->data + first_pos; ++ first_pos; } if(second_pos == second->size) { /* That component is not contained in second (thus 0) */ if(first_comp->n > 0) return FALSE; } else { second_comp = second->data + second_pos; while(second_comp != NULL && first_comp->id > second_comp->id) { ++second_pos; if(second_pos != second->size) second_comp = second->data + second_pos; else second_comp = NULL; } if(second_comp == NULL || first_comp->id < second_comp->id) { /* That component is not contained in second (thus 0) */ if(first_comp->n > 0) return FALSE; else /* 0 <= 0 */ continue; } g_assert(first_comp->id == second_comp->id); if(first_comp->n > second_comp->n) return FALSE; } } return TRUE; } /** * inf_adopted_state_vector_vdiff: * @first: A #InfAdoptedStateVector. * @second: Another #InfAdoptedStateVector. * * This function returns the sum of the differences between each component * of @first and @second. This function can only be called if * inf_adopted_state_vector_causally_before() returns %TRUE. * * Returns: The sum of the differences between each component of @first and * @second. */ guint inf_adopted_state_vector_vdiff(InfAdoptedStateVector* first, InfAdoptedStateVector* second) { gsize n; guint first_sum; guint second_sum; g_return_val_if_fail( inf_adopted_state_vector_causally_before(first, second) == TRUE, 0 ); first_sum = 0; second_sum = 0; for(n = 0; n < first->size; ++ n) first_sum += first->data[n].n; for(n = 0; n < second->size; ++ n) second_sum += second->data[n].n; g_assert(second_sum >= first_sum); return second_sum - first_sum; } /** * inf_adopted_state_vector_to_string: * @vec: A #InfAdoptedStateVector. * * Returns a string representation of @vec. * * Return Value: A newly-allocated string to be freed by the caller. **/ gchar* inf_adopted_state_vector_to_string(InfAdoptedStateVector* vec) { GString* str; gsize pos; InfAdoptedStateVectorComponent* component; g_return_val_if_fail(vec != NULL, NULL); str = g_string_sized_new(vec->size * 12); for(pos = 0; pos < vec->size; ++pos) { component = vec->data + pos; if(component->n > 0) { if(str->len > 0) g_string_append_c(str, ';'); g_string_append_printf(str, "%u:%u", component->id, component->n); } } return g_string_free(str, FALSE); } /** * inf_adopted_state_vector_from_string: * @str: A string representation of a #InfAdoptedStateVector. * @error: Location to place an error, if any. * * Recreates the #InfAdoptedStateVector from its string representation. If * an error occurs, the function returns %NULL and @error is set. * * Return Value: A new #InfAdoptedStateVector, or %NULL. **/ InfAdoptedStateVector* inf_adopted_state_vector_from_string(const gchar* str, GError** error) { InfAdoptedStateVector* vec; const char* strpos; char* endpos; gsize pos; guint id; guint n; g_return_val_if_fail(str != NULL, NULL); vec = inf_adopted_state_vector_new(); strpos = str; while(*strpos) { id = strtoul(strpos, &endpos, 10); if(*endpos != ':') { g_set_error( error, inf_adopted_state_vector_error_quark(), INF_ADOPTED_STATE_VECTOR_BAD_FORMAT, "%s", _("Expected ':' after ID") ); inf_adopted_state_vector_free(vec); return NULL; } pos = inf_adopted_state_vector_find_insert_pos(vec, id); if(pos < vec->size && vec->data[pos].id == id) { g_set_error( error, inf_adopted_state_vector_error_quark(), INF_ADOPTED_STATE_VECTOR_BAD_FORMAT, _("ID '%u' already occured before"), id ); inf_adopted_state_vector_free(vec); return NULL; } strpos = endpos + 1; /* step over ':' */ n = strtoul(strpos, &endpos, 10); if(*endpos != ';' && *endpos != '\0') { g_set_error( error, inf_adopted_state_vector_error_quark(), INF_ADOPTED_STATE_VECTOR_BAD_FORMAT, _("Expected ';' or end of string after component of ID '%u'"), id ); inf_adopted_state_vector_free(vec); return NULL; } inf_adopted_state_vector_insert(vec, id, n, pos); strpos = endpos; if(*strpos != '\0') ++ strpos; /* step over ';' */ } return vec; } /** * inf_adopted_state_vector_to_string_diff: * @vec: A #InfAdoptedStateVector. * @orig: Another #InfAdoptedStateVector. * * Returns the string representation of a diff between @orig and @vec. This * is possibly smaller than the representation created by * inf_adopted_state_vector_to_string(), but the same @orig vector is needed * to recreate @vec from the string representation. Additionally, * inf_adopted_state_vector_causally_before(@orig, @vec) must hold. * * Return Value: A newly allocated string to be freed by the caller. **/ gchar* inf_adopted_state_vector_to_string_diff(InfAdoptedStateVector* vec, InfAdoptedStateVector* orig) { gsize vec_pos; gsize orig_pos; InfAdoptedStateVectorComponent* vec_comp; InfAdoptedStateVectorComponent* orig_comp; GString* str; g_return_val_if_fail(vec != NULL, NULL); g_return_val_if_fail(orig != NULL, NULL); g_return_val_if_fail( inf_adopted_state_vector_causally_before(orig, vec) == TRUE, NULL ); str = g_string_sized_new(vec->size * 12); vec_pos = 0; for(orig_pos = 0; orig_pos < orig->size; ++orig_pos) { orig_comp = orig->data + orig_pos; if(orig_comp->n == 0) continue; g_assert(vec_pos != vec->size); vec_comp = vec->data + vec_pos; while(vec_comp->id < orig_comp->id) { /* There does not seem to be a corresponding entry in orig_comp, so * it is implicitely zero. */ if(str->len > 0) g_string_append_c(str, ';'); g_string_append_printf(str, "%u:%u", vec_comp->id, vec_comp->n); ++vec_pos; g_assert(vec_pos != vec->size); vec_comp = vec->data + vec_pos; } /* Otherwise the inf_adopted_state_vector_causally_before test above * should not have passed since orig_comp->n is not 0. */ g_assert(vec_comp->id == orig_comp->id); g_assert(vec_comp->n >= orig_comp->n); if(vec_comp->n > orig_comp->n) { if(str->len > 0) g_string_append_c(str, ';'); g_string_append_printf( str, "%u:%u", vec_comp->id, vec_comp->n - orig_comp->n ); } ++vec_pos; } /* All remaining components in vec have no counterpart in orig, meaning * their values in orig are implicitely zero. */ while(vec_pos != vec->size) { vec_comp = vec->data + vec_pos; if (vec_comp->n > 0) { if(str->len > 0) g_string_append_c(str, ';'); g_string_append_printf(str, "%u:%u", vec_comp->id, vec_comp->n); } ++vec_pos; } return g_string_free(str, FALSE); } /** * inf_adopted_state_vector_from_string_diff: * @str: A string representation of a diff between state vectors. * @orig: The state vector used to create @str in * inf_adopted_state_vector_to_string_diff(). * @error: Location to place an error, if any. * * Recreates a vector from its string representation diff and the original * vector. If an error returns, the function returns %NULL and @error is set. * * Return Value: The created state vector, or %NULL on error. Free with * inf_adopted_state_vector_free() when no longer needed. **/ InfAdoptedStateVector* inf_adopted_state_vector_from_string_diff(const gchar* str, InfAdoptedStateVector* orig, GError** error) { InfAdoptedStateVector* vec; gsize vec_pos; gsize orig_pos; InfAdoptedStateVectorComponent* vec_comp; InfAdoptedStateVectorComponent* orig_comp; g_return_val_if_fail(str != NULL, NULL); g_return_val_if_fail(orig != NULL, NULL); vec = inf_adopted_state_vector_from_string(str, error); if(vec == NULL) return NULL; vec_pos = 0; for(orig_pos = 0; orig_pos < orig->size; ++orig_pos) { orig_comp = orig->data + orig_pos; if(orig_comp->n == 0) continue; if(vec_pos == vec->size) { inf_adopted_state_vector_insert( vec, orig_comp->id, orig_comp->n, vec_pos ); } else { vec_comp = vec->data + vec_pos; while(vec_comp->id < orig_comp->id) { ++vec_pos; if(vec_pos < vec->size) { vec_comp = vec->data + vec_pos; } else { break; } } if(vec_comp->id == orig_comp->id) { vec_comp->n += orig_comp->n; ++vec_pos; } else { inf_adopted_state_vector_insert( vec, orig_comp->id, orig_comp->n, vec_pos ); } } } return vec; } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/adopted/inf-adopted-session-record.c0000644000175000017500000005313512264763732022240 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include #include #include #include #include /* TODO: Better error handling; we should have a proper InfErrnoError * (or InfSystemError or something), and we should check the fflush error * codes. */ /* TODO: Or just use GIOChannel here... */ /** * SECTION:inf-adopted-session-record * @title: InfAdoptedSessionRecord * @short_description: Create a record of a session * @include: libinfinity/adopted/inf-adopted-session-record.h * @see_also: #InfAdoptedSession, #InfAdoptedSessionReplay * @stability: Unstable * * #InfAdoptedSessionRecord creates a record of a #InfAdoptedSession. It * records every modification made to the session from the beginning of its * own lifetime to the end of its lifetime. * * It does not record user status changes and thus the recorded session * cannot reliably be replayed with all user information. It's main purpose is * to make it easy to reproduce bugs in libinfinity. However, it might be * extended in the future. * * To replay a record, use #InfAdoptedSessionReplay or the tool * inf-test-text-replay in the infinote test suite. */ /* TODO: Record user join/leave events, and update last send vectors on * rejoin. */ typedef struct _InfAdoptedSessionRecordPrivate InfAdoptedSessionRecordPrivate; struct _InfAdoptedSessionRecordPrivate { InfAdoptedSession* session; xmlTextWriterPtr writer; FILE* file; gchar* filename; GHashTable* last_send_table; }; enum { PROP_0, /* construct only */ PROP_SESSION }; #define INF_ADOPTED_SESSION_RECORD_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), INF_ADOPTED_TYPE_SESSION_RECORD, InfAdoptedSessionRecordPrivate)) static GObjectClass* parent_class; static GQuark libxml2_writer_error_quark; static void inf_adopted_session_record_handle_xml_error(InfAdoptedSessionRecord* record) { InfAdoptedSessionRecordPrivate* priv; xmlErrorPtr xmlerror; priv = INF_ADOPTED_SESSION_RECORD_PRIVATE(record); xmlerror = xmlGetLastError(); g_warning( /* Error writing record `': */ _("Error writing record \"%s\": %s"), priv->filename, xmlerror->message ); } static void inf_adopted_session_record_write_node(InfAdoptedSessionRecord* record, xmlNodePtr xml) { InfAdoptedSessionRecordPrivate* priv; xmlAttrPtr attr; xmlChar* value; xmlNodePtr child; int result; priv = INF_ADOPTED_SESSION_RECORD_PRIVATE(record); result = xmlTextWriterStartElement(priv->writer, xml->name); if(result < 0) inf_adopted_session_record_handle_xml_error(record); for(attr = xml->properties; attr != NULL; attr = attr->next) { value = xmlGetProp(xml, attr->name); result = xmlTextWriterWriteAttribute(priv->writer, attr->name, value); if(result < 0) inf_adopted_session_record_handle_xml_error(record); xmlFree(value); } for(child = xml->children; child != NULL; child = child->next) { if(child->type == XML_ELEMENT_NODE) { inf_adopted_session_record_write_node(record, child); } else if(child->type == XML_TEXT_NODE) { value = xmlNodeGetContent(child); result = xmlTextWriterWriteString(priv->writer, value); if(result < 0) inf_adopted_session_record_handle_xml_error(record); xmlFree(value); } } result = xmlTextWriterEndElement(priv->writer); if(result < 0) inf_adopted_session_record_handle_xml_error(record); } static void inf_adopted_session_record_user_joined(InfAdoptedSessionRecord* record, InfAdoptedUser* user) { InfAdoptedSessionRecordPrivate* priv; priv = INF_ADOPTED_SESSION_RECORD_PRIVATE(record); g_hash_table_insert( priv->last_send_table, user, inf_adopted_state_vector_copy(inf_adopted_user_get_vector(user)) ); } static void inf_adopted_session_record_execute_request_cb(InfAdoptedAlgorithm* algorithm, InfAdoptedUser* user, InfAdoptedRequest* request, gboolean apply, gpointer user_data) { InfAdoptedSessionRecord* record; InfAdoptedSessionRecordPrivate* priv; InfAdoptedSessionClass* session_class; InfAdoptedStateVector* previous; xmlNodePtr xml; int result; record = INF_ADOPTED_SESSION_RECORD(user_data); priv = INF_ADOPTED_SESSION_RECORD_PRIVATE(record); session_class = INF_ADOPTED_SESSION_GET_CLASS(priv->session); xml = xmlNewNode(NULL, (const xmlChar*)"request"); previous = g_hash_table_lookup(priv->last_send_table, user); g_assert(previous != NULL); session_class->request_to_xml(priv->session, xml, request, previous, FALSE); inf_adopted_session_record_write_node(record, xml); xmlFreeNode(xml); result = xmlTextWriterFlush(priv->writer); if(result < 0) inf_adopted_session_record_handle_xml_error(record); fflush(priv->file); /* Update last send entry */ previous = inf_adopted_state_vector_copy(inf_adopted_request_get_vector(request)); if(inf_adopted_request_affects_buffer(request)) inf_adopted_state_vector_add(previous, inf_user_get_id(INF_USER(user)), 1); g_hash_table_insert(priv->last_send_table, user, previous); } static void inf_adopted_session_record_add_user_cb(InfUserTable* user_table, InfUser* user, gpointer user_data) { InfAdoptedSessionRecord* record; InfAdoptedSessionRecordPrivate* priv; xmlNodePtr xml; int result; record = INF_ADOPTED_SESSION_RECORD(user_data); priv = INF_ADOPTED_SESSION_RECORD_PRIVATE(record); inf_adopted_session_record_user_joined(record, INF_ADOPTED_USER(user)); result = xmlTextWriterWriteString(priv->writer, (const xmlChar*)"\n "); if(result < 0) inf_adopted_session_record_handle_xml_error(record); xml = xmlNewNode(NULL, (const xmlChar*)"user"); inf_session_user_to_xml(INF_SESSION(priv->session), user, xml); inf_adopted_session_record_write_node(record, xml); xmlFreeNode(xml); result = xmlTextWriterFlush(priv->writer); if(result < 0) inf_adopted_session_record_handle_xml_error(record); fflush(priv->file); } static void inf_adopted_session_record_start_foreach_user_func(InfUser* user, gpointer user_data) { inf_adopted_session_record_user_joined( INF_ADOPTED_SESSION_RECORD(user_data), INF_ADOPTED_USER(user) ); } static void inf_adopted_session_record_real_start(InfAdoptedSessionRecord* record) { InfAdoptedSessionRecordPrivate* priv; InfAdoptedAlgorithm* algorithm; InfUserTable* user_table; xmlNodePtr xml; xmlNodePtr child; xmlNodePtr cur; int result; guint total; InfSessionClass* session_class; priv = INF_ADOPTED_SESSION_RECORD_PRIVATE(record); algorithm = inf_adopted_session_get_algorithm(priv->session); user_table = inf_session_get_user_table(INF_SESSION(priv->session)); session_class = INF_SESSION_GET_CLASS(priv->session); g_signal_connect( G_OBJECT(algorithm), "execute-request", G_CALLBACK(inf_adopted_session_record_execute_request_cb), record ); g_signal_connect( G_OBJECT(user_table), "add-user", G_CALLBACK(inf_adopted_session_record_add_user_cb), record ); priv->last_send_table = g_hash_table_new_full( NULL, NULL, NULL, (GDestroyNotify)inf_adopted_state_vector_free ); inf_user_table_foreach_user( inf_session_get_user_table(INF_SESSION(priv->session)), inf_adopted_session_record_start_foreach_user_func, record ); result = xmlTextWriterStartDocument(priv->writer, NULL, "UTF-8", NULL); if(result < 0) inf_adopted_session_record_handle_xml_error(record); result = xmlTextWriterStartElement( priv->writer, (const xmlChar*)"infinote-adopted-session-record" ); if(result < 0) inf_adopted_session_record_handle_xml_error(record); /* TODO: Have someone else inserting sync-begin and sync-end... that's quite * hacky here. */ xml = xmlNewNode(NULL, (const xmlChar*)"initial"); child = xmlNewChild(xml, NULL, (const xmlChar*)"sync-begin", NULL); session_class->to_xml_sync(INF_SESSION(priv->session), xml); xmlNewChild(xml, NULL, (const xmlChar*)"sync-end", NULL); total = 0; for(cur = child; cur != NULL; cur = cur->next) ++ total; inf_xml_util_set_attribute_uint(child, "num-messages", total - 2); inf_adopted_session_record_write_node(record, xml); xmlFreeNode(xml); result = xmlTextWriterFlush(priv->writer); if(result < 0) inf_adopted_session_record_handle_xml_error(record); fflush(priv->file); } static void inf_adopted_session_record_synchronization_complete_cb(InfSession* session, InfXmlConnection* conn, gpointer user_data) { InfAdoptedSessionRecord* record; record = INF_ADOPTED_SESSION_RECORD(user_data); inf_signal_handlers_disconnect_by_func( G_OBJECT(session), G_CALLBACK(inf_adopted_session_record_synchronization_complete_cb), record ); inf_adopted_session_record_real_start(record); } /* * GObject overrides. */ static void inf_adopted_session_record_init(GTypeInstance* instance, gpointer g_class) { InfAdoptedSessionRecord* record; InfAdoptedSessionRecordPrivate* priv; record = INF_ADOPTED_SESSION_RECORD(instance); priv = INF_ADOPTED_SESSION_RECORD_PRIVATE(record); priv->session = NULL; priv->writer = NULL; priv->file = NULL; priv->filename = NULL; priv->last_send_table = NULL; } static void inf_adopted_session_record_dispose(GObject* object) { InfAdoptedSessionRecord* record; InfAdoptedSessionRecordPrivate* priv; GError* error; record = INF_ADOPTED_SESSION_RECORD(object); priv = INF_ADOPTED_SESSION_RECORD_PRIVATE(record); if(priv->writer != NULL) { error = NULL; inf_adopted_session_record_stop_recording(record, &error); if(error != NULL) { g_assert(priv->filename != NULL); g_warning( /* Error while finishing record `': */ "Error while finishing record `%s': %s", priv->filename, error->message ); g_error_free(error); } } if(priv->session != NULL) { g_object_unref(priv->session); priv->session = NULL; } G_OBJECT_CLASS(parent_class)->dispose(object); } static void inf_adopted_session_record_finalize(GObject* object) { InfAdoptedSessionRecord* record; InfAdoptedSessionRecordPrivate* priv; record = INF_ADOPTED_SESSION_RECORD(object); priv = INF_ADOPTED_SESSION_RECORD_PRIVATE(record); g_assert(priv->filename == NULL); G_OBJECT_CLASS(parent_class)->finalize(object); } static void inf_adopted_session_record_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec) { InfAdoptedSessionRecord* record; InfAdoptedSessionRecordPrivate* priv; record = INF_ADOPTED_SESSION_RECORD(object); priv = INF_ADOPTED_SESSION_RECORD_PRIVATE(record); switch(prop_id) { case PROP_SESSION: g_assert(priv->session == NULL); /* construct only */ priv->session = INF_ADOPTED_SESSION(g_value_dup_object(value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void inf_adopted_session_record_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec) { InfAdoptedSessionRecord* record; InfAdoptedSessionRecordPrivate* priv; record = INF_ADOPTED_SESSION_RECORD(object); priv = INF_ADOPTED_SESSION_RECORD_PRIVATE(record); switch(prop_id) { case PROP_SESSION: g_value_set_object(value, G_OBJECT(priv->session)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } /* * Gype registration. */ static void inf_adopted_session_record_class_init(gpointer g_class, gpointer class_data) { GObjectClass* object_class; object_class = G_OBJECT_CLASS(g_class); parent_class = G_OBJECT_CLASS(g_type_class_peek_parent(g_class)); g_type_class_add_private(g_class, sizeof(InfAdoptedSessionRecordPrivate)); object_class->dispose = inf_adopted_session_record_dispose; object_class->finalize = inf_adopted_session_record_finalize; object_class->set_property = inf_adopted_session_record_set_property; object_class->get_property = inf_adopted_session_record_get_property; libxml2_writer_error_quark = g_quark_from_static_string("LIBXML2_WRITER_ERROR"); g_object_class_install_property( object_class, PROP_SESSION, g_param_spec_object( "session", "Session", "The session to record", INF_ADOPTED_TYPE_SESSION, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); } GType inf_adopted_session_record_get_type(void) { static GType session_record_type = 0; if(!session_record_type) { static const GTypeInfo session_record_type_info = { sizeof(InfAdoptedSessionRecordClass), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ inf_adopted_session_record_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InfAdoptedSessionRecord), /* instance_size */ 0, /* n_preallocs */ inf_adopted_session_record_init, /* instance_init */ NULL /* value_table */ }; session_record_type = g_type_register_static( G_TYPE_OBJECT, "InfAdoptedSessionRecord", &session_record_type_info, 0 ); } return session_record_type; } /* * Public API. */ /** * inf_adopted_session_record_new: * @session: A #InfAdoptedSession. * * Creates a new #InfAdoptedSessionRecord, recording @session. To start * recording, call inf_adopted_session_record_start_recording(). * * Return Value: A new #InfAdoptedSessionRecord. **/ InfAdoptedSessionRecord* inf_adopted_session_record_new(InfAdoptedSession* session) { GObject* object; g_return_val_if_fail(INF_ADOPTED_IS_SESSION(session), NULL); object = g_object_new( INF_ADOPTED_TYPE_SESSION_RECORD, "session", session, NULL ); return INF_ADOPTED_SESSION_RECORD(object); } /** * inf_adopted_session_record_start_recording: * @record: A #InfAdoptedSessionRecord. * @filename: The file in which to store the record. * @error: Location to store error information, if any. * * Starts to record the session. Make sure the session is not already closed * before calling this function. If an error occurs, such as if @filename * could not be opened, then the function returns %FALSE and @error is set. * * Return Value: %TRUE if the session is started to be recorded, %FALSE on * error. **/ gboolean inf_adopted_session_record_start_recording(InfAdoptedSessionRecord* record, const gchar* filename, GError** error) { InfAdoptedSessionRecordPrivate* priv; InfSessionStatus status; xmlOutputBufferPtr buffer; xmlErrorPtr xmlerror; int errcode; g_return_val_if_fail(INF_ADOPTED_IS_SESSION_RECORD(record), FALSE); g_return_val_if_fail(filename != NULL, FALSE); g_return_val_if_fail(error == NULL || *error == NULL, FALSE); priv = INF_ADOPTED_SESSION_RECORD_PRIVATE(record); status = inf_session_get_status(INF_SESSION(priv->session)); g_return_val_if_fail(priv->writer == NULL, FALSE); g_return_val_if_fail(status != INF_SESSION_CLOSED, FALSE); priv->file = fopen(filename, "w"); if(priv->file == NULL) { errcode = errno; g_set_error( error, g_quark_from_static_string("ERRNO_ERROR"), errcode, "%s", strerror(errcode) ); return FALSE; } buffer = xmlOutputBufferCreateFile(priv->file, NULL); if(buffer == NULL) { fclose(priv->file); priv->file = NULL; xmlerror = xmlGetLastError(); g_set_error( error, libxml2_writer_error_quark, xmlerror->code, "%s", xmlerror->message ); return FALSE; } priv->writer = xmlNewTextWriter(buffer); if(priv->writer == NULL) { /* TODO: Does this also fclose our file? */ xmlOutputBufferClose(buffer); priv->file = NULL; xmlerror = xmlGetLastError(); g_set_error( error, libxml2_writer_error_quark, xmlerror->code, "%s", xmlerror->message ); return FALSE; } xmlTextWriterSetIndent(priv->writer, 1); switch(status) { case INF_SESSION_SYNCHRONIZING: g_signal_connect_after( G_OBJECT(priv->session), "synchronization-complete", G_CALLBACK(inf_adopted_session_record_synchronization_complete_cb), record ); break; case INF_SESSION_RUNNING: inf_adopted_session_record_real_start(record); break; default: g_assert_not_reached(); break; } g_assert(priv->filename == NULL); priv->filename = g_strdup(filename); return TRUE; } /** * inf_adopted_session_record_stop_recording: * @record: A #InfAdoptedSessionRecord. * @error: Location to store error information, if any. * * Stops the recording of the current session, which must have been started * previously via inf_adopted_session_record_start_recording(). If an error * occurs, then the function returns %FALSE and @error is set. Note that even * if an error occurs, then the recording is stopped as well. However, the * file might not have been completely written to disk, so you should still * show any errors during this function to the user. * * Return Value: %TRUE if the recording has been stored successfully, %FALSE * otherwise. */ gboolean inf_adopted_session_record_stop_recording(InfAdoptedSessionRecord* record, GError** error) { InfAdoptedSessionRecordPrivate* priv; InfSessionStatus status; InfAdoptedAlgorithm* algorithm; InfUserTable* user_table; xmlErrorPtr xmlerror; int result; g_return_val_if_fail(INF_ADOPTED_IS_SESSION_RECORD(record), FALSE); g_return_val_if_fail(error == NULL || *error == NULL, FALSE); priv = INF_ADOPTED_SESSION_RECORD_PRIVATE(record); g_return_val_if_fail(priv->writer != NULL, FALSE); inf_signal_handlers_disconnect_by_func( G_OBJECT(priv->session), G_CALLBACK(inf_adopted_session_record_synchronization_complete_cb), record ); /* In synchronizing state we did not yet connect to these signals, and * the algorithm doesn't even exist. */ status = inf_session_get_status(INF_SESSION(priv->session)); if(status != INF_SESSION_SYNCHRONIZING) { user_table = inf_session_get_user_table(INF_SESSION(priv->session)); /* The algorithm has been destroyed when the session has been closed. */ if(status != INF_SESSION_CLOSED) { algorithm = inf_adopted_session_get_algorithm(priv->session); g_assert(algorithm != NULL); inf_signal_handlers_disconnect_by_func( G_OBJECT(algorithm), G_CALLBACK(inf_adopted_session_record_execute_request_cb), record ); } inf_signal_handlers_disconnect_by_func( G_OBJECT(user_table), G_CALLBACK(inf_adopted_session_record_add_user_cb), record ); } result = xmlTextWriterWriteString(priv->writer, (const xmlChar*)"\n"); if(result < 0) inf_adopted_session_record_handle_xml_error(record); result = xmlTextWriterEndDocument(priv->writer); if(result < 0) { xmlerror = xmlGetLastError(); g_set_error( error, libxml2_writer_error_quark, xmlerror->code, "%s", xmlerror->message ); return FALSE; } /* TODO: Does this fclose our file? */ xmlFreeTextWriter(priv->writer); priv->writer = NULL; priv->file = NULL; g_free(priv->filename); priv->filename = NULL; /* This has only been created if the session has entered running state * already. */ if(priv->last_send_table != NULL) { g_hash_table_unref(priv->last_send_table); priv->last_send_table = NULL; } return result >= 0; } /** * inf_adopted_session_record_is_recording: * @record: A #InfAdoptedSessionRecord. * * Returns whether @record is currently recording a session. * * Returns: Whether @record currently records the session. */ gboolean inf_adopted_session_record_is_recording(InfAdoptedSessionRecord* record) { g_return_val_if_fail(INF_ADOPTED_IS_SESSION_RECORD(record), FALSE); return INF_ADOPTED_SESSION_RECORD_PRIVATE(record)->writer != NULL; } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/adopted/inf-adopted-operation.h0000644000175000017500000001711512264763732021304 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_ADOPTED_OPERATION_H__ #define __INF_ADOPTED_OPERATION_H__ /* We cannot include inf-adopted-user.h because inf-adopted-user.h includes * us via inf-adopted-request-log.h via inf-adopted-request.h */ /*#include */ typedef struct _InfAdoptedUser InfAdoptedUser; #include #include G_BEGIN_DECLS #define INF_ADOPTED_TYPE_OPERATION (inf_adopted_operation_get_type()) #define INF_ADOPTED_OPERATION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INF_ADOPTED_TYPE_OPERATION, InfAdoptedOperation)) #define INF_ADOPTED_IS_OPERATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INF_ADOPTED_TYPE_OPERATION)) #define INF_ADOPTED_OPERATION_GET_IFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE((inst), INF_ADOPTED_TYPE_OPERATION, InfAdoptedOperationIface)) #define INF_ADOPTED_TYPE_OPERATION_FLAGS (inf_adopted_operation_flags_get_type()) typedef struct _InfAdoptedOperation InfAdoptedOperation; typedef struct _InfAdoptedOperationIface InfAdoptedOperationIface; /** * InfAdoptedConcurrencyId: * @INF_ADOPTED_CONCURRENCY_SELF: Transform the operation itself. * @INF_ADOPTED_CONCURRENCY_NONE: Unspecified which operation to transform. * @INF_ADOPTED_CONCURRENCY_OTHER: Transform the other operation. * * A concurrency ID is used to determine which operation to transform in case * two similar operations are transformed against each other. */ typedef enum _InfAdoptedConcurrencyId { INF_ADOPTED_CONCURRENCY_SELF = 1, INF_ADOPTED_CONCURRENCY_NONE = 0, INF_ADOPTED_CONCURRENCY_OTHER = -1 } InfAdoptedConcurrencyId; /** * InfAdoptedOperationFlags: * @INF_ADOPTED_OPERATION_AFFECTS_BUFFER: The operation changes the content of * the buffer. * @INF_ADOPTED_OPERATION_REVERSIBLE: The operation is reversible, which means * that inf_adopted_operation_revert() can be called to generate an operation * that undoes the effect of the operation. * * Various flags for #InfAdoptedOperation. */ typedef enum _InfAdoptedOperationFlags { INF_ADOPTED_OPERATION_AFFECTS_BUFFER = 1 << 0, INF_ADOPTED_OPERATION_REVERSIBLE = 1 << 1 } InfAdoptedOperationFlags; /** * InfAdoptedOperationIface: * @need_concurrency_id: Virtual function to determine whether a concurrency * ID is required to transform @operation against @against. * @get_concurrency_id: Virtual function to obtain a concurrency ID for * transforming @op against @against. * @transform: Virtual function that transform @operation against @against and * returns a new #InfAdoptedOperation as the result of the transformation. * @concurrency_id is either 1 or -1 and can be used to make a decision in * case there is no other criteria to decide how to do the transformation, for * example when both @operation and @against are inserting text at the same * position in the buffer. * @copy: Virtual function that returns a copy of the operation. * @get_flags: Virtual function that returns the flags of the operation, * see #InfAdoptedOperationFlags. * @apply: Virtual function that applies the operation to the buffer. @by is * the user that applies the operation. * @revert: Virtual function that creates a new operation that undoes the * effect of the operation. If @get_flags does never return the * %INF_ADOPTED_OPERATION_REVERSIBLE flag set, then this is allowed to be * %NULL. * @make_reversible: Virtual function that creates a reversible operation out * of the operation itself. If @get_flags does always return the * %INF_ADOPTED_OPERATION_REVERSIBLE flag set, then this is allowed to be * %NULL. Some operations may not be reversible, but can be made reversible * with some extra information such as another operation that collected * information while being transformed, or the current buffer. This function * should return either a new, reversible operation that has the same effect * on a buffer, or %NULL if the operation cannot be made reversible. * * The virtual methods that need to be implemented by an operation to be used * with #InfAdoptedAlgorithm. */ struct _InfAdoptedOperationIface { /*< private >*/ GTypeInterface parent; /*< public >*/ gboolean (*need_concurrency_id)(InfAdoptedOperation* operation, InfAdoptedOperation* against); InfAdoptedConcurrencyId (*get_concurrency_id)(InfAdoptedOperation* op, InfAdoptedOperation* against); InfAdoptedOperation* (*transform)(InfAdoptedOperation* operation, InfAdoptedOperation* against, InfAdoptedConcurrencyId concurrency_id); InfAdoptedOperation* (*copy)(InfAdoptedOperation* operation); InfAdoptedOperationFlags (*get_flags)(InfAdoptedOperation* operation); void (*apply)(InfAdoptedOperation* operation, InfAdoptedUser* by, InfBuffer* buffer); InfAdoptedOperation* (*revert)(InfAdoptedOperation* operation); InfAdoptedOperation* (*make_reversible)(InfAdoptedOperation* operation, InfAdoptedOperation* with, InfBuffer* buffer); }; /** * InfAdoptedOperation: * * #InfAdoptedOperation is an opaque data type. You should only access it * via the public API functions. */ GType inf_adopted_concurrency_id_get_type(void) G_GNUC_CONST; GType inf_adopted_operation_flags_get_type(void) G_GNUC_CONST; GType inf_adopted_operation_get_type(void) G_GNUC_CONST; gboolean inf_adopted_operation_need_concurrency_id(InfAdoptedOperation* operation, InfAdoptedOperation* against); InfAdoptedConcurrencyId inf_adopted_operation_get_concurrency_id(InfAdoptedOperation* operation, InfAdoptedOperation* against); InfAdoptedOperation* inf_adopted_operation_transform(InfAdoptedOperation* operation, InfAdoptedOperation* against, gint concurrency_id); InfAdoptedOperation* inf_adopted_operation_copy(InfAdoptedOperation* operation); InfAdoptedOperationFlags inf_adopted_operation_get_flags(InfAdoptedOperation* operation); void inf_adopted_operation_apply(InfAdoptedOperation* operation, InfAdoptedUser* by, InfBuffer* buffer); gboolean inf_adopted_operation_is_reversible(InfAdoptedOperation* operation); InfAdoptedOperation* inf_adopted_operation_revert(InfAdoptedOperation* operation); InfAdoptedOperation* inf_adopted_operation_make_reversible(InfAdoptedOperation* operation, InfAdoptedOperation* with, InfBuffer* buffer); G_END_DECLS #endif /* __INF_ADOPTED_OPERATION_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/adopted/inf-adopted-request-log.h0000644000175000017500000001057612264763732021557 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_ADOPTED_REQUEST_LOG_H__ #define __INF_ADOPTED_REQUEST_LOG_H__ #include #include G_BEGIN_DECLS #define INF_ADOPTED_TYPE_REQUEST_LOG (inf_adopted_request_log_get_type()) #define INF_ADOPTED_REQUEST_LOG(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INF_ADOPTED_TYPE_REQUEST_LOG, InfAdoptedRequestLog)) #define INF_ADOPTED_REQUEST_LOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INF_ADOPTED_TYPE_REQUEST_LOG, InfAdoptedRequestLogClass)) #define INF_ADOPTED_IS_REQUEST_LOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INF_ADOPTED_TYPE_REQUEST_LOG)) #define INF_ADOPTED_IS_REQUEST_LOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INF_ADOPTED_TYPE_REQUEST_LOG)) #define INF_ADOPTED_REQUEST_LOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), INF_ADOPTED_TYPE_REQUEST_LOG, InfAdoptedRequestLogClass)) typedef struct _InfAdoptedRequestLog InfAdoptedRequestLog; typedef struct _InfAdoptedRequestLogClass InfAdoptedRequestLogClass; /** * InfAdoptedRequestLogClass: * @add_request: Default signal handler for the * #InfAdoptedRequestLog::add-request signal. * * This structure contains the default signal handlers for * #InfAdoptedRequestLog. */ struct _InfAdoptedRequestLogClass { /*< private >*/ GObjectClass parent_class; /*< public >*/ void(*add_request)(InfAdoptedRequestLog* request_log, InfAdoptedRequest* request); }; /** * InfAdoptedRequestLog: * * #InfAdoptedRequestLog is an opaque data type. You should only access it via * the public API functions. */ struct _InfAdoptedRequestLog { /*< private >*/ GObject parent; gpointer priv; }; GType inf_adopted_request_log_get_type(void) G_GNUC_CONST; InfAdoptedRequestLog* inf_adopted_request_log_new(guint user_id); guint inf_adopted_request_log_get_user_id(InfAdoptedRequestLog* log); guint inf_adopted_request_log_get_begin(InfAdoptedRequestLog* log); guint inf_adopted_request_log_get_end(InfAdoptedRequestLog* log); gboolean inf_adopted_request_log_is_empty(InfAdoptedRequestLog* log); void inf_adopted_request_log_set_begin(InfAdoptedRequestLog* log, guint n); InfAdoptedRequest* inf_adopted_request_log_get_request(InfAdoptedRequestLog* log, guint n); void inf_adopted_request_log_add_request(InfAdoptedRequestLog* log, InfAdoptedRequest* request); void inf_adopted_request_log_remove_requests(InfAdoptedRequestLog* log, guint up_to); InfAdoptedRequest* inf_adopted_request_log_next_associated(InfAdoptedRequestLog* log, InfAdoptedRequest* request); InfAdoptedRequest* inf_adopted_request_log_prev_associated(InfAdoptedRequestLog* log, InfAdoptedRequest* request); InfAdoptedRequest* inf_adopted_request_log_original_request(InfAdoptedRequestLog* log, InfAdoptedRequest* request); InfAdoptedRequest* inf_adopted_request_log_next_undo(InfAdoptedRequestLog* log); InfAdoptedRequest* inf_adopted_request_log_next_redo(InfAdoptedRequestLog* log); InfAdoptedRequest* inf_adopted_request_log_upper_related(InfAdoptedRequestLog* log, guint n); InfAdoptedRequest* inf_adopted_request_log_lower_related(InfAdoptedRequestLog* log, guint n); G_END_DECLS #endif /* __INF_ADOPTED_REQUEST_LOG_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/adopted/Makefile.am0000644000175000017500000000205712264763732016776 00000000000000libinfinity_adopted_la_CPPFLAGS = \ -I$(top_srcdir) \ $(infinity_CFLAGS) noinst_LTLIBRARIES = libinfinity_adopted.la libinfinity_adopted_ladir = \ $(includedir)/libinfinity-$(LIBINFINITY_API_VERSION)/libinfinity/adopted libinfinity_adopted_la_SOURCES = \ inf-adopted-algorithm.c \ inf-adopted-concurrency-warning.c \ inf-adopted-no-operation.c \ inf-adopted-operation.c \ inf-adopted-request.c \ inf-adopted-request-log.c \ inf-adopted-session.c \ inf-adopted-session-record.c \ inf-adopted-session-replay.c \ inf-adopted-split-operation.c \ inf-adopted-state-vector.c \ inf-adopted-undo-grouping.c \ inf-adopted-user.c libinfinity_adopted_la_HEADERS = \ inf-adopted-algorithm.h \ inf-adopted-no-operation.h \ inf-adopted-operation.h \ inf-adopted-request.h \ inf-adopted-request-log.h \ inf-adopted-session.h \ inf-adopted-session-record.h \ inf-adopted-session-replay.h \ inf-adopted-split-operation.h \ inf-adopted-state-vector.h \ inf-adopted-undo-grouping.h \ inf-adopted-user.h noinst_HEADERS = \ inf-adopted-concurrency-warning.h libinfinity-0.5.5/libinfinity/adopted/inf-adopted-session.c0000644000175000017500000013044312264763732020762 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ /* TODO: warning if no update from a particular non-local user for some time */ #include #include #include #include #include #include #include #include /** * SECTION:inf-adopted-session * @title: InfAdoptedSession * @short_description: Session handling concurrency control via the adOPTed * algorithm. * @include: libinfinity/adopted/inf-adopted-session.h * @see_also: #InfSession, #InfAdoptedAlgorithm * @stability: Unstable * * #InfAdoptedSession handles concurrency control with an #InfAdoptedAlgorithm * on top of a #InfSession. It takes care of sending all necessary information * to joining users, receives requests from the network (passing them to * #InfAdoptedAlgorithm) and transfers local requests to the other users. It * also makes sure to periodically send the state the local host is in to * other uses even if the local users are idle (which is required for others * to cleanup their request logs and request caches). */ typedef struct _InfAdoptedSessionToXmlSyncForeachData InfAdoptedSessionToXmlSyncForeachData; struct _InfAdoptedSessionToXmlSyncForeachData { InfAdoptedSession* session; xmlNodePtr parent_xml; }; typedef struct _InfAdoptedSessionLocalUser InfAdoptedSessionLocalUser; struct _InfAdoptedSessionLocalUser { InfAdoptedUser* user; InfAdoptedStateVector* last_send_vector; time_t noop_time; }; typedef struct _InfAdoptedSessionPrivate InfAdoptedSessionPrivate; struct _InfAdoptedSessionPrivate { InfIo* io; guint max_total_log_size; InfAdoptedAlgorithm* algorithm; GSList* local_users; /* having zero or one item in 99.9% of all cases */ /* Timeout for sending noop with our current vector time */ InfIoTimeout* noop_timeout; /* User to send the time for */ InfAdoptedSessionLocalUser* next_noop_user; }; enum { PROP_0, /* construct only */ PROP_IO, PROP_MAX_TOTAL_LOG_SIZE, /* read only */ PROP_ALGORITHM }; #define INF_ADOPTED_SESSION_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), INF_ADOPTED_TYPE_SESSION, InfAdoptedSessionPrivate)) static InfSessionClass* parent_class; static GQuark inf_adopted_session_error_quark; /* TODO: This should perhaps be a property: */ static const int INF_ADOPTED_SESSION_NOOP_INTERVAL = 30; /* * Utility functions. */ static InfAdoptedSessionLocalUser* inf_adopted_session_lookup_local_user(InfAdoptedSession* session, InfAdoptedUser* user) { InfAdoptedSessionPrivate* priv; InfAdoptedSessionLocalUser* local; GSList* item; priv = INF_ADOPTED_SESSION_PRIVATE(session); for(item = priv->local_users; item != NULL; item = g_slist_next(item)) { local = (InfAdoptedSessionLocalUser*)item->data; if(local->user == user) return local; } return NULL; } /* Checks whether request can be inserted into log */ /* TODO: Move into request log class? */ static gboolean inf_adopted_session_validate_request(InfAdoptedRequestLog* log, InfAdoptedRequest* request, GError** error) { InfAdoptedStateVector* vector; guint user_id; guint n; guint begin; guint end; vector = inf_adopted_request_get_vector(request); user_id = inf_adopted_request_get_user_id(request); n = inf_adopted_state_vector_get(vector, user_id); begin = inf_adopted_request_log_get_begin(log); end = inf_adopted_request_log_get_end(log); /* TODO: Actually, begin != end is only relevant for the first request * in request log. */ if(end != n && begin != end) { g_set_error( error, inf_adopted_session_error_quark, INF_ADOPTED_SESSION_ERROR_INVALID_REQUEST, _("Request has index '%u', but index '%u' was expected"), n, inf_adopted_request_log_get_end(log) ); return FALSE; } else { switch(inf_adopted_request_get_request_type(request)) { case INF_ADOPTED_REQUEST_DO: /* Nothing to check for */ return TRUE; case INF_ADOPTED_REQUEST_UNDO: if(inf_adopted_request_log_next_undo(log) == NULL) { g_set_error( error, inf_adopted_session_error_quark, INF_ADOPTED_SESSION_ERROR_INVALID_REQUEST, "%s", _("Undo received, but no previous request found") ); return FALSE; } else { return TRUE; } case INF_ADOPTED_REQUEST_REDO: if(inf_adopted_request_log_next_redo(log) == NULL) { g_set_error( error, inf_adopted_session_error_quark, INF_ADOPTED_SESSION_ERROR_INVALID_REQUEST, "%s", _("Redo received, but no previous request found") ); return FALSE; } else { return TRUE; } default: g_assert_not_reached(); return FALSE; } } } static InfAdoptedUser* inf_adopted_session_user_from_request_xml(InfAdoptedSession* session, xmlNodePtr xml, GError** error) { InfUserTable* user_table; InfUser* user; guint user_id; user_table = inf_session_get_user_table(INF_SESSION(session)); if(!inf_xml_util_get_attribute_uint_required(xml, "user", &user_id, error)) return FALSE; /* User ID 0 means no user */ if(user_id == 0) return NULL; user = inf_user_table_lookup_user_by_id(user_table, user_id); if(user == NULL) { g_set_error( error, inf_adopted_session_error_quark, INF_ADOPTED_SESSION_ERROR_NO_SUCH_USER, _("No such user with user ID '%u'"), user_id ); return NULL; } g_assert(INF_ADOPTED_IS_USER(user)); return INF_ADOPTED_USER(user); } /* * Noop timer */ static void inf_adopted_session_noop_timeout_func(gpointer user_data) { InfAdoptedSession* session; InfAdoptedSessionPrivate* priv; InfAdoptedOperation* op; InfAdoptedRequest* request; session = INF_ADOPTED_SESSION(user_data); priv = INF_ADOPTED_SESSION_PRIVATE(session); priv->noop_timeout = NULL; g_assert(priv->next_noop_user != NULL); op = INF_ADOPTED_OPERATION(inf_adopted_no_operation_new()); request = inf_adopted_algorithm_generate_request_noexec( priv->algorithm, priv->next_noop_user->user, op ); g_object_unref(op); /* This resets noop_time for this user, determines the next user for * which to generate a noop request and schedules the new timeout. */ inf_adopted_session_broadcast_request(session, request); g_object_unref(request); } static InfAdoptedSessionLocalUser* inf_adopted_session_find_next_noop_user(InfAdoptedSession* session) { InfAdoptedSessionPrivate* priv; GSList* item; InfAdoptedSessionLocalUser* local; InfAdoptedSessionLocalUser* next_user; priv = INF_ADOPTED_SESSION_PRIVATE(session); next_user = NULL; for(item = priv->local_users; item != NULL; item = g_slist_next(item)) { local = (InfAdoptedSessionLocalUser*)item->data; if(local->noop_time != 0) if(next_user == NULL || local->noop_time < next_user->noop_time) next_user = local; } return next_user; } static void inf_adopted_session_schedule_noop_timer(InfAdoptedSession* session) { InfAdoptedSessionPrivate* priv; time_t current; time_t sched; priv = INF_ADOPTED_SESSION_PRIVATE(session); if(priv->noop_timeout != NULL) { inf_io_remove_timeout(priv->io, priv->noop_timeout); priv->noop_timeout = NULL; } if(priv->next_noop_user != NULL) { current = time(NULL); sched = priv->next_noop_user->noop_time + INF_ADOPTED_SESSION_NOOP_INTERVAL; if(sched >= current) sched -= current; else sched = 0; priv->noop_timeout = inf_io_add_timeout( priv->io, sched * 1000, inf_adopted_session_noop_timeout_func, session, NULL ); } } static void inf_adopted_session_start_noop_timer(InfAdoptedSession* session, InfAdoptedSessionLocalUser* local) { InfAdoptedSessionPrivate* priv; priv = INF_ADOPTED_SESSION_PRIVATE(session); g_assert(local->noop_time == 0); local->noop_time = time(NULL); if(priv->noop_timeout == NULL) { priv->next_noop_user = inf_adopted_session_find_next_noop_user(session); g_assert(priv->next_noop_user != NULL); inf_adopted_session_schedule_noop_timer(session); } } static void inf_adopted_session_stop_noop_timer(InfAdoptedSession* session, InfAdoptedSessionLocalUser* local) { InfAdoptedSessionPrivate* priv; InfAdoptedSessionLocalUser* next_noop_user; priv = INF_ADOPTED_SESSION_PRIVATE(session); if(local->noop_time > 0) { local->noop_time = 0; next_noop_user = inf_adopted_session_find_next_noop_user(session); if(next_noop_user != priv->next_noop_user) { priv->next_noop_user = next_noop_user; inf_adopted_session_schedule_noop_timer(session); } } } /* Breadcasts a request N times - makes only sense for undo and redo requests, * so that's the only thing we offer API for. */ static void inf_adopted_session_broadcast_n_requests(InfAdoptedSession* session, InfAdoptedRequest* request, guint n) { InfAdoptedSessionPrivate* priv; InfAdoptedSessionClass* session_class; InfUserTable* user_table; guint user_id; InfUser* user; InfAdoptedSessionLocalUser* local; xmlNodePtr xml; priv = INF_ADOPTED_SESSION_PRIVATE(session); session_class = INF_ADOPTED_SESSION_GET_CLASS(session); g_assert(session_class->request_to_xml != NULL); user_table = inf_session_get_user_table(INF_SESSION(session)); user_id = inf_adopted_request_get_user_id(request); user = inf_user_table_lookup_user_by_id(user_table, user_id); g_assert(user != NULL); local = inf_adopted_session_lookup_local_user( session, INF_ADOPTED_USER(user) ); g_assert(local != NULL); xml = xmlNewNode(NULL, (const xmlChar*)"request"); session_class->request_to_xml( session, xml, request, local->last_send_vector, FALSE ); if(n > 1) inf_xml_util_set_attribute_uint(xml, "num", n); inf_session_send_to_subscriptions(INF_SESSION(session), xml); inf_adopted_state_vector_free(local->last_send_vector); local->last_send_vector = inf_adopted_state_vector_copy( inf_adopted_request_get_vector(request) ); /* Add this request to last send vector if it increases vector time * (-> affects buffer). */ if(inf_adopted_request_affects_buffer(request) == TRUE) inf_adopted_state_vector_add(local->last_send_vector, user_id, n); inf_adopted_session_stop_noop_timer(session, local); } /* * Signal handlers */ static void inf_adopted_session_local_user_added(InfAdoptedSession* session, InfAdoptedUser* user) { InfAdoptedSessionPrivate* priv; InfSessionStatus status; InfAdoptedSessionLocalUser* local; InfAdoptedStateVector* current_state; priv = INF_ADOPTED_SESSION_PRIVATE(session); status = inf_session_get_status(INF_SESSION(session)); /* Cannot be local while synchronizing */ g_assert(status == INF_SESSION_RUNNING); local = g_slice_new(InfAdoptedSessionLocalUser); local->user = user; local->last_send_vector = inf_adopted_state_vector_copy( inf_adopted_user_get_vector(user) ); /* Set current vector for local user, this is kept up-to-date by * InfAdoptedAlgorithm. TODO: Also do this in InfAdoptedAlgorithm? */ inf_adopted_user_set_vector( user, inf_adopted_state_vector_copy( inf_adopted_algorithm_get_current(priv->algorithm) ) ); local->noop_time = 0; priv->local_users = g_slist_prepend(priv->local_users, local); /* Start noop timer if user is not up to date */ current_state = inf_adopted_algorithm_get_current(priv->algorithm); if(inf_adopted_state_vector_compare(current_state, local->last_send_vector)) inf_adopted_session_start_noop_timer(session, local); } static void inf_adopted_session_remove_local_user_cb(InfUserTable* user_table, InfUser* user, gpointer user_data) { InfAdoptedSession* session; InfAdoptedSessionPrivate* priv; InfAdoptedSessionLocalUser* local; session = INF_ADOPTED_SESSION(user_data); priv = INF_ADOPTED_SESSION_PRIVATE(session); local = inf_adopted_session_lookup_local_user( session, INF_ADOPTED_USER(user) ); g_assert(local != NULL); inf_adopted_session_stop_noop_timer(session, local); inf_adopted_state_vector_free(local->last_send_vector); priv->local_users = g_slist_remove(priv->local_users, local); g_slice_free(InfAdoptedSessionLocalUser, local); } static void inf_adopted_session_add_local_user_cb(InfUserTable* user_table, InfUser* user, gpointer user_data) { g_assert(INF_ADOPTED_IS_USER(user)); inf_adopted_session_local_user_added( INF_ADOPTED_SESSION(user_data), INF_ADOPTED_USER(user) ); } static void inf_adopted_session_constructor_foreach_local_user_func(InfUser* user, gpointer user_data) { g_assert(INF_ADOPTED_IS_USER(user)); inf_adopted_session_local_user_added( INF_ADOPTED_SESSION(user_data), INF_ADOPTED_USER(user) ); } static void inf_adopted_session_execute_request_cb(InfAdoptedAlgorithm* algorithm, InfAdoptedUser* user, InfAdoptedRequest* request, gboolean apply, gpointer user_data) { InfAdoptedSession* session; InfAdoptedSessionPrivate* priv; GSList* item; InfAdoptedSessionLocalUser* local; guint id; session = INF_ADOPTED_SESSION(user_data); priv = INF_ADOPTED_SESSION_PRIVATE(session); if(inf_adopted_request_affects_buffer(request)) { id = inf_adopted_request_get_user_id(request); /* A request has been executed, meaning we are no longer up to date. Send * a noop in some time, so that others know what we already processed. */ for(item = priv->local_users; item != NULL; item = g_slist_next(item)) { local = (InfAdoptedSessionLocalUser*)item->data; if(local->noop_time == 0) /* Except we issued the request ourselves, of course. */ if(inf_user_get_id(INF_USER(local->user)) != id) inf_adopted_session_start_noop_timer(session, local); } } /* Mark inactive users active if they do something */ /* Note: This behaviour is implicitly performed by both client and server, * and requires no further network traffic. However, users explictely have * to be set inactive. */ if(inf_adopted_request_get_request_type(request) != INF_ADOPTED_REQUEST_DO || !INF_ADOPTED_IS_NO_OPERATION(inf_adopted_request_get_operation(request))) { /* TODO: We should offer a virtual function to flush all requests for * local users, either here or even in InfSession via a vfunc, so that * we don't accidentally make local users active by a delayed request. */ if(inf_user_get_status(INF_USER(user)) == INF_USER_INACTIVE) g_object_set(G_OBJECT(user), "status", INF_USER_ACTIVE, NULL); } } /* * Helper functions */ static void inf_adopted_session_create_algorithm(InfAdoptedSession* session) { InfAdoptedSessionPrivate* priv; priv = INF_ADOPTED_SESSION_PRIVATE(session); g_assert(priv->algorithm == NULL); g_assert( inf_session_get_status(INF_SESSION(session)) == INF_SESSION_RUNNING ); priv->algorithm = inf_adopted_algorithm_new_full( inf_session_get_user_table(INF_SESSION(session)), inf_session_get_buffer(INF_SESSION(session)), priv->max_total_log_size ); g_signal_connect( G_OBJECT(priv->algorithm), "execute-request", G_CALLBACK(inf_adopted_session_execute_request_cb), session ); g_object_notify(G_OBJECT(session), "algorithm"); } /* * GObject overrides. */ static void inf_adopted_session_init(GTypeInstance* instance, gpointer g_class) { InfAdoptedSession* session; InfAdoptedSessionPrivate* priv; session = INF_ADOPTED_SESSION(instance); priv = INF_ADOPTED_SESSION_PRIVATE(session); priv->io = NULL; priv->max_total_log_size = 2048; priv->algorithm = NULL; priv->local_users = NULL; priv->noop_timeout = NULL; priv->next_noop_user = NULL; } static GObject* inf_adopted_session_constructor(GType type, guint n_construct_properties, GObjectConstructParam* construct_properties) { GObject* object; InfAdoptedSession* session; InfAdoptedSessionPrivate* priv; InfSessionStatus status; InfUserTable* user_table; object = G_OBJECT_CLASS(parent_class)->constructor( type, n_construct_properties, construct_properties ); session = INF_ADOPTED_SESSION(object); priv = INF_ADOPTED_SESSION_PRIVATE(session); g_assert(priv->io != NULL); g_object_get(G_OBJECT(session), "status", &status, NULL); user_table = inf_session_get_user_table(INF_SESSION(session)); g_signal_connect( G_OBJECT(user_table), "add-local-user", G_CALLBACK(inf_adopted_session_add_local_user_cb), session ); g_signal_connect( G_OBJECT(user_table), "remove-local-user", G_CALLBACK(inf_adopted_session_remove_local_user_cb), session ); switch(status) { case INF_SESSION_PRESYNC: case INF_SESSION_SYNCHRONIZING: /* algorithm is created during initial synchronization when parameters * like initial vector time, max total log size etc. are known. */ break; case INF_SESSION_RUNNING: g_assert(inf_session_get_buffer(INF_SESSION(session)) != NULL); inf_adopted_session_create_algorithm(session); break; case INF_SESSION_CLOSED: /* Session should not be initially closed */ default: g_assert_not_reached(); break; } /* Add initial local users. Note that this requires the algorithm to exist, * though in synchronizing state no local users can exist. */ inf_user_table_foreach_local_user( user_table, inf_adopted_session_constructor_foreach_local_user_func, session ); return object; } static void inf_adopted_session_dispose(GObject* object) { InfAdoptedSession* session; InfAdoptedSessionPrivate* priv; InfUserTable* user_table; session = INF_ADOPTED_SESSION(object); priv = INF_ADOPTED_SESSION_PRIVATE(session); user_table = inf_session_get_user_table(INF_SESSION(session)); inf_signal_handlers_disconnect_by_func( G_OBJECT(user_table), G_CALLBACK(inf_adopted_session_add_local_user_cb), session ); inf_signal_handlers_disconnect_by_func( G_OBJECT(user_table), G_CALLBACK(inf_adopted_session_remove_local_user_cb), session ); if(priv->noop_timeout != NULL) { inf_io_remove_timeout(priv->io, priv->noop_timeout); priv->noop_timeout = NULL; } /* This calls the close vfunc if the session is running, in which we * free the local users. */ G_OBJECT_CLASS(parent_class)->dispose(object); g_assert(priv->local_users == NULL); if(priv->algorithm != NULL) { inf_signal_handlers_disconnect_by_func( G_OBJECT(priv->algorithm), G_CALLBACK(inf_adopted_session_execute_request_cb), session ); g_object_unref(G_OBJECT(priv->algorithm)); priv->algorithm = NULL; } if(priv->io != NULL) { g_object_unref(G_OBJECT(priv->io)); priv->io = NULL; } } static void inf_adopted_session_finalize(GObject* object) { InfAdoptedSession* session; InfAdoptedSessionPrivate* priv; session = INF_ADOPTED_SESSION(object); priv = INF_ADOPTED_SESSION_PRIVATE(session); /* Should have been freed in close, called by dispose */ g_assert(priv->local_users == NULL); G_OBJECT_CLASS(parent_class)->finalize(object); } static void inf_adopted_session_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec) { InfAdoptedSession* session; InfAdoptedSessionPrivate* priv; session = INF_ADOPTED_SESSION(object); priv = INF_ADOPTED_SESSION_PRIVATE(session); switch(prop_id) { case PROP_IO: g_assert(priv->io == NULL); /* construct only */ priv->io = INF_IO(g_value_dup_object(value)); break; case PROP_MAX_TOTAL_LOG_SIZE: priv->max_total_log_size = g_value_get_uint(value); break; case PROP_ALGORITHM: /* read only */ default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void inf_adopted_session_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec) { InfAdoptedSession* session; InfAdoptedSessionPrivate* priv; session = INF_ADOPTED_SESSION(object); priv = INF_ADOPTED_SESSION_PRIVATE(session); switch(prop_id) { case PROP_IO: g_value_set_object(value, G_OBJECT(priv->io)); break; case PROP_MAX_TOTAL_LOG_SIZE: g_value_set_uint(value, priv->max_total_log_size); break; case PROP_ALGORITHM: g_value_set_object(value, G_OBJECT(priv->algorithm)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } /* * VFunc implementations. */ static void inf_adopted_session_to_xml_sync_foreach_user_func(InfUser* user, gpointer user_data) { InfAdoptedRequestLog* log; InfAdoptedSessionToXmlSyncForeachData* data; InfAdoptedSessionClass* session_class; guint i; guint end; xmlNodePtr xml; InfAdoptedRequest* request; g_assert(INF_ADOPTED_IS_USER(user)); data = (InfAdoptedSessionToXmlSyncForeachData*)user_data; log = inf_adopted_user_get_request_log(INF_ADOPTED_USER(user)); end = inf_adopted_request_log_get_end(log); session_class = INF_ADOPTED_SESSION_GET_CLASS(data->session); g_assert(session_class->request_to_xml != NULL); for(i = inf_adopted_request_log_get_begin(log); i < end; ++ i) { request = inf_adopted_request_log_get_request(log, i); xml = xmlNewChild( data->parent_xml, NULL, (const xmlChar*)"sync-request", NULL ); /* TODO: Diff to previous request? */ session_class->request_to_xml(data->session, xml, request, NULL, TRUE); xmlAddChild(data->parent_xml, xml); } } static void inf_adopted_session_to_xml_sync(InfSession* session, xmlNodePtr parent) { InfAdoptedSessionPrivate* priv; InfAdoptedSessionToXmlSyncForeachData foreach_data; priv = INF_ADOPTED_SESSION_PRIVATE(session); g_assert(priv->algorithm != NULL); INF_SESSION_CLASS(parent_class)->to_xml_sync(session, parent); foreach_data.session = INF_ADOPTED_SESSION(session); foreach_data.parent_xml = parent; inf_user_table_foreach_user( inf_session_get_user_table(session), inf_adopted_session_to_xml_sync_foreach_user_func, &foreach_data ); } static gboolean inf_adopted_session_process_xml_sync(InfSession* session, InfXmlConnection* connection, const xmlNodePtr xml, GError** error) { InfAdoptedSessionClass* session_class; InfAdoptedRequest* request; InfAdoptedUser* user; InfAdoptedRequestLog* log; if(strcmp((const char*)xml->name, "sync-request") == 0) { session_class = INF_ADOPTED_SESSION_GET_CLASS(session); g_assert(session_class->xml_to_request != NULL); request = session_class->xml_to_request( INF_ADOPTED_SESSION(session), xml, NULL, /* TODO: Diff to previous request, if any. */ TRUE, error ); if(request == NULL) return FALSE; user = INF_ADOPTED_USER( inf_user_table_lookup_user_by_id( inf_session_get_user_table(session), inf_adopted_request_get_user_id(request) ) ); log = inf_adopted_user_get_request_log(user); if(inf_adopted_session_validate_request(log, request, error) == FALSE) { g_object_unref(request); return FALSE; } inf_adopted_request_log_add_request(log, request); g_object_unref(request); return TRUE; } return INF_SESSION_CLASS(parent_class)->process_xml_sync( session, connection, xml, error ); } static InfCommunicationScope inf_adopted_session_process_xml_run(InfSession* session, InfXmlConnection* connection, const xmlNodePtr xml, GError** error) { InfAdoptedSessionPrivate* priv; InfAdoptedSessionClass* session_class; InfAdoptedRequest* request; InfAdoptedUser* user; gboolean has_num; guint num; GError* local_error; InfAdoptedRequest* copy_req; guint i; priv = INF_ADOPTED_SESSION_PRIVATE(session); if(strcmp((const char*)xml->name, "request") == 0) { session_class = INF_ADOPTED_SESSION_GET_CLASS(session); g_assert(session_class->xml_to_request != NULL); user = inf_adopted_session_user_from_request_xml( INF_ADOPTED_SESSION(session), xml, error ); if(user == NULL) return INF_COMMUNICATION_SCOPE_PTP; if(inf_user_get_status(INF_USER(user)) == INF_USER_UNAVAILABLE || inf_user_get_connection(INF_USER(user)) != connection) { g_set_error( error, inf_user_error_quark(), INF_USER_ERROR_NOT_JOINED, "%s", _("User did not join from this connection") ); return INF_COMMUNICATION_SCOPE_PTP; } local_error = NULL; has_num = inf_xml_util_get_attribute_uint(xml, "num", &num, &local_error); if(local_error != NULL) { g_propagate_error(error, local_error); return INF_COMMUNICATION_SCOPE_PTP; } request = session_class->xml_to_request( INF_ADOPTED_SESSION(session), xml, inf_adopted_user_get_vector(user), FALSE, error ); if(request == NULL) return INF_COMMUNICATION_SCOPE_PTP; inf_adopted_algorithm_receive_request(priv->algorithm, request); /* Apply the request more than once if num is given. This is mostly used * for multiple undos and redos, but is in general allowed for any * request. */ if(has_num) { for(i = 1; i < num; ++i) { /* TODO: This is a bit of a hack since requests are normally * immutable. It avoids an additional vector copy here though. */ copy_req = inf_adopted_request_copy(request); inf_adopted_state_vector_add( inf_adopted_request_get_vector(copy_req), inf_user_get_id(INF_USER(user)), i ); inf_adopted_algorithm_receive_request(priv->algorithm, copy_req); g_object_unref(copy_req); } } g_object_unref(request); /* Requests can always be forwarded since user is given. */ return INF_COMMUNICATION_SCOPE_GROUP; } return INF_SESSION_CLASS(parent_class)->process_xml_run( session, connection, xml, error ); } static GArray* inf_adopted_session_get_xml_user_props(InfSession* session, InfXmlConnection* conn, const xmlNodePtr xml) { GArray* array; GParameter* parameter; InfAdoptedStateVector* vector; xmlChar* time; array = INF_SESSION_CLASS(parent_class)->get_xml_user_props( session, conn, xml ); /* Vector time */ time = inf_xml_util_get_attribute(xml, "time"); if(time != NULL) { vector = inf_adopted_state_vector_from_string((const gchar*)time, NULL); xmlFree(time); /* TODO: Error reporting for get_xml_user_props */ if(vector != NULL) { parameter = inf_session_get_user_property(array, "vector"); g_value_init(¶meter->value, INF_ADOPTED_TYPE_STATE_VECTOR); g_value_take_boxed(¶meter->value, vector); } } /* log-begin is not in the spec */ #if 0 /* Initial request log, only if ID is also given */ id_param = inf_session_lookup_user_property( (const GParameter*)array->data, array->len, "id" ); if(id_param != NULL && inf_xml_util_get_attribute_uint(xml, "log-begin", &log_begin, NULL)) { log = inf_adopted_request_log_new( g_value_get_uint(&id_param->value), log_begin ); parameter = inf_session_get_user_property(array, "request-log"); g_value_init(¶meter->value, INF_ADOPTED_TYPE_REQUEST_LOG); g_value_take_object(¶meter->value, log); } #endif return array; } static void inf_adopted_session_set_xml_user_props(InfSession* session, const GParameter* params, guint n_params, xmlNodePtr xml) { const GParameter* time; InfAdoptedStateVector* vector; gchar* time_string; INF_SESSION_CLASS(parent_class)->set_xml_user_props( session, params, n_params, xml ); time = inf_session_lookup_user_property(params, n_params, "vector"); if(time != NULL) { vector = (InfAdoptedStateVector*)g_value_get_boxed(&time->value); time_string = inf_adopted_state_vector_to_string(vector); inf_xml_util_set_attribute(xml, "time", time_string); g_free(time_string); } /* log-begin is not in the spec */ #if 0 log = inf_session_lookup_user_property(params, n_params, "request-log"); if(log != NULL) { log_begin = inf_adopted_request_log_get_begin( INF_ADOPTED_REQUEST_LOG(g_value_get_object(&log->value)) ); inf_xml_util_set_attribute_uint(xml, "log-begin", log_begin); } #endif } static gboolean inf_adopted_session_validate_user_props(InfSession* session, const GParameter* params, guint n_params, InfUser* exclude, GError** error) { const GParameter* time; gboolean result; result = INF_SESSION_CLASS(parent_class)->validate_user_props( session, params, n_params, exclude, error ); if(result == FALSE) return FALSE; time = inf_session_lookup_user_property(params, n_params, "vector"); if(time == NULL) { g_set_error( error, inf_adopted_session_error_quark, INF_ADOPTED_SESSION_ERROR_MISSING_STATE_VECTOR, "%s", _("'time' attribute in user message is missing") ); return FALSE; } return TRUE; } static void inf_adopted_session_close(InfSession* session) { InfAdoptedSessionPrivate* priv; InfAdoptedSessionLocalUser* local; GSList* item; priv = INF_ADOPTED_SESSION_PRIVATE(session); for(item = priv->local_users; item != NULL; item = g_slist_next(item)) { local = (InfAdoptedSessionLocalUser*)item->data; inf_adopted_state_vector_free(local->last_send_vector); g_slice_free(InfAdoptedSessionLocalUser, local); } g_slist_free(priv->local_users); priv->local_users = NULL; /* Local user info is no longer required */ INF_SESSION_CLASS(parent_class)->close(session); } static void inf_adopted_session_synchronization_complete_foreach_user_func(InfUser* user, gpointer data) { InfAdoptedRequestLog* log; log = inf_adopted_user_get_request_log(INF_ADOPTED_USER(user)); /* Set begin index of empty request logs. Algorithm relies on * inf_adopted_request_log_get_begin() to return the index of the request * that will first be added to the request log. */ if(inf_adopted_request_log_is_empty(log)) { inf_adopted_request_log_set_begin( log, inf_adopted_state_vector_get( inf_adopted_user_get_vector(INF_ADOPTED_USER(user)), inf_user_get_id(user) ) ); } } static void inf_adopted_session_synchronization_complete(InfSession* session, InfXmlConnection* connection) { InfAdoptedSessionPrivate* priv; InfSessionStatus status; priv = INF_ADOPTED_SESSION_PRIVATE(session); g_object_get(G_OBJECT(session), "status", &status, NULL); INF_SESSION_CLASS(parent_class)->synchronization_complete( session, connection ); if(status == INF_SESSION_SYNCHRONIZING) { inf_user_table_foreach_user( inf_session_get_user_table(session), inf_adopted_session_synchronization_complete_foreach_user_func, NULL ); /* Create adOPTed algorithm upon successful synchronization */ g_assert(priv->algorithm == NULL); inf_adopted_session_create_algorithm(INF_ADOPTED_SESSION(session)); } } /* * Gype registration. */ static void inf_adopted_session_class_init(gpointer g_class, gpointer class_data) { GObjectClass* object_class; InfSessionClass* session_class; InfAdoptedSessionClass* adopted_session_class; object_class = G_OBJECT_CLASS(g_class); session_class = INF_SESSION_CLASS(g_class); adopted_session_class = INF_ADOPTED_SESSION_CLASS(g_class); parent_class = INF_SESSION_CLASS(g_type_class_peek_parent(g_class)); g_type_class_add_private(g_class, sizeof(InfAdoptedSessionPrivate)); object_class->constructor = inf_adopted_session_constructor; object_class->dispose = inf_adopted_session_dispose; object_class->finalize = inf_adopted_session_finalize; object_class->set_property = inf_adopted_session_set_property; object_class->get_property = inf_adopted_session_get_property; session_class->to_xml_sync = inf_adopted_session_to_xml_sync; session_class->process_xml_sync = inf_adopted_session_process_xml_sync; session_class->process_xml_run = inf_adopted_session_process_xml_run; session_class->get_xml_user_props = inf_adopted_session_get_xml_user_props; session_class->set_xml_user_props = inf_adopted_session_set_xml_user_props; session_class->validate_user_props = inf_adopted_session_validate_user_props; session_class->close = inf_adopted_session_close; session_class->synchronization_complete = inf_adopted_session_synchronization_complete; adopted_session_class->xml_to_request = NULL; adopted_session_class->request_to_xml = NULL; inf_adopted_session_error_quark = g_quark_from_static_string( "INF_ADOPTED_SESSION_ERROR" ); g_object_class_install_property( object_class, PROP_IO, g_param_spec_object( "io", "IO", "The IO object used for timeouts", INF_TYPE_IO, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); g_object_class_install_property( object_class, PROP_MAX_TOTAL_LOG_SIZE, g_param_spec_uint( "max-total-log-size", "Maxmimum total log size", "The maximum number of requests to keep in all user's logs", 0, G_MAXUINT, 2048, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); g_object_class_install_property( object_class, PROP_ALGORITHM, g_param_spec_object( "algorithm", "Algorithm", "The adOPTed algorithm used for translating incoming requests", INF_ADOPTED_TYPE_ALGORITHM, G_PARAM_READABLE ) ); } GType inf_adopted_session_get_type(void) { static GType session_type = 0; if(!session_type) { static const GTypeInfo session_type_info = { sizeof(InfAdoptedSessionClass), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ inf_adopted_session_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InfAdoptedSession), /* instance_size */ 0, /* n_preallocs */ inf_adopted_session_init, /* instance_init */ NULL /* value_table */ }; session_type = g_type_register_static( INF_TYPE_SESSION, "InfAdoptedSession", &session_type_info, 0 ); } return session_type; } /* * Public API. */ /** * inf_adopted_session_get_io: * @session: A #InfAdoptedSession. * * Returns the #InfIo object of @session. * * Return Value: A #InfIo. **/ InfIo* inf_adopted_session_get_io(InfAdoptedSession* session) { g_return_val_if_fail(INF_ADOPTED_IS_SESSION(session), NULL); return INF_ADOPTED_SESSION_PRIVATE(session)->io; } /** * inf_adopted_session_get_algorithm: * @session: A #InfAdoptedSession. * * Returns the #InfAdoptedAlgorithm object of @session. Returns %NULL if * @session has status %INF_SESSION_PRESYNC or %INF_SESSION_SYNCHRONIZING * because there the algorithm object is not yet created before successful * synchronization. * * Return Value: A #InfAdoptedAlgorithm, or %NULL. **/ InfAdoptedAlgorithm* inf_adopted_session_get_algorithm(InfAdoptedSession* session) { g_return_val_if_fail(INF_ADOPTED_IS_SESSION(session), NULL); return INF_ADOPTED_SESSION_PRIVATE(session)->algorithm; } /** * inf_adopted_session_broadcast_request: * @session: A #InfAdoptedSession. * @request: A #InfAdoptedRequest obtained from @session's algorithm. * * Sends a request to all subscribed connections. The request should originate * from a call to inf_adopted_algorithm_generate_request_noexec(), * inf_adopted_algorithm_generate_request(), * inf_adopted_algorithm_generate_undo() or * inf_adopted_algorithm_generate_redo() with @session's #InfAdoptedAlgorithm. **/ void inf_adopted_session_broadcast_request(InfAdoptedSession* session, InfAdoptedRequest* request) { g_return_if_fail(INF_ADOPTED_IS_SESSION(session)); g_return_if_fail(INF_ADOPTED_IS_REQUEST(request)); inf_adopted_session_broadcast_n_requests(session, request, 1); } /** * inf_adopted_session_undo: * @session: A #InfAdoptedSession. * @user: A local #InfAdoptedUser. * @n: The number of undo requests to issue. * * This is a shortcut for creating @n undo requests and broadcasting them. * If @n > 1 then this is also more efficient. **/ void inf_adopted_session_undo(InfAdoptedSession* session, InfAdoptedUser* user, guint n) { InfAdoptedSessionPrivate* priv; InfAdoptedRequest* request; guint i; g_return_if_fail(INF_ADOPTED_IS_SESSION(session)); g_return_if_fail(INF_ADOPTED_IS_USER(user)); g_return_if_fail(n >= 1); /* TODO: Check whether we can issue n undo requests before doing anything */ priv = INF_ADOPTED_SESSION_PRIVATE(session); request = inf_adopted_algorithm_generate_undo(priv->algorithm, user); for(i = 1; i < n; ++i) inf_adopted_algorithm_generate_undo(priv->algorithm, user); inf_adopted_session_broadcast_n_requests(session, request, n); g_object_unref(request); } /** * inf_adopted_session_redo: * @session: A #InfAdoptedSession. * @user: A local #InfAdoptedUser. * @n: The number of redo requests to issue. * * This is a shortcut for creating @n redo requests and broadcasting them. * If @n > 1 then this is also more efficient. **/ void inf_adopted_session_redo(InfAdoptedSession* session, InfAdoptedUser* user, guint n) { InfAdoptedSessionPrivate* priv; InfAdoptedRequest* request; guint i; /* TODO: Check whether we can issue n redo requests before doing anything */ g_return_if_fail(INF_ADOPTED_IS_SESSION(session)); g_return_if_fail(INF_ADOPTED_IS_USER(user)); g_return_if_fail(n >= 1); priv = INF_ADOPTED_SESSION_PRIVATE(session); request = inf_adopted_algorithm_generate_redo(priv->algorithm, user); for(i = 1; i < n; ++i) inf_adopted_algorithm_generate_redo(priv->algorithm, user); inf_adopted_session_broadcast_n_requests(session, request, n); g_object_unref(request); } /** * inf_adopted_session_read_request_info: * @session: A #InfAdoptedSession. * @xml: The XML to read the data from. * @diff_vec: The reference vector of the time vector of the request, or * %NULL. * @user: Location to store the user of the request, or %NULL. * @time: Location to store the state the request was made, or %NULL. * @operation: Location to store the operation of the request, or %NULL. * @error: Location to place an error, if any. * * This function reads common information such as the state vector the request * was made and the user that made the request from XML. It is most likely to * be used by implementations of the xml_to_request virtual function. * * Returns: %TRUE if the data could be read successfully, %FALSE if the XML * request does not contain valid request data, in which case @error is set. */ gboolean inf_adopted_session_read_request_info(InfAdoptedSession* session, xmlNodePtr xml, InfAdoptedStateVector* diff_vec, InfAdoptedUser** user, InfAdoptedStateVector** time, xmlNodePtr* operation, GError** error) { xmlChar* attr; xmlNodePtr child; if(user != NULL) { *user = inf_adopted_session_user_from_request_xml(session, xml, error); if(*user == NULL) return FALSE; } if(time != NULL) { attr = inf_xml_util_get_attribute_required(xml, "time", error); if(attr == NULL) return FALSE; if(diff_vec == NULL) { *time = inf_adopted_state_vector_from_string((const gchar*)attr, error); } else { *time = inf_adopted_state_vector_from_string_diff( (const gchar*)attr, diff_vec, error ); } xmlFree(attr); if(*time == NULL) return FALSE; } if(operation != NULL) { /* Get first child element */ child = xml->children; while(child != NULL && child->type != XML_ELEMENT_NODE) child = child->next; if(child == NULL) { g_set_error( error, inf_adopted_session_error_quark, INF_ADOPTED_SESSION_ERROR_MISSING_OPERATION, "%s", _("Operation for request missing") ); if(time) inf_adopted_state_vector_free(*time); return FALSE; } *operation = child; } return TRUE; } /** * inf_adopted_session_write_request_info: * @session: A #InfAdoptedSession. * @diff_vec: A reference state vector, or %NULL. * @request: The #InfAdoptedRequest whose info to write. * @xml: The XML node to write the data into. * @operation: An XML node representing the operation of the request, or * %NULL. * * This function writes common data from @request, such as the user that * issued the request and the state in which the request was made into @xml. * If @diff_vec is given, then the state is written as a diff to this vector, * see inf_adopted_state_vector_to_string_diff(). Deserializing this data * again (via inf_adopted_session_read_request_info()) requires the same * @diff_vec then. * * This function is most likely to be used by implementations of the * request_to_xml virtual function. */ void inf_adopted_session_write_request_info(InfAdoptedSession* session, InfAdoptedRequest* request, InfAdoptedStateVector* diff_vec, xmlNodePtr xml, xmlNodePtr operation) { InfAdoptedStateVector* vector; guint user_id; gchar* vec_str; vector = inf_adopted_request_get_vector(request); user_id = inf_adopted_request_get_user_id(request); inf_xml_util_set_attribute_uint(xml, "user", user_id); if(diff_vec == NULL) vec_str = inf_adopted_state_vector_to_string(vector); else vec_str = inf_adopted_state_vector_to_string_diff(vector, diff_vec); inf_xml_util_set_attribute(xml, "time", vec_str); g_free(vec_str); if(operation != NULL) xmlAddChild(xml, operation); } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/adopted/inf-adopted-session-record.h0000644000175000017500000000600512264763732022237 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_ADOPTED_SESSION_RECORD_RECORD_H__ #define __INF_ADOPTED_SESSION_RECORD_RECORD_H__ #include #include G_BEGIN_DECLS #define INF_ADOPTED_TYPE_SESSION_RECORD (inf_adopted_session_record_get_type()) #define INF_ADOPTED_SESSION_RECORD(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INF_ADOPTED_TYPE_SESSION_RECORD, InfAdoptedSessionRecord)) #define INF_ADOPTED_SESSION_RECORD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INF_ADOPTED_TYPE_SESSION_RECORD, InfAdoptedSessionRecordClass)) #define INF_ADOPTED_IS_SESSION_RECORD(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INF_ADOPTED_TYPE_SESSION_RECORD)) #define INF_ADOPTED_IS_SESSION_RECORD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INF_ADOPTED_TYPE_SESSION_RECORD)) #define INF_ADOPTED_SESSION_RECORD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), INF_ADOPTED_TYPE_SESSION_RECORD, InfAdoptedSessionRecordClass)) typedef struct _InfAdoptedSessionRecord InfAdoptedSessionRecord; typedef struct _InfAdoptedSessionRecordClass InfAdoptedSessionRecordClass; /** * InfAdoptedSessionRecordClass: * * This structure does not contain any public fields. */ struct _InfAdoptedSessionRecordClass { /*< private >*/ GObjectClass parent_class; }; /** * InfAdoptedSessionRecord: * * #InfAdoptedSessionRecord is an opaque data type. You should only access it * via the public API functions. */ struct _InfAdoptedSessionRecord { /*< private >*/ GObject parent; }; GType inf_adopted_session_record_get_type(void); InfAdoptedSessionRecord* inf_adopted_session_record_new(InfAdoptedSession* session); gboolean inf_adopted_session_record_start_recording(InfAdoptedSessionRecord* record, const gchar* filename, GError** error); gboolean inf_adopted_session_record_stop_recording(InfAdoptedSessionRecord* record, GError** error); gboolean inf_adopted_session_record_is_recording(InfAdoptedSessionRecord* record); G_END_DECLS #endif /* __INF_ADOPTED_SESSION_RECORD_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/adopted/inf-adopted-user.h0000644000175000017500000000545312264763732020264 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_ADOPTED_USER_H__ #define __INF_ADOPTED_USER_H__ #include #include #include #include G_BEGIN_DECLS #define INF_ADOPTED_TYPE_USER (inf_adopted_user_get_type()) #define INF_ADOPTED_USER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INF_ADOPTED_TYPE_USER, InfAdoptedUser)) #define INF_ADOPTED_USER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INF_ADOPTED_TYPE_USER, InfAdoptedUserClass)) #define INF_ADOPTED_IS_USER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INF_ADOPTED_TYPE_USER)) #define INF_ADOPTED_IS_USER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INF_ADOPTED_TYPE_USER)) #define INF_ADOPTED_USER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), INF_ADOPTED_TYPE_USER, InfAdoptedUserClass)) /* Already declared in inf-adopted-operation.h to avoid * cyclic include chains */ /*typedef struct _InfAdoptedUser InfAdoptedUser;*/ typedef struct _InfAdoptedUserClass InfAdoptedUserClass; /** * InfAdoptedUserClass: * * This structure does not contain any public fields. */ struct _InfAdoptedUserClass { /*< private >*/ InfUserClass parent_class; }; /** * InfAdoptedUser: * * #InfAdoptedUser is an opaque data type. You should only access it * via the public API functions. */ struct _InfAdoptedUser { /*< private >*/ InfUser parent; gpointer priv; }; GType inf_adopted_user_get_type(void) G_GNUC_CONST; guint inf_adopted_user_get_component(InfAdoptedUser* user, guint id); InfAdoptedStateVector* inf_adopted_user_get_vector(InfAdoptedUser* user); void inf_adopted_user_set_vector(InfAdoptedUser* user, InfAdoptedStateVector* vec); InfAdoptedRequestLog* inf_adopted_user_get_request_log(InfAdoptedUser* user); G_END_DECLS #endif /* __INF_ADOPTED_USER_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/adopted/inf-adopted-session-replay.h0000644000175000017500000001102412264763732022252 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_ADOPTED_SESSION_REPLAY_H__ #define __INF_ADOPTED_SESSION_REPLAY_H__ #include #include #include G_BEGIN_DECLS #define INF_ADOPTED_TYPE_SESSION_REPLAY (inf_adopted_session_replay_get_type()) #define INF_ADOPTED_SESSION_REPLAY(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INF_ADOPTED_TYPE_SESSION_REPLAY, InfAdoptedSessionReplay)) #define INF_ADOPTED_SESSION_REPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INF_ADOPTED_TYPE_SESSION_REPLAY, InfAdoptedSessionReplayClass)) #define INF_ADOPTED_IS_SESSION_REPLAY(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INF_ADOPTED_TYPE_SESSION_REPLAY)) #define INF_ADOPTED_IS_SESSION_REPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INF_ADOPTED_TYPE_SESSION_REPLAY)) #define INF_ADOPTED_SESSION_REPLAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), INF_ADOPTED_TYPE_SESSION_REPLAY, InfAdoptedSessionReplayClass)) typedef struct _InfAdoptedSessionReplay InfAdoptedSessionReplay; typedef struct _InfAdoptedSessionReplayClass InfAdoptedSessionReplayClass; /** * InfAdoptedSessionReplayError: * @INF_ADOPTED_SESSION_REPLAY_ERROR_BAD_FILE: The record file could not be * opened for reading. * @INF_ADOPTED_SESSION_REPLAY_ERROR_BAD_XML: The record file contains * invalid XML. * @INF_ADOPTED_SESSION_REPLAY_ERROR_BAD_DOCUMENT: The record file is not a * session recording. * @INF_ADOPTED_SESSION_REPLAY_ERROR_BAD_SESSION_TYPE: The record file is a * session recording for a different type of session than the one provided. * @INF_ADOPTED_SESSION_REPLAY_ERROR_BAD_FORMAT: The record file is invalid. * @INF_ADOPTED_SESSION_REPLAY_ERROR_UNEXPECTED_EOF: More data was expected * to be read from the record file, but the end of file was reached. * * Error codes for the INF_ADOPTED_SESSION_REPLAY_ERROR * error domain. These can occur while loading or replaying a session * with #InfAdoptedSessionReplay. */ typedef enum _InfAdoptedSessionReplayError { INF_ADOPTED_SESSION_REPLAY_ERROR_BAD_FILE, INF_ADOPTED_SESSION_REPLAY_ERROR_BAD_XML, INF_ADOPTED_SESSION_REPLAY_ERROR_BAD_DOCUMENT, INF_ADOPTED_SESSION_REPLAY_ERROR_BAD_SESSION_TYPE, INF_ADOPTED_SESSION_REPLAY_ERROR_BAD_FORMAT, INF_ADOPTED_SESSION_REPLAY_ERROR_UNEXPECTED_EOF } InfAdoptedSessionReplayError; /** * InfAdoptedSessionReplayClass: * * This structure does not contain any public fields. */ struct _InfAdoptedSessionReplayClass { /*< private >*/ GObjectClass parent_class; }; /** * InfAdoptedSessionReplay: * * #InfAdoptedSessionReplay is an opaque data type. You should only access it * via the public API functions. */ struct _InfAdoptedSessionReplay { /*< private >*/ GObject parent; }; GType inf_adopted_session_replay_get_type(void); InfAdoptedSessionReplay* inf_adopted_session_replay_new(void); /* TODO: Move InfcNotePlugin to common, as InfNotePlugin, and "derive" * InfdNotePlugin from it. */ gboolean inf_adopted_session_replay_set_record(InfAdoptedSessionReplay* replay, const gchar* filename, const InfcNotePlugin* plugin, GError** error); InfAdoptedSession* inf_adopted_session_replay_get_session(InfAdoptedSessionReplay* replay); gboolean inf_adopted_session_replay_play_next(InfAdoptedSessionReplay* replay, GError** error); gboolean inf_adopted_session_replay_play_to_end(InfAdoptedSessionReplay* replay, GError** error); G_END_DECLS #endif /* __INF_ADOPTED_SESSION_REPLAY_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/adopted/inf-adopted-state-vector.h0000644000175000017500000001063612264763732021725 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_ADOPTED_STATE_VECTOR_H__ #define __INF_ADOPTED_STATE_VECTOR_H__ #include G_BEGIN_DECLS #define INF_ADOPTED_TYPE_STATE_VECTOR (inf_adopted_state_vector_get_type()) /** * InfAdoptedStateVector: * * #InfAdoptedStateVector is an opaque data type. You should only access it * via the public API functions. */ typedef struct _InfAdoptedStateVector InfAdoptedStateVector; /** * InfAdoptedStateVectorError: * @INF_ADOPTED_STATE_VECTOR_BAD_FORMAT: A string representation of an * #InfAdoptedStateVector as required by * inf_adopted_state_vector_from_string() or * inf_adopted_state_vector_from_string_diff() is invalid. * @INF_ADOPTED_STATE_VECTOR_FAILED: No further specified error code. * * Error codes for #InfAdoptedStateVector. */ typedef enum _InfAdoptedStateVectorError { INF_ADOPTED_STATE_VECTOR_BAD_FORMAT, INF_ADOPTED_STATE_VECTOR_FAILED } InfAdoptedStateVectorError; /** * InfAdoptedStateVectorForeachFunc: * @id: The ID of the entry. * @value: The value of the entry. * @user_data: The user data passed to inf_adopted_state_vector_foreach(). * * This function is called for every component in the state vector during * the invocation of inf_adopted_state_vector_foreach(). */ typedef void(*InfAdoptedStateVectorForeachFunc)(guint id, guint value, gpointer user_data); GType inf_adopted_state_vector_get_type(void) G_GNUC_CONST; GQuark inf_adopted_state_vector_error_quark(void); InfAdoptedStateVector* inf_adopted_state_vector_new(void); InfAdoptedStateVector* inf_adopted_state_vector_copy(InfAdoptedStateVector* vec); void inf_adopted_state_vector_free(InfAdoptedStateVector* vec); guint inf_adopted_state_vector_get(InfAdoptedStateVector* vec, guint id); void inf_adopted_state_vector_set(InfAdoptedStateVector* vec, guint id, guint value); void inf_adopted_state_vector_add(InfAdoptedStateVector* vec, guint id, gint value); void inf_adopted_state_vector_foreach(InfAdoptedStateVector* vec, InfAdoptedStateVectorForeachFunc func, gpointer user_data); int inf_adopted_state_vector_compare(InfAdoptedStateVector* first, InfAdoptedStateVector* second); gboolean inf_adopted_state_vector_causally_before(InfAdoptedStateVector* first, InfAdoptedStateVector* second); gboolean inf_adopted_state_vector_causally_before_inc(InfAdoptedStateVector* first, InfAdoptedStateVector* second, guint inc_component); guint inf_adopted_state_vector_vdiff(InfAdoptedStateVector* first, InfAdoptedStateVector* second); gchar* inf_adopted_state_vector_to_string(InfAdoptedStateVector* vec); InfAdoptedStateVector* inf_adopted_state_vector_from_string(const gchar* str, GError** error); gchar* inf_adopted_state_vector_to_string_diff(InfAdoptedStateVector* vec, InfAdoptedStateVector* orig); InfAdoptedStateVector* inf_adopted_state_vector_from_string_diff(const gchar* str, InfAdoptedStateVector* orig, GError** error); G_END_DECLS #endif /* __INF_ADOPTED_STATE_VECTOR_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/adopted/inf-adopted-undo-grouping.c0000644000175000017500000006635412264763732022105 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include /** * SECTION:inf-adopted-undo-grouping * @title: InfAdoptedUndoGrouping * @short_description: Grouping of requests to be undone simultaneously * @include: libinfinity/adopted/inf-adopted-undo-grouping.h * @see_also: #InfAdoptedAlgorithm * @stability: Unstable * * #InfAdoptedUndoGrouping groups related requests together so that they can * be undone at the same time. For example, Undo in a text editor is normally * expected to operate on written words, not characters. Therefore, multiple * requests need to be undone at once. * * The undo grouping helps with this. Everytime it needs to decide whether two * requests should be grouped it emits * #InfAdoptedUndoGrouping::group-requests. If the signal handler returns * %TRUE then the two requests will be undone at the same time, otherwise not. * * It is also possible to explicitely group a bunch of requests that would * not be grouped otherwise, by calling inf_adopted_undo_grouping_start_group() * and inf_adopted_undo_grouping_end_group() before and after issuing the * requests, respectively. * * The default signal handler always returns %FALSE. However, this behaviour * can be changed in derived classes. */ typedef struct _InfAdoptedUndoGroupingItem InfAdoptedUndoGroupingItem; struct _InfAdoptedUndoGroupingItem { InfAdoptedRequest* request; gboolean in_group; }; typedef enum __InfAdoptedUndoGroupingFlags { /* allow grouping with items before explicit group */ INF_ADOPTED_UNDO_GROUPING_ALLOW_WITH_PREV = 1 << 0, /* allow grouping with items after explicit group */ INF_ADOPTED_UNDO_GROUPING_ALLOW_WITH_NEXT = 1 << 1, /* whether the next item is the first item inside an explicit group */ INF_ADOPTED_UNDO_GROUPING_FIRST_IN_GROUP = 1 << 2, /* whether the next item is the first item after an explicit group */ INF_ADOPTED_UNDO_GROUPING_FIRST_AFTER_GROUP = 1 << 3 } InfAdoptedUndoGroupingFlags; typedef struct _InfAdoptedUndoGroupingPrivate InfAdoptedUndoGroupingPrivate; struct _InfAdoptedUndoGroupingPrivate { InfAdoptedAlgorithm* algorithm; InfAdoptedUser* user; InfAdoptedUndoGroupingItem* items; guint n_items; guint n_alloc; guint first_item; guint item_pos; /* relative to first_item */ guint group_ref; guint group_flags; }; enum { PROP_0, /* construct only */ PROP_ALGORITHM, PROP_USER }; enum { GROUP_REQUESTS, LAST_SIGNAL }; #define INF_ADOPTED_UNDO_GROUPING_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), INF_ADOPTED_TYPE_UNDO_GROUPING, InfAdoptedUndoGroupingPrivate)) static GObjectClass* parent_class; static guint undo_grouping_signals[LAST_SIGNAL]; static void inf_adopted_undo_grouping_add_request(InfAdoptedUndoGrouping* grouping, InfAdoptedRequest* request) { InfAdoptedUndoGroupingPrivate* priv; guint max; InfAdoptedUndoGroupingItem* item; InfAdoptedUndoGroupingItem* prev_item; InfAdoptedUndoGroupingFlags flags; gboolean first_after_group; gboolean first_in_group; gboolean allow_with_next; gboolean allow_with_prev; priv = INF_ADOPTED_UNDO_GROUPING_PRIVATE(grouping); switch(inf_adopted_request_get_request_type(request)) { case INF_ADOPTED_REQUEST_DO: if(priv->first_item + priv->item_pos == priv->n_alloc) { /* The maximum number of requests that we ever need to hold is half of * the algorithm's max total log size, since undoing one of the requests * in the log takes another request. We add +1 because we add the new * request before removing the old one. */ g_object_get( G_OBJECT(priv->algorithm), "max-total-log-size", &max, NULL ); if(max != G_MAXUINT) { max = (max/2) + 1; /* Don't start to wrap around as long as we have not reached the max * buffer size. */ if(priv->n_alloc < max) { priv->n_alloc = MIN(priv->n_alloc * 2, max); priv->n_alloc = MAX(priv->n_alloc, MIN(16, max)); priv->items = g_realloc( priv->items, priv->n_alloc * sizeof(InfAdoptedUndoGroupingItem) ); } } else { priv->n_alloc = MAX(priv->n_alloc * 2, 16); priv->items = g_realloc( priv->items, priv->n_alloc * sizeof(InfAdoptedUndoGroupingItem) ); } } /* Cut redo possibilities */ priv->n_items = priv->item_pos; g_assert(priv->n_items < priv->n_alloc); item = &priv->items[(priv->first_item + priv->item_pos) % priv->n_alloc]; /* We don't ref request, it is kept alive by the request log anyway */ item->request = request; if(priv->item_pos > 0) { flags = priv->group_flags; first_after_group = (flags & INF_ADOPTED_UNDO_GROUPING_FIRST_AFTER_GROUP) != 0; first_in_group = (flags & INF_ADOPTED_UNDO_GROUPING_FIRST_IN_GROUP) != 0; allow_with_next = (flags & INF_ADOPTED_UNDO_GROUPING_ALLOW_WITH_NEXT) != 0; allow_with_prev = (flags & INF_ADOPTED_UNDO_GROUPING_ALLOW_WITH_PREV) != 0; if(first_after_group && !allow_with_next) { item->in_group = FALSE; } else if(priv->group_ref > 0 && first_in_group && !allow_with_prev) { item->in_group = FALSE; } else if(priv->group_ref > 0 && !first_in_group) { item->in_group = TRUE; } else { prev_item = &priv->items[ (priv->first_item + priv->item_pos - 1) % priv->n_alloc ]; g_signal_emit( G_OBJECT(grouping), undo_grouping_signals[GROUP_REQUESTS], 0, prev_item->request, request, &item->in_group ); } } else { /* No previous request, so start group */ item->in_group = FALSE; } priv->group_flags &= ~(INF_ADOPTED_UNDO_GROUPING_FIRST_IN_GROUP | INF_ADOPTED_UNDO_GROUPING_FIRST_AFTER_GROUP); ++priv->n_items; ++priv->item_pos; break; case INF_ADOPTED_REQUEST_UNDO: g_assert(priv->item_pos > 0); --priv->item_pos; break; case INF_ADOPTED_REQUEST_REDO: g_assert(priv->item_pos < priv->n_items); ++priv->item_pos; break; } } /* Remove requests that can no longer be undone from buffer */ static void inf_adopted_undo_grouping_cleanup(InfAdoptedUndoGrouping* grouping) { InfAdoptedUndoGroupingPrivate* priv; InfAdoptedUndoGroupingItem* item; guint max_total_log_size; guint vdiff; priv = INF_ADOPTED_UNDO_GROUPING_PRIVATE(grouping); g_assert(priv->user != NULL); g_object_get( priv->algorithm, "max-total-log-size", &max_total_log_size, NULL ); if(max_total_log_size != G_MAXUINT) { while(priv->n_items > 0) { item = &priv->items[priv->first_item]; vdiff = inf_adopted_state_vector_vdiff( inf_adopted_request_get_vector(item->request), inf_adopted_user_get_vector(priv->user) ); if(vdiff + priv->item_pos > max_total_log_size) { /* Request is too old to be undone, remove from buffer */ if(priv->item_pos == 0) { /* Remove all items since we cannot redo the following anymore at * this point since the first one to redo is too old. */ priv->first_item = 0; priv->n_items = 0; break; } else { /* Remove the request being too old */ priv->first_item = (priv->first_item + 1) % priv->n_alloc; --priv->n_items; --priv->item_pos; /* Reuse buffer if we drop to zero */ if(priv->n_items == 0) priv->first_item = 0; else priv->items[priv->first_item].in_group = FALSE; } } else { /* All OK */ break; } } } } static void inf_adopted_undo_grouping_add_request_cb(InfAdoptedRequestLog* log, InfAdoptedRequest* request, gpointer user_data) { InfAdoptedUndoGrouping* grouping; grouping = INF_ADOPTED_UNDO_GROUPING(user_data); inf_adopted_undo_grouping_add_request(grouping, request); } static void inf_adopted_undo_grouping_execute_request_cb(InfAdoptedAlgorithm* algorithm, InfAdoptedUser* user, InfAdoptedRequest* request, gboolean apply, gpointer user_data) { InfAdoptedUndoGrouping* grouping; InfAdoptedUndoGroupingPrivate* priv; guint user_id; /* Note that this signal handler is called _after_ the request has been * executed. If the execution causes requests in the request log to be * removed, then this will still happen after the signal emission though, * so all requests in our buffers are still valid at this point. */ grouping = INF_ADOPTED_UNDO_GROUPING(user_data); priv = INF_ADOPTED_UNDO_GROUPING_PRIVATE(grouping); /* If the request does not affect the buffer then it did not increase the * state vector, in which case we don't need to check again here. */ if(priv->user != NULL) { user_id = inf_user_get_id(INF_USER(priv->user)); /* We need to do cleanup if our user issued this request, even if the * request does not affect the buffer, since it raises that user's * vector time, and thus might cause requests in its request log to be * dropped. */ if(inf_adopted_request_affects_buffer(request) || inf_adopted_request_get_user_id(request) == user_id) { inf_adopted_undo_grouping_cleanup(grouping); } } } static void inf_adopted_undo_grouping_init_user(InfAdoptedUndoGrouping* grouping) { InfAdoptedUndoGroupingPrivate* priv; InfAdoptedRequestLog* log; InfAdoptedRequest* request; guint max_total_log_size; guint end; guint i; priv = INF_ADOPTED_UNDO_GROUPING_PRIVATE(grouping); g_assert(priv->user != NULL); g_signal_connect( G_OBJECT(inf_adopted_user_get_request_log(priv->user)), "add-request", G_CALLBACK(inf_adopted_undo_grouping_add_request_cb), grouping ); g_object_get( priv->algorithm, "max-total-log-size", &max_total_log_size, NULL ); /* Add initial requests from request log */ log = inf_adopted_user_get_request_log(priv->user); end = inf_adopted_request_log_get_end(log); for(i = inf_adopted_request_log_get_begin(log); i < end; ++i) { request = inf_adopted_request_log_get_request(log, i); inf_adopted_undo_grouping_add_request(grouping, request); /* TODO: Instead of cleaning up requests that we have added just before, * we may find out which ones will not end up in the buffer anyway because * they cannot be undone anymore. This would require * inf_adopted_algorithm_can_undo_redo() to work for requests that are * anywhere in the log and to be public. */ inf_adopted_undo_grouping_cleanup(grouping); } } static void inf_adopted_undo_grouping_deinit_user(InfAdoptedUndoGrouping* grouping) { InfAdoptedUndoGroupingPrivate* priv; priv = INF_ADOPTED_UNDO_GROUPING_PRIVATE(grouping); g_assert(priv->user != NULL); inf_signal_handlers_disconnect_by_func( G_OBJECT(inf_adopted_user_get_request_log(priv->user)), G_CALLBACK(inf_adopted_undo_grouping_add_request_cb), grouping ); g_object_unref(priv->user); priv->user = NULL; g_free(priv->items); priv->items = NULL; priv->n_items = 0; priv->n_alloc = 0; priv->first_item = 0; priv->item_pos = 0; g_object_notify(G_OBJECT(grouping), "user"); } static void inf_adopted_undo_grouping_init(GTypeInstance* instance, gpointer g_class) { InfAdoptedUndoGrouping* grouping; InfAdoptedUndoGroupingPrivate* priv; grouping = INF_ADOPTED_UNDO_GROUPING(instance); priv = INF_ADOPTED_UNDO_GROUPING_PRIVATE(grouping); priv->algorithm = NULL; priv->user = NULL; priv->items = NULL; priv->n_items = 0; priv->n_alloc = 0; priv->first_item = 0; priv->item_pos = 0; priv->group_ref = 0; priv->group_flags = 0; } static void inf_adopted_undo_grouping_dispose(GObject* object) { InfAdoptedUndoGrouping* grouping; InfAdoptedUndoGroupingPrivate* priv; grouping = INF_ADOPTED_UNDO_GROUPING(object); priv = INF_ADOPTED_UNDO_GROUPING_PRIVATE(grouping); inf_adopted_undo_grouping_set_algorithm(grouping, NULL, NULL); G_OBJECT_CLASS(parent_class)->dispose(object); } static void inf_adopted_undo_grouping_finalize(GObject* object) { InfAdoptedUndoGrouping* grouping; InfAdoptedUndoGroupingPrivate* priv; grouping = INF_ADOPTED_UNDO_GROUPING(object); priv = INF_ADOPTED_UNDO_GROUPING_PRIVATE(grouping); G_OBJECT_CLASS(parent_class)->finalize(object); } static void inf_adopted_undo_grouping_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec) { InfAdoptedUndoGrouping* grouping; InfAdoptedUndoGroupingPrivate* priv; grouping = INF_ADOPTED_UNDO_GROUPING(object); priv = INF_ADOPTED_UNDO_GROUPING_PRIVATE(grouping); switch(prop_id) { case PROP_ALGORITHM: inf_adopted_undo_grouping_set_algorithm( grouping, INF_ADOPTED_ALGORITHM(g_value_get_object(value)), NULL ); break; case PROP_USER: inf_adopted_undo_grouping_set_algorithm( grouping, priv->algorithm, INF_ADOPTED_USER(g_value_get_object(value)) ); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void inf_adopted_undo_grouping_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec) { InfAdoptedUndoGrouping* grouping; InfAdoptedUndoGroupingPrivate* priv; grouping = INF_ADOPTED_UNDO_GROUPING(object); priv = INF_ADOPTED_UNDO_GROUPING_PRIVATE(grouping); switch(prop_id) { case PROP_ALGORITHM: g_value_set_object(value, priv->algorithm); break; case PROP_USER: g_value_set_object(value, priv->user); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static gboolean inf_adopted_undo_grouping_group_requests(InfAdoptedUndoGrouping* grouping, InfAdoptedRequest* first, InfAdoptedRequest* second) { return FALSE; } static void inf_adopted_undo_grouping_class_init(gpointer g_class, gpointer class_data) { GObjectClass* object_class; InfAdoptedUndoGroupingClass* undo_grouping_class; object_class = G_OBJECT_CLASS(g_class); undo_grouping_class = INF_ADOPTED_UNDO_GROUPING_CLASS(g_class); parent_class = G_OBJECT_CLASS(g_type_class_peek_parent(g_class)); g_type_class_add_private(g_class, sizeof(InfAdoptedUndoGroupingPrivate)); object_class->dispose = inf_adopted_undo_grouping_dispose; object_class->finalize = inf_adopted_undo_grouping_finalize; object_class->set_property = inf_adopted_undo_grouping_set_property; object_class->get_property = inf_adopted_undo_grouping_get_property; undo_grouping_class->group_requests = inf_adopted_undo_grouping_group_requests; g_object_class_install_property( object_class, PROP_ALGORITHM, g_param_spec_object( "algorithm", "Algorithm", "The algorithm for which to group requests", INF_ADOPTED_TYPE_ALGORITHM, G_PARAM_READWRITE ) ); g_object_class_install_property( object_class, PROP_USER, g_param_spec_object( "user", "User", "The user for which to group requests", INF_ADOPTED_TYPE_USER, G_PARAM_READWRITE ) ); /** * InfAdoptedUndoGrouping::group-requests: * @grouping: The #InfAdoptedUndoGrouping which is about to group a request. * @first: The previous request. * @second: The current request. * * This signal is emitted whenever the #InfAdoptedUndoGrouping needs to * decide whether to put two requests into the same undo group or not. * A signal handler should return %TRUE if they belong into the same group * or %FALSE otherwise. Note however that the two requests may not * immediately follow each other because other users may have issued * requests inbetween. Check the vector times of the requests to find out, * using inf_adopted_request_get_vector(). */ undo_grouping_signals[GROUP_REQUESTS] = g_signal_new( "group-requests", G_OBJECT_CLASS_TYPE(object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(InfAdoptedUndoGroupingClass, group_requests), g_signal_accumulator_true_handled, NULL, inf_marshal_BOOLEAN__OBJECT_OBJECT, G_TYPE_BOOLEAN, 2, INF_ADOPTED_TYPE_REQUEST, INF_ADOPTED_TYPE_REQUEST ); } GType inf_adopted_undo_grouping_get_type(void) { static GType undo_grouping_type = 0; if(!undo_grouping_type) { static const GTypeInfo undo_grouping_type_info = { sizeof(InfAdoptedUndoGroupingClass), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ inf_adopted_undo_grouping_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InfAdoptedUndoGrouping), /* instance_size */ 0, /* n_preallocs */ inf_adopted_undo_grouping_init, /* instance_init */ NULL /* value_table */ }; undo_grouping_type = g_type_register_static( G_TYPE_OBJECT, "InfAdoptedUndoGrouping", &undo_grouping_type_info, 0 ); } return undo_grouping_type; } /** * inf_adopted_undo_grouping_new: * * Creates a new #InfAdoptedUndoGrouping. To start grouping requests, set a * user whose requests to group via inf_adopted_undo_grouping_set_algorithm(). * Before doing so you might want to connect to * #InfAdoptedUndoGrouping::group-requests, so the user's initial requests can * be grouped correctly. * * Returns: A new #InfAdoptedUndoGrouping, to be freed via g_object_unref(). */ InfAdoptedUndoGrouping* inf_adopted_undo_grouping_new(void) { GObject* object; object = g_object_new(INF_ADOPTED_TYPE_UNDO_GROUPING, NULL); return INF_ADOPTED_UNDO_GROUPING(object); } /** * inf_adopted_undo_grouping_get_algorithm: * @grouping: A #InfAdoptedUndoGrouping. * * Returns the #InfAdoptedAlgorithm for @grouping. * * Returns: @grouping's algorithm. */ InfAdoptedAlgorithm* inf_adopted_undo_grouping_get_algorithm(InfAdoptedUndoGrouping* grouping) { g_return_val_if_fail(INF_ADOPTED_IS_UNDO_GROUPING(grouping), NULL); return INF_ADOPTED_UNDO_GROUPING_PRIVATE(grouping)->algorithm; } /** * inf_adopted_undo_grouping_set_algorithm: * @grouping: A #InfAdoptedUndoGrouping. * @algorithm: The #InfAdoptedAlgorithm for the document to group requests, * or %NULL. * @user: The user for which to group requests, or %NULL. Ignored if * @algorithm is %NULL. * * Sets the algorithm and user to group requests for. This function will group * all requests in user's request log, and also each new request that is * added to it's log. Requests that cannot be undone anymore (because * they are too old), will be correctly taken care off. */ void inf_adopted_undo_grouping_set_algorithm(InfAdoptedUndoGrouping* grouping, InfAdoptedAlgorithm* algorithm, InfAdoptedUser* user) { InfAdoptedUndoGroupingPrivate* priv; g_return_if_fail(INF_ADOPTED_IS_UNDO_GROUPING(grouping)); g_return_if_fail(algorithm == NULL || INF_ADOPTED_IS_ALGORITHM(algorithm)); g_return_if_fail(user == NULL || INF_ADOPTED_IS_USER(user)); priv = INF_ADOPTED_UNDO_GROUPING_PRIVATE(grouping); g_object_freeze_notify(G_OBJECT(grouping)); if(priv->algorithm != algorithm) { if(priv->algorithm != NULL) { inf_signal_handlers_disconnect_by_func( G_OBJECT(priv->algorithm), G_CALLBACK(inf_adopted_undo_grouping_execute_request_cb), grouping ); /* The user belonged to the old algorithm */ if(priv->user != NULL) inf_adopted_undo_grouping_deinit_user(grouping); g_object_unref(priv->algorithm); priv->algorithm = NULL; } priv->algorithm = algorithm; if(algorithm != NULL) { g_object_ref(algorithm); g_signal_connect_after( G_OBJECT(priv->algorithm), "execute-request", G_CALLBACK(inf_adopted_undo_grouping_execute_request_cb), grouping ); } g_object_notify(G_OBJECT(grouping), "algorithm"); } if(priv->user != user) { if(priv->user != NULL) inf_adopted_undo_grouping_deinit_user(grouping); priv->user = user; if(user != NULL) { g_object_ref(user); inf_adopted_undo_grouping_init_user(grouping); } g_object_notify(G_OBJECT(grouping), "user"); } g_object_thaw_notify(G_OBJECT(grouping)); } /** * inf_adopted_undo_grouping_start_group: * @grouping: A #InfAdoptedUndoGrouping. * @allow_group_with_prev: Whether the new group can be part of the previous * group if #InfAdoptedUndoGrouping::group-requests allows. * * Makes all requests issued after this call belong into the same group, * i.e. they will be undone at once. This can make sense for example when the * user copy+pastes something into the document which causes multiple requests * to be generated. A call to inf_adopted_undo_grouping_end_group() restores * the normal behavior. */ void inf_adopted_undo_grouping_start_group(InfAdoptedUndoGrouping* grouping, gboolean allow_group_with_prev) { InfAdoptedUndoGroupingPrivate* priv; g_return_if_fail(INF_ADOPTED_IS_UNDO_GROUPING(grouping)); priv = INF_ADOPTED_UNDO_GROUPING_PRIVATE(grouping); g_return_if_fail(priv->algorithm != NULL); g_return_if_fail(priv->user != NULL); if(priv->group_ref++ == 0) { priv->group_flags = INF_ADOPTED_UNDO_GROUPING_FIRST_IN_GROUP; if(allow_group_with_prev) priv->group_flags |= INF_ADOPTED_UNDO_GROUPING_ALLOW_WITH_PREV; } } /** * inf_adopted_undo_grouping_end_group: * @grouping: A #InfAdoptedUndoGrouping. * @allow_group_with_next: Whether subsequent requests are allow to be part of * this group if #InfAdoptedUndoGrouping::group-requests allows. * * When inf_adopted_undo_grouping_start_group() was called before, then this * function restores the normal behaviour of grouping requests. */ void inf_adopted_undo_grouping_end_group(InfAdoptedUndoGrouping* grouping, gboolean allow_group_with_next) { InfAdoptedUndoGroupingPrivate* priv; g_return_if_fail(INF_ADOPTED_IS_UNDO_GROUPING(grouping)); priv = INF_ADOPTED_UNDO_GROUPING_PRIVATE(grouping); g_return_if_fail(priv->algorithm != NULL); g_return_if_fail(priv->user != NULL); g_return_if_fail(priv->group_ref > 0); if(--priv->group_ref == 0) { priv->group_flags = INF_ADOPTED_UNDO_GROUPING_FIRST_AFTER_GROUP; if(allow_group_with_next) priv->group_flags |= INF_ADOPTED_UNDO_GROUPING_ALLOW_WITH_NEXT; } } /** * inf_adopted_undo_grouping_get_undo_size: * @grouping: A #InfAdoptedUndoGrouping. * * Returns the number of requests to undo so that a whole group is being * undone. This takes into account that possibly not the whole group cannot * be undone due to the #InfAdoptedAlgorithm:max-total-log-size constraint. * * Returns: The number of requests in the current undo group. */ guint inf_adopted_undo_grouping_get_undo_size(InfAdoptedUndoGrouping* grouping) { InfAdoptedUndoGroupingPrivate* priv; guint max_total_log_size; InfAdoptedRequestLog* log; InfAdoptedStateVector* current; guint pos; guint index; InfAdoptedRequest* lower_related; InfAdoptedStateVector* vector; guint vdiff; g_return_val_if_fail(INF_ADOPTED_IS_UNDO_GROUPING(grouping), 0); priv = INF_ADOPTED_UNDO_GROUPING_PRIVATE(grouping); if(priv->item_pos == 0) return 0; g_object_get( G_OBJECT(priv->algorithm), "max-total-log-size", &max_total_log_size, NULL ); log = inf_adopted_user_get_request_log(priv->user); current = inf_adopted_user_get_vector(priv->user); pos = priv->item_pos; do { g_assert(pos > 0); index = inf_adopted_request_get_index(priv->items[pos-1].request); lower_related = inf_adopted_request_log_lower_related(log, index); vector = inf_adopted_request_get_vector(lower_related); vdiff = inf_adopted_state_vector_vdiff(vector, current); if(vdiff + priv->item_pos - pos >= max_total_log_size) return priv->item_pos - pos; --pos; } while(priv->items[(priv->first_item + pos) % priv->n_alloc].in_group); return priv->item_pos - pos; } /** * inf_adopted_undo_grouping_get_redo_size: * @grouping: A #InfAdoptedUndoGrouping. * * Returns the number of requests to redo so that a whole group is being * redone. This takes into account that possibly not the whole group cannot * be undone due to the #InfAdoptedAlgorithm:max-total-log-size constraint. * * Returns: The number of requests in the current redo group. */ guint inf_adopted_undo_grouping_get_redo_size(InfAdoptedUndoGrouping* grouping) { InfAdoptedUndoGroupingPrivate* priv; guint max_total_log_size; InfAdoptedRequestLog* log; InfAdoptedStateVector* current; guint pos; guint index; InfAdoptedRequest* lower_related; InfAdoptedStateVector* vector; guint vdiff; g_return_val_if_fail(INF_ADOPTED_IS_UNDO_GROUPING(grouping), 0); priv = INF_ADOPTED_UNDO_GROUPING_PRIVATE(grouping); if(priv->item_pos == priv->n_items) return 0; g_object_get( G_OBJECT(priv->algorithm), "max-total-log-size", &max_total_log_size, NULL ); log = inf_adopted_user_get_request_log(priv->user); current = inf_adopted_user_get_vector(priv->user); pos = priv->item_pos; do { g_assert(pos < priv->n_items); index = inf_adopted_request_get_index(priv->items[pos].request); lower_related = inf_adopted_request_log_lower_related(log, index); vector = inf_adopted_request_get_vector(lower_related); vdiff = inf_adopted_state_vector_vdiff(vector, current); if(vdiff + pos - priv->item_pos >= max_total_log_size) return pos - priv->item_pos; ++pos; } while(pos < priv->n_items && priv->items[(priv->first_item + pos) % priv->n_alloc].in_group); return pos - priv->item_pos; } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/adopted/Makefile.in0000644000175000017500000012311012264766065017003 00000000000000# Makefile.in generated by automake 1.13.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = libinfinity/adopted DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/mkinstalldirs $(top_srcdir)/depcomp \ $(libinfinity_adopted_la_HEADERS) $(noinst_HEADERS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/libinfinity/inf-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libinfinity_adopted_la_LIBADD = am_libinfinity_adopted_la_OBJECTS = \ libinfinity_adopted_la-inf-adopted-algorithm.lo \ libinfinity_adopted_la-inf-adopted-concurrency-warning.lo \ libinfinity_adopted_la-inf-adopted-no-operation.lo \ libinfinity_adopted_la-inf-adopted-operation.lo \ libinfinity_adopted_la-inf-adopted-request.lo \ libinfinity_adopted_la-inf-adopted-request-log.lo \ libinfinity_adopted_la-inf-adopted-session.lo \ libinfinity_adopted_la-inf-adopted-session-record.lo \ libinfinity_adopted_la-inf-adopted-session-replay.lo \ libinfinity_adopted_la-inf-adopted-split-operation.lo \ libinfinity_adopted_la-inf-adopted-state-vector.lo \ libinfinity_adopted_la-inf-adopted-undo-grouping.lo \ libinfinity_adopted_la-inf-adopted-user.lo libinfinity_adopted_la_OBJECTS = $(am_libinfinity_adopted_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -I$(top_builddir)/libinfinity 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) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libinfinity_adopted_la_SOURCES) DIST_SOURCES = $(libinfinity_adopted_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libinfinity_adopted_ladir)" HEADERS = $(libinfinity_adopted_la_HEADERS) $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBINFINITY_API_VERSION = @LIBINFINITY_API_VERSION@ LIBINFINITY_LIBTOOL_VERSION = @LIBINFINITY_LIBTOOL_VERSION@ LIBINFINITY_VERSION = @LIBINFINITY_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ avahi_CFLAGS = @avahi_CFLAGS@ avahi_LIBS = @avahi_LIBS@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gtk_requirement = @gtk_requirement@ gtk_version = @gtk_version@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infgtk_CFLAGS = @infgtk_CFLAGS@ infgtk_LIBS = @infgtk_LIBS@ infinity_CFLAGS = @infinity_CFLAGS@ infinity_LIBS = @infinity_LIBS@ infinoted_CFLAGS = @infinoted_CFLAGS@ infinoted_LIBS = @infinoted_LIBS@ infodir = @infodir@ inftext_CFLAGS = @inftext_CFLAGS@ inftext_LIBS = @inftext_LIBS@ inftextgtk_CFLAGS = @inftextgtk_CFLAGS@ inftextgtk_LIBS = @inftextgtk_LIBS@ install_sh = @install_sh@ libdaemon_CFLAGS = @libdaemon_CFLAGS@ libdaemon_LIBS = @libdaemon_LIBS@ 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@ libinfinity_adopted_la_CPPFLAGS = \ -I$(top_srcdir) \ $(infinity_CFLAGS) noinst_LTLIBRARIES = libinfinity_adopted.la libinfinity_adopted_ladir = \ $(includedir)/libinfinity-$(LIBINFINITY_API_VERSION)/libinfinity/adopted libinfinity_adopted_la_SOURCES = \ inf-adopted-algorithm.c \ inf-adopted-concurrency-warning.c \ inf-adopted-no-operation.c \ inf-adopted-operation.c \ inf-adopted-request.c \ inf-adopted-request-log.c \ inf-adopted-session.c \ inf-adopted-session-record.c \ inf-adopted-session-replay.c \ inf-adopted-split-operation.c \ inf-adopted-state-vector.c \ inf-adopted-undo-grouping.c \ inf-adopted-user.c libinfinity_adopted_la_HEADERS = \ inf-adopted-algorithm.h \ inf-adopted-no-operation.h \ inf-adopted-operation.h \ inf-adopted-request.h \ inf-adopted-request-log.h \ inf-adopted-session.h \ inf-adopted-session-record.h \ inf-adopted-session-replay.h \ inf-adopted-split-operation.h \ inf-adopted-state-vector.h \ inf-adopted-undo-grouping.h \ inf-adopted-user.h noinst_HEADERS = \ inf-adopted-concurrency-warning.h all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libinfinity/adopted/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu libinfinity/adopted/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libinfinity_adopted.la: $(libinfinity_adopted_la_OBJECTS) $(libinfinity_adopted_la_DEPENDENCIES) $(EXTRA_libinfinity_adopted_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libinfinity_adopted_la_OBJECTS) $(libinfinity_adopted_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_adopted_la-inf-adopted-algorithm.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_adopted_la-inf-adopted-concurrency-warning.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_adopted_la-inf-adopted-no-operation.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_adopted_la-inf-adopted-operation.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_adopted_la-inf-adopted-request-log.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_adopted_la-inf-adopted-request.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_adopted_la-inf-adopted-session-record.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_adopted_la-inf-adopted-session-replay.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_adopted_la-inf-adopted-session.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_adopted_la-inf-adopted-split-operation.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_adopted_la-inf-adopted-state-vector.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_adopted_la-inf-adopted-undo-grouping.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_adopted_la-inf-adopted-user.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< libinfinity_adopted_la-inf-adopted-algorithm.lo: inf-adopted-algorithm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_adopted_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_adopted_la-inf-adopted-algorithm.lo -MD -MP -MF $(DEPDIR)/libinfinity_adopted_la-inf-adopted-algorithm.Tpo -c -o libinfinity_adopted_la-inf-adopted-algorithm.lo `test -f 'inf-adopted-algorithm.c' || echo '$(srcdir)/'`inf-adopted-algorithm.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_adopted_la-inf-adopted-algorithm.Tpo $(DEPDIR)/libinfinity_adopted_la-inf-adopted-algorithm.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-adopted-algorithm.c' object='libinfinity_adopted_la-inf-adopted-algorithm.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_adopted_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_adopted_la-inf-adopted-algorithm.lo `test -f 'inf-adopted-algorithm.c' || echo '$(srcdir)/'`inf-adopted-algorithm.c libinfinity_adopted_la-inf-adopted-concurrency-warning.lo: inf-adopted-concurrency-warning.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_adopted_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_adopted_la-inf-adopted-concurrency-warning.lo -MD -MP -MF $(DEPDIR)/libinfinity_adopted_la-inf-adopted-concurrency-warning.Tpo -c -o libinfinity_adopted_la-inf-adopted-concurrency-warning.lo `test -f 'inf-adopted-concurrency-warning.c' || echo '$(srcdir)/'`inf-adopted-concurrency-warning.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_adopted_la-inf-adopted-concurrency-warning.Tpo $(DEPDIR)/libinfinity_adopted_la-inf-adopted-concurrency-warning.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-adopted-concurrency-warning.c' object='libinfinity_adopted_la-inf-adopted-concurrency-warning.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_adopted_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_adopted_la-inf-adopted-concurrency-warning.lo `test -f 'inf-adopted-concurrency-warning.c' || echo '$(srcdir)/'`inf-adopted-concurrency-warning.c libinfinity_adopted_la-inf-adopted-no-operation.lo: inf-adopted-no-operation.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_adopted_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_adopted_la-inf-adopted-no-operation.lo -MD -MP -MF $(DEPDIR)/libinfinity_adopted_la-inf-adopted-no-operation.Tpo -c -o libinfinity_adopted_la-inf-adopted-no-operation.lo `test -f 'inf-adopted-no-operation.c' || echo '$(srcdir)/'`inf-adopted-no-operation.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_adopted_la-inf-adopted-no-operation.Tpo $(DEPDIR)/libinfinity_adopted_la-inf-adopted-no-operation.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-adopted-no-operation.c' object='libinfinity_adopted_la-inf-adopted-no-operation.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_adopted_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_adopted_la-inf-adopted-no-operation.lo `test -f 'inf-adopted-no-operation.c' || echo '$(srcdir)/'`inf-adopted-no-operation.c libinfinity_adopted_la-inf-adopted-operation.lo: inf-adopted-operation.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_adopted_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_adopted_la-inf-adopted-operation.lo -MD -MP -MF $(DEPDIR)/libinfinity_adopted_la-inf-adopted-operation.Tpo -c -o libinfinity_adopted_la-inf-adopted-operation.lo `test -f 'inf-adopted-operation.c' || echo '$(srcdir)/'`inf-adopted-operation.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_adopted_la-inf-adopted-operation.Tpo $(DEPDIR)/libinfinity_adopted_la-inf-adopted-operation.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-adopted-operation.c' object='libinfinity_adopted_la-inf-adopted-operation.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_adopted_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_adopted_la-inf-adopted-operation.lo `test -f 'inf-adopted-operation.c' || echo '$(srcdir)/'`inf-adopted-operation.c libinfinity_adopted_la-inf-adopted-request.lo: inf-adopted-request.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_adopted_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_adopted_la-inf-adopted-request.lo -MD -MP -MF $(DEPDIR)/libinfinity_adopted_la-inf-adopted-request.Tpo -c -o libinfinity_adopted_la-inf-adopted-request.lo `test -f 'inf-adopted-request.c' || echo '$(srcdir)/'`inf-adopted-request.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_adopted_la-inf-adopted-request.Tpo $(DEPDIR)/libinfinity_adopted_la-inf-adopted-request.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-adopted-request.c' object='libinfinity_adopted_la-inf-adopted-request.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_adopted_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_adopted_la-inf-adopted-request.lo `test -f 'inf-adopted-request.c' || echo '$(srcdir)/'`inf-adopted-request.c libinfinity_adopted_la-inf-adopted-request-log.lo: inf-adopted-request-log.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_adopted_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_adopted_la-inf-adopted-request-log.lo -MD -MP -MF $(DEPDIR)/libinfinity_adopted_la-inf-adopted-request-log.Tpo -c -o libinfinity_adopted_la-inf-adopted-request-log.lo `test -f 'inf-adopted-request-log.c' || echo '$(srcdir)/'`inf-adopted-request-log.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_adopted_la-inf-adopted-request-log.Tpo $(DEPDIR)/libinfinity_adopted_la-inf-adopted-request-log.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-adopted-request-log.c' object='libinfinity_adopted_la-inf-adopted-request-log.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_adopted_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_adopted_la-inf-adopted-request-log.lo `test -f 'inf-adopted-request-log.c' || echo '$(srcdir)/'`inf-adopted-request-log.c libinfinity_adopted_la-inf-adopted-session.lo: inf-adopted-session.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_adopted_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_adopted_la-inf-adopted-session.lo -MD -MP -MF $(DEPDIR)/libinfinity_adopted_la-inf-adopted-session.Tpo -c -o libinfinity_adopted_la-inf-adopted-session.lo `test -f 'inf-adopted-session.c' || echo '$(srcdir)/'`inf-adopted-session.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_adopted_la-inf-adopted-session.Tpo $(DEPDIR)/libinfinity_adopted_la-inf-adopted-session.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-adopted-session.c' object='libinfinity_adopted_la-inf-adopted-session.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_adopted_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_adopted_la-inf-adopted-session.lo `test -f 'inf-adopted-session.c' || echo '$(srcdir)/'`inf-adopted-session.c libinfinity_adopted_la-inf-adopted-session-record.lo: inf-adopted-session-record.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_adopted_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_adopted_la-inf-adopted-session-record.lo -MD -MP -MF $(DEPDIR)/libinfinity_adopted_la-inf-adopted-session-record.Tpo -c -o libinfinity_adopted_la-inf-adopted-session-record.lo `test -f 'inf-adopted-session-record.c' || echo '$(srcdir)/'`inf-adopted-session-record.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_adopted_la-inf-adopted-session-record.Tpo $(DEPDIR)/libinfinity_adopted_la-inf-adopted-session-record.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-adopted-session-record.c' object='libinfinity_adopted_la-inf-adopted-session-record.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_adopted_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_adopted_la-inf-adopted-session-record.lo `test -f 'inf-adopted-session-record.c' || echo '$(srcdir)/'`inf-adopted-session-record.c libinfinity_adopted_la-inf-adopted-session-replay.lo: inf-adopted-session-replay.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_adopted_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_adopted_la-inf-adopted-session-replay.lo -MD -MP -MF $(DEPDIR)/libinfinity_adopted_la-inf-adopted-session-replay.Tpo -c -o libinfinity_adopted_la-inf-adopted-session-replay.lo `test -f 'inf-adopted-session-replay.c' || echo '$(srcdir)/'`inf-adopted-session-replay.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_adopted_la-inf-adopted-session-replay.Tpo $(DEPDIR)/libinfinity_adopted_la-inf-adopted-session-replay.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-adopted-session-replay.c' object='libinfinity_adopted_la-inf-adopted-session-replay.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_adopted_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_adopted_la-inf-adopted-session-replay.lo `test -f 'inf-adopted-session-replay.c' || echo '$(srcdir)/'`inf-adopted-session-replay.c libinfinity_adopted_la-inf-adopted-split-operation.lo: inf-adopted-split-operation.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_adopted_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_adopted_la-inf-adopted-split-operation.lo -MD -MP -MF $(DEPDIR)/libinfinity_adopted_la-inf-adopted-split-operation.Tpo -c -o libinfinity_adopted_la-inf-adopted-split-operation.lo `test -f 'inf-adopted-split-operation.c' || echo '$(srcdir)/'`inf-adopted-split-operation.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_adopted_la-inf-adopted-split-operation.Tpo $(DEPDIR)/libinfinity_adopted_la-inf-adopted-split-operation.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-adopted-split-operation.c' object='libinfinity_adopted_la-inf-adopted-split-operation.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_adopted_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_adopted_la-inf-adopted-split-operation.lo `test -f 'inf-adopted-split-operation.c' || echo '$(srcdir)/'`inf-adopted-split-operation.c libinfinity_adopted_la-inf-adopted-state-vector.lo: inf-adopted-state-vector.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_adopted_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_adopted_la-inf-adopted-state-vector.lo -MD -MP -MF $(DEPDIR)/libinfinity_adopted_la-inf-adopted-state-vector.Tpo -c -o libinfinity_adopted_la-inf-adopted-state-vector.lo `test -f 'inf-adopted-state-vector.c' || echo '$(srcdir)/'`inf-adopted-state-vector.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_adopted_la-inf-adopted-state-vector.Tpo $(DEPDIR)/libinfinity_adopted_la-inf-adopted-state-vector.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-adopted-state-vector.c' object='libinfinity_adopted_la-inf-adopted-state-vector.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_adopted_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_adopted_la-inf-adopted-state-vector.lo `test -f 'inf-adopted-state-vector.c' || echo '$(srcdir)/'`inf-adopted-state-vector.c libinfinity_adopted_la-inf-adopted-undo-grouping.lo: inf-adopted-undo-grouping.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_adopted_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_adopted_la-inf-adopted-undo-grouping.lo -MD -MP -MF $(DEPDIR)/libinfinity_adopted_la-inf-adopted-undo-grouping.Tpo -c -o libinfinity_adopted_la-inf-adopted-undo-grouping.lo `test -f 'inf-adopted-undo-grouping.c' || echo '$(srcdir)/'`inf-adopted-undo-grouping.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_adopted_la-inf-adopted-undo-grouping.Tpo $(DEPDIR)/libinfinity_adopted_la-inf-adopted-undo-grouping.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-adopted-undo-grouping.c' object='libinfinity_adopted_la-inf-adopted-undo-grouping.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_adopted_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_adopted_la-inf-adopted-undo-grouping.lo `test -f 'inf-adopted-undo-grouping.c' || echo '$(srcdir)/'`inf-adopted-undo-grouping.c libinfinity_adopted_la-inf-adopted-user.lo: inf-adopted-user.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_adopted_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_adopted_la-inf-adopted-user.lo -MD -MP -MF $(DEPDIR)/libinfinity_adopted_la-inf-adopted-user.Tpo -c -o libinfinity_adopted_la-inf-adopted-user.lo `test -f 'inf-adopted-user.c' || echo '$(srcdir)/'`inf-adopted-user.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_adopted_la-inf-adopted-user.Tpo $(DEPDIR)/libinfinity_adopted_la-inf-adopted-user.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-adopted-user.c' object='libinfinity_adopted_la-inf-adopted-user.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_adopted_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_adopted_la-inf-adopted-user.lo `test -f 'inf-adopted-user.c' || echo '$(srcdir)/'`inf-adopted-user.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-libinfinity_adopted_laHEADERS: $(libinfinity_adopted_la_HEADERS) @$(NORMAL_INSTALL) @list='$(libinfinity_adopted_la_HEADERS)'; test -n "$(libinfinity_adopted_ladir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(libinfinity_adopted_ladir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libinfinity_adopted_ladir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libinfinity_adopted_ladir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(libinfinity_adopted_ladir)" || exit $$?; \ done uninstall-libinfinity_adopted_laHEADERS: @$(NORMAL_UNINSTALL) @list='$(libinfinity_adopted_la_HEADERS)'; test -n "$(libinfinity_adopted_ladir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(libinfinity_adopted_ladir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libinfinity_adopted_ladir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-libinfinity_adopted_laHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libinfinity_adopted_laHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-libinfinity_adopted_laHEADERS \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-libinfinity_adopted_laHEADERS # 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: libinfinity-0.5.5/libinfinity/adopted/inf-adopted-split-operation.h0000644000175000017500000000574612264763732022444 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_ADOPTED_SPLIT_OPERATION_H__ #define __INF_ADOPTED_SPLIT_OPERATION_H__ #include #include G_BEGIN_DECLS #define INF_ADOPTED_TYPE_SPLIT_OPERATION (inf_adopted_split_operation_get_type()) #define INF_ADOPTED_SPLIT_OPERATION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INF_ADOPTED_TYPE_SPLIT_OPERATION, InfAdoptedSplitOperation)) #define INF_ADOPTED_SPLIT_OPERATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INF_ADOPTED_TYPE_SPLIT_OPERATION, InfAdoptedSplitOperationClass)) #define INF_ADOPTED_IS_SPLIT_OPERATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INF_ADOPTED_TYPE_SPLIT_OPERATION)) #define INF_ADOPTED_IS_SPLIT_OPERATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INF_ADOPTED_TYPE_SPLIT_OPERATION)) #define INF_ADOPTED_SPLIT_OPERATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), INF_ADOPTED_TYPE_SPLIT_OPERATION, InfAdoptedSplitOperationClass)) typedef struct _InfAdoptedSplitOperation InfAdoptedSplitOperation; typedef struct _InfAdoptedSplitOperationClass InfAdoptedSplitOperationClass; /** * InfAdoptedSplitOperationClass: * * This structure does not contain any public fields. */ struct _InfAdoptedSplitOperationClass { /*< private >*/ GObjectClass parent_class; }; /** * InfAdoptedSplitOperation: * * #InfAdoptedSplitOperation is an opaque data type. You should only access it * via the public API functions. */ struct _InfAdoptedSplitOperation { /*< private >*/ GObject parent; }; GType inf_adopted_split_operation_get_type(void) G_GNUC_CONST; InfAdoptedSplitOperation* inf_adopted_split_operation_new(InfAdoptedOperation* first, InfAdoptedOperation* second); GSList* inf_adopted_split_operation_unsplit(InfAdoptedSplitOperation* operation); InfAdoptedOperation* inf_adopted_split_operation_transform_other(InfAdoptedSplitOperation* op, InfAdoptedOperation* other, gint concurrency_id); G_END_DECLS #endif /* __INF_ADOPTED_SPLIT_OPERATION_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/adopted/inf-adopted-concurrency-warning.h0000644000175000017500000000221312264763732023272 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_ADOPTED_CONCURRENCY_WARNING_H__ #define __INF_ADOPTED_CONCURRENCY_WARNING_H__ #include G_BEGIN_DECLS /*< private >*/ void _inf_adopted_concurrency_warning(GType for_type); G_END_DECLS #endif /* __INF_ADOPTED_CONCURRENCY_WARNING_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/adopted/inf-adopted-undo-grouping.h0000644000175000017500000000722012264763732022075 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_ADOPTED_UNDO_GROUPING_H__ #define __INF_ADOPTED_UNDO_GROUPING_H__ #include #include #include G_BEGIN_DECLS #define INF_ADOPTED_TYPE_UNDO_GROUPING (inf_adopted_undo_grouping_get_type()) #define INF_ADOPTED_UNDO_GROUPING(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INF_ADOPTED_TYPE_UNDO_GROUPING, InfAdoptedUndoGrouping)) #define INF_ADOPTED_UNDO_GROUPING_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INF_ADOPTED_TYPE_UNDO_GROUPING, InfAdoptedUndoGroupingClass)) #define INF_ADOPTED_IS_UNDO_GROUPING(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INF_ADOPTED_TYPE_UNDO_GROUPING)) #define INF_ADOPTED_IS_UNDO_GROUPING_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INF_ADOPTED_TYPE_UNDO_GROUPING)) #define INF_ADOPTED_UNDO_GROUPING_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), INF_ADOPTED_TYPE_UNDO_GROUPING, InfAdoptedUndoGroupingClass)) typedef struct _InfAdoptedUndoGrouping InfAdoptedUndoGrouping; typedef struct _InfAdoptedUndoGroupingClass InfAdoptedUndoGroupingClass; /** * InfAdoptedUndoGroupingClass: * @group_requests: Default signal handler for the * #InfAdoptedUndoGrouping::group-requests signal. * * This structure contains default signal handlers for #InfAdoptedUndoGrouping. */ struct _InfAdoptedUndoGroupingClass { /*< private >*/ GObjectClass parent_class; /*< public >*/ gboolean (*group_requests)(InfAdoptedUndoGrouping* grouping, InfAdoptedRequest* first, InfAdoptedRequest* second); }; /** * InfAdoptedUndoGrouping: * * #InfAdoptedUndoGrouping is an opaque data type. You should only access it via * the public API functions. */ struct _InfAdoptedUndoGrouping { /*< private >*/ GObject parent; }; GType inf_adopted_undo_grouping_get_type(void) G_GNUC_CONST; InfAdoptedUndoGrouping* inf_adopted_undo_grouping_new(void); InfAdoptedAlgorithm* inf_adopted_undo_grouping_get_algorithm(InfAdoptedUndoGrouping* grouping); void inf_adopted_undo_grouping_set_algorithm(InfAdoptedUndoGrouping* grouping, InfAdoptedAlgorithm* algorithm, InfAdoptedUser* user); void inf_adopted_undo_grouping_start_group(InfAdoptedUndoGrouping* grouping, gboolean allow_group_with_prev); void inf_adopted_undo_grouping_end_group(InfAdoptedUndoGrouping* grouping, gboolean allow_group_with_next); guint inf_adopted_undo_grouping_get_undo_size(InfAdoptedUndoGrouping* grouping); guint inf_adopted_undo_grouping_get_redo_size(InfAdoptedUndoGrouping* grouping); G_END_DECLS #endif /* __INF_ADOPTED_UNDO_GROUPING_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/adopted/inf-adopted-split-operation.c0000644000175000017500000004200712264763732022426 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ /** * SECTION:inf-adopted-split-operation * @short_description: Operation wrapping two operations * @include: libinfinity/adopted/inf-adopted-split-operation.h * @stability: Unstable * * #InfAdoptedSplitOperation is a wrapper around that two * #InfAdoptedOperations. This is normally not required directly but * may be a result of some transformation. **/ #include #include #include typedef struct _InfAdoptedSplitOperationPrivate InfAdoptedSplitOperationPrivate; struct _InfAdoptedSplitOperationPrivate { InfAdoptedOperation* first; InfAdoptedOperation* second; /* TODO: Cache new_second? We should probably profile before */ }; enum { PROP_0, PROP_FIRST, PROP_SECOND }; #define INF_ADOPTED_SPLIT_OPERATION_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), INF_ADOPTED_TYPE_SPLIT_OPERATION, InfAdoptedSplitOperationPrivate)) static GObjectClass* parent_class; static void inf_adopted_split_operation_unsplit_impl(InfAdoptedSplitOperation* operation, GSList** list) { InfAdoptedSplitOperationPrivate* priv; priv = INF_ADOPTED_SPLIT_OPERATION_PRIVATE(operation); /* Since we prepend the entries to the list, we begin with the second * operation so that the list actually contains the operations in order. */ if(INF_ADOPTED_IS_SPLIT_OPERATION(priv->second)) { inf_adopted_split_operation_unsplit_impl( INF_ADOPTED_SPLIT_OPERATION(priv->second), list ); } else { *list = g_slist_prepend(*list, priv->second); } if(INF_ADOPTED_IS_SPLIT_OPERATION(priv->first)) { inf_adopted_split_operation_unsplit_impl( INF_ADOPTED_SPLIT_OPERATION(priv->first), list ); } else { *list = g_slist_prepend(*list, priv->first); } } static void inf_adopted_split_operation_init(GTypeInstance* instance, gpointer g_class) { InfAdoptedSplitOperation* operation; InfAdoptedSplitOperationPrivate* priv; operation = INF_ADOPTED_SPLIT_OPERATION(instance); priv = INF_ADOPTED_SPLIT_OPERATION_PRIVATE(operation); priv->first = NULL; priv->second = NULL; } static void inf_adopted_split_operation_dispose(GObject* object) { InfAdoptedSplitOperation* operation; InfAdoptedSplitOperationPrivate* priv; operation = INF_ADOPTED_SPLIT_OPERATION(object); priv = INF_ADOPTED_SPLIT_OPERATION_PRIVATE(operation); if(priv->first != NULL) g_object_unref(G_OBJECT(priv->first)); if(priv->second != NULL) g_object_unref(G_OBJECT(priv->second)); G_OBJECT_CLASS(parent_class)->dispose(object); } static void inf_adopted_split_operation_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec) { InfAdoptedSplitOperation* operation; InfAdoptedSplitOperationPrivate* priv; operation = INF_ADOPTED_SPLIT_OPERATION(object); priv = INF_ADOPTED_SPLIT_OPERATION_PRIVATE(operation); switch(prop_id) { case PROP_FIRST: if(priv->first != NULL) g_object_unref(G_OBJECT(priv->first)); priv->first = INF_ADOPTED_OPERATION(g_value_dup_object(value)); g_assert(priv->first != INF_ADOPTED_OPERATION(operation)); break; case PROP_SECOND: if(priv->second != NULL) g_object_unref(G_OBJECT(priv->second)); priv->second = INF_ADOPTED_OPERATION(g_value_dup_object(value)); g_assert(priv->second != INF_ADOPTED_OPERATION(operation)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void inf_adopted_split_operation_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec) { InfAdoptedSplitOperation* operation; InfAdoptedSplitOperationPrivate* priv; operation = INF_ADOPTED_SPLIT_OPERATION(object); priv = INF_ADOPTED_SPLIT_OPERATION_PRIVATE(operation); switch(prop_id) { case PROP_FIRST: g_value_set_object(value, G_OBJECT(priv->first)); break; case PROP_SECOND: g_value_set_object(value, G_OBJECT(priv->second)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void inf_adopted_split_operation_class_init(gpointer g_class, gpointer class_data) { GObjectClass* object_class; object_class = G_OBJECT_CLASS(g_class); parent_class = G_OBJECT_CLASS(g_type_class_peek_parent(g_class)); g_type_class_add_private(g_class, sizeof(InfAdoptedSplitOperationPrivate)); object_class->dispose = inf_adopted_split_operation_dispose; object_class->set_property = inf_adopted_split_operation_set_property; object_class->get_property = inf_adopted_split_operation_get_property; g_object_class_install_property( object_class, PROP_FIRST, g_param_spec_object( "first", "First operation", "The first operation of the split operation", INF_ADOPTED_TYPE_OPERATION, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); g_object_class_install_property( object_class, PROP_SECOND, g_param_spec_object( "second", "Second operation", "The second operation of the split operation", INF_ADOPTED_TYPE_OPERATION, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); } static gboolean inf_adopted_split_operation_need_concurrency_id(InfAdoptedOperation* op, InfAdoptedOperation* against) { InfAdoptedSplitOperation* split; InfAdoptedSplitOperationPrivate* priv; split = INF_ADOPTED_SPLIT_OPERATION(op); priv = INF_ADOPTED_SPLIT_OPERATION_PRIVATE(split); return inf_adopted_operation_need_concurrency_id(priv->first, against) || inf_adopted_operation_need_concurrency_id(priv->second, against); } static InfAdoptedConcurrencyId inf_adopted_split_operation_get_concurrency_id(InfAdoptedOperation* operation, InfAdoptedOperation* against) { InfAdoptedSplitOperation* split; InfAdoptedSplitOperationPrivate* priv; InfAdoptedConcurrencyId first_id; InfAdoptedConcurrencyId second_id; split = INF_ADOPTED_SPLIT_OPERATION(operation); priv = INF_ADOPTED_SPLIT_OPERATION_PRIVATE(split); first_id = inf_adopted_operation_get_concurrency_id(priv->first, against); second_id = inf_adopted_operation_get_concurrency_id(priv->second, against); /* everything is fine if both split parts agree, or if only one can * make a decision. Problem if they are contradictory. */ if(first_id == second_id) return first_id; else if(first_id == INF_ADOPTED_CONCURRENCY_NONE) return second_id; else if(second_id == INF_ADOPTED_CONCURRENCY_NONE) return first_id; _inf_adopted_concurrency_warning(INF_ADOPTED_TYPE_SPLIT_OPERATION); return INF_ADOPTED_CONCURRENCY_NONE; } static InfAdoptedOperation* inf_adopted_split_operation_transform(InfAdoptedOperation* operation, InfAdoptedOperation* against, InfAdoptedConcurrencyId concurrency_id) { InfAdoptedSplitOperation* split; InfAdoptedSplitOperationPrivate* priv; InfAdoptedOperation* new_first; InfAdoptedOperation* new_second; InfAdoptedOperation* result; split = INF_ADOPTED_SPLIT_OPERATION(operation); priv = INF_ADOPTED_SPLIT_OPERATION_PRIVATE(split); new_first = inf_adopted_operation_transform( priv->first, against, concurrency_id ); new_second = inf_adopted_operation_transform( priv->second, against, concurrency_id ); /* TODO: Check whether one of these is a noop and return only the other * one in that case. */ result = INF_ADOPTED_OPERATION( inf_adopted_split_operation_new(new_first, new_second) ); g_object_unref(G_OBJECT(new_first)); g_object_unref(G_OBJECT(new_second)); return result; } static InfAdoptedOperation* inf_adopted_split_operation_copy(InfAdoptedOperation* operation) { InfAdoptedSplitOperation* split; InfAdoptedSplitOperationPrivate* priv; split = INF_ADOPTED_SPLIT_OPERATION(operation); priv = INF_ADOPTED_SPLIT_OPERATION_PRIVATE(split); return INF_ADOPTED_OPERATION( inf_adopted_split_operation_new( inf_adopted_operation_copy(priv->first), inf_adopted_operation_copy(priv->second) ) ); } static InfAdoptedOperationFlags inf_adopted_split_operation_get_flags(InfAdoptedOperation* operation) { InfAdoptedSplitOperation* split; InfAdoptedSplitOperationPrivate* priv; InfAdoptedOperationFlags flags1; InfAdoptedOperationFlags flags2; InfAdoptedOperationFlags result; split = INF_ADOPTED_SPLIT_OPERATION(operation); priv = INF_ADOPTED_SPLIT_OPERATION_PRIVATE(split); flags1 = inf_adopted_operation_get_flags(priv->first); flags2 = inf_adopted_operation_get_flags(priv->second); result = 0; if( (flags1 & INF_ADOPTED_OPERATION_AFFECTS_BUFFER) != 0 || (flags2 & INF_ADOPTED_OPERATION_AFFECTS_BUFFER) != 0) { result |= INF_ADOPTED_OPERATION_AFFECTS_BUFFER; } if( (flags1 & INF_ADOPTED_OPERATION_REVERSIBLE) != 0 && (flags2 & INF_ADOPTED_OPERATION_REVERSIBLE) != 0) { result |= INF_ADOPTED_OPERATION_REVERSIBLE; } return result; } static void inf_adopted_split_operation_apply(InfAdoptedOperation* operation, InfAdoptedUser* by, InfBuffer* buffer) { InfAdoptedSplitOperation* split; InfAdoptedSplitOperationPrivate* priv; InfAdoptedOperation* new_second; split = INF_ADOPTED_SPLIT_OPERATION(operation); priv = INF_ADOPTED_SPLIT_OPERATION_PRIVATE(split); new_second = inf_adopted_operation_transform(priv->second, priv->first, 0); inf_adopted_operation_apply(priv->first, by, buffer); inf_adopted_operation_apply(new_second, by, buffer); g_object_unref(G_OBJECT(new_second)); } static InfAdoptedOperation* inf_adopted_split_operation_revert(InfAdoptedOperation* operation) { InfAdoptedSplitOperation* split; InfAdoptedSplitOperationPrivate* priv; InfAdoptedOperation* new_second; InfAdoptedOperation* revert_first; InfAdoptedOperation* revert_second; InfAdoptedSplitOperation* result; split = INF_ADOPTED_SPLIT_OPERATION(operation); priv = INF_ADOPTED_SPLIT_OPERATION_PRIVATE(split); new_second = inf_adopted_operation_transform(priv->second, priv->first, 0); revert_first = inf_adopted_operation_revert(priv->first); revert_second = inf_adopted_operation_revert(new_second); g_object_unref(new_second); result = inf_adopted_split_operation_new(revert_first, revert_second); g_object_unref(revert_first); g_object_unref(revert_second); return INF_ADOPTED_OPERATION(result); } static InfAdoptedOperation* inf_adopted_split_operation_make_reversible(InfAdoptedOperation* operation, InfAdoptedOperation* with, InfBuffer* buffer) { InfAdoptedSplitOperation* split; InfAdoptedSplitOperationPrivate* priv; InfAdoptedOperation* first; InfAdoptedOperation* second; split = INF_ADOPTED_SPLIT_OPERATION(operation); priv = INF_ADOPTED_SPLIT_OPERATION_PRIVATE(split); first = inf_adopted_operation_make_reversible(priv->first, with, buffer); if(first == NULL) return NULL; second = inf_adopted_operation_make_reversible(priv->second, with, buffer); if(second == NULL) { g_object_unref(G_OBJECT(first)); return NULL; } return INF_ADOPTED_OPERATION( inf_adopted_split_operation_new(first, second) ); } static void inf_adopted_split_operation_operation_init(gpointer g_iface, gpointer iface_data) { InfAdoptedOperationIface* iface; iface = (InfAdoptedOperationIface*)g_iface; iface->need_concurrency_id = inf_adopted_split_operation_need_concurrency_id; iface->get_concurrency_id = inf_adopted_split_operation_get_concurrency_id; iface->transform = inf_adopted_split_operation_transform; iface->copy = inf_adopted_split_operation_copy; iface->get_flags = inf_adopted_split_operation_get_flags; iface->apply = inf_adopted_split_operation_apply; iface->revert = inf_adopted_split_operation_revert; iface->make_reversible = inf_adopted_split_operation_make_reversible; } GType inf_adopted_split_operation_get_type(void) { static GType split_operation_type = 0; if(!split_operation_type) { static const GTypeInfo split_operation_type_info = { sizeof(InfAdoptedSplitOperationClass), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ inf_adopted_split_operation_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InfAdoptedSplitOperation), /* instance_size */ 0, /* n_preallocs */ inf_adopted_split_operation_init, /* instance_init */ NULL /* value_table */ }; static const GInterfaceInfo operation_info = { inf_adopted_split_operation_operation_init, NULL, NULL }; split_operation_type = g_type_register_static( G_TYPE_OBJECT, "InfAdoptedSplitOperation", &split_operation_type_info, 0 ); g_type_add_interface_static( split_operation_type, INF_ADOPTED_TYPE_OPERATION, &operation_info ); } return split_operation_type; } /** * inf_adopted_split_operation_new: * @first: one of the #InfAdoptedOperations to be wrapped * @second: the other #InfAdoptedOperation to be wrapped * * Creates a new #InfAdoptedSplitOperation. A split operation is simply a * wrapper around two operations (which may in turn be split operations). * * Return Value: A new #InfAdoptedSplitOperation. **/ InfAdoptedSplitOperation* inf_adopted_split_operation_new(InfAdoptedOperation* first, InfAdoptedOperation* second) { GObject* object; g_return_val_if_fail(INF_ADOPTED_IS_OPERATION(first), NULL); g_return_val_if_fail(INF_ADOPTED_IS_OPERATION(second), NULL); object = g_object_new( INF_ADOPTED_TYPE_SPLIT_OPERATION, "first", first, "second", second, NULL ); return INF_ADOPTED_SPLIT_OPERATION(object); } /** * inf_adopted_split_operation_unsplit: * @operation: A #InfAdoptedSplitOperation. * * Returns a list of the operations contained by the split operation. If the * splitted operation are in turn split operations, they will also be * unsplitted. The returned list is guarenteed to not contain a * #InfAdoptedSplitOperation. * * Return Value: A list of operations. Free with g_slist_free() when done. **/ GSList* inf_adopted_split_operation_unsplit(InfAdoptedSplitOperation* operation) { GSList* result; result = NULL; inf_adopted_split_operation_unsplit_impl(operation, &result); return result; } /** * inf_adopted_split_operation_transform_other: * @op: A #InfAdoptedSplitOperation. * @other: An arbitrary #InfAdoptedOperation. * @concurrency_id: The concurrency id for the transformation of * @other against @op. * * Transforms @other against @op. * * Return Value: The transformed operation. **/ InfAdoptedOperation* inf_adopted_split_operation_transform_other(InfAdoptedSplitOperation* op, InfAdoptedOperation* other, gint concurrency_id) { InfAdoptedSplitOperationPrivate* priv; InfAdoptedOperation* tmp; InfAdoptedOperation* new_second; InfAdoptedOperation* result; g_return_val_if_fail(INF_ADOPTED_IS_SPLIT_OPERATION(op), NULL); g_return_val_if_fail(INF_ADOPTED_IS_OPERATION(other), NULL); priv = INF_ADOPTED_SPLIT_OPERATION_PRIVATE(op); tmp = inf_adopted_operation_transform(other, priv->first, concurrency_id); new_second = inf_adopted_operation_transform(priv->second, priv->first, 0); result = inf_adopted_operation_transform(tmp, new_second, concurrency_id); g_object_unref(G_OBJECT(tmp)); g_object_unref(G_OBJECT(new_second)); return result; } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/adopted/inf-adopted-operation.c0000644000175000017500000003367512264763732021310 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include /** * SECTION:inf-adopted-operation * @title: InfAdoptedOperation * @short_description: Operation that can be processed by * #InfAdoptedAlgorithm. * @include: libinfinity/adopted/inf-adopted-operation.h * @see_also: #InfAdoptedRequest, #InfAdoptedAlgorithm * @stability: Unstable * * The #InfAdoptedOperation interface must be implemented by operations that * are supposed to be used by #InfAdoptedAlgorithm. They basically need to * define transformation rules for transformation against other operations. **/ static void inf_adopted_operation_base_init(gpointer g_class) { static gboolean initialized = FALSE; if(!initialized) { initialized = TRUE; } } GType inf_adopted_concurrency_id_get_type(void) { static GType concurrency_id_type = 0; if(!concurrency_id_type) { static const GEnumValue concurrency_id_type_values[] = { { INF_ADOPTED_CONCURRENCY_SELF, "INF_ADOPTED_CONCURRENCY_SELF", "self" }, { INF_ADOPTED_CONCURRENCY_NONE, "INF_ADOPTED_CONCURRENCY_NONE", "none" }, { INF_ADOPTED_CONCURRENCY_OTHER, "INF_ADOPTED_CONCURRENCY_OTHER", "other" }, { 0, NULL, NULL } }; concurrency_id_type = g_enum_register_static( "InfAdoptedConcurrencyId", concurrency_id_type_values ); } return concurrency_id_type; } GType inf_adopted_operation_flags_get_type(void) { static GType operation_flags_type = 0; if(!operation_flags_type) { static const GFlagsValue operation_flags_type_values[] = { { INF_ADOPTED_OPERATION_AFFECTS_BUFFER, "INF_ADOPTED_OPERATION_AFFECTS_BUFFER", "affects_buffer", }, { INF_ADOPTED_OPERATION_REVERSIBLE, "INF_ADOPTED_OPERATION_REVERSIBLE", "reversible", }, { 0, NULL, NULL } }; operation_flags_type = g_flags_register_static( "InfAdoptedOperationFlags", operation_flags_type_values ); } return operation_flags_type; } GType inf_adopted_operation_get_type(void) { static GType adopted_operation_type = 0; if(!adopted_operation_type) { static const GTypeInfo adopted_operation_info = { sizeof(InfAdoptedOperationIface), /* class_size */ inf_adopted_operation_base_init, /* base_init */ NULL, /* base_finalize */ NULL, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ 0, /* instance_size */ 0, /* n_preallocs */ NULL, /* instance_init */ NULL /* value_table */ }; adopted_operation_type = g_type_register_static( G_TYPE_INTERFACE, "InfAdoptedOperation", &adopted_operation_info, 0 ); g_type_interface_add_prerequisite(adopted_operation_type, G_TYPE_OBJECT); } return adopted_operation_type; } /** * inf_adopted_operation_need_concurrency_id: * @operation: The #InfAdoptedOperation to transform. * @against: The operation to transform against. * * This function returns whether transforming @operation against @against * is not defined unambiguously. In that case, transformation requires a * so-called concurrency ID which determines which of the two operations * is transformed. * * Returns: Whether transformation of @operation against @against requires a * concurrency ID to be defined. */ gboolean inf_adopted_operation_need_concurrency_id(InfAdoptedOperation* operation, InfAdoptedOperation* against) { InfAdoptedOperationIface* iface; g_return_val_if_fail(INF_ADOPTED_IS_OPERATION(operation), FALSE); g_return_val_if_fail(INF_ADOPTED_IS_OPERATION(against), FALSE); iface = INF_ADOPTED_OPERATION_GET_IFACE(operation); g_assert(iface->need_concurrency_id != NULL); return iface->need_concurrency_id(operation, against); } /** * inf_adopted_operation_get_concurrency_id: * @operation: The #InfAdoptedOperation to transform. * @against: The operation to transform against. * * This function returns a concurrency ID for transformation of @operation * against @against. It always returns %INF_ADOPTED_CONCURRENCY_NONE when * inf_adopted_operation_need_concurrency_id() returns %TRUE for * @operation and @against (but that's not necessarily true the other way * around), since it is not possible to decide which operation to transform * without any additional information. * * However, the function can be called on the same operations in a previous * state. In some cases, a decision can be made based on those previous * operations. This can then be used as concurrency ID to call * inf_adopted_operation_transform(). * * Note that the function is antisymmetric. If it returns * %INF_ADOPTED_CONCURRENCY_SELF, then it returns * %INF_ADOPTED_CONCURRENCY_OTHER for swapped arguments. * * Returns: A concurrency ID between @operation and @against. Can be * %INF_ADOPTED_CONCURRENCY_NONE in case no decision can be made. */ InfAdoptedConcurrencyId inf_adopted_operation_get_concurrency_id(InfAdoptedOperation* operation, InfAdoptedOperation* against) { InfAdoptedOperationIface* iface; InfAdoptedConcurrencyId id; g_return_val_if_fail( INF_ADOPTED_IS_OPERATION(operation), INF_ADOPTED_CONCURRENCY_NONE ); g_return_val_if_fail( INF_ADOPTED_IS_OPERATION(against), INF_ADOPTED_CONCURRENCY_NONE ); /* Use antisymmetricity if second argument is split operation, so that * subclasses don't need to handle that case explicitely. */ if(!INF_ADOPTED_IS_SPLIT_OPERATION(operation) && INF_ADOPTED_IS_SPLIT_OPERATION(against)) { iface = INF_ADOPTED_OPERATION_GET_IFACE(against); g_assert(iface->get_concurrency_id != NULL); id = iface->get_concurrency_id(against, operation); switch(id) { case INF_ADOPTED_CONCURRENCY_SELF: return INF_ADOPTED_CONCURRENCY_OTHER; case INF_ADOPTED_CONCURRENCY_NONE: return INF_ADOPTED_CONCURRENCY_NONE; case INF_ADOPTED_CONCURRENCY_OTHER: return INF_ADOPTED_CONCURRENCY_SELF; default: g_assert_not_reached(); return INF_ADOPTED_CONCURRENCY_NONE; } } else { iface = INF_ADOPTED_OPERATION_GET_IFACE(operation); g_assert(iface->get_concurrency_id != NULL); return iface->get_concurrency_id(operation, against); } } /** * inf_adopted_operation_transform: * @operation: The #InfAdoptedOperation to transform. * @against: The operation to transform against. * @concurrency_id: The concurrency ID for the transformation. * * Performs an inclusion transformation of @operation against @against, * meaning that the effect of @against is included in @operation. * * If inf_adopted_operation_need_concurrency_id() returns %TRUE for @operation * and @against, then @concurrency_id must not be * %INF_ADOPTED_CONCURRENCY_NONE. Otherwise, the parameter is ignored. * * Return Value: The transformed #InfAdoptedOperation, or %NULL if the * transformation failed. **/ InfAdoptedOperation* inf_adopted_operation_transform(InfAdoptedOperation* operation, InfAdoptedOperation* against, InfAdoptedConcurrencyId concurrency_id) { InfAdoptedOperationIface* iface; g_return_val_if_fail(INF_ADOPTED_IS_OPERATION(operation), NULL); g_return_val_if_fail(INF_ADOPTED_IS_OPERATION(against), NULL); /* Transform against both parts of split operation if we are transforming * against split operation. */ if(INF_ADOPTED_IS_SPLIT_OPERATION(against)) { return inf_adopted_split_operation_transform_other( INF_ADOPTED_SPLIT_OPERATION(against), operation, concurrency_id ); } else { iface = INF_ADOPTED_OPERATION_GET_IFACE(operation); g_assert(iface->transform != NULL); return (*iface->transform)(operation, against, concurrency_id); } } /** * inf_adopted_operation_copy: * @operation: The #InfAdoptedOperation to copy. * * Returns a copy of @operation. * * Return Value: A copy of @operation. **/ InfAdoptedOperation* inf_adopted_operation_copy(InfAdoptedOperation* operation) { InfAdoptedOperationIface* iface; g_return_val_if_fail(INF_ADOPTED_IS_OPERATION(operation), NULL); iface = INF_ADOPTED_OPERATION_GET_IFACE(operation); g_assert(iface->copy != NULL); return (*iface->copy)(operation); } /** * inf_adopted_operation_get_flags: * @operation: A #InfAdoptedOperation. * * Returns the flags for @operation. * * Return Value: #InfAdoptedOperationFlags for @operation. **/ InfAdoptedOperationFlags inf_adopted_operation_get_flags(InfAdoptedOperation* operation) { InfAdoptedOperationIface* iface; g_return_val_if_fail(INF_ADOPTED_IS_OPERATION(operation), 0); iface = INF_ADOPTED_OPERATION_GET_IFACE(operation); if(iface->get_flags != NULL) return (*iface->get_flags)(operation); else return 0; } /** * inf_adopted_operation_apply: * @operation: A #InfAdoptedOperation. * @by: A #InfAdoptedUser. * @buffer: The #InfBuffer to apply the operation to. * * Applies @operation to @buffer. The operation is considered to be applied by * user @by. **/ void inf_adopted_operation_apply(InfAdoptedOperation* operation, InfAdoptedUser* by, InfBuffer* buffer) { InfAdoptedOperationIface* iface; g_return_if_fail(INF_ADOPTED_IS_OPERATION(operation)); g_return_if_fail(INF_ADOPTED_IS_USER(by)); g_return_if_fail(INF_IS_BUFFER(buffer)); iface = INF_ADOPTED_OPERATION_GET_IFACE(operation); /* apply must be implemented */ g_assert(iface->apply != NULL); (*iface->apply)(operation, by, buffer); } /** * inf_adopted_operation_is_reversible: * @operation: A #InfAdoptedOperation. * * Returns whether @operation is reversible. * * Return Value: Whether @operation is reversible. **/ gboolean inf_adopted_operation_is_reversible(InfAdoptedOperation* operation) { InfAdoptedOperationFlags flags; g_return_val_if_fail(INF_ADOPTED_IS_OPERATION(operation), FALSE); flags = inf_adopted_operation_get_flags(operation); if( (flags & INF_ADOPTED_OPERATION_REVERSIBLE) != 0) return TRUE; else return FALSE; } /** * inf_adopted_operation_revert: * @operation: A #InfAdoptedOperation. * * Returns a new #InfAdoptedOperation that undoes the effect of @operation. If * @operation and then its reverse operation are applied to a buffer (in that * order), the buffer remains unchanged. * * @operation must be reversible for this function to be called (i.e. * inf_adopted_operation_is_reversible() must return TRUE). * * Return Value: The reverse operation of @operation. **/ InfAdoptedOperation* inf_adopted_operation_revert(InfAdoptedOperation* operation) { InfAdoptedOperationIface* iface; g_return_val_if_fail(INF_ADOPTED_IS_OPERATION(operation), NULL); g_assert(inf_adopted_operation_is_reversible(operation) == TRUE); iface = INF_ADOPTED_OPERATION_GET_IFACE(operation); /* When inf_adopted_operation_is_reversible() returns TRUE for an operation * it must implement revert. */ g_assert(iface->revert != NULL); return (*iface->revert)(operation); } /** * inf_adopted_operation_make_reversible: * @operation: A #InfAdoptedOperation. * @with: Another #InfAdoptedOperation that emerged from @operation by * transforming it. * @buffer: A #InfBuffer. * * Some operations may not be reversible, but can be made reversible with * some extra information such as another operation that collected * enough information while being transformed, and the current buffer. * * This function can only be called when @operation is not yet reversible * and returns a new operation that has the same effect as @operation, but is * reversible. * * For example, an operation that deletes some range of text in a text editor * is not reversible if it only stores the position and length of the range, * but can be made reversible when it looks up what there is at that position * in the buffer. * * Return Value: A reversible #InfAdoptedOperation, or %NULL if @operation * cannot be made reversible with the given transformed operation @with and * @buffer. **/ InfAdoptedOperation* inf_adopted_operation_make_reversible(InfAdoptedOperation* operation, InfAdoptedOperation* with, InfBuffer* buffer) { InfAdoptedOperationIface* iface; g_return_val_if_fail(INF_ADOPTED_IS_OPERATION(operation), NULL); g_return_val_if_fail(INF_ADOPTED_IS_OPERATION(with), NULL); g_return_val_if_fail(INF_IS_BUFFER(buffer), NULL); g_assert(inf_adopted_operation_is_reversible(operation) == FALSE); iface = INF_ADOPTED_OPERATION_GET_IFACE(operation); if(iface->make_reversible != NULL) return (*iface->make_reversible)(operation, with, buffer); else return NULL; } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/adopted/inf-adopted-user.c0000644000175000017500000002047212264763732020255 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include typedef struct _InfAdoptedUserPrivate InfAdoptedUserPrivate; struct _InfAdoptedUserPrivate { InfAdoptedStateVector* vector; InfAdoptedRequestLog* log; }; enum { PROP_0, PROP_VECTOR, PROP_REQUEST_LOG }; #define INF_ADOPTED_USER_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), INF_ADOPTED_TYPE_USER, InfAdoptedUserPrivate)) #define INF_ADOPTED_USER_PRIVATE(obj) ((InfAdoptedUserPrivate*)(obj)->priv) static InfUserClass* parent_class; static void inf_adopted_user_init(GTypeInstance* instance, gpointer g_class) { InfAdoptedUser* user; InfAdoptedUserPrivate* priv; user = INF_ADOPTED_USER(instance); user->priv = INF_ADOPTED_USER_GET_PRIVATE(user); priv = INF_ADOPTED_USER_PRIVATE(user); priv->vector = inf_adopted_state_vector_new(); priv->log = NULL; } static GObject* inf_adopted_user_constructor(GType type, guint n_construct_properties, GObjectConstructParam* construct_properties) { GObject* object; InfAdoptedUser* user; InfAdoptedUserPrivate* priv; object = G_OBJECT_CLASS(parent_class)->constructor( type, n_construct_properties, construct_properties ); user = INF_ADOPTED_USER(object); priv = INF_ADOPTED_USER_PRIVATE(user); /* Create empty request log if none was set during construction */ priv->log = inf_adopted_request_log_new(inf_user_get_id(INF_USER(user))); return object; } static void inf_adopted_user_dispose(GObject* object) { InfAdoptedUser* user; InfAdoptedUserPrivate* priv; user = INF_ADOPTED_USER(object); priv = INF_ADOPTED_USER_PRIVATE(user); if(priv->log != NULL) { g_object_unref(G_OBJECT(priv->log)); priv->log = NULL; } G_OBJECT_CLASS(parent_class)->dispose(object); } static void inf_adopted_user_finalize(GObject* object) { InfAdoptedUser* user; InfAdoptedUserPrivate* priv; user = INF_ADOPTED_USER(object); priv = INF_ADOPTED_USER_PRIVATE(user); inf_adopted_state_vector_free(priv->vector); G_OBJECT_CLASS(parent_class)->finalize(object); } static void inf_adopted_user_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec) { InfAdoptedUser* user; InfAdoptedUserPrivate* priv; InfAdoptedRequestLog* log; user = INF_ADOPTED_USER(object); priv = INF_ADOPTED_USER_PRIVATE(user); switch(prop_id) { case PROP_VECTOR: inf_adopted_state_vector_free(priv->vector); priv->vector = g_value_dup_boxed(value); break; case PROP_REQUEST_LOG: g_assert(priv->log == NULL); /* construct only */ if(g_value_get_object(value) != NULL) { log = INF_ADOPTED_REQUEST_LOG(g_value_get_object(value)); g_assert( inf_adopted_request_log_get_user_id(log) == inf_user_get_id(INF_USER(user)) ); priv->log = log; g_object_ref(G_OBJECT(log)); } break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void inf_adopted_user_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec) { InfAdoptedUser* user; InfAdoptedUserPrivate* priv; user = INF_ADOPTED_USER(object); priv = INF_ADOPTED_USER_PRIVATE(user); switch(prop_id) { case PROP_VECTOR: g_value_set_boxed(value, priv->vector); break; case PROP_REQUEST_LOG: g_value_set_object(value, G_OBJECT(priv->log)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void inf_adopted_user_class_init(gpointer g_class, gpointer class_data) { GObjectClass* object_class; object_class = G_OBJECT_CLASS(g_class); parent_class = INF_USER_CLASS(g_type_class_peek_parent(g_class)); g_type_class_add_private(g_class, sizeof(InfAdoptedUserPrivate)); object_class->constructor = inf_adopted_user_constructor; object_class->dispose = inf_adopted_user_dispose; object_class->finalize = inf_adopted_user_finalize; object_class->set_property = inf_adopted_user_set_property; object_class->get_property = inf_adopted_user_get_property; g_object_class_install_property( object_class, PROP_VECTOR, g_param_spec_boxed( "vector", "State vector", "The state this user is currently at", INF_ADOPTED_TYPE_STATE_VECTOR, G_PARAM_READWRITE ) ); g_object_class_install_property( object_class, PROP_REQUEST_LOG, g_param_spec_object( "request-log", "Request log", "Request log of this user", INF_ADOPTED_TYPE_REQUEST_LOG, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); } GType inf_adopted_user_get_type(void) { static GType user_type = 0; if(!user_type) { static const GTypeInfo user_type_info = { sizeof(InfAdoptedUserClass), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ inf_adopted_user_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InfAdoptedUser), /* instance_size */ 0, /* n_preallocs */ inf_adopted_user_init, /* instance_init */ NULL /* value_table */ }; user_type = g_type_register_static( INF_TYPE_USER, "InfAdoptedUser", &user_type_info, 0 ); } return user_type; } /** * inf_adopted_user_get_component: * @user: A #InfAdoptedUser. * @id: The component to retrieve. * * Returns the amount of requests @user is guaranteed to have processed from * the user with ID @id. * * Returns: The number of requests @user has processed from @id. **/ guint inf_adopted_user_get_component(InfAdoptedUser* user, guint id) { g_return_val_if_fail(INF_ADOPTED_IS_USER(user), 0); g_return_val_if_fail(id != 0, 0); return inf_adopted_state_vector_get( INF_ADOPTED_USER_PRIVATE(user)->vector, id ); } /** * inf_adopted_user_get_vector: * @user: A #InfAdoptedUser. * * Returns the current vector time of @user. * * Return Value: The current vector time of @user. **/ InfAdoptedStateVector* inf_adopted_user_get_vector(InfAdoptedUser* user) { g_return_val_if_fail(INF_ADOPTED_IS_USER(user), NULL); return INF_ADOPTED_USER_PRIVATE(user)->vector; } /** * inf_adopted_user_set_vector: * @user: A #InfAdoptedUser. * @vec: A #InfAdoptedStateVector. * * Updates the state vector of @user. This function takes ownership of @vec. **/ void inf_adopted_user_set_vector(InfAdoptedUser* user, InfAdoptedStateVector* vec) { InfAdoptedUserPrivate* priv; g_return_if_fail(INF_ADOPTED_IS_USER(user)); g_return_if_fail(vec != NULL); priv = INF_ADOPTED_USER_PRIVATE(user); inf_adopted_state_vector_free(priv->vector); priv->vector = vec; g_object_notify(G_OBJECT(user), "vector"); } /** * inf_adopted_user_get_request_log: * @user: A #InfAdoptedUser. * * Returns the request log of @user. * * Return Value: User's #InfAdoptedRequestLog. **/ InfAdoptedRequestLog* inf_adopted_user_get_request_log(InfAdoptedUser* user) { g_return_val_if_fail(INF_ADOPTED_IS_USER(user), NULL); return INF_ADOPTED_USER_PRIVATE(user)->log; } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/adopted/inf-adopted-request-log.c0000644000175000017500000010510612264763732021544 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include /* For (g_)memmove */ /** * SECTION:inf-adopted-request-log * @title: InfAdoptedRequestLog * @short_description: History of requests * @include: libinfinity/adopted/inf-adopted-request-log.h * @see_also: #InfAdoptedRequest, #InfAdoptedAlgorithm * @stability: Unstable * * #InfAdoptedRequestLog stores all requests by a particular user. These need * to be looked up by #InfAdoptedAlgorithm to perform transformations of * older requests to the current state. It also adds relations between the * requests so that is easy to find the request that an Undo request undoes, * or the Undo request undoing a given request, if available. * * When requests are no longer needed, then they can also be removed again * from the log, however requests can only be removed so that remaining Undo * or Redo requests do not refer to some request that is about to be removed. */ typedef struct _InfAdoptedRequestLogEntry InfAdoptedRequestLogEntry; struct _InfAdoptedRequestLogEntry { InfAdoptedRequest* request; InfAdoptedRequestLogEntry* original; InfAdoptedRequestLogEntry* next_associated; InfAdoptedRequestLogEntry* prev_associated; InfAdoptedRequestLogEntry* lower_related; InfAdoptedRequestLogEntry* upper_related; }; typedef struct _InfAdoptedRequestLogPrivate InfAdoptedRequestLogPrivate; struct _InfAdoptedRequestLogPrivate { guint user_id; InfAdoptedRequestLogEntry* entries; InfAdoptedRequestLogEntry* next_undo; InfAdoptedRequestLogEntry* next_redo; gsize offset; guint begin; guint end; gsize alloc; }; enum { PROP_0, /* construct only */ PROP_USER_ID, PROP_BEGIN, PROP_END, PROP_NEXT_UNDO, PROP_NEXT_REDO }; enum { ADD_REQUEST, LAST_SIGNAL }; #define INF_ADOPTED_REQUEST_LOG_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), INF_ADOPTED_TYPE_REQUEST_LOG, InfAdoptedRequestLogPrivate)) #define INF_ADOPTED_REQUEST_LOG_PRIVATE(obj) ((InfAdoptedRequestLogPrivate*)(obj)->priv) static GObjectClass* parent_class; static const guint INF_ADOPTED_REQUEST_LOG_INC = 0x80; static guint request_log_signals[LAST_SIGNAL]; #ifdef INF_ADOPTED_REQUEST_LOG_CHECK_RELATED static void inf_adopted_request_log_verify_related(InfAdoptedRequestLog* log) { InfAdoptedRequestLogPrivate* priv; InfAdoptedRequestLogEntry* begin; InfAdoptedRequestLogEntry* end; InfAdoptedRequestLogEntry* current; InfAdoptedRequestLogEntry* lower_related; InfAdoptedRequestLogEntry* upper_related; priv = INF_ADOPTED_REQUEST_LOG_PRIVATE(log); begin = priv->entries + priv->offset; end = begin + (priv->end - priv->begin); lower_related = NULL; upper_related = NULL; for(current = begin; current != end; ++current) { g_assert( (lower_related == NULL && upper_related == NULL) || (lower_related != NULL && upper_related != NULL)); if(lower_related == NULL) { g_assert(current->lower_related == current); g_assert(current->upper_related >= current); if(current->upper_related > current) { lower_related = current->lower_related; upper_related = current->upper_related; } } else { g_assert(current->lower_related == lower_related); g_assert(current->upper_related == upper_related); if(current == upper_related) { lower_related = NULL; upper_related = NULL; } } } } #else # define inf_adopted_request_log_verify_related(log) #endif /* * Associated and Related requests */ /* Find the request that is undone if the next request was an undo request * (to be cached in priv->next_undo). Similar if type is REDO. */ static InfAdoptedRequestLogEntry* inf_adopted_request_log_find_associated(InfAdoptedRequestLog* log, InfAdoptedRequestType type) { InfAdoptedRequestLogPrivate* priv; InfAdoptedRequestLogEntry* entry; g_assert(type != INF_ADOPTED_REQUEST_DO); priv = INF_ADOPTED_REQUEST_LOG_PRIVATE(log); entry = priv->entries + priv->offset + (priv->end - priv->begin) - 1; while(entry >= priv->entries + priv->offset) { switch(inf_adopted_request_get_request_type(entry->request)) { case INF_ADOPTED_REQUEST_DO: /* There is no Undo to Redo */ if(type == INF_ADOPTED_REQUEST_REDO) return NULL; return entry; case INF_ADOPTED_REQUEST_UNDO: if(type == INF_ADOPTED_REQUEST_UNDO) { g_assert(entry->prev_associated != NULL); entry = entry->prev_associated - 1; } else { return entry; } break; case INF_ADOPTED_REQUEST_REDO: if(type == INF_ADOPTED_REQUEST_REDO) { g_assert(entry->prev_associated != NULL); entry = entry->prev_associated - 1; } else { return entry; } break; default: g_assert_not_reached(); break; } } return NULL; } /* * GObject overrides */ static void inf_adopted_request_log_init(GTypeInstance* instance, gpointer g_class) { InfAdoptedRequestLog* log; InfAdoptedRequestLogPrivate* priv; log = INF_ADOPTED_REQUEST_LOG(instance); log->priv = INF_ADOPTED_REQUEST_LOG_GET_PRIVATE(log); priv = INF_ADOPTED_REQUEST_LOG_PRIVATE(log); priv->user_id = 0; priv->alloc = INF_ADOPTED_REQUEST_LOG_INC; priv->entries = g_malloc(priv->alloc * sizeof(InfAdoptedRequestLogEntry)); priv->begin = 0; priv->end = 0; priv->offset = 0; priv->next_undo = NULL; priv->next_redo = NULL; } static void inf_adopted_request_log_dispose(GObject* object) { InfAdoptedRequestLog* log; InfAdoptedRequestLogPrivate* priv; guint i; log = INF_ADOPTED_REQUEST_LOG(object); priv = INF_ADOPTED_REQUEST_LOG_PRIVATE(log); for(i = priv->offset; i < priv->offset + (priv->end - priv->begin); ++ i) g_object_unref(G_OBJECT(priv->entries[i].request)); priv->begin = 0; priv->end = 0; priv->offset = 0; G_OBJECT_CLASS(parent_class)->dispose(object); } static void inf_adopted_request_log_finalize(GObject* object) { InfAdoptedRequestLog* log; InfAdoptedRequestLogPrivate* priv; log = INF_ADOPTED_REQUEST_LOG(object); priv = INF_ADOPTED_REQUEST_LOG_PRIVATE(log); g_free(priv->entries); G_OBJECT_CLASS(parent_class)->finalize(object); } static void inf_adopted_request_log_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec) { InfAdoptedRequestLog* log; InfAdoptedRequestLogPrivate* priv; log = INF_ADOPTED_REQUEST_LOG(object); priv = INF_ADOPTED_REQUEST_LOG_PRIVATE(log); switch(prop_id) { case PROP_USER_ID: g_assert(priv->user_id == 0); /* construct only */ g_assert(g_value_get_uint(value) != 0); /* 0 is invalid user ID */ priv->user_id = g_value_get_uint(value); break; case PROP_BEGIN: g_assert(priv->begin == 0); /* construct only */ priv->begin = g_value_get_uint(value); priv->end = priv->begin; break; case PROP_END: case PROP_NEXT_UNDO: case PROP_NEXT_REDO: /* These are read only; fallthrough */ default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void inf_adopted_request_log_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec) { InfAdoptedRequestLog* log; InfAdoptedRequestLogPrivate* priv; log = INF_ADOPTED_REQUEST_LOG(object); priv = INF_ADOPTED_REQUEST_LOG_PRIVATE(log); switch(prop_id) { case PROP_USER_ID: g_value_set_uint(value, priv->user_id); break; case PROP_BEGIN: g_value_set_uint(value, priv->begin); break; case PROP_END: g_value_set_uint(value, priv->end); break; case PROP_NEXT_UNDO: if(priv->next_undo != NULL) g_value_set_object(value, G_OBJECT(priv->next_undo->request)); else g_value_set_object(value, NULL); break; case PROP_NEXT_REDO: if(priv->next_redo != NULL) g_value_set_object(value, G_OBJECT(priv->next_redo->request)); else g_value_set_object(value, NULL); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void inf_adopted_request_log_add_request_handler(InfAdoptedRequestLog* log, InfAdoptedRequest* request) { InfAdoptedRequestLogPrivate* priv; InfAdoptedRequestLogEntry* entry; InfAdoptedRequestLogEntry* old_entries; InfAdoptedRequestLogEntry* current; guint i; priv = INF_ADOPTED_REQUEST_LOG_PRIVATE(log); g_assert(inf_adopted_request_get_user_id(request) == priv->user_id); g_assert( priv->begin == priv->end || inf_adopted_state_vector_get( inf_adopted_request_get_vector(request), priv->user_id ) == priv->end ); if(priv->offset + (priv->end - priv->begin) == priv->alloc) { if(priv->offset > 0) { g_memmove( priv->entries, priv->entries + priv->offset, (priv->end - priv->begin) * sizeof(InfAdoptedRequestLogEntry) ); /* We now corrupted several pointers in our entries because of * moving memory around. */ for(i = 0; i < priv->end - priv->begin; ++ i) { g_assert(priv->entries[i].original != NULL); priv->entries[i].original -= priv->offset; if(priv->entries[i].next_associated != NULL) priv->entries[i].next_associated -= priv->offset; if(priv->entries[i].prev_associated != NULL) priv->entries[i].prev_associated -= priv->offset; priv->entries[i].lower_related -= priv->offset; priv->entries[i].upper_related -= priv->offset; } if(priv->next_undo != NULL) priv->next_undo -= priv->offset; if(priv->next_redo != NULL) priv->next_redo -= priv->offset; priv->offset = 0; } else { old_entries = priv->entries; priv->alloc += INF_ADOPTED_REQUEST_LOG_INC; priv->entries = g_realloc( priv->entries, priv->alloc * sizeof(InfAdoptedRequestLogEntry) ); if(priv->entries != old_entries) { /* The realloc above could have invalidated several pointers */ for(i = 0; i < priv->end - priv->begin; ++ i) { g_assert(priv->entries[i].original != NULL); priv->entries[i].original = priv->entries + (priv->entries[i].original - old_entries); if(priv->entries[i].next_associated != NULL) { priv->entries[i].next_associated = priv->entries + (priv->entries[i].next_associated - old_entries); } if(priv->entries[i].prev_associated != NULL) { priv->entries[i].prev_associated = priv->entries + (priv->entries[i].prev_associated - old_entries); } priv->entries[i].lower_related = priv->entries + (priv->entries[i].lower_related - old_entries); priv->entries[i].upper_related = priv->entries + (priv->entries[i].upper_related - old_entries); } if(priv->next_undo != NULL) priv->next_undo = priv->entries + (priv->next_undo - old_entries); if(priv->next_redo != NULL) priv->next_redo = priv->entries + (priv->next_redo - old_entries); } } } g_object_freeze_notify(G_OBJECT(log)); if(priv->begin == priv->end) { priv->begin = inf_adopted_state_vector_get( inf_adopted_request_get_vector(request), priv->user_id ); priv->end = priv->begin; } entry = &priv->entries[priv->offset + (priv->end - priv->begin)]; ++ priv->end; g_object_notify(G_OBJECT(log), "end"); entry->request = request; g_object_ref(G_OBJECT(request)); switch(inf_adopted_request_get_request_type(request)) { case INF_ADOPTED_REQUEST_DO: entry->original = entry; entry->next_associated = NULL; entry->prev_associated = NULL; entry->lower_related = entry; entry->upper_related = entry; priv->next_undo = entry; g_object_notify(G_OBJECT(log), "next-undo"); if(priv->next_redo != NULL) { priv->next_redo = NULL; g_object_notify(G_OBJECT(log), "next-redo"); } break; case INF_ADOPTED_REQUEST_UNDO: g_assert(priv->next_undo != NULL); entry->next_associated = NULL; entry->prev_associated = priv->next_undo; entry->prev_associated->next_associated = entry; entry->original = entry->prev_associated->original; entry->lower_related = entry->original->lower_related; entry->upper_related = entry; for(current = entry->lower_related; current != entry; ++current) { current->lower_related = entry->lower_related; current->upper_related = entry; } priv->next_undo = inf_adopted_request_log_find_associated(log, INF_ADOPTED_REQUEST_UNDO); g_object_notify(G_OBJECT(log), "next-undo"); priv->next_redo = entry; g_object_notify(G_OBJECT(log), "next-redo"); g_assert(priv->next_undo == NULL || inf_adopted_request_get_request_type(priv->next_undo->request) == INF_ADOPTED_REQUEST_DO || inf_adopted_request_get_request_type(priv->next_undo->request) == INF_ADOPTED_REQUEST_REDO); break; case INF_ADOPTED_REQUEST_REDO: g_assert(priv->next_redo != NULL); entry->next_associated = NULL; entry->prev_associated = priv->next_redo; entry->prev_associated->next_associated = entry; entry->original = entry->prev_associated->original; entry->lower_related = entry->original->lower_related; entry->upper_related = entry; for(current = entry->lower_related; current != entry; ++current) { current->lower_related = entry->lower_related; current->upper_related = entry; } priv->next_undo = entry; g_object_notify(G_OBJECT(log), "next-undo"); priv->next_redo = inf_adopted_request_log_find_associated(log, INF_ADOPTED_REQUEST_REDO); g_object_notify(G_OBJECT(log), "next-redo"); g_assert(priv->next_redo == NULL || inf_adopted_request_get_request_type(priv->next_redo->request) == INF_ADOPTED_REQUEST_UNDO); break; default: g_assert_not_reached(); break; } inf_adopted_request_log_verify_related(log); g_object_thaw_notify(G_OBJECT(log)); } static void inf_adopted_request_log_class_init(gpointer g_class, gpointer class_data) { GObjectClass* object_class; InfAdoptedRequestLogClass* request_log_class; object_class = G_OBJECT_CLASS(g_class); request_log_class = INF_ADOPTED_REQUEST_LOG_CLASS(g_class); parent_class = G_OBJECT_CLASS(g_type_class_peek_parent(g_class)); g_type_class_add_private(g_class, sizeof(InfAdoptedRequestLogPrivate)); object_class->dispose = inf_adopted_request_log_dispose; object_class->finalize = inf_adopted_request_log_finalize; object_class->set_property = inf_adopted_request_log_set_property; object_class->get_property = inf_adopted_request_log_get_property; request_log_class->add_request = inf_adopted_request_log_add_request_handler; g_object_class_install_property( object_class, PROP_USER_ID, g_param_spec_uint( "user-id", "User ID", "The ID of the user whose requests the log contains", 0, G_MAXUINT, 0, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); g_object_class_install_property( object_class, PROP_BEGIN, g_param_spec_uint( "begin", "Begin", "The first index contained in the log", 0, G_MAXUINT, 0, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); g_object_class_install_property( object_class, PROP_END, g_param_spec_uint( "end", "End", "The index of the next request that is inserted into the log", 0, G_MAXUINT, 0, G_PARAM_READABLE ) ); g_object_class_install_property( object_class, PROP_NEXT_UNDO, g_param_spec_object( "next-undo", "Next undo", "The request that is undone when the user issues an undo request now", INF_ADOPTED_TYPE_REQUEST, G_PARAM_READABLE ) ); g_object_class_install_property( object_class, PROP_NEXT_REDO, g_param_spec_object( "next-redo", "Next redo", "The request that is redone when the user issues a redo request new", INF_ADOPTED_TYPE_REQUEST, G_PARAM_READABLE ) ); /** * InfAdoptedRequestLog::add-request: * @request_log: The #InfAdoptedRequestLog to which a new request is added. * @request: The new request being added. * * This signal is emitted whenever a new request is added to the request log * via inf_adopted_request_log_add_request(). */ request_log_signals[ADD_REQUEST] = g_signal_new( "add-request", G_OBJECT_CLASS_TYPE(object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(InfAdoptedRequestLogClass, add_request), NULL, NULL, inf_marshal_VOID__OBJECT, G_TYPE_NONE, 1, INF_ADOPTED_TYPE_REQUEST ); } GType inf_adopted_request_log_get_type(void) { static GType request_log_type = 0; if(!request_log_type) { static const GTypeInfo request_log_type_info = { sizeof(InfAdoptedRequestLogClass), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ inf_adopted_request_log_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InfAdoptedRequestLog), /* instance_size */ 0, /* n_preallocs */ inf_adopted_request_log_init, /* instance_init */ NULL /* value_table */ }; request_log_type = g_type_register_static( G_TYPE_OBJECT, "InfAdoptedRequestLog", &request_log_type_info, 0 ); } return request_log_type; } /** * inf_adopted_request_log_new: * @user_id: The ID of the #InfAdoptedUser to create a request log for. The * request log only contains requests of that particular user. * * Return Value: A new #InfAdoptedRequestLog. **/ InfAdoptedRequestLog* inf_adopted_request_log_new(guint user_id) { GObject* object; g_return_val_if_fail(user_id != 0, NULL); object = g_object_new( INF_ADOPTED_TYPE_REQUEST_LOG, "user-id", user_id, NULL ); return INF_ADOPTED_REQUEST_LOG(object); } /** * inf_adopted_request_log_get_user_id: * @log: A #InfAdoptedRequestLog. * * Returns the ID of the user whose requests @log contains. * * Return Value: The log's user ID. **/ guint inf_adopted_request_log_get_user_id(InfAdoptedRequestLog* log) { g_return_val_if_fail(INF_ADOPTED_IS_REQUEST_LOG(log), 0); return INF_ADOPTED_REQUEST_LOG_PRIVATE(log)->user_id; } /** * inf_adopted_request_log_get_begin: * @log: A #InfAdoptedRequestLog. * * Returns the first index (i.e. the index of the oldest request) in the log. * * Return Value: The first index in the log. **/ guint inf_adopted_request_log_get_begin(InfAdoptedRequestLog* log) { g_return_val_if_fail(INF_ADOPTED_IS_REQUEST_LOG(log), 0); return INF_ADOPTED_REQUEST_LOG_PRIVATE(log)->begin; } /** * inf_adopted_request_log_get_end: * @log: A #InfAdoptedRequestLog. * * Returns the index a newly inserted request would have (i.e. one past the * index of the newest request in the log). This ensures that * inf_adopted_request_log_get_end() - inf_adopted_request_log_get_begin() * reveals the number of requests in the log. * * Return Value: The index of the next request in the log. **/ guint inf_adopted_request_log_get_end(InfAdoptedRequestLog* log) { g_return_val_if_fail(INF_ADOPTED_IS_REQUEST_LOG(log), 0); return INF_ADOPTED_REQUEST_LOG_PRIVATE(log)->end; } /** * inf_adopted_request_log_is_empty: * @log: A #InfAdoptedRequestLog. * * Returns whether @log is empty. A log is empty if it does not contain any * requsets. * * Returns: Whether @log is empty. */ gboolean inf_adopted_request_log_is_empty(InfAdoptedRequestLog* log) { InfAdoptedRequestLogPrivate* priv; g_return_val_if_fail(INF_ADOPTED_IS_REQUEST_LOG(log), TRUE); priv = INF_ADOPTED_REQUEST_LOG_PRIVATE(log); if(priv->begin == priv->end) return TRUE; return FALSE; } /** * inf_adopted_request_log_set_begin: * @log: A #InfAdoptedRequestLog. * @n: The index of the first request to be added to the log. * * This function sets the index of the first log that will be added to @log. * For a new request log, this is set to 0. If you intend to insert a request * sequence into @log that does not start with 0, then you can call this * function with the desired start index, so that * inf_adopted_request_log_get_begin() and inf_adopted_request_log_get_end() * return the correct value. * * If you don't need inf_adopted_request_log_get_begin() or * inf_adopted_request_log_get_end() before adding the first request to the * log, then you don't need to call this function, since * inf_adopted_request_log_add_request() will do it implicitely based on the * request's vector time component for the request log's user. * * This function can only be called if the request log is empty, see * inf_adopted_request_log_is_empty(). */ void inf_adopted_request_log_set_begin(InfAdoptedRequestLog* log, guint n) { InfAdoptedRequestLogPrivate* priv; g_return_if_fail(INF_ADOPTED_IS_REQUEST_LOG(log)); priv = INF_ADOPTED_REQUEST_LOG_PRIVATE(log); g_return_if_fail(priv->begin == priv->end); if(priv->begin != n) { priv->begin = n; priv->end = n; g_object_notify(G_OBJECT(log), "begin"); g_object_notify(G_OBJECT(log), "end"); } } /** * inf_adopted_request_log_get_request: * @log: A #InfAdoptedRequestLog. * @n: The index of a request contained in @log. * * Returns the request with the given index. Such a request must exist in * @log. * * Return Value: A #InfAdoptedRequest. The request is owned by the request * log, you do not need to free it. **/ InfAdoptedRequest* inf_adopted_request_log_get_request(InfAdoptedRequestLog* log, guint n) { InfAdoptedRequestLogPrivate* priv; g_return_val_if_fail(INF_ADOPTED_IS_REQUEST_LOG(log), NULL); priv = INF_ADOPTED_REQUEST_LOG_PRIVATE(log); g_return_val_if_fail(n >= priv->begin && n < priv->end, NULL); return priv->entries[priv->offset + n - priv->begin].request; } /** * inf_adopted_request_add_request: * @log: A #InfAdoptedRequestLog. * @request: A #InfAdoptedRequest. * * Inserts @request into @log. The component represented by the log's user * of the request's state vector must match the end index of @log if @log * is not empty. Also, the user that issued @request must be the same user as * the one this request log belongs to. **/ void inf_adopted_request_log_add_request(InfAdoptedRequestLog* log, InfAdoptedRequest* request) { InfAdoptedRequestLogPrivate* priv; g_return_if_fail(INF_ADOPTED_IS_REQUEST_LOG(log)); g_return_if_fail(INF_ADOPTED_IS_REQUEST(request)); priv = INF_ADOPTED_REQUEST_LOG_PRIVATE(log); g_return_if_fail(inf_adopted_request_get_user_id(request) == priv->user_id); g_return_if_fail( priv->begin == priv->end || inf_adopted_state_vector_get( inf_adopted_request_get_vector(request), priv->user_id ) == priv->end ); g_signal_emit(G_OBJECT(log), request_log_signals[ADD_REQUEST], 0, request); } /** * inf_adopted_request_log_remove_requests: * @log: A #InfAdoptedRequestLog. * @up_to: The index of the first request not to remove. * * Removes all requests with index lower than @up_to. This function only works * if the request before @up_to is an "upper related" request. * See inf_adopted_request_log_upper_related(). This condition guarantees * that remaining requests do not refer to removed ones. **/ void inf_adopted_request_log_remove_requests(InfAdoptedRequestLog* log, guint up_to) { InfAdoptedRequestLogPrivate* priv; guint i; g_return_if_fail(INF_ADOPTED_IS_REQUEST_LOG(log)); priv = INF_ADOPTED_REQUEST_LOG_PRIVATE(log); g_return_if_fail(up_to >= priv->begin && up_to <= priv->end); g_return_if_fail( up_to == priv->begin || priv->entries[priv->offset + up_to - priv->begin - 1].upper_related == &priv->entries[priv->offset + up_to - priv->begin - 1] ); for(i = priv->offset; i < priv->offset + (up_to - priv->begin); ++i) g_object_unref(G_OBJECT(priv->entries[i].request)); g_object_freeze_notify(G_OBJECT(log)); /* If the next undo/redo request has been removed, there cannot be * a new next undo/redo request, because the next undo is already the * newest one in the log */ if(priv->next_undo != NULL) { if(priv->next_undo < priv->entries + priv->offset + (up_to - priv->begin)) { priv->next_undo = NULL; g_object_notify(G_OBJECT(log), "next-undo"); } } if(priv->next_redo != NULL) { if(priv->next_redo < priv->entries + priv->offset + (up_to - priv->begin)) { priv->next_redo = NULL; g_object_notify(G_OBJECT(log), "next-redo"); } } priv->offset += (up_to - priv->begin); priv->begin = up_to; g_object_notify(G_OBJECT(log), "begin"); inf_adopted_request_log_verify_related(log); g_object_thaw_notify(G_OBJECT(log)); } /** * inf_adopted_request_log_next_associated: * @log: A #InfAdoptedRequestLog. * @request: A #InfAdoptedRequest contained in @log. * * If @request is of type %INF_ADOPTED_REQUEST_DO or * %INF_ADOPTED_REQUEST_REDO, this returns UNDO request that undoes this * request, if any. If @request is a %INF_ADOPTED_REQUEST UNDO request, this * returns a request that redoes @request, if any. * * Return Value: The next associated request of @request, or %NULL. **/ InfAdoptedRequest* inf_adopted_request_log_next_associated(InfAdoptedRequestLog* log, InfAdoptedRequest* request) { InfAdoptedRequestLogPrivate* priv; InfAdoptedStateVector* vector; guint user_id; guint n; InfAdoptedRequestLogEntry* entry; g_return_val_if_fail(INF_ADOPTED_IS_REQUEST_LOG(log), NULL); g_return_val_if_fail(INF_ADOPTED_IS_REQUEST(request), NULL); priv = INF_ADOPTED_REQUEST_LOG_PRIVATE(log); vector = inf_adopted_request_get_vector(request); user_id = inf_adopted_request_get_user_id(request); n = inf_adopted_state_vector_get(vector, user_id); g_return_val_if_fail(priv->user_id == user_id, NULL); g_return_val_if_fail(n >= priv->begin && n < priv->end, NULL); entry = priv->entries + priv->offset + n - priv->begin; if(entry->next_associated == NULL) return NULL; return entry->next_associated->request; } /** * inf_adopted_request_log_prev_associated: * @log: A #InfAdoptedRequestLog. * @request: A #InfAdoptedRequest. * * If @request is of type %INF_ADOPTED_REQUEST_REDO or, this returns the UNDO * request that is redone by @request, if @request is a * %INF_ADOPTED_REQUEST_UNDO request, this returns the request that is undone * by @request. * * @request must either be contained in @log or the vector time component * of its own user must be equivalent to inf_adopted_request_log_get_end(), * in which case @request is treated as it if was the newest requset in @log. * * Return Value: The previous associated request of @request, or %NULL. **/ InfAdoptedRequest* inf_adopted_request_log_prev_associated(InfAdoptedRequestLog* log, InfAdoptedRequest* request) { InfAdoptedRequestLogPrivate* priv; InfAdoptedStateVector* vector; guint user_id; guint n; InfAdoptedRequestLogEntry* entry; g_return_val_if_fail(INF_ADOPTED_IS_REQUEST_LOG(log), NULL); g_return_val_if_fail(INF_ADOPTED_IS_REQUEST(request), NULL); priv = INF_ADOPTED_REQUEST_LOG_PRIVATE(log); vector = inf_adopted_request_get_vector(request); user_id = inf_adopted_request_get_user_id(request); n = inf_adopted_state_vector_get(vector, user_id); g_return_val_if_fail(priv->user_id == user_id, NULL); g_return_val_if_fail(n >= priv->begin && n <= priv->end, NULL); if(n == priv->end) { switch(inf_adopted_request_get_request_type(request)) { case INF_ADOPTED_REQUEST_DO: entry = NULL; break; case INF_ADOPTED_REQUEST_UNDO: entry = priv->next_undo; break; case INF_ADOPTED_REQUEST_REDO: entry = priv->next_redo; break; default: g_assert_not_reached(); break; } if(entry != NULL) return entry->request; else return NULL; } else { entry = priv->entries + priv->offset + n - priv->begin; if(entry->prev_associated == NULL) return NULL; return entry->prev_associated->request; } } /** * inf_adopted_request_log_original_request: * @log: A #InfAdoptedRequestLog. * @request: A #InfAdoptedRequest. * * Returns the most previous associated request for @request, that is, * the %INF_ADOPTED_REQUEST_DO request that @request undoes or redoes, * respectively. If @request itself is a %INF_ADOPTED_REQUEST_DO request, * @request itself is returned. * * @request must either be contained in @log or the vector time component * of its own user must be equivalent to inf_adopted_request_log_get_end(), * in which case @request is treated as it if was the newest request in @log. * * Return Value: The original request of @request. This function never * returns %NULL. **/ InfAdoptedRequest* inf_adopted_request_log_original_request(InfAdoptedRequestLog* log, InfAdoptedRequest* request) { InfAdoptedRequestLogPrivate* priv; InfAdoptedStateVector* vector; guint user_id; guint n; InfAdoptedRequestLogEntry* entry; g_return_val_if_fail(INF_ADOPTED_IS_REQUEST_LOG(log), NULL); g_return_val_if_fail(INF_ADOPTED_IS_REQUEST(request), NULL); priv = INF_ADOPTED_REQUEST_LOG_PRIVATE(log); vector = inf_adopted_request_get_vector(request); user_id = inf_adopted_request_get_user_id(request); n = inf_adopted_state_vector_get(vector, user_id); g_return_val_if_fail(priv->user_id == user_id, NULL); g_return_val_if_fail(n >= priv->begin && n <= priv->end, NULL); if(n == priv->end) { switch(inf_adopted_request_get_request_type(request)) { case INF_ADOPTED_REQUEST_DO: entry = NULL; break; case INF_ADOPTED_REQUEST_UNDO: entry = priv->next_undo; break; case INF_ADOPTED_REQUEST_REDO: entry = priv->next_redo; break; default: g_assert_not_reached(); break; } if(entry != NULL) return entry->original->request; else return request; } else { entry = priv->entries + priv->offset + n - priv->begin; g_assert(entry->original != NULL); return entry->original->request; } } /** * inf_adopted_request_log_next_undo: * @log: A #InfAdoptedRequestLog. * * Returns the request that would be undone if a undo request was added to * the request log. * * Return Value: The next request to be undone, or %NULL. **/ InfAdoptedRequest* inf_adopted_request_log_next_undo(InfAdoptedRequestLog* log) { InfAdoptedRequestLogPrivate* priv; g_return_val_if_fail(INF_ADOPTED_IS_REQUEST_LOG(log), NULL); priv = INF_ADOPTED_REQUEST_LOG_PRIVATE(log); if(priv->next_undo == NULL) return NULL; return priv->next_undo->request; } /** * inf_adopted_request_log_next_redo: * @log: A #InfAdoptedRequestLog. * * Returns the request that would be redone if a redo request was added to * the request log. * * Return Value: The next request to be redone, or %NULL. **/ InfAdoptedRequest* inf_adopted_request_log_next_redo(InfAdoptedRequestLog* log) { InfAdoptedRequestLogPrivate* priv; g_return_val_if_fail(INF_ADOPTED_IS_REQUEST_LOG(log), NULL); priv = INF_ADOPTED_REQUEST_LOG_PRIVATE(log); if(priv->next_redo == NULL) return NULL; return priv->next_redo->request; } /** * inf_adopted_request_log_upper_related: * @log: A #InfAdoptedRequestLog. * @n: Index of a request in @log. * * Returns the newest request in @log that is related to @nth request * in log. requests are considered related when they are enclosed by a * do/undo, an undo/redo or a redo/undo pair. * * Note that the sets of related requests within a request log are * disjoint. * * Return Value: The newest request in @log being related to the @nth * request. **/ InfAdoptedRequest* inf_adopted_request_log_upper_related(InfAdoptedRequestLog* log, guint n) { InfAdoptedRequestLogPrivate* priv; InfAdoptedRequestLogEntry* current; g_return_val_if_fail(INF_ADOPTED_IS_REQUEST_LOG(log), NULL); priv = INF_ADOPTED_REQUEST_LOG_PRIVATE(log); g_return_val_if_fail(n >= priv->begin && n < priv->end, NULL); inf_adopted_request_log_verify_related(log); current = priv->entries + priv->offset + n - priv->begin; return current->upper_related->request; } /** * inf_adopted_request_log_lower_related: * @log: A #InfAdoptedRequestLog. * @n: Index of a request in @log. * * Returns the oldest request in @log that is related to @nth request * in log. Requests are considered related when they are enclosed by a * do/undo, an undo/redo or a redo/undo pair. * * Note that the sets of related requests within a request log are * disjoint. * * Return Value: The oldest request in @log being related to the @nth * request. **/ InfAdoptedRequest* inf_adopted_request_log_lower_related(InfAdoptedRequestLog* log, guint n) { InfAdoptedRequestLogPrivate* priv; InfAdoptedRequestLogEntry* current; g_return_val_if_fail(INF_ADOPTED_IS_REQUEST_LOG(log), NULL); priv = INF_ADOPTED_REQUEST_LOG_PRIVATE(log); g_return_val_if_fail(n >= priv->begin && n < priv->end, NULL); inf_adopted_request_log_verify_related(log); current = priv->entries + priv->offset + n - priv->begin; return current->lower_related->request; } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/adopted/inf-adopted-request.h0000644000175000017500000001127512264763732020775 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_ADOPTED_REQUEST_H__ #define __INF_ADOPTED_REQUEST_H__ #include #include #include G_BEGIN_DECLS #define INF_ADOPTED_TYPE_REQUEST (inf_adopted_request_get_type()) #define INF_ADOPTED_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INF_ADOPTED_TYPE_REQUEST, InfAdoptedRequest)) #define INF_ADOPTED_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INF_ADOPTED_TYPE_REQUEST, InfAdoptedRequestClass)) #define INF_ADOPTED_IS_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INF_ADOPTED_TYPE_REQUEST)) #define INF_ADOPTED_IS_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INF_ADOPTED_TYPE_REQUEST)) #define INF_ADOPTED_REQUEST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), INF_ADOPTED_TYPE_REQUEST, InfAdoptedRequestClass)) #define INF_ADOPTED_TYPE_REQUEST_TYPE (inf_adopted_request_type_get_type()) typedef struct _InfAdoptedRequest InfAdoptedRequest; typedef struct _InfAdoptedRequestClass InfAdoptedRequestClass; /** * InfAdoptedRequestClass: * * This structure does not contain any public fields. */ struct _InfAdoptedRequestClass { /*< private >*/ GObjectClass parent_class; }; /** * InfAdoptedRequest: * * #InfAdoptedRequest is an opaque data type. You should only access it via * the public API functions. */ struct _InfAdoptedRequest { /*< private >*/ GObject parent; gpointer priv; }; /** * InfAdoptedRequestType: * @INF_ADOPTED_REQUEST_DO: A request that performs an operation. * @INF_ADOPTED_REQUEST_UNDO: A request that undoes a previously applied * request. * @INF_ADOPTED_REQUEST_REDO: A request that redoes a previously undone * request. * * Possible types for an #InfAdoptedRequest. */ typedef enum _InfAdoptedRequestType { INF_ADOPTED_REQUEST_DO, INF_ADOPTED_REQUEST_UNDO, INF_ADOPTED_REQUEST_REDO } InfAdoptedRequestType; GType inf_adopted_request_type_get_type(void) G_GNUC_CONST; GType inf_adopted_request_get_type(void) G_GNUC_CONST; InfAdoptedRequest* inf_adopted_request_new_do(InfAdoptedStateVector* vector, guint user_id, InfAdoptedOperation* operation); InfAdoptedRequest* inf_adopted_request_new_undo(InfAdoptedStateVector* vector, guint user_id); InfAdoptedRequest* inf_adopted_request_new_redo(InfAdoptedStateVector* vector, guint user_id); InfAdoptedRequest* inf_adopted_request_copy(InfAdoptedRequest* request); InfAdoptedRequestType inf_adopted_request_get_request_type(InfAdoptedRequest* request); InfAdoptedStateVector* inf_adopted_request_get_vector(InfAdoptedRequest* request); guint inf_adopted_request_get_user_id(InfAdoptedRequest* request); InfAdoptedOperation* inf_adopted_request_get_operation(InfAdoptedRequest* request); guint inf_adopted_request_get_index(InfAdoptedRequest* request); gboolean inf_adopted_request_need_concurrency_id(InfAdoptedRequest* request, InfAdoptedRequest* against); InfAdoptedConcurrencyId inf_adopted_request_get_concurrency_id(InfAdoptedRequest* request, InfAdoptedRequest* against); InfAdoptedRequest* inf_adopted_request_transform(InfAdoptedRequest* request, InfAdoptedRequest* against, InfAdoptedConcurrencyId concurrency_id); InfAdoptedRequest* inf_adopted_request_mirror(InfAdoptedRequest* request, guint by); InfAdoptedRequest* inf_adopted_request_fold(InfAdoptedRequest* request, guint into, guint by); gboolean inf_adopted_request_affects_buffer(InfAdoptedRequest* request); G_END_DECLS #endif /* __INF_ADOPTED_REQUEST_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/adopted/inf-adopted-algorithm.h0000644000175000017500000001252312264763732021270 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_ADOPTED_ALGORITHM_H__ #define __INF_ADOPTED_ALGORITHM_H__ #include #include #include #include #include G_BEGIN_DECLS #define INF_ADOPTED_TYPE_ALGORITHM (inf_adopted_algorithm_get_type()) #define INF_ADOPTED_ALGORITHM(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INF_ADOPTED_TYPE_ALGORITHM, InfAdoptedAlgorithm)) #define INF_ADOPTED_ALGORITHM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INF_ADOPTED_TYPE_ALGORITHM, InfAdoptedAlgorithmClass)) #define INF_ADOPTED_IS_ALGORITHM(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INF_ADOPTED_TYPE_ALGORITHM)) #define INF_ADOPTED_IS_ALGORITHM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INF_ADOPTED_TYPE_ALGORITHM)) #define INF_ADOPTED_ALGORITHM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), INF_ADOPTED_TYPE_ALGORITHM, InfAdoptedAlgorithmClass)) typedef struct _InfAdoptedAlgorithm InfAdoptedAlgorithm; typedef struct _InfAdoptedAlgorithmClass InfAdoptedAlgorithmClass; /** * InfAdoptedAlgorithmClass: * @can_undo_changed: Default signal handler for the * #InfAdoptedAlgorithm::can_undo_changed signal. * @can_redo_changed: Default signal handler for the * #InfAdoptedAlgorithm::can_redo_changed signal. * @execute_request: Default signal handler for the * #InfAdoptedAlgorithm::execute_request signal. * @apply_request: Default signal handler for the * #InfAdoptedAlgorithm::apply_request signal. * * Signals for the #InfAdoptedAlgorithm class. */ struct _InfAdoptedAlgorithmClass { /*< private >*/ GObjectClass parent_class; /* Signals */ /*< public >*/ void(*can_undo_changed)(InfAdoptedAlgorithm* algorithm, InfAdoptedUser* user, gboolean can_undo); void(*can_redo_changed)(InfAdoptedAlgorithm* algorithm, InfAdoptedUser* user, gboolean can_redo); void(*execute_request)(InfAdoptedAlgorithm* algorithm, InfAdoptedUser* user, InfAdoptedRequest* request, gboolean apply); void(*apply_request)(InfAdoptedAlgorithm* algorithm, InfAdoptedUser* user, InfAdoptedRequest* request); }; /** * InfAdoptedAlgorithm: * * #InfAdoptedAlgorithm is an opaque data type. You should only access it via * the public API functions. */ struct _InfAdoptedAlgorithm { /*< private >*/ GObject parent; gpointer priv; }; GType inf_adopted_algorithm_get_type(void) G_GNUC_CONST; InfAdoptedAlgorithm* inf_adopted_algorithm_new(InfUserTable* user_table, InfBuffer* buffer); InfAdoptedAlgorithm* inf_adopted_algorithm_new_full(InfUserTable* user_table, InfBuffer* buffer, guint max_total_log_size); InfAdoptedStateVector* inf_adopted_algorithm_get_current(InfAdoptedAlgorithm* algorithm); InfAdoptedRequest* inf_adopted_algorithm_generate_request_noexec(InfAdoptedAlgorithm* algorithm, InfAdoptedUser* user, InfAdoptedOperation* operation); InfAdoptedRequest* inf_adopted_algorithm_generate_request(InfAdoptedAlgorithm* algorithm, InfAdoptedUser* user, InfAdoptedOperation* operation); InfAdoptedRequest* inf_adopted_algorithm_generate_undo(InfAdoptedAlgorithm* algorithm, InfAdoptedUser* user); InfAdoptedRequest* inf_adopted_algorithm_generate_redo(InfAdoptedAlgorithm* algorithm, InfAdoptedUser* user); InfAdoptedRequest* inf_adopted_algorithm_translate_request(InfAdoptedAlgorithm* algorithm, InfAdoptedRequest* request, InfAdoptedStateVector* to); void inf_adopted_algorithm_receive_request(InfAdoptedAlgorithm* algorithm, InfAdoptedRequest* request); gboolean inf_adopted_algorithm_can_undo(InfAdoptedAlgorithm* algorithm, InfAdoptedUser* user); gboolean inf_adopted_algorithm_can_redo(InfAdoptedAlgorithm* algorithm, InfAdoptedUser* user); G_END_DECLS #endif /* __INF_ADOPTED_ALGORITHM_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/adopted/inf-adopted-session-replay.c0000644000175000017500000007025612264763732022261 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include #include #include #include #include /** * SECTION:inf-adopted-session-replay * @title: InfAdoptedSessionReplay * @short_description: Replay a record of a session * @include: libinfinity/adopted/inf-adopted-session-replay.h * @see_also: #InfAdoptedSession, #InfAdoptedSessionRecord * @stability: Unstable * * #InfAdoptedSessionReplay can be used to replay a record created with * #InfAdoptedSessionRecord. * * Use inf_adopted_session_replay_set_record() to specify the recording to * replay, and then use inf_adopted_session_replay_get_session() to obtain * the replayed session. */ /* cf. * http://www.gnu.org/software/dotgnu/pnetlib-doc/System/Xml/XmlNodeType.html */ #define XML_READER_TYPE_NONE 0 #define XML_READER_TYPE_ELEMENT 1 #define XML_READER_TYPE_SIGNIFICANT_WHITESPACE 14 #define XML_READER_TYPE_END_ELEMENT 15 typedef struct _InfAdoptedSessionReplayPrivate InfAdoptedSessionReplayPrivate; struct _InfAdoptedSessionReplayPrivate { gchar* filename; xmlTextReaderPtr reader; GError* error; InfCommunicationManager* publisher_manager; InfCommunicationHostedGroup* publisher_group; InfSimulatedConnection* publisher_conn; InfCommunicationManager* client_manager; InfCommunicationJoinedGroup* client_group; InfSimulatedConnection* client_conn; InfAdoptedSession* session; }; enum { PROP_0, PROP_FILENAME, PROP_SESSION }; #define INF_ADOPTED_SESSION_REPLAY_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), INF_ADOPTED_TYPE_SESSION_REPLAY, InfAdoptedSessionReplayPrivate)) static GObjectClass* parent_class; static GQuark session_replay_error_quark; static xmlNodePtr inf_adopted_session_replay_read_current(xmlTextReaderPtr reader, GError** error) { xmlErrorPtr xml_error; xmlNodePtr cur; cur = xmlTextReaderExpand(reader); if(!cur) { xml_error = xmlGetLastError(); g_set_error( error, session_replay_error_quark, INF_ADOPTED_SESSION_REPLAY_ERROR_BAD_XML, "%s", xml_error->message ); return NULL; } return cur; } static gboolean inf_adopted_session_replay_handle_advance_result(int result, GError** error) { xmlErrorPtr xml_error; switch(result) { case -1: xml_error = xmlGetLastError(); g_set_error( error, session_replay_error_quark, INF_ADOPTED_SESSION_REPLAY_ERROR_BAD_XML, "%s", xml_error->message ); return FALSE; case 0: case 1: return TRUE; default: g_assert_not_reached(); return FALSE; } } static gboolean inf_adopted_session_replay_handle_advance_required_result(int result, GError** error) { xmlErrorPtr xml_error; switch(result) { case -1: xml_error = xmlGetLastError(); g_set_error( error, session_replay_error_quark, INF_ADOPTED_SESSION_REPLAY_ERROR_BAD_XML, "%s", xml_error->message ); return FALSE; case 0: g_set_error( error, session_replay_error_quark, INF_ADOPTED_SESSION_REPLAY_ERROR_UNEXPECTED_EOF, "%s", _("Unexpected end of recording") ); return FALSE; case 1: return TRUE; default: g_assert_not_reached(); return FALSE; } } static gboolean inf_adopted_session_replay_advance(xmlTextReaderPtr reader, GError** error) { int result; result = xmlTextReaderRead(reader); return inf_adopted_session_replay_handle_advance_result(result, error); } static gboolean inf_adopted_session_replay_advance_required(xmlTextReaderPtr reader, GError** error) { int result; result = xmlTextReaderRead(reader); return inf_adopted_session_replay_handle_advance_required_result( result, error ); } static gboolean inf_adopted_session_replay_advance_subtree_required(xmlTextReaderPtr reader, GError** error) { int result; result = xmlTextReaderNext(reader); return inf_adopted_session_replay_handle_advance_required_result( result, error ); } static gboolean inf_adopted_session_replay_skip_whitespace(xmlTextReaderPtr reader, GError** error) { while(xmlTextReaderNodeType(reader) == XML_READER_TYPE_SIGNIFICANT_WHITESPACE) { if(inf_adopted_session_replay_advance(reader, error) == FALSE) return FALSE; } return TRUE; } static gboolean inf_adopted_session_replay_skip_whitespace_required(xmlTextReaderPtr reader, GError** error) { while(xmlTextReaderNodeType(reader) == XML_READER_TYPE_SIGNIFICANT_WHITESPACE) { if(inf_adopted_session_replay_advance_required(reader, error) == FALSE) return FALSE; } return TRUE; } static void inf_adopted_session_replay_clear(InfAdoptedSessionReplay* replay) { InfAdoptedSessionReplayPrivate* priv; priv = INF_ADOPTED_SESSION_REPLAY_PRIVATE(replay); g_object_freeze_notify(G_OBJECT(replay)); if(priv->filename != NULL) { g_free(priv->filename); priv->filename = NULL; g_object_notify(G_OBJECT(replay), "filename"); } if(priv->reader != NULL) { if(xmlTextReaderClose(priv->reader) == -1) g_warning("Failed to close XML reader: %s", xmlGetLastError()->message); xmlFreeTextReader(priv->reader); priv->reader = NULL; } g_assert(priv->error == NULL); if(priv->publisher_group != NULL) { g_object_unref(priv->publisher_group); priv->publisher_group = NULL; } if(priv->publisher_conn != NULL) { g_object_unref(priv->publisher_conn); priv->publisher_conn = NULL; } if(priv->publisher_manager != NULL) { g_object_unref(priv->publisher_manager); priv->publisher_manager = NULL; } if(priv->client_group != NULL) { g_object_unref(priv->client_group); priv->client_group = NULL; } if(priv->client_conn != NULL) { g_object_unref(priv->client_conn); priv->client_conn = NULL; } if(priv->client_manager != NULL) { g_object_unref(priv->client_manager); priv->client_manager = NULL; } if(priv->session != NULL) { g_object_unref(priv->session); priv->session = NULL; g_object_notify(G_OBJECT(replay), "session"); } g_object_thaw_notify(G_OBJECT(replay)); } static void inf_adopted_session_replay_synchronization_failed_cb(InfSession* session, InfXmlConnection* conn, GError* error, gpointer user_data) { InfAdoptedSessionReplay* replay; InfAdoptedSessionReplayPrivate* priv; replay = INF_ADOPTED_SESSION_REPLAY(user_data); priv = INF_ADOPTED_SESSION_REPLAY_PRIVATE(replay); g_assert(priv->error == NULL); priv->error = g_error_copy(error); } static gboolean inf_adopted_session_replay_play_initial(InfAdoptedSessionReplay* replay, const InfcNotePlugin* plugin, GError** error) { InfAdoptedSessionReplayPrivate* priv; xmlTextReaderPtr reader; xmlNodePtr cur; const xmlChar* name; xmlChar* value; gulong handler; priv = INF_ADOPTED_SESSION_REPLAY_PRIVATE(replay); reader = priv->reader; /* Advance to root node */ if(xmlTextReaderNodeType(reader) != XML_READER_TYPE_ELEMENT) if(!inf_adopted_session_replay_advance_required(reader, error)) return FALSE; name = xmlTextReaderConstName(reader); if(strcmp((const char*)name, "infinote-adopted-session-record") != 0) { g_set_error( error, session_replay_error_quark, INF_ADOPTED_SESSION_REPLAY_ERROR_BAD_DOCUMENT, "%s", _("Document is not a session recording") ); return FALSE; } value = xmlTextReaderGetAttribute(reader, (const xmlChar*)"session-type"); if(value && strcmp((const char*)name, plugin->note_type) != 0) { xmlFree(value); g_set_error( error, session_replay_error_quark, INF_ADOPTED_SESSION_REPLAY_ERROR_BAD_SESSION_TYPE, "%s", _("Session type of the recording does not match") ); return FALSE; } if(value) xmlFree(value); if(!inf_adopted_session_replay_advance_required(reader, error)) return FALSE; if(!inf_adopted_session_replay_skip_whitespace_required(reader, error)) return FALSE; name = xmlTextReaderConstName(reader); if(strcmp((const char*)name, "initial") != 0) { g_set_error( error, session_replay_error_quark, INF_ADOPTED_SESSION_REPLAY_ERROR_BAD_FORMAT, "%s", _("Initial session state missing in recording") ); return FALSE; } if(!inf_adopted_session_replay_advance_required(reader, error)) return FALSE; if(!inf_adopted_session_replay_skip_whitespace_required(reader, error)) return FALSE; handler = g_signal_connect( priv->session, "synchronization-failed", G_CALLBACK(inf_adopted_session_replay_synchronization_failed_cb), replay ); while(xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT) { switch(inf_session_get_status(INF_SESSION(priv->session))) { case INF_SESSION_CLOSED: g_assert_not_reached(); g_signal_handler_disconnect(priv->session, handler); return FALSE; case INF_SESSION_SYNCHRONIZING: cur = inf_adopted_session_replay_read_current(reader, error); if(!cur) { g_signal_handler_disconnect(priv->session, handler); return FALSE; } inf_communication_group_send_message( INF_COMMUNICATION_GROUP(priv->publisher_group), INF_XML_CONNECTION(priv->publisher_conn), xmlCopyNode(cur, 1) ); /* TODO: Check whether this caused an error. Maybe there should be an * error signal for InfCommunicationGroup, delegating * inf_net_object_received's error. */ inf_simulated_connection_flush(priv->publisher_conn); /* error can be set if the synchronization failed */ if(priv->error != NULL) { g_signal_handler_disconnect(priv->session, handler); g_propagate_error(error, priv->error); priv->error = NULL; return FALSE; } if(!inf_adopted_session_replay_advance_subtree_required(reader, error)) { g_signal_handler_disconnect(priv->session, handler); return FALSE; } if(!inf_adopted_session_replay_skip_whitespace_required(reader, error)) { g_signal_handler_disconnect(priv->session, handler); return FALSE; } break; case INF_SESSION_RUNNING: g_signal_handler_disconnect(priv->session, handler); g_set_error( error, session_replay_error_quark, INF_ADOPTED_SESSION_REPLAY_ERROR_BAD_FORMAT, "%s", _("Session switched to running without having finished playing " "the initial") ); return FALSE; case INF_SESSION_PRESYNC: default: g_assert_not_reached(); break; } } g_signal_handler_disconnect(priv->session, handler); if(xmlTextReaderNodeType(reader) != XML_READER_TYPE_END_ELEMENT) { g_set_error( error, session_replay_error_quark, INF_ADOPTED_SESSION_REPLAY_ERROR_BAD_FORMAT, "%s", _("Superfluous XML in initial session section") ); return FALSE; } if(inf_session_get_status(INF_SESSION(priv->session)) == INF_SESSION_SYNCHRONIZING) { g_set_error( error, session_replay_error_quark, INF_ADOPTED_SESSION_REPLAY_ERROR_BAD_FORMAT, "%s", _("Session is still in synchronizing state after having " "played the initial") ); return FALSE; } /* Jump over end element */ if(!inf_adopted_session_replay_advance_required(reader, error)) return FALSE; /* Not "_required"; recording might end right after initial */ if(!inf_adopted_session_replay_skip_whitespace(reader, error)) return FALSE; return TRUE; } /* * GObject overrides. */ static void inf_adopted_session_replay_init(GTypeInstance* instance, gpointer g_class) { InfAdoptedSessionReplay* record; InfAdoptedSessionReplayPrivate* priv; record = INF_ADOPTED_SESSION_REPLAY(instance); priv = INF_ADOPTED_SESSION_REPLAY_PRIVATE(record); priv->filename = NULL; priv->reader = NULL; priv->error = NULL; priv->publisher_manager = NULL; priv->publisher_group = NULL; priv->publisher_conn = NULL; priv->client_manager = NULL; priv->client_group = NULL; priv->client_conn = NULL; priv->session = NULL; } static void inf_adopted_session_replay_dispose(GObject* object) { InfAdoptedSessionReplay* replay; InfAdoptedSessionReplayPrivate* priv; replay = INF_ADOPTED_SESSION_REPLAY(object); priv = INF_ADOPTED_SESSION_REPLAY_PRIVATE(replay); inf_adopted_session_replay_clear(replay); G_OBJECT_CLASS(parent_class)->dispose(object); } static void inf_adopted_session_replay_finalize(GObject* object) { InfAdoptedSessionReplay* replay; InfAdoptedSessionReplayPrivate* priv; replay = INF_ADOPTED_SESSION_REPLAY(object); priv = INF_ADOPTED_SESSION_REPLAY_PRIVATE(replay); g_assert(priv->filename == NULL); G_OBJECT_CLASS(parent_class)->finalize(object); } static void inf_adopted_session_replay_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec) { InfAdoptedSessionReplay* replay; InfAdoptedSessionReplayPrivate* priv; replay = INF_ADOPTED_SESSION_REPLAY(object); priv = INF_ADOPTED_SESSION_REPLAY_PRIVATE(replay); switch(prop_id) { case PROP_FILENAME: case PROP_SESSION: /* read only */ default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void inf_adopted_session_replay_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec) { InfAdoptedSessionReplay* replay; InfAdoptedSessionReplayPrivate* priv; replay = INF_ADOPTED_SESSION_REPLAY(object); priv = INF_ADOPTED_SESSION_REPLAY_PRIVATE(replay); switch(prop_id) { case PROP_FILENAME: g_value_set_string(value, priv->filename); break; case PROP_SESSION: g_value_set_object(value, G_OBJECT(priv->session)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } /* * Gype registration. */ static void inf_adopted_session_replay_class_init(gpointer g_class, gpointer class_data) { GObjectClass* object_class; object_class = G_OBJECT_CLASS(g_class); parent_class = G_OBJECT_CLASS(g_type_class_peek_parent(g_class)); g_type_class_add_private(g_class, sizeof(InfAdoptedSessionReplayPrivate)); object_class->dispose = inf_adopted_session_replay_dispose; object_class->finalize = inf_adopted_session_replay_finalize; object_class->set_property = inf_adopted_session_replay_set_property; object_class->get_property = inf_adopted_session_replay_get_property; session_replay_error_quark = g_quark_from_static_string("INF_ADOPTED_SESSION_REPLAY_ERROR"); g_object_class_install_property( object_class, PROP_FILENAME, g_param_spec_string( "filename", "Filename", "The filename of the record to play", NULL, G_PARAM_READABLE ) ); g_object_class_install_property( object_class, PROP_SESSION, g_param_spec_object( "session", "Session", "The replayed session", INF_ADOPTED_TYPE_SESSION, G_PARAM_READABLE ) ); } GType inf_adopted_session_replay_get_type(void) { static GType session_replay_type = 0; if(!session_replay_type) { static const GTypeInfo session_replay_type_info = { sizeof(InfAdoptedSessionReplayClass), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ inf_adopted_session_replay_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InfAdoptedSessionReplay), /* instance_size */ 0, /* n_preallocs */ inf_adopted_session_replay_init, /* instance_init */ NULL /* value_table */ }; session_replay_type = g_type_register_static( G_TYPE_OBJECT, "InfAdoptedSessionReplay", &session_replay_type_info, 0 ); } return session_replay_type; } /* * Public API. */ /** * inf_adopted_session_replay_new: * * Creates a new #InfAdoptedSessionReplay. Use * inf_adopted_session_replay_set_record() to start the recording, and * inf_adopted_session_replay_play_next() or * inf_adopted_session_replay_play_to_end() to play it. * * Return Value: A new #InfAdoptedSessionReplay. Free with g_object_unref() * when no longer in use. **/ InfAdoptedSessionReplay* inf_adopted_session_replay_new(void) { GObject* object; object = g_object_new(INF_ADOPTED_TYPE_SESSION_REPLAY, NULL); return INF_ADOPTED_SESSION_REPLAY(object); } /** * inf_adopted_session_replay_set_record: * @replay: A #InfAdoptedSessionReplay. * @filename: Path to the record file to play. * @plugin: A #InfcNotePlugin for the note type of the recorded session. * @error: Location to store error information, if any. * * Set the record file for @replay to play. It should have been created with * #InfAdoptedSessionRecord. @plugin should match the type of the recorded * session. If an error occurs, the function returns %FALSE and @error is set. * * Returns: %TRUE on success, or %FALSE if the record file could not be set. */ gboolean inf_adopted_session_replay_set_record(InfAdoptedSessionReplay* replay, const gchar* filename, const InfcNotePlugin* plugin, GError** error) { InfAdoptedSessionReplayPrivate* priv; xmlTextReaderPtr reader; InfIo* io; gboolean result; xmlErrorPtr xml_error; g_return_val_if_fail(INF_ADOPTED_IS_SESSION_REPLAY(replay), FALSE); g_return_val_if_fail(filename != NULL, FALSE); g_return_val_if_fail(plugin != NULL, FALSE); g_return_val_if_fail(error == NULL || *error == NULL, FALSE); priv = INF_ADOPTED_SESSION_REPLAY_PRIVATE(replay); reader = xmlReaderForFile( filename, NULL, XML_PARSE_NOERROR | XML_PARSE_NOWARNING ); if(!reader) { xml_error = xmlGetLastError(); g_set_error( error, session_replay_error_quark, INF_ADOPTED_SESSION_REPLAY_ERROR_BAD_FILE, "%s", xml_error->message ); return FALSE; } /* TODO: Keep current staet if playing the initial fails */ g_object_freeze_notify(G_OBJECT(replay)); inf_adopted_session_replay_clear(replay); priv->filename = g_strdup(filename); priv->reader = reader; priv->publisher_conn = inf_simulated_connection_new(); priv->client_conn = inf_simulated_connection_new(); inf_simulated_connection_connect(priv->publisher_conn, priv->client_conn); inf_simulated_connection_set_mode( priv->publisher_conn, INF_SIMULATED_CONNECTION_DELAYED ); inf_simulated_connection_set_mode( priv->client_conn, INF_SIMULATED_CONNECTION_DELAYED ); priv->publisher_manager = inf_communication_manager_new(); priv->publisher_group = inf_communication_manager_open_group( priv->publisher_manager, "InfAdoptedSessionReplay", NULL ); inf_communication_hosted_group_add_member( priv->publisher_group, INF_XML_CONNECTION(priv->publisher_conn) ); priv->client_manager = inf_communication_manager_new(); priv->client_group = inf_communication_manager_join_group( priv->client_manager, "InfAdoptedSessionReplay", INF_XML_CONNECTION(priv->client_conn), "central" ); /* This is not used anyway, but it needs to be present: */ io = INF_IO(inf_standalone_io_new()); priv->session = INF_ADOPTED_SESSION( plugin->session_new( io, priv->client_manager, INF_SESSION_SYNCHRONIZING, priv->client_group, INF_XML_CONNECTION(priv->client_conn), plugin->user_data ) ); g_object_unref(io); inf_communication_group_set_target( INF_COMMUNICATION_GROUP(priv->client_group), INF_COMMUNICATION_OBJECT(priv->session) ); inf_simulated_connection_flush(priv->publisher_conn); inf_simulated_connection_flush(priv->client_conn); if(!inf_adopted_session_replay_play_initial(replay, plugin, error)) { inf_adopted_session_replay_clear(replay); result = FALSE; } else { g_object_notify(G_OBJECT(replay), "filename"); g_object_notify(G_OBJECT(replay), "session"); result = TRUE; } g_object_thaw_notify(G_OBJECT(replay)); return result; } /** * inf_adopted_session_replay_get_session: * @replay: A #InfAdoptedSessionReplay. * * Returns the played back session, or %NULL if * inf_adopted_session_replay_set_record() was not yet called. * * Returns: A #InfAdoptedSessionReplay, or %NULL. */ InfAdoptedSession* inf_adopted_session_replay_get_session(InfAdoptedSessionReplay* replay) { g_return_val_if_fail(INF_ADOPTED_IS_SESSION_REPLAY(replay), NULL); return INF_ADOPTED_SESSION_REPLAY_PRIVATE(replay)->session; } /** * inf_adopted_session_replay_play_next: * @replay: A #InfAdoptedSessionReplay. * @error: Location to store error information, if any. * * Reads the next request from the record and passes it to the session. Note * that this might do nothing if that request is not yet causally ready, * meaning that it depends on another request that has not yet been played. In * that case it will be executed as soon as it is ready, that is after some * future inf_adopted_session_replay_play_next() call. Therefore, it is also * possible that this function executes more than one request. * * If an error occurs, then this function returns %FALSE and @error is set. * If the end of the recording is reached, then it also returns %FALSE, but * @error is left untouched. If the next request has been read, then it * returns %TRUE. * * Returns: %TRUE if a request was read, otherwise %FALSE. */ gboolean inf_adopted_session_replay_play_next(InfAdoptedSessionReplay* replay, GError** error) { InfAdoptedSessionReplayPrivate* priv; xmlTextReaderPtr reader; int type; xmlNodePtr cur; guint id; InfUser* user; InfSessionClass* session_class; GArray* user_props; GParameter* param; guint i; g_return_val_if_fail(INF_ADOPTED_IS_SESSION_REPLAY(replay), FALSE); g_return_val_if_fail(error == NULL || *error == NULL, FALSE); priv = INF_ADOPTED_SESSION_REPLAY_PRIVATE(replay); reader = priv->reader; type = xmlTextReaderNodeType(reader); /* EOF, maybe the writer crashed and could not finish the record properly */ if(type == XML_READER_TYPE_NONE) return FALSE; /* */ if(type == XML_READER_TYPE_END_ELEMENT) return FALSE; if(type != XML_READER_TYPE_ELEMENT) { g_set_error( error, session_replay_error_quark, INF_ADOPTED_SESSION_REPLAY_ERROR_BAD_FORMAT, "%s", _("Superfluous XML in requests section") ); return FALSE; } cur = inf_adopted_session_replay_read_current(reader, error); if(cur == NULL) return FALSE; if(strcmp((const char*)cur->name, "request") == 0) { /* TODO: Add user join/leaves to record. * Until that is done, make users available when they issue a request. */ if(!inf_xml_util_get_attribute_uint_required(cur, "user", &id, error)) return FALSE; user = inf_user_table_lookup_user_by_id( inf_session_get_user_table(INF_SESSION(priv->session)), id ); if(!user) { g_set_error( error, session_replay_error_quark, INF_ADOPTED_SESSION_REPLAY_ERROR_BAD_FORMAT, _("No such user with ID \"%u\""), id ); return FALSE; } if(inf_user_get_status(user) == INF_USER_UNAVAILABLE) { g_object_set( G_OBJECT(user), "status", INF_USER_ACTIVE, "connection", priv->client_conn, NULL ); } inf_communication_group_send_group_message( INF_COMMUNICATION_GROUP(priv->publisher_group), xmlCopyNode(cur, 1) ); /* TODO: Check whether this caused an error. Maybe there should be an * error signal for InfCommunicationGroup, delegating * inf_net_object_received's error. */ inf_simulated_connection_flush(priv->publisher_conn); } else if(strcmp((const char*)cur->name, "user") == 0) { /* User join */ session_class = INF_SESSION_GET_CLASS(priv->session); user_props = session_class->get_xml_user_props( INF_SESSION(priv->session), INF_XML_CONNECTION(priv->publisher_conn), cur ); param = inf_session_get_user_property(user_props, "connection"); if(!G_IS_VALUE(¶m->value)) { g_value_init(¶m->value, INF_TYPE_XML_CONNECTION); g_value_set_object(¶m->value, G_OBJECT(priv->client_conn)); } user = inf_session_add_user( INF_SESSION(priv->session), (const GParameter*)user_props->data, user_props->len, error ); for(i = 0; i < user_props->len; ++i) g_value_unset(&g_array_index(user_props, GParameter, i).value); g_array_free(user_props, TRUE); if(user == NULL) return FALSE; } else { g_set_error( error, session_replay_error_quark, INF_ADOPTED_SESSION_REPLAY_ERROR_BAD_FORMAT, _("Unexpected node \"%s\" in requests section"), id ); return FALSE; } if(!inf_adopted_session_replay_advance_subtree_required(reader, error)) return FALSE; if(!inf_adopted_session_replay_skip_whitespace(reader, error)) return FALSE; return TRUE; } /** * inf_adopted_session_replay_play_to_end: * @replay: A #InfAdoptedSessionReplay. * @error: Location to store error information, if any. * * Plays all requests that are contained in the recording, so that the * replay's session has the same state as the recorded session when the * recording was stopped. * * Note that, depending on the size of the record, this function may take * some time to finish. * * If an error occurs during replay, then the function returns %FALSE and * @error is set. Otherwise it returns %TRUE. * * Returns: %TRUE on success, or %FALSE if an error occurs. */ gboolean inf_adopted_session_replay_play_to_end(InfAdoptedSessionReplay* replay, GError** error) { GError* local_error; gboolean result; g_return_val_if_fail(INF_ADOPTED_IS_SESSION_REPLAY(replay), FALSE); g_return_val_if_fail(error == NULL || *error == NULL, FALSE); local_error = NULL; do { result = inf_adopted_session_replay_play_next(replay, &local_error); } while(result); if(local_error != NULL) { g_propagate_error(error, local_error); return FALSE; } return TRUE; } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/adopted/inf-adopted-no-operation.h0000644000175000017500000000470412264763732021716 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_ADOPTED_NO_OPERATION_H__ #define __INF_ADOPTED_NO_OPERATION_H__ #include G_BEGIN_DECLS #define INF_ADOPTED_TYPE_NO_OPERATION (inf_adopted_no_operation_get_type()) #define INF_ADOPTED_NO_OPERATION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INF_ADOPTED_TYPE_NO_OPERATION, InfAdoptedNoOperation)) #define INF_ADOPTED_NO_OPERATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INF_ADOPTED_TYPE_NO_OPERATION, InfAdoptedNoOperationClass)) #define INF_ADOPTED_IS_NO_OPERATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INF_ADOPTED_TYPE_NO_OPERATION)) #define INF_ADOPTED_IS_NO_OPERATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INF_ADOPTED_TYPE_NO_OPERATION)) #define INF_ADOPTED_NO_OPERATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), INF_ADOPTED_TYPE_NO_OPERATION, InfAdoptedNoOperationClass)) typedef struct _InfAdoptedNoOperation InfAdoptedNoOperation; typedef struct _InfAdoptedNoOperationClass InfAdoptedNoOperationClass; /** * InfAdoptedNoOperationClass: * * This structure does not contain any public fields. */ struct _InfAdoptedNoOperationClass { /*< private >*/ GObjectClass parent_class; }; /** * InfAdoptedNoOperation: * * #InfAdoptedNoOperation is an opaque data type. You should only access it * via the public API functions. */ struct _InfAdoptedNoOperation { /*< private >*/ GObject parent; }; GType inf_adopted_no_operation_get_type(void) G_GNUC_CONST; InfAdoptedNoOperation* inf_adopted_no_operation_new(void); G_END_DECLS #endif /* __INF_ADOPTED_NO_OPERATION_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/adopted/inf-adopted-algorithm.c0000644000175000017500000022406412264763732021270 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include /** * SECTION:inf-adopted-algorithm * @title: InfAdoptedAlgorithm * @short_description: adOPTed implementation * @include: libinfinity/adopted/inf-adopted-algorithm.h * @stability: Unstable * @see_also: #InfAdoptedSession * * #InfAdoptedAlgorithm implements the adOPTed algorithm for concurrency * control as described in the paper "An integrating, transformation-oriented * approach to concurrency control and undo in group editors" by Matthias * Ressel, Doris Nitsche-Ruhland and Rul Gunzenhäuser * (http://portal.acm.org/citation.cfm?id=240305). * * It is based on requests, represented by the #InfAdoptedRequest class. If * there is at least one local #InfUser in the algorithm's user table, then * you can create own reequests by the functions * inf_adopted_algorithm_generate_request(), * inf_adopted_algorithm_generate_request_noexec(), * inf_adopted_algorithm_generate_undo() and * inf_adopted_algorithm_generate_redo(). Remote requests can be applied via * inf_adopted_algorithm_receive_request(). This class does not take care of * transfering the generated requests to other users which is the scope of * #InfAdoptedSession. * * The implementation is not tied to text editing. It can handle any * operations implementing #InfAdoptedOperation as long as they define * sufficient transformation functions. The libinftext library provides * operations for text editing, see #InfTextInsertOperation and * #InfTextDeleteOperation. **/ /* This class implements the adOPTed algorithm as described in the paper * "An integrating, transformation-oriented approach to concurrency control * and undo in group editors" by Matthias Ressel, Doris Nitsche-Ruhland * and Rul Gunzenhäuser (http://portal.acm.org/citation.cfm?id=240305). Don't * even try to understand (the interesting part) of this code without having * read it. * * "Reducing the Problems of Group Undo" by Matthias Ressel and Rul * Gunzenhäuser (http://portal.acm.org/citation.cfm?doid=320297.320312) * might also be worth a read to (better) understand how local group undo * is achieved. */ /* TODO: Do only cleanup if too much entries in cache? */ /* TODO: If users are not issuing any requests for some time, and we can be * sure that we do not need to transform any requests, then remove them from * the users array (users_begin, users_end). Readd users as soon as they * issue buffer-altering requests. */ typedef struct _InfAdoptedAlgorithmLocalUser InfAdoptedAlgorithmLocalUser; struct _InfAdoptedAlgorithmLocalUser { InfAdoptedUser* user; gboolean can_undo; gboolean can_redo; }; typedef struct _InfAdoptedAlgorithmCacheCleanupData InfAdoptedAlgorithmCacheCleanupData; struct _InfAdoptedAlgorithmCacheCleanupData { InfAdoptedAlgorithm* algorithm; InfAdoptedStateVector* lcp; GSList* rem_keys; }; typedef struct _InfAdoptedAlgorithmRequestKey InfAdoptedAlgorithmRequestKey; struct _InfAdoptedAlgorithmRequestKey { /* Not a copy, directly points to vector of the keyed request */ InfAdoptedStateVector* vector; guint user_id; }; typedef struct _InfAdoptedAlgorithmPrivate InfAdoptedAlgorithmPrivate; struct _InfAdoptedAlgorithmPrivate { /* request log policy */ guint max_total_log_size; InfAdoptedStateVector* current; InfAdoptedStateVector* buffer_modified_time; InfUserTable* user_table; InfBuffer* buffer; /* doubly-linked so we can easily remove an element from the middle */ GList* queue; /* Users in user table. We need to iterate over them very often, so we * keep them as array here. */ InfAdoptedUser** users_begin; InfAdoptedUser** users_end; /* Request cache */ /* TODO: Consider using a hash table here... given a good hash function it * could perhaps speedup lookup. */ GTree* cache; GSList* local_users; }; enum { PROP_0, /* construct only */ PROP_USER_TABLE, PROP_BUFFER, PROP_MAX_TOTAL_LOG_SIZE, /* read/only */ PROP_CURRENT_STATE, PROP_BUFFER_MODIFIED_STATE }; enum { CAN_UNDO_CHANGED, CAN_REDO_CHANGED, EXECUTE_REQUEST, APPLY_REQUEST, LAST_SIGNAL }; #define INF_ADOPTED_ALGORITHM_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), INF_ADOPTED_TYPE_ALGORITHM, InfAdoptedAlgorithmPrivate)) #define INF_ADOPTED_ALGORITHM_PRIVATE(obj) ((InfAdoptedAlgorithmPrivate*)(obj)->priv) static GObjectClass* parent_class; static guint algorithm_signals[LAST_SIGNAL]; static int inf_adopted_algorithm_request_key_cmp(gconstpointer a, gconstpointer b, gpointer user_data) { const InfAdoptedAlgorithmRequestKey* key_a; const InfAdoptedAlgorithmRequestKey* key_b; key_a = (const InfAdoptedAlgorithmRequestKey*)a; key_b = (const InfAdoptedAlgorithmRequestKey*)b; if(key_a->user_id < key_b->user_id) return -1; if(key_a->user_id > key_b->user_id) return 1; return inf_adopted_state_vector_compare(key_a->vector, key_b->vector); } static void inf_adopted_algorithm_request_key_free(gpointer key) { g_slice_free(InfAdoptedAlgorithmRequestKey, key); } /* Returns a new state vector v so that both first and second are causally * before v and so that there is no other state vector with the same property * that is causally before v. */ /* TODO: Move this to state vector, possibly with a faster O(n) * implementation (This is O(n log n), at best) */ static InfAdoptedStateVector* inf_adopted_algorithm_least_common_successor(InfAdoptedAlgorithm* algorithm, InfAdoptedStateVector* first, InfAdoptedStateVector* second) { InfAdoptedAlgorithmPrivate* priv; InfAdoptedUser** user; InfAdoptedStateVector* result; guint id; priv = INF_ADOPTED_ALGORITHM_PRIVATE(algorithm); result = inf_adopted_state_vector_new(); for(user = priv->users_begin; user != priv->users_end; ++ user) { id = inf_user_get_id(INF_USER(*user)); inf_adopted_state_vector_set( result, id, MAX( inf_adopted_state_vector_get(first, id), inf_adopted_state_vector_get(second, id) ) ); } g_assert(inf_adopted_state_vector_causally_before(first, result)); g_assert(inf_adopted_state_vector_causally_before(second, result)); return result; } /* Returns a new state vector v so that v is both causally before first and * second and so that there is no other state vector with the same property * so that v is causally before that vector. */ /* TODO: Move this to state vector, possibly with a faster O(n) * implementation (This is O(n log n), at best) */ /* TODO: A version modifying first instead of returning a new result, * use in inf_adopted_algorithm_cleanup(). */ static InfAdoptedStateVector* inf_adopted_algorithm_least_common_predecessor(InfAdoptedAlgorithm* algorithm, InfAdoptedStateVector* first, InfAdoptedStateVector* second) { InfAdoptedAlgorithmPrivate* priv; InfAdoptedUser** user; InfAdoptedStateVector* result; guint id; priv = INF_ADOPTED_ALGORITHM_PRIVATE(algorithm); result = inf_adopted_state_vector_new(); for(user = priv->users_begin; user != priv->users_end; ++ user) { id = inf_user_get_id(INF_USER(*user)); inf_adopted_state_vector_set( result, id, MIN( inf_adopted_state_vector_get(first, id), inf_adopted_state_vector_get(second, id) ) ); } return result; } /* Checks whether the given request can be undone (or redone if it is an * undo request). In general, a user can perform an undo when * there is a request to undo in the request log. However, if there are too * much requests between it and the latest request (as determined by * max_total_log_size) we cannot issue an undo because others might already * have dropped that request from their request log (and therefore no longer * compute the Undo operation). */ static gboolean inf_adopted_algorithm_can_undo_redo(InfAdoptedAlgorithm* algorithm, InfAdoptedUser* user, InfAdoptedRequest* request) { InfAdoptedAlgorithmPrivate* priv; InfAdoptedRequestLog* log; guint diff; priv = INF_ADOPTED_ALGORITHM_PRIVATE(algorithm); if(request != NULL) { if(priv->max_total_log_size != G_MAXUINT) { log = inf_adopted_user_get_request_log(user); request = inf_adopted_request_log_original_request(log, request); /* TODO: If other requests need to be undone or redone before request * can be undone or redone, then we need to include these in the * vdiff. */ diff = inf_adopted_state_vector_vdiff( inf_adopted_request_get_vector(request), inf_adopted_user_get_vector(user) ); if(diff >= priv->max_total_log_size) return FALSE; else return TRUE; } else { /* unlimited */ return TRUE; } } else { /* no request to undo */ return FALSE; } } static gboolean inf_adopted_algorithm_cleanup_cache_traverse_func(gpointer key, gpointer value, gpointer data) { InfAdoptedAlgorithmRequestKey* request_key; InfAdoptedAlgorithmCacheCleanupData* cleanup_data; InfAdoptedAlgorithmPrivate* priv; guint vdiff; request_key = (InfAdoptedAlgorithmRequestKey*)key; cleanup_data = (InfAdoptedAlgorithmCacheCleanupData*)data; priv = INF_ADOPTED_ALGORITHM_PRIVATE(cleanup_data->algorithm); g_assert(priv->max_total_log_size != G_MAXUINT); /* TODO: Save vdiff-to-zero of lcp in cache data and vdiff-to-zero in * request key. We could then get the final vdiff by just subtracting them, * saving an exepensive inf_adopted_state_vector_vdiff() call. */ if(inf_adopted_state_vector_causally_before(request_key->vector, cleanup_data->lcp)) { vdiff = inf_adopted_state_vector_vdiff( request_key->vector, cleanup_data->lcp ); if(vdiff > priv->max_total_log_size) { /* Old enough to remove */ cleanup_data->rem_keys = g_slist_prepend(cleanup_data->rem_keys, request_key); } } /* TODO: Return TRUE if this takes too long (>10 msecs or so)? */ return FALSE; } /* TODO: This is "only" some kind of garbage collection that does not need * to be done after _every_ request received. */ static void inf_adopted_algorithm_cleanup(InfAdoptedAlgorithm* algorithm) { InfAdoptedAlgorithmPrivate* priv; InfAdoptedStateVector* temp; InfAdoptedUser** user; InfAdoptedRequestLog* log; InfAdoptedRequest* req; InfAdoptedStateVector* req_vec; InfAdoptedStateVector* low_vec; gboolean req_before_lcp; guint n; guint id; guint vdiff; InfAdoptedAlgorithmCacheCleanupData cleanup_data; GSList* item; priv = INF_ADOPTED_ALGORITHM_PRIVATE(algorithm); g_assert(priv->users_begin != priv->users_end); /* We don't do cleanup in case the total log size is G_MAXUINT, which * means we keep all requests without limit. */ if(priv->max_total_log_size == G_MAXUINT) return; /* We remove every request whose "lower related" request has a greater * vdiff to the lcp then max-total-log-size from both request log and * the request cache. The lcp is a common state that _all_ sites are * guaranteed to have reached. Related requests not causally before lcp are * always kept, though. This should not happen if max-total-log-size is * reasonably high and the network latency reasonably low, but we can't * guarentee it does not happen. It just means we can't drop a request that * another site has not yet processed, although it is old enough.*/ /* The "upper related" request of a request A is the next-newer request so * that all requests before the "upper related" request can be removed * without any remaining request in the log still refering to a removed * one. See also inf_adopted_request_log_upper_related(). */ /* Note that we could be more intelligent here. It would be enough if the * oldest request of a set of related requests is old enough to be removed. * But we would need to make sure that the requests between the oldest and * the upper related are not required anymore. I am not sure whether there * are additional conditions. However, in the current case, some requests * are just kept a bit longer than necessary, in favor of simplicity. */ cleanup_data.lcp = inf_adopted_state_vector_copy(priv->current); for(user = priv->users_begin; user != priv->users_end; ++ user) { if(inf_user_get_status(INF_USER(*user)) != INF_USER_UNAVAILABLE) { temp = inf_adopted_algorithm_least_common_predecessor( algorithm, cleanup_data.lcp, inf_adopted_user_get_vector(*user) ); inf_adopted_state_vector_free(cleanup_data.lcp); cleanup_data.lcp = temp; } } for(user = priv->users_begin; user != priv->users_end; ++ user) { id = inf_user_get_id(INF_USER(*user)); log = inf_adopted_user_get_request_log(*user); n = inf_adopted_request_log_get_begin(log); /* Remove all sets of related requests whose upper related request has * a large enough vdiff to lcp. */ while(n < inf_adopted_request_log_get_end(log)) { req = inf_adopted_request_log_upper_related(log, n); req_vec = inf_adopted_request_get_vector(req); /* We can only remove requests that are causally before lcp, * as explained above. We need to compare the target vector time of the * request, though, and not the source which is why we increase the * request's user's component by one. This is because of the fact that * the request needs to be available to reach its target vector time. */ req_before_lcp = inf_adopted_state_vector_causally_before_inc( req_vec, cleanup_data.lcp, id ); if(!req_before_lcp) break; /* TODO: Experimentally, I try using the lower related for the vdiff * here. If it doesn't work out, then we will need to use the upper * related. Note that changing this requires changing the cleanup * tests, too. */ low_vec = inf_adopted_request_get_vector( inf_adopted_request_log_get_request(log, n) ); vdiff = inf_adopted_state_vector_vdiff(low_vec, cleanup_data.lcp); /* TODO: Again, I experimentally changed <= to < here. If the vdiff is * equal to the log size, then nobody can do anything with the request * set anymore: Everybody already processed every request in the set * (otherwise, the causally_before_ check above would have failed), and * the user in question cannot Undo anymore since this would require one * too much request in the request log. Note again that changing this * requires changing the cleanup tests, too. */ if(vdiff < priv->max_total_log_size) break; /* Check next set of related requests */ n = inf_adopted_state_vector_get(req_vec, id) + 1; } inf_adopted_request_log_remove_requests(log, n); } cleanup_data.algorithm = algorithm; cleanup_data.rem_keys = NULL; /* Remove requests from cache. That's O(n log n) here in the worst case, * which is quite bad regarding that the cache can contain hundreds of * thousands of requests, or even more given a large enough * max total log size. However, that's a problem with the GTree API. * TODO: We could try out GHashTable instead which has * g_hash_table_foreach_remove() allowing this to be implemented in O(n). * We should still do good profiling, though. */ /* TODO: We can also do this in an idle handler, and only process a couple * requests at a time. */ g_tree_foreach( priv->cache, inf_adopted_algorithm_cleanup_cache_traverse_func, &cleanup_data ); for(item = cleanup_data.rem_keys; item != NULL; item = g_slist_next(item)) g_tree_remove(priv->cache, item->data); g_slist_free(cleanup_data.rem_keys); inf_adopted_state_vector_free(cleanup_data.lcp); } /* Updates the can_undo and can_redo fields of the * InfAdoptedAlgorithmLocalUsers. */ static void inf_adopted_algorithm_update_undo_redo(InfAdoptedAlgorithm* algorithm) { InfAdoptedAlgorithmPrivate* priv; InfAdoptedAlgorithmLocalUser* local; InfAdoptedRequestLog* log; GSList* item; gboolean can_undo; gboolean can_redo; priv = INF_ADOPTED_ALGORITHM_PRIVATE(algorithm); for(item = priv->local_users; item != NULL; item = g_slist_next(item)) { local = item->data; log = inf_adopted_user_get_request_log(local->user); can_undo = inf_adopted_algorithm_can_undo_redo( algorithm, local->user, inf_adopted_request_log_next_undo(log) ); can_redo = inf_adopted_algorithm_can_undo_redo( algorithm, local->user, inf_adopted_request_log_next_redo(log) ); if(local->can_undo != can_undo) { g_signal_emit( G_OBJECT(algorithm), algorithm_signals[CAN_UNDO_CHANGED], 0, local->user, can_undo ); } if(local->can_redo != can_redo) { g_signal_emit( G_OBJECT(algorithm), algorithm_signals[CAN_REDO_CHANGED], 0, local->user, can_redo ); } } } static InfAdoptedAlgorithmLocalUser* inf_adopted_algorithm_find_local_user(InfAdoptedAlgorithm* algorithm, InfAdoptedUser* user) { InfAdoptedAlgorithmPrivate* priv; GSList* item; InfAdoptedAlgorithmLocalUser* local; priv = INF_ADOPTED_ALGORITHM_PRIVATE(algorithm); for(item = priv->local_users; item != NULL; item = g_slist_next(item)) { local = (InfAdoptedAlgorithmLocalUser*)item->data; if(local->user == user) return local; } return NULL; } static void inf_adopted_algorithm_local_user_free(InfAdoptedAlgorithm* algorithm, InfAdoptedAlgorithmLocalUser* local) { InfAdoptedAlgorithmPrivate* priv; priv = INF_ADOPTED_ALGORITHM_PRIVATE(algorithm); priv->local_users = g_slist_remove(priv->local_users, local); g_slice_free(InfAdoptedAlgorithmLocalUser, local); } static void inf_adopted_algorithm_add_user(InfAdoptedAlgorithm* algorithm, InfAdoptedUser* user) { InfAdoptedAlgorithmPrivate* priv; InfAdoptedRequestLog* log; InfAdoptedStateVector* time; guint user_count; priv = INF_ADOPTED_ALGORITHM_PRIVATE(algorithm); log = inf_adopted_user_get_request_log(user); time = inf_adopted_user_get_vector(user); inf_adopted_state_vector_set( priv->current, inf_user_get_id(INF_USER(user)), inf_adopted_state_vector_get(time, inf_user_get_id(INF_USER(user))) ); user_count = (priv->users_end - priv->users_begin) + 1; priv->users_begin = g_realloc(priv->users_begin, sizeof(InfAdoptedUser*) * user_count); priv->users_end = priv->users_begin + user_count; priv->users_begin[user_count - 1] = user; } static void inf_adopted_algorithm_add_local_user(InfAdoptedAlgorithm* algorithm, InfAdoptedUser* user) { InfAdoptedAlgorithmPrivate* priv; InfAdoptedAlgorithmLocalUser* local; InfAdoptedRequestLog* log; priv = INF_ADOPTED_ALGORITHM_PRIVATE(algorithm); local = g_slice_new(InfAdoptedAlgorithmLocalUser); local->user = user; log = inf_adopted_user_get_request_log(user); local->can_undo = inf_adopted_algorithm_can_undo_redo( algorithm, user, inf_adopted_request_log_next_undo(log) ); local->can_redo = inf_adopted_algorithm_can_undo_redo( algorithm, user, inf_adopted_request_log_next_redo(log) ); priv->local_users = g_slist_prepend(priv->local_users, local); } static void inf_adopted_algorithm_add_user_cb(InfUserTable* user_table, InfUser* user, gpointer user_data) { InfAdoptedAlgorithm* algorithm; algorithm = INF_ADOPTED_ALGORITHM(user_data); g_assert(INF_ADOPTED_IS_USER(user)); inf_adopted_algorithm_add_user(algorithm, INF_ADOPTED_USER(user)); } static void inf_adopted_algorithm_add_local_user_cb(InfUserTable* user_table, InfUser* user, gpointer user_data) { InfAdoptedAlgorithm* algorithm; algorithm = INF_ADOPTED_ALGORITHM(user_data); g_assert(INF_ADOPTED_IS_USER(user)); inf_adopted_algorithm_add_local_user(algorithm, INF_ADOPTED_USER(user)); } static void inf_adopted_algorithm_remove_local_user_cb(InfUserTable* user_table, InfUser* user, gpointer user_data) { InfAdoptedAlgorithm* algorithm; InfAdoptedAlgorithmPrivate* priv; InfAdoptedAlgorithmLocalUser* local; algorithm = INF_ADOPTED_ALGORITHM(user_data); priv = INF_ADOPTED_ALGORITHM_PRIVATE(algorithm); local = inf_adopted_algorithm_find_local_user(algorithm, INF_ADOPTED_USER(user)); g_assert(local != NULL); inf_adopted_algorithm_local_user_free(algorithm, local); } /* Checks whether two states are equivalent, meaning one can be reached from * the other just by folding. */ static gboolean inf_adopted_algorithm_buffer_states_equivalent(InfAdoptedAlgorithm* algorithm, InfAdoptedStateVector* first, InfAdoptedStateVector* second) { InfAdoptedAlgorithmPrivate* priv; InfAdoptedUser** user_it; InfAdoptedUser* user; InfAdoptedRequest* request; InfAdoptedRequestLog* log; guint user_id; guint first_n; guint second_n; g_assert(inf_adopted_state_vector_causally_before(first, second)); priv = INF_ADOPTED_ALGORITHM_PRIVATE(algorithm); for(user_it = priv->users_begin; user_it != priv->users_end; ++ user_it) { user = *user_it; user_id = inf_user_get_id(INF_USER(user)); log = inf_adopted_user_get_request_log(user); first_n = inf_adopted_state_vector_get(first, user_id); second_n = inf_adopted_state_vector_get(second, user_id); /* TODO: This algorithm can probably be optimized by moving it into * request log. Note the similarity to is_component_reachable. */ while(second_n > first_n) { /* If we dropped too much state, then we can't say whether the two * states are equivalent. Assume they aren't. */ if(second_n <= inf_adopted_request_log_get_begin(log)) return FALSE; request = inf_adopted_request_log_get_request(log, second_n - 1); if(inf_adopted_request_get_request_type(request) == INF_ADOPTED_REQUEST_DO) { return FALSE; } else { request = inf_adopted_request_log_prev_associated(log, request); second_n = inf_adopted_state_vector_get( inf_adopted_request_get_vector(request), user_id ); } } if(second_n < first_n) return FALSE; } return TRUE; } static void inf_adopted_algorithm_buffer_notify_modified_cb(GObject* object, GParamSpec* pspec, gpointer user_data) { InfAdoptedAlgorithm* algorithm; InfAdoptedAlgorithmPrivate* priv; gboolean equivalent; algorithm = INF_ADOPTED_ALGORITHM(user_data); priv = INF_ADOPTED_ALGORITHM_PRIVATE(algorithm); if(inf_buffer_get_modified(INF_BUFFER(object))) { if(priv->buffer_modified_time != NULL) { /* If the current state is equivalent to the one the buffer has changed * the modified flag the last time, then the modified flag actually * changed. Otherwise, we got notified without the flag actually * changing. This should not happen normally, but we would lose * information about when the buffer has been non-modified the last * time otherwise. */ equivalent = inf_adopted_algorithm_buffer_states_equivalent( algorithm, priv->buffer_modified_time, priv->current ); if(equivalent == TRUE) { inf_adopted_state_vector_free(priv->buffer_modified_time); priv->buffer_modified_time = NULL; } } } else { if(priv->buffer_modified_time != NULL) inf_adopted_state_vector_free(priv->buffer_modified_time); /* Buffer is not modified anymore */ priv->buffer_modified_time = inf_adopted_state_vector_copy(priv->current); } } static void inf_adopted_algorithm_update_local_user_times(InfAdoptedAlgorithm* algorithm) { /* TODO: I don't think we even need this because we could treat local * users implicitely as in-sync with priv->current. It would make some loops * a bit more complex, perhaps. * * Alternative: Let the local users just point to priv->current. */ InfAdoptedAlgorithmPrivate* priv; InfAdoptedAlgorithmLocalUser* local; GSList* item; priv = INF_ADOPTED_ALGORITHM_PRIVATE(algorithm); for(item = priv->local_users; item != NULL; item = g_slist_next(item)) { local = item->data; inf_adopted_user_set_vector( local->user, inf_adopted_state_vector_copy(priv->current) ); } } /* TODO: Move this into request log? */ static gboolean inf_adopted_algorithm_is_component_reachable(InfAdoptedAlgorithm* algorithm, InfAdoptedStateVector* v, InfAdoptedUser* component) { InfAdoptedAlgorithmPrivate* priv; InfAdoptedRequestLog* log; InfAdoptedRequest* request; InfAdoptedRequestType type; InfAdoptedStateVector* current; guint n; priv = INF_ADOPTED_ALGORITHM_PRIVATE(algorithm); log = inf_adopted_user_get_request_log(component); current = v; g_assert(log != NULL); for(;;) { n = inf_adopted_state_vector_get( current, inf_user_get_id(INF_USER(component)) ); g_assert(n >= inf_adopted_request_log_get_begin(log)); /* Can be equal to end if the corresponding request is not yet * inserted in the log. */ g_assert(n <= inf_adopted_request_log_get_end(log)); if(n == inf_adopted_request_log_get_begin(log)) return TRUE; request = inf_adopted_request_log_get_request(log, n - 1); type = inf_adopted_request_get_request_type(request); if(type == INF_ADOPTED_REQUEST_DO) { return inf_adopted_state_vector_causally_before_inc( inf_adopted_request_get_vector(request), v, inf_adopted_request_get_user_id(request) ); } else { current = inf_adopted_request_get_vector( inf_adopted_request_log_prev_associated(log, request) ); } } } static gboolean inf_adopted_algorithm_is_reachable(InfAdoptedAlgorithm* algorithm, InfAdoptedStateVector* v) { InfAdoptedAlgorithmPrivate* priv; InfAdoptedUser** user; priv = INF_ADOPTED_ALGORITHM_PRIVATE(algorithm); g_assert( inf_adopted_state_vector_causally_before(v, priv->current) == TRUE ); for(user = priv->users_begin; user != priv->users_end; ++ user) if(!inf_adopted_algorithm_is_component_reachable(algorithm, v, *user)) return FALSE; return TRUE; } /* We can cache requests if: * a) they are reversible. If they are not, they will be made reversible * later (see inf_adopted_algorithm_execute_request), but the algorithm relies * on cached requests being reversible. * b) they affect the buffer. If they do not, then they will not be used for * later transformations anyway. */ static gboolean inf_adopted_algorithm_can_cache(InfAdoptedRequest* request) { InfAdoptedOperation* operation; InfAdoptedOperationFlags flags; #define INF_ADOPTED_OPERATION_CACHABLE \ (INF_ADOPTED_OPERATION_AFFECTS_BUFFER | INF_ADOPTED_OPERATION_REVERSIBLE) if(inf_adopted_request_get_request_type(request) != INF_ADOPTED_REQUEST_DO) return TRUE; operation = inf_adopted_request_get_operation(request); flags = inf_adopted_operation_get_flags(operation) & INF_ADOPTED_OPERATION_CACHABLE; return flags == INF_ADOPTED_OPERATION_CACHABLE; } /* Translates two requests to state at and then transforms them against each * other. The result needs to be unref()ed. */ static InfAdoptedRequest* inf_adopted_algorithm_transform_request(InfAdoptedAlgorithm* algorithm, InfAdoptedRequest* request, InfAdoptedRequest* against, InfAdoptedStateVector* at) { InfAdoptedRequest* request_at; InfAdoptedRequest* against_at; InfAdoptedConcurrencyId concurrency_id; InfAdoptedStateVector* lcs; InfAdoptedRequest* lcs_against; InfAdoptedRequest* lcs_request; InfAdoptedRequest* result; g_assert( inf_adopted_state_vector_causally_before( inf_adopted_request_get_vector(request), at ) ); g_assert( inf_adopted_state_vector_causally_before( inf_adopted_request_get_vector(against), at ) ); against_at = inf_adopted_algorithm_translate_request( algorithm, against, at ); request_at = inf_adopted_algorithm_translate_request( algorithm, request, at ); concurrency_id = INF_ADOPTED_CONCURRENCY_NONE; if(inf_adopted_request_need_concurrency_id(request_at, against_at) == TRUE) { lcs = inf_adopted_algorithm_least_common_successor( algorithm, inf_adopted_request_get_vector(request), inf_adopted_request_get_vector(against) ); g_assert(inf_adopted_state_vector_causally_before(lcs, at)); if(inf_adopted_state_vector_compare(lcs, at) != 0) { lcs_against = inf_adopted_algorithm_translate_request( algorithm, against, lcs ); lcs_request = inf_adopted_algorithm_translate_request( algorithm, request, lcs ); concurrency_id = inf_adopted_request_get_concurrency_id(lcs_request, lcs_against); g_object_unref(lcs_request); g_object_unref(lcs_against); } inf_adopted_state_vector_free(lcs); } result = inf_adopted_request_transform( request_at, against_at, concurrency_id ); g_object_unref(request_at); g_object_unref(against_at); return result; } /* This should only ever be called by * inf_adopted_algorithm_translate_request() after it did the cache and * validity checks */ static InfAdoptedRequest* inf_adopted_algorithm_translate_request_nocache(InfAdoptedAlgorithm* algorithm, InfAdoptedRequest* request, InfAdoptedStateVector* to) { InfAdoptedAlgorithmPrivate* priv; InfAdoptedUser** user_it; /* user iterator */ InfUser* user; /* points to current user (mostly *user_it) */ guint user_id; /* Corresponding ID */ InfAdoptedRequestLog* log; /* points to current log */ InfAdoptedStateVector* vector; /* always points to request's vector */ InfAdoptedRequest* associated; InfAdoptedRequest* translated; InfAdoptedRequest* result; gint by; guint n; priv = INF_ADOPTED_ALGORITHM_PRIVATE(algorithm); vector = inf_adopted_request_get_vector(request); result = NULL; if(inf_adopted_request_get_request_type(request) != INF_ADOPTED_REQUEST_DO) { user_id = inf_adopted_request_get_user_id(request); user = inf_user_table_lookup_user_by_id(priv->user_table, user_id); log = inf_adopted_user_get_request_log(INF_ADOPTED_USER(user)); /* Try late mirror if this is not a do request */ associated = inf_adopted_request_log_prev_associated(log, request); g_assert(associated != NULL); n = inf_adopted_state_vector_get(to, user_id); by = n - inf_adopted_state_vector_get( inf_adopted_request_get_vector(associated), user_id ); inf_adopted_state_vector_add(to, user_id, -by); if(inf_adopted_algorithm_is_reachable(algorithm, to)) { translated = inf_adopted_algorithm_translate_request( algorithm, associated, to ); result = inf_adopted_request_mirror(translated, by); g_object_unref(translated); } /* Reset to for other routines to use */ inf_adopted_state_vector_set(to, user_id, n); if(result) return result; } else { /* The request is a do request: We might already be done if we are * already at the state we are supposed to translate request to. */ if(inf_adopted_state_vector_compare(vector, to) == 0) { g_object_ref(request); return request; } } for(user_it = priv->users_begin; user_it != priv->users_end; ++ user_it) { user = INF_USER(*user_it); user_id = inf_user_get_id(user); if(user_id == inf_adopted_request_get_user_id(request)) continue; n = inf_adopted_state_vector_get(to, user_id); log = inf_adopted_user_get_request_log(INF_ADOPTED_USER(user)); g_assert(n >= inf_adopted_request_log_get_begin(log)); if(n == inf_adopted_request_log_get_begin(log)) continue; /* Fold late, if possible */ associated = inf_adopted_request_log_get_request(log, n - 1); if(inf_adopted_request_get_request_type(associated) != INF_ADOPTED_REQUEST_DO) { associated = inf_adopted_request_log_prev_associated(log, associated); g_assert(associated != NULL); by = n - inf_adopted_state_vector_get( inf_adopted_request_get_vector(associated), user_id ); inf_adopted_state_vector_add(to, user_id, -by); if(inf_adopted_algorithm_is_reachable(algorithm, to) && inf_adopted_state_vector_causally_before(vector, to) == TRUE) { translated = inf_adopted_algorithm_translate_request( algorithm, request, to ); result = inf_adopted_request_fold( translated, user_id, by ); g_object_unref(translated); } /* Reset to for other routines to use */ inf_adopted_state_vector_set(to, user_id, n); if(result) return result; } /* Transform into direction we are not going to fold later */ if(inf_adopted_state_vector_get(vector, user_id) < n) /* inf_adopted_state_vector_get(to, user_id))*/ { inf_adopted_state_vector_set(to, user_id, n - 1); if(inf_adopted_algorithm_is_reachable(algorithm, to)) { associated = inf_adopted_request_log_get_request(log, n - 1); result = inf_adopted_algorithm_transform_request( algorithm, request, associated, to ); } /* Reset to be reused */ inf_adopted_state_vector_set(to, user_id, n); if(result) return result; } } #if 0 /* Last resort: Transform always */ for(user_it = priv->users_begin; user_it != priv->users_end; ++ user_it) { user = INF_USER(*user_it); user_id = inf_user_get_id(user); if(user_id == inf_adopted_request_get_user_id(request)) continue; n = inf_adopted_state_vector_get(v, user_id); log = inf_adopted_user_get_request_log(INF_ADOPTED_USER(user)); g_assert(n >= inf_adopted_request_log_get_begin(log)); if(n == inf_adopted_request_log_get_begin(log)) continue; if(inf_adopted_state_vector_get(vector, user_id) < inf_adopted_state_vector_get(to, user_id)) { inf_adopted_state_vector_set(v, user_id, n - 1); if(inf_adopted_algorithm_is_reachable(algorithm, v)) { associated = inf_adopted_request_log_get_request(log, n - 1); result = inf_adopted_algorithm_transform_request( algorithm, request, associated, v ); goto done; } else { /* Reset to be reused */ inf_adopted_state_vector_set(v, user_id, n); } } } #endif g_assert_not_reached(); return NULL; } static void inf_adopted_algorithm_init(GTypeInstance* instance, gpointer g_class) { InfAdoptedAlgorithm* algorithm; InfAdoptedAlgorithmPrivate* priv; algorithm = INF_ADOPTED_ALGORITHM(instance); algorithm->priv = INF_ADOPTED_ALGORITHM_GET_PRIVATE(algorithm); priv = INF_ADOPTED_ALGORITHM_PRIVATE(algorithm); priv->max_total_log_size = 2048; priv->current = inf_adopted_state_vector_new(); priv->buffer_modified_time = NULL; priv->user_table = NULL; priv->buffer = NULL; priv->queue = NULL; /* Lookup by user, user is not refed because the request log holds a * reference anyway. */ priv->users_begin = NULL; priv->users_end = NULL; priv->cache = g_tree_new_full( inf_adopted_algorithm_request_key_cmp, NULL, inf_adopted_algorithm_request_key_free, g_object_unref ); priv->local_users = NULL; } static void inf_adopted_algorithm_constructor_foreach_user_func(InfUser* user, gpointer user_data) { InfAdoptedAlgorithm* algorithm; algorithm = INF_ADOPTED_ALGORITHM(user_data); g_assert(INF_ADOPTED_IS_USER(user)); inf_adopted_algorithm_add_user(algorithm, INF_ADOPTED_USER(user)); } static void inf_adopted_algorithm_constructor_foreach_local_user_func(InfUser* user, gpointer user_data) { InfAdoptedAlgorithm* algorithm; algorithm = INF_ADOPTED_ALGORITHM(user_data); g_assert(INF_ADOPTED_IS_USER(user)); inf_adopted_algorithm_add_local_user(algorithm, INF_ADOPTED_USER(user)); } static GObject* inf_adopted_algorithm_constructor(GType type, guint n_construct_properties, GObjectConstructParam* construct_properties) { GObject* object; InfAdoptedAlgorithm* algorithm; InfAdoptedAlgorithmPrivate* priv; gboolean modified; object = G_OBJECT_CLASS(parent_class)->constructor( type, n_construct_properties, construct_properties ); algorithm = INF_ADOPTED_ALGORITHM(object); priv = INF_ADOPTED_ALGORITHM_PRIVATE(algorithm); /* Add initial users */ inf_user_table_foreach_user( priv->user_table, inf_adopted_algorithm_constructor_foreach_user_func, algorithm ); inf_user_table_foreach_local_user( priv->user_table, inf_adopted_algorithm_constructor_foreach_local_user_func, algorithm ); g_object_get(G_OBJECT(priv->buffer), "modified", &modified, NULL); if(modified == FALSE) { priv->buffer_modified_time = inf_adopted_state_vector_copy(priv->current); } return object; } static void inf_adopted_algorithm_dispose(GObject* object) { InfAdoptedAlgorithm* algorithm; InfAdoptedAlgorithmPrivate* priv; GList* item; algorithm = INF_ADOPTED_ALGORITHM(object); priv = INF_ADOPTED_ALGORITHM_PRIVATE(algorithm); while(priv->local_users != NULL) inf_adopted_algorithm_local_user_free(algorithm, priv->local_users->data); for(item = priv->queue; item != NULL; item = g_list_next(item)) g_object_unref(G_OBJECT(item->data)); g_list_free(priv->queue); priv->queue = NULL; g_tree_destroy(priv->cache); priv->cache = NULL; g_free(priv->users_begin); if(priv->buffer != NULL) { inf_signal_handlers_disconnect_by_func( G_OBJECT(priv->buffer), G_CALLBACK(inf_adopted_algorithm_buffer_notify_modified_cb), algorithm ); g_object_unref(priv->buffer); priv->buffer = NULL; } if(priv->buffer_modified_time != NULL) inf_adopted_state_vector_free(priv->buffer_modified_time); if(priv->user_table != NULL) { inf_signal_handlers_disconnect_by_func( G_OBJECT(priv->user_table), G_CALLBACK(inf_adopted_algorithm_add_user_cb), algorithm ); inf_signal_handlers_disconnect_by_func( G_OBJECT(priv->user_table), G_CALLBACK(inf_adopted_algorithm_add_local_user_cb), algorithm ); inf_signal_handlers_disconnect_by_func( G_OBJECT(priv->user_table), G_CALLBACK(inf_adopted_algorithm_remove_local_user_cb), algorithm ); g_object_unref(priv->user_table); priv->user_table = NULL; } G_OBJECT_CLASS(parent_class)->dispose(object); } static void inf_adopted_algorithm_finalize(GObject* object) { InfAdoptedAlgorithm* algorithm; InfAdoptedAlgorithmPrivate* priv; algorithm = INF_ADOPTED_ALGORITHM(object); priv = INF_ADOPTED_ALGORITHM_PRIVATE(algorithm); inf_adopted_state_vector_free(priv->current); G_OBJECT_CLASS(parent_class)->finalize(object); } static void inf_adopted_algorithm_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec) { InfAdoptedAlgorithm* algorithm; InfAdoptedAlgorithmPrivate* priv; algorithm = INF_ADOPTED_ALGORITHM(object); priv = INF_ADOPTED_ALGORITHM_PRIVATE(algorithm); switch(prop_id) { case PROP_USER_TABLE: g_assert(priv->user_table == NULL); /* construct/only */ priv->user_table = INF_USER_TABLE(g_value_dup_object(value)); g_signal_connect( G_OBJECT(priv->user_table), "add-user", G_CALLBACK(inf_adopted_algorithm_add_user_cb), algorithm ); g_signal_connect( G_OBJECT(priv->user_table), "add-local-user", G_CALLBACK(inf_adopted_algorithm_add_local_user_cb), algorithm ); g_signal_connect( G_OBJECT(priv->user_table), "remove-local-user", G_CALLBACK(inf_adopted_algorithm_remove_local_user_cb), algorithm ); break; case PROP_BUFFER: g_assert(priv->buffer == NULL); /* construct only */ g_assert(priv->buffer_modified_time == NULL); priv->buffer = INF_BUFFER(g_value_dup_object(value)); g_signal_connect( G_OBJECT(priv->buffer), "notify::modified", G_CALLBACK(inf_adopted_algorithm_buffer_notify_modified_cb), algorithm ); break; case PROP_MAX_TOTAL_LOG_SIZE: priv->max_total_log_size = g_value_get_uint(value); break; case PROP_CURRENT_STATE: case PROP_BUFFER_MODIFIED_STATE: /* read/only */ default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void inf_adopted_algorithm_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec) { InfAdoptedAlgorithm* log; InfAdoptedAlgorithmPrivate* priv; log = INF_ADOPTED_ALGORITHM(object); priv = INF_ADOPTED_ALGORITHM_PRIVATE(log); switch(prop_id) { case PROP_USER_TABLE: g_value_set_object(value, G_OBJECT(priv->user_table)); break; case PROP_BUFFER: g_value_set_object(value, G_OBJECT(priv->buffer)); break; case PROP_MAX_TOTAL_LOG_SIZE: g_value_set_uint(value, priv->max_total_log_size); break; case PROP_CURRENT_STATE: g_value_set_boxed(value, priv->current); break; case PROP_BUFFER_MODIFIED_STATE: g_value_set_boxed(value, priv->buffer_modified_time); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void inf_adopted_algorithm_can_undo_changed(InfAdoptedAlgorithm* algorithm, InfAdoptedUser* user, gboolean can_undo) { InfAdoptedAlgorithmPrivate* priv; GSList* item; priv = INF_ADOPTED_ALGORITHM_PRIVATE(algorithm); for(item = priv->local_users; item != NULL; item = g_slist_next(item)) if( ((InfAdoptedAlgorithmLocalUser*)item->data)->user == user) ((InfAdoptedAlgorithmLocalUser*)item->data)->can_undo = can_undo; } static void inf_adopted_algorithm_can_redo_changed(InfAdoptedAlgorithm* algorithm, InfAdoptedUser* user, gboolean can_redo) { InfAdoptedAlgorithmPrivate* priv; GSList* item; priv = INF_ADOPTED_ALGORITHM_PRIVATE(algorithm); for(item = priv->local_users; item != NULL; item = g_slist_next(item)) if( ((InfAdoptedAlgorithmLocalUser*)item->data)->user == user) ((InfAdoptedAlgorithmLocalUser*)item->data)->can_redo = can_redo; } static void inf_adopted_algorithm_execute_request(InfAdoptedAlgorithm* algorithm, InfAdoptedUser* user, InfAdoptedRequest* request, gboolean apply) { InfAdoptedAlgorithmPrivate* priv; InfAdoptedRequestLog* log; InfAdoptedRequest* translated; InfAdoptedRequest* log_request; InfAdoptedOperation* operation; InfAdoptedOperation* reversible_operation; InfAdoptedOperationFlags flags; InfAdoptedRequest* original; InfAdoptedStateVector* v; gboolean equivalent; priv = INF_ADOPTED_ALGORITHM_PRIVATE(algorithm); g_assert( inf_adopted_state_vector_causally_before( inf_adopted_request_get_vector(request), priv->current ) == TRUE ); log = inf_adopted_user_get_request_log(user); /* Adjust vector time for Undo/Redo operations because they only depend on * their original operation. */ if(inf_adopted_request_get_request_type(request) != INF_ADOPTED_REQUEST_DO) { original = inf_adopted_request_log_original_request(log, request); v = inf_adopted_state_vector_copy( inf_adopted_request_get_vector(original) ); inf_adopted_state_vector_set( v, inf_adopted_request_get_user_id(request), inf_adopted_state_vector_get( inf_adopted_request_get_vector(request), inf_adopted_request_get_user_id(request) ) ); switch(inf_adopted_request_get_request_type(request)) { case INF_ADOPTED_REQUEST_UNDO: log_request = inf_adopted_request_new_undo( v, inf_adopted_request_get_user_id(request) ); break; case INF_ADOPTED_REQUEST_REDO: log_request = inf_adopted_request_new_redo( v, inf_adopted_request_get_user_id(request) ); break; default: g_assert_not_reached(); break; } inf_adopted_state_vector_free(v); } else { log_request = request; g_object_ref(log_request); } translated = inf_adopted_algorithm_translate_request( algorithm, log_request, priv->current ); if(inf_adopted_request_get_request_type(request) == INF_ADOPTED_REQUEST_DO) { g_assert(log_request == request); operation = inf_adopted_request_get_operation(request); flags = inf_adopted_operation_get_flags(operation); if( (flags & INF_ADOPTED_OPERATION_AFFECTS_BUFFER) != 0) { if(inf_adopted_operation_is_reversible(operation) == FALSE) { reversible_operation = inf_adopted_operation_make_reversible( operation, inf_adopted_request_get_operation(translated), priv->buffer ); if(reversible_operation != NULL) { g_object_unref(log_request); log_request = inf_adopted_request_new_do( inf_adopted_request_get_vector(request), inf_adopted_request_get_user_id(request), reversible_operation ); g_object_unref(reversible_operation); } } } else { /* Does not affect the buffer, so is not recorded in log */ g_object_unref(log_request); log_request = NULL; } } if(log_request != NULL) { inf_adopted_request_log_add_request(log, log_request); inf_adopted_state_vector_add( priv->current, inf_adopted_request_get_user_id(request), 1 ); inf_adopted_algorithm_update_local_user_times(algorithm); g_object_unref(log_request); } inf_signal_handlers_block_by_func( G_OBJECT(priv->buffer), G_CALLBACK(inf_adopted_algorithm_buffer_notify_modified_cb), algorithm ); if(apply == TRUE) { g_signal_emit( G_OBJECT(algorithm), algorithm_signals[APPLY_REQUEST], 0, user, translated ); } /* TODO: We only need to do this if we changed the current state vector * time <=> if the current request was added to the log */ if(priv->buffer_modified_time != NULL) { equivalent = inf_adopted_algorithm_buffer_states_equivalent( algorithm, priv->buffer_modified_time, priv->current ); if(equivalent == TRUE) { inf_buffer_set_modified(priv->buffer, FALSE); inf_adopted_state_vector_free(priv->buffer_modified_time); priv->buffer_modified_time = inf_adopted_state_vector_copy(priv->current); } else { /* The buffer does this automatically when applying an operation: */ /*inf_buffer_set_modified(priv->buffer, TRUE);*/ } } else { /* When the modified flag is set to false, then we create the * buffer_modified_time, so when it is unset, the flag needs to be set. * Otherwise, we didn't get notified correctly. */ g_assert(inf_buffer_get_modified(priv->buffer) == TRUE); } inf_signal_handlers_unblock_by_func( G_OBJECT(priv->buffer), G_CALLBACK(inf_adopted_algorithm_buffer_notify_modified_cb), algorithm ); g_object_unref(translated); } static void inf_adopted_algorithm_apply_request(InfAdoptedAlgorithm* algorithm, InfAdoptedUser* user, InfAdoptedRequest* request) { InfAdoptedAlgorithmPrivate* priv; priv = INF_ADOPTED_ALGORITHM_PRIVATE(algorithm); inf_adopted_operation_apply( inf_adopted_request_get_operation(request), user, priv->buffer ); } static void inf_adopted_algorithm_class_init(gpointer g_class, gpointer class_data) { GObjectClass* object_class; InfAdoptedAlgorithmClass* algorithm_class; object_class = G_OBJECT_CLASS(g_class); algorithm_class = INF_ADOPTED_ALGORITHM_CLASS(g_class); parent_class = G_OBJECT_CLASS(g_type_class_peek_parent(g_class)); g_type_class_add_private(g_class, sizeof(InfAdoptedAlgorithmPrivate)); object_class->constructor = inf_adopted_algorithm_constructor; object_class->dispose = inf_adopted_algorithm_dispose; object_class->finalize = inf_adopted_algorithm_finalize; object_class->set_property = inf_adopted_algorithm_set_property; object_class->get_property = inf_adopted_algorithm_get_property; algorithm_class->can_undo_changed = inf_adopted_algorithm_can_undo_changed; algorithm_class->can_redo_changed = inf_adopted_algorithm_can_redo_changed; algorithm_class->execute_request = inf_adopted_algorithm_execute_request; algorithm_class->apply_request = inf_adopted_algorithm_apply_request; g_object_class_install_property( object_class, PROP_USER_TABLE, g_param_spec_object( "user-table", "User table", "The user table", INF_TYPE_USER_TABLE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); g_object_class_install_property( object_class, PROP_BUFFER, g_param_spec_object( "buffer", "Buffer", "The buffer to apply operations to", INF_TYPE_BUFFER, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); g_object_class_install_property( object_class, PROP_MAX_TOTAL_LOG_SIZE, g_param_spec_uint( "max-total-log-size", "Maxmimum total log size", "The maximum number of requests to keep in all user's logs", 0, G_MAXUINT, 2048, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); g_object_class_install_property( object_class, PROP_CURRENT_STATE, g_param_spec_boxed( "current-state", "Current state", "The state vector describing the current document state", INF_ADOPTED_TYPE_STATE_VECTOR, G_PARAM_READABLE ) ); g_object_class_install_property( object_class, PROP_BUFFER_MODIFIED_STATE, g_param_spec_boxed( "buffer-modified-state", "Buffer modified state", "The state in which the buffer is considered not being modified", INF_ADOPTED_TYPE_STATE_VECTOR, G_PARAM_READABLE ) ); /** * InfAdoptedAlgorithm::can-undo-changed: * @algorithm: The #InfAdoptedAlgorithm for which a user's * can-undo state changed. * @user: The #InfAdoptedUser whose can-undo state has changed. * @can_undo: Whether @user can issue an undo request in the current * state or not. * * This signal is emitted every time the can-undo state of a local user * in @algorithm's user table changed. The can-undo state defines whether * @user can generate an undo request * (via inf_adopted_algorithm_generate_undo()) in the current situation, see * also inf_adopted_algorithm_can_undo(). */ algorithm_signals[CAN_UNDO_CHANGED] = g_signal_new( "can-undo-changed", G_OBJECT_CLASS_TYPE(object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(InfAdoptedAlgorithmClass, can_undo_changed), NULL, NULL, inf_marshal_VOID__OBJECT_BOOLEAN, G_TYPE_NONE, 2, INF_ADOPTED_TYPE_USER, G_TYPE_BOOLEAN ); /** * InfAdoptedAlgorithm::can-redo-changed: * @algorithm: The #InfAdoptedAlgorithm for which a user's * can-redo state changed. * @user: The #InfAdoptedUser whose can-redo state has changed. * @can_undo: Whether @user can issue a redo request in the current * state or not. * * This signal is emitted every time the can-redo state of a local user * in @algorithm's user table changed. The can-redo state defines whether * @user can generate a redo request * (via inf_adopted_algorithm_generate_redo()) in the current situation, see * also inf_adopted_algorithm_can_redo(). */ algorithm_signals[CAN_REDO_CHANGED] = g_signal_new( "can-redo-changed", G_OBJECT_CLASS_TYPE(object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(InfAdoptedAlgorithmClass, can_redo_changed), NULL, NULL, inf_marshal_VOID__OBJECT_BOOLEAN, G_TYPE_NONE, 2, INF_ADOPTED_TYPE_USER, G_TYPE_BOOLEAN ); /** * InfAdoptedAlgorithm::execute-request: * @algorithm: The #InfAdoptedAlgorithm executing a request. * @user: The #InfAdoptedUser executing the request. * @request: The #InfAdoptedRequest being executed. * @apply: Whether the request will be applied after execution. * * This signal is emitted every time the algorithm executes a request. * @request is the request that @algorithm will execute. @request can * generally not be applied to the current state, and it might also be an * undo or redo request. The default handler of this signal computes the * operation that can be applied to the buffer, and applies it when @apply * is %TRUE by emitting #InfAdoptedAlgorithm::apply-request. */ algorithm_signals[EXECUTE_REQUEST] = g_signal_new( "execute-request", G_OBJECT_CLASS_TYPE(object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(InfAdoptedAlgorithmClass, execute_request), NULL, NULL, inf_marshal_VOID__OBJECT_OBJECT_BOOLEAN, G_TYPE_NONE, 3, INF_ADOPTED_TYPE_USER, INF_ADOPTED_TYPE_REQUEST, G_TYPE_BOOLEAN ); /** * InfAdoptedAlgorithm::apply-request: * @algorithm: The #InfAdoptedAlgorithm applying a request. * @user: The #InfAdoptedUser applying the request. * @request: The #InfAdoptedRequest being applied. * * This signal is emitted every time the algorithm applies a request. * * Note a call to inf_adopted_algorithm_generate_request(), * inf_adopted_algorithm_generate_undo() * or inf_adopted_algorithm_generate_redo() always applies the generated * request. In contrast, inf_adopted_algorithm_receive_request() might not * apply the given request (if requests it depends upon have not yet * received) or might apply multiple request (if the provided request * fulfills the dependencies of queued requests). * * Note also that the signal is not emitted for every request processed by * #InfAdoptedAlgorithm since * inf_adopted_algorithm_generate_request_noexec() generates a request but * does not apply it. */ algorithm_signals[APPLY_REQUEST] = g_signal_new( "apply-request", G_OBJECT_CLASS_TYPE(object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(InfAdoptedAlgorithmClass, apply_request), NULL, NULL, inf_marshal_VOID__OBJECT_OBJECT, G_TYPE_NONE, 2, INF_ADOPTED_TYPE_USER, INF_ADOPTED_TYPE_REQUEST ); } GType inf_adopted_algorithm_get_type(void) { static GType algorithm_type = 0; if(!algorithm_type) { static const GTypeInfo algorithm_type_info = { sizeof(InfAdoptedAlgorithmClass), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ inf_adopted_algorithm_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InfAdoptedAlgorithm), /* instance_size */ 0, /* n_preallocs */ inf_adopted_algorithm_init, /* instance_init */ NULL /* value_table */ }; algorithm_type = g_type_register_static( G_TYPE_OBJECT, "InfAdoptedAlgorithm", &algorithm_type_info, 0 ); } return algorithm_type; } /** * inf_adopted_algorithm_new: * @user_table: The table of participating users. * @buffer: The buffer to apply operations to. * * Creates a #InfAdoptedAlgorithm. * * Return Value: A new #InfAdoptedAlgorithm. **/ InfAdoptedAlgorithm* inf_adopted_algorithm_new(InfUserTable* user_table, InfBuffer* buffer) { GObject* object; g_return_val_if_fail(INF_IS_BUFFER(buffer), NULL); object = g_object_new( INF_ADOPTED_TYPE_ALGORITHM, "user-table", user_table, "buffer", buffer, NULL ); return INF_ADOPTED_ALGORITHM(object); } /** * inf_adopted_algorithm_new_full: * @user_table: The table of participating users. * @buffer: The buffer to apply operations to. * @max_total_log_size: The maxmimum number of operations to keep in all * user's request logs. * * Note that it is possible that request logs need to grow a bit larger than * @max_total_log_size in high-latency situations or when a user does not send * status updates frequently. However, when all requests have been * processed by all users, the sum of all requests in the logs is guaranteed * to be lower or equal to this value. * * Set to %G_MAXUINT to disable limitation. In theory, this would allow * everyone to undo every operation up to the first one ever made. In practise, * this issues a huge amount of data that needs to be synchronized on user * join and is too expensive to compute anyway. * * The default value is 2048. * * Return Value: A new #InfAdoptedAlgorithm. **/ InfAdoptedAlgorithm* inf_adopted_algorithm_new_full(InfUserTable* user_table, InfBuffer* buffer, guint max_total_log_size) { GObject* object; g_return_val_if_fail(INF_IS_BUFFER(buffer), NULL); object = g_object_new( INF_ADOPTED_TYPE_ALGORITHM, "user-table", user_table, "buffer", buffer, "max-total-log-size", max_total_log_size, NULL ); return INF_ADOPTED_ALGORITHM(object); } /** * inf_adopted_algorithm_get_current: * @algorithm: A #InfAdoptedAlgorithm. * * Returns the current vector time of @algorithm. * * Return Value: A #InfAdoptedStateVector owned by @algorithm. **/ InfAdoptedStateVector* inf_adopted_algorithm_get_current(InfAdoptedAlgorithm* algorithm) { g_return_val_if_fail(INF_ADOPTED_IS_ALGORITHM(algorithm), NULL); return INF_ADOPTED_ALGORITHM_PRIVATE(algorithm)->current; } /** * inf_adopted_algorithm_generate_request_noexec: * @algorithm: A #InfAdoptedAlgorithm. * @user: A local #InfAdoptedUser. * @operation: A #InfAdoptedOperation. * * Creates a #InfAdoptedRequest for the given operation, executed by @user. * The user needs to have the %INF_USER_LOCAL flag set. * * The operation is not applied to the buffer, so you are responsible that * the operation is applied before the next request is processed or generated. * This may be useful if you are applying multiple operations, but want * to only make a single request out of them to save bandwidth. * * Return Value: A #InfAdoptedRequest that needs to be transmitted to the * other non-local users. **/ InfAdoptedRequest* inf_adopted_algorithm_generate_request_noexec(InfAdoptedAlgorithm* algorithm, InfAdoptedUser* user, InfAdoptedOperation* operation) { InfAdoptedAlgorithmPrivate* priv; InfAdoptedRequest* request; g_return_val_if_fail(INF_ADOPTED_IS_ALGORITHM(algorithm), NULL); g_return_val_if_fail(INF_ADOPTED_IS_USER(user), NULL); g_return_val_if_fail(INF_ADOPTED_IS_OPERATION(operation), NULL); g_return_val_if_fail( (inf_user_get_flags(INF_USER(user)) & INF_USER_LOCAL) != 0, NULL ); priv = INF_ADOPTED_ALGORITHM_PRIVATE(algorithm); request = inf_adopted_request_new_do( priv->current, inf_user_get_id(INF_USER(user)), operation ); g_signal_emit( G_OBJECT(algorithm), algorithm_signals[EXECUTE_REQUEST], 0, user, request, FALSE ); inf_adopted_algorithm_cleanup(algorithm); inf_adopted_algorithm_update_undo_redo(algorithm); return request; } /** * inf_adopted_algorithm_generate_request: * @algorithm: A #InfAdoptedAlgorithm. * @user: A local #InfAdoptedUser. * @operation: A #InfAdoptedOperation. * * Creates a #InfAdoptedRequest for the given operation, executed by @user. * The user needs to have the %INF_USER_LOCAL flag set. @operation is * applied to the buffer (by @user). * * Return Value: A #InfAdoptedRequest that needs to be transmitted to the * other non-local users. **/ InfAdoptedRequest* inf_adopted_algorithm_generate_request(InfAdoptedAlgorithm* algorithm, InfAdoptedUser* user, InfAdoptedOperation* operation) { InfAdoptedAlgorithmPrivate* priv; InfAdoptedRequest* request; g_return_val_if_fail(INF_ADOPTED_IS_ALGORITHM(algorithm), NULL); g_return_val_if_fail(INF_ADOPTED_IS_USER(user), NULL); g_return_val_if_fail(INF_ADOPTED_IS_OPERATION(operation), NULL); g_return_val_if_fail( (inf_user_get_flags(INF_USER(user)) & INF_USER_LOCAL) != 0, NULL ); priv = INF_ADOPTED_ALGORITHM_PRIVATE(algorithm); request = inf_adopted_request_new_do( priv->current, inf_user_get_id(INF_USER(user)), operation ); g_signal_emit( G_OBJECT(algorithm), algorithm_signals[EXECUTE_REQUEST], 0, user, request, TRUE ); inf_adopted_algorithm_cleanup(algorithm); inf_adopted_algorithm_update_undo_redo(algorithm); return request; } /** * inf_adopted_algorithm_generate_undo: * @algorithm: A #InfAdoptedAlgorithm. * @user: A local #InfAdoptedUser. * * Creates a request of type %INF_ADOPTED_REQUEST_UNDO for the given * user and with the current vector time. The user needs to have the * %INF_USER_LOCAL flag set. It also applies the effect of the operation to * the buffer. * * Return Value: A #InfAdoptedRequest that needs to be transmitted to the * other non-local users. **/ InfAdoptedRequest* inf_adopted_algorithm_generate_undo(InfAdoptedAlgorithm* algorithm, InfAdoptedUser* user) { InfAdoptedAlgorithmPrivate* priv; InfAdoptedRequest* request; g_return_val_if_fail(INF_ADOPTED_IS_ALGORITHM(algorithm), NULL); g_return_val_if_fail(INF_ADOPTED_IS_USER(user), NULL); g_return_val_if_fail( (inf_user_get_flags(INF_USER(user)) & INF_USER_LOCAL) != 0, NULL ); g_return_val_if_fail(inf_adopted_algorithm_can_undo(algorithm, user), NULL); priv = INF_ADOPTED_ALGORITHM_PRIVATE(algorithm); request = inf_adopted_request_new_undo( priv->current, inf_user_get_id(INF_USER(user)) ); g_signal_emit( G_OBJECT(algorithm), algorithm_signals[EXECUTE_REQUEST], 0, user, request, TRUE ); inf_adopted_algorithm_cleanup(algorithm); inf_adopted_algorithm_update_undo_redo(algorithm); return request; } /** * inf_adopted_algorithm_generate_redo: * @algorithm: A #InfAdoptedAlgorithm. * @user: A local #InfAdoptedUser. * * Creates a request of type %INF_ADOPTED_REQUEST_REDO for the given * user and with the current vector time. The user needs to have the * %INF_USER_LOCAL flag set. It also applies the effect of the operation to * the buffer. * * Return Value: A #InfAdoptedRequest that needs to be transmitted to the * other non-local users. **/ InfAdoptedRequest* inf_adopted_algorithm_generate_redo(InfAdoptedAlgorithm* algorithm, InfAdoptedUser* user) { InfAdoptedAlgorithmPrivate* priv; InfAdoptedRequest* request; g_return_val_if_fail(INF_ADOPTED_IS_ALGORITHM(algorithm), NULL); g_return_val_if_fail(INF_ADOPTED_IS_USER(user), NULL); g_return_val_if_fail( (inf_user_get_flags(INF_USER(user)) & INF_USER_LOCAL) != 0, NULL ); g_return_val_if_fail(inf_adopted_algorithm_can_redo(algorithm, user), NULL); priv = INF_ADOPTED_ALGORITHM_PRIVATE(algorithm); request = inf_adopted_request_new_redo( priv->current, inf_user_get_id(INF_USER(user)) ); g_signal_emit( G_OBJECT(algorithm), algorithm_signals[EXECUTE_REQUEST], 0, user, request, TRUE ); inf_adopted_algorithm_cleanup(algorithm); inf_adopted_algorithm_update_undo_redo(algorithm); return request; } /** * inf_adopted_algorithm_translate_request: * @algorithm: A #InfAdoptedAlgorithm. * @request: A #InfAdoptedRequest. * @to: The state vector to translate @request to. * * Translates @request so that it can be applied to the document at state @to. * @request will not be modified but a new, translated request is returned * instead. * * There are several preconditions for this function to be called. @to must * be a reachable point in the state space. Also, requests can only be * translated in forward direction, so @request's vector time must be * causally before (see inf_adopted_state_vector_causally_before()) @to. * * Returns: A new or cached #InfAdoptedRequest. Free with g_object_unref() * when no longer needed. */ InfAdoptedRequest* inf_adopted_algorithm_translate_request(InfAdoptedAlgorithm* algorithm, InfAdoptedRequest* request, InfAdoptedStateVector* to) { InfAdoptedAlgorithmPrivate* priv; guint user_id; InfAdoptedRequest* result; InfAdoptedAlgorithmRequestKey lookup_key; InfAdoptedAlgorithmRequestKey* insert_key; g_return_val_if_fail(INF_ADOPTED_IS_ALGORITHM(algorithm), NULL); g_return_val_if_fail(INF_ADOPTED_IS_REQUEST(request), NULL); g_return_val_if_fail(to != NULL, NULL); priv = INF_ADOPTED_ALGORITHM_PRIVATE(algorithm); user_id = inf_adopted_request_get_user_id(request); /* Validity checks */ g_return_val_if_fail( inf_user_table_lookup_user_by_id(priv->user_table, user_id) != NULL, NULL ); g_return_val_if_fail( inf_adopted_state_vector_causally_before(to, priv->current), NULL ); g_return_val_if_fail( inf_adopted_state_vector_causally_before( inf_adopted_request_get_vector( inf_adopted_request_log_original_request( inf_adopted_user_get_request_log( INF_ADOPTED_USER( inf_user_table_lookup_user_by_id(priv->user_table, user_id) ) ), request ) ), to ), NULL ); g_return_val_if_fail( inf_adopted_algorithm_is_reachable(algorithm, to) == TRUE, NULL ); /* If the request affects the buffer, then it might have been cached * earlier. */ if(inf_adopted_request_affects_buffer(request)) { lookup_key.vector = to; lookup_key.user_id = user_id; result = g_tree_lookup(priv->cache, &lookup_key); if(result != NULL) { g_object_ref(result); return result; } } result = inf_adopted_algorithm_translate_request_nocache( algorithm, request, to ); g_assert( inf_adopted_state_vector_compare( inf_adopted_request_get_vector(result), to ) == 0 ); if(inf_adopted_algorithm_can_cache(result)) { insert_key = g_slice_new(InfAdoptedAlgorithmRequestKey); insert_key->vector = inf_adopted_request_get_vector(result); insert_key->user_id = user_id; g_assert(g_tree_lookup(priv->cache, insert_key) == NULL); g_tree_replace(priv->cache, insert_key, result); g_object_ref(result); } return result; } /** * inf_adopted_algorithm_receive_request: * @algorithm: A #InfAdoptedAlgorithm. * @request: A #InfAdoptedRequest from a non-local user. * * This function processes a request received from a non-local user and * applies its operation to the buffer. **/ void inf_adopted_algorithm_receive_request(InfAdoptedAlgorithm* algorithm, InfAdoptedRequest* request) { InfAdoptedAlgorithmPrivate* priv; InfAdoptedRequest* queued_request; InfAdoptedStateVector* vector; InfAdoptedStateVector* user_vector; guint user_id; InfUser* user; GList* item; g_return_if_fail(INF_ADOPTED_IS_ALGORITHM(algorithm)); g_return_if_fail(INF_ADOPTED_IS_REQUEST(request)); priv = INF_ADOPTED_ALGORITHM_PRIVATE(algorithm); user_id = inf_adopted_request_get_user_id(request); user = inf_user_table_lookup_user_by_id(priv->user_table, user_id); g_return_if_fail(user != NULL); vector = inf_adopted_request_get_vector(request); user_vector = inf_adopted_user_get_vector(INF_ADOPTED_USER(user)); g_return_if_fail( ((inf_user_get_flags(user)) & INF_USER_LOCAL) == 0); /* Update user vector if this is the newest request from that user. */ if(inf_adopted_state_vector_causally_before(user_vector, vector)) { /* Update remote user's vector: We know which requests the remote user * already has processed. */ user_vector = inf_adopted_state_vector_copy(vector); if(inf_adopted_request_affects_buffer(request)) inf_adopted_state_vector_add(user_vector, inf_user_get_id(user), 1); inf_adopted_user_set_vector(INF_ADOPTED_USER(user), user_vector); } /* TODO: Errorcheck that we can apply the request. That means: If it's a * DO request, check vector timestamps, if it's an undo or redo request, * then check can_undo/can_redo. This means this function needs to take a * GError**. */ if(inf_adopted_state_vector_causally_before(vector, priv->current) == FALSE) { priv->queue = g_list_prepend(priv->queue, request); g_object_ref(G_OBJECT(request)); } else { g_signal_emit( G_OBJECT(algorithm), algorithm_signals[EXECUTE_REQUEST], 0, user, request, TRUE ); /* process queued requests that might have become executable now. */ /* TODO: Do this in an idle handler, to stay responsive. */ do { for(item = priv->queue; item != NULL; item = g_list_next(item)) { queued_request = INF_ADOPTED_REQUEST(item->data); vector = inf_adopted_request_get_vector(queued_request); if(inf_adopted_state_vector_causally_before(vector, priv->current)) { user_id = inf_adopted_request_get_user_id(queued_request); user = inf_user_table_lookup_user_by_id(priv->user_table, user_id); g_assert(user != NULL); g_signal_emit( G_OBJECT(algorithm), algorithm_signals[EXECUTE_REQUEST], 0, user, queued_request, TRUE ); g_object_unref(G_OBJECT(queued_request)); priv->queue = g_list_delete_link(priv->queue, item); break; } } } while(item != NULL); } inf_adopted_algorithm_cleanup(algorithm); inf_adopted_algorithm_update_undo_redo(algorithm); } /** * inf_adopted_algorithm_can_undo: * @algorithm: A #InfAdoptedAlgorithm. * @user: A local #InfAdoptedUser. * * Returns whether @user can issue an undo request in the current state. Note * that if @user is non-local, then the result of this function does not * depend on the current state but on the state that we know @user is * guaranteed to have reached. This is because @user might still issue an * Undo request even if the max-total-log-size is already exceeded if @user * does not know yet that it is exceeded. * * Return Value: %TRUE if Undo is possible, %FALSE otherwise. **/ gboolean inf_adopted_algorithm_can_undo(InfAdoptedAlgorithm* algorithm, InfAdoptedUser* user) { InfAdoptedAlgorithmLocalUser* local; InfAdoptedRequestLog* log; g_return_val_if_fail(INF_ADOPTED_IS_ALGORITHM(algorithm), FALSE); g_return_val_if_fail(INF_ADOPTED_IS_USER(user), FALSE); local = inf_adopted_algorithm_find_local_user(algorithm, user); if(local != NULL) { return local->can_undo; } else { log = inf_adopted_user_get_request_log(user); return inf_adopted_algorithm_can_undo_redo( algorithm, user, inf_adopted_request_log_next_undo(log) ); } } /** * inf_adopted_algorithm_can_redo: * @algorithm: A #InfAdoptedAlgorithm. * @user: A local #InfAdoptedUser. * * Returns whether @user can issue a redo request in the current state. Note * that if @user is non-local, then the result of this function does not * depend on the current state but on the state that we know @user is * guaranteed to have reached. This is because @user might still issue a * Redo request even if the max-total-log-size is already exceeded if @user * does not know yet that it is exceeded. * * Return Value: %TRUE if Redo is possible, %FALSE otherwise. **/ gboolean inf_adopted_algorithm_can_redo(InfAdoptedAlgorithm* algorithm, InfAdoptedUser* user) { InfAdoptedAlgorithmLocalUser* local; InfAdoptedRequestLog* log; g_return_val_if_fail(INF_ADOPTED_IS_ALGORITHM(algorithm), FALSE); g_return_val_if_fail(INF_ADOPTED_IS_USER(user), FALSE); local = inf_adopted_algorithm_find_local_user(algorithm, user); if(local != NULL) { return local->can_redo; } else { log = inf_adopted_user_get_request_log(user); return inf_adopted_algorithm_can_undo_redo( algorithm, user, inf_adopted_request_log_next_redo(log) ); } } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/adopted/inf-adopted-concurrency-warning.c0000644000175000017500000000327012264763732023271 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include /* This function is only used internally. Please don't wrap it for language * bindings. */ void _inf_adopted_concurrency_warning(GType for_type) { g_warning( _("%s was called for %s. This means that you hit an unforseen " "situation in libinfinity. The session could become inconsistent " "because of this. If you were using Gobby, please notify me (Armin " "Burgmeier, armin@arbur.net) about this, and attach the contents of " "the ~/.infinote-records folder, or just the record of the session " "that triggered this error if you know which one. I hope I can fix " "this problem with that information in future versions."), "get_concurrency_id", g_type_name(for_type) ); } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/adopted/inf-adopted-no-operation.c0000644000175000017500000001343312264763732021710 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include /** * SECTION:inf-adopted-no-operation * @title: InfAdoptedNoOperation * @short_description: An operation not doing anything. * @include: libinfinity/adopted/inf-adopted-no-operation.h * @stability: Unstable * @see_also: #InfAdoptedOperation * * #InfAdoptedNoOperation is an operation that does nothing when applied to * the buffer. This might be the result of an operation transformation, for * example if a request is received that is supposed to delete text that was * already deleted by the local site. It is also used by #InfAdoptedSession to * send the current state to other users in case the user being idle, so that * others keep knowing the current state of that user (this is especially * required for cleanup of request logs and caches). **/ static GObjectClass* parent_class; static void inf_adopted_no_operation_class_init(gpointer g_class, gpointer class_data) { parent_class = G_OBJECT_CLASS(g_type_class_peek_parent(g_class)); } static gboolean inf_adopted_no_operation_need_concurrency_id(InfAdoptedOperation* operation, InfAdoptedOperation* against) { return FALSE; } static InfAdoptedConcurrencyId inf_adopted_no_operation_get_concurrency_id(InfAdoptedOperation* operation, InfAdoptedOperation* against) { _inf_adopted_concurrency_warning(INF_ADOPTED_TYPE_NO_OPERATION); return INF_ADOPTED_CONCURRENCY_NONE; } static InfAdoptedOperation* inf_adopted_no_operation_transform(InfAdoptedOperation* operation, InfAdoptedOperation* against, gint concurrency_id) { return INF_ADOPTED_OPERATION(inf_adopted_no_operation_new()); } static InfAdoptedOperation* inf_adopted_no_operation_copy(InfAdoptedOperation* operation) { return INF_ADOPTED_OPERATION(inf_adopted_no_operation_new()); } static InfAdoptedOperationFlags inf_adopted_no_operation_get_flags(InfAdoptedOperation* operation) { return INF_ADOPTED_OPERATION_REVERSIBLE; } static void inf_adopted_no_operation_apply(InfAdoptedOperation* operation, InfAdoptedUser* by, InfBuffer* buffer) { /* Does nothing */ } static InfAdoptedOperation* inf_adopted_no_operation_revert(InfAdoptedOperation* operation) { return INF_ADOPTED_OPERATION(inf_adopted_no_operation_new()); } static void inf_adopted_no_operation_operation_init(gpointer g_iface, gpointer iface_data) { InfAdoptedOperationIface* iface; iface = (InfAdoptedOperationIface*)g_iface; iface->need_concurrency_id = inf_adopted_no_operation_need_concurrency_id; iface->get_concurrency_id = inf_adopted_no_operation_get_concurrency_id; iface->transform = inf_adopted_no_operation_transform; iface->copy = inf_adopted_no_operation_copy; iface->get_flags = inf_adopted_no_operation_get_flags; iface->apply = inf_adopted_no_operation_apply; iface->revert = inf_adopted_no_operation_revert; /* should never be called because no_operation is always reversible */ iface->make_reversible = NULL; } GType inf_adopted_no_operation_get_type(void) { static GType no_operation_type = 0; if(!no_operation_type) { static const GTypeInfo no_operation_type_info = { sizeof(InfAdoptedNoOperationClass), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ inf_adopted_no_operation_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InfAdoptedNoOperation), /* instance_size */ 0, /* n_preallocs */ NULL, /* instance_init */ NULL /* value_table */ }; static const GInterfaceInfo operation_info = { inf_adopted_no_operation_operation_init, NULL, NULL }; no_operation_type = g_type_register_static( G_TYPE_OBJECT, "InfAdoptedNoOperation", &no_operation_type_info, 0 ); g_type_add_interface_static( no_operation_type, INF_ADOPTED_TYPE_OPERATION, &operation_info ); } return no_operation_type; } /** * inf_adopted_no_operation_new: * * Creates a new #InfAdoptedNoOperation. A no operation is an operation * that does nothing, but might be the result of a transformation. * * Return Value: A new #InfAdoptedNoOperation. **/ InfAdoptedNoOperation* inf_adopted_no_operation_new(void) { GObject* object; object = g_object_new(INF_ADOPTED_TYPE_NO_OPERATION, NULL); return INF_ADOPTED_NO_OPERATION(object); } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/adopted/inf-adopted-session.h0000644000175000017500000001360412264763732020766 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_ADOPTED_SESSION_H__ #define __INF_ADOPTED_SESSION_H__ #include #include #include #include #include G_BEGIN_DECLS #define INF_ADOPTED_TYPE_SESSION (inf_adopted_session_get_type()) #define INF_ADOPTED_SESSION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INF_ADOPTED_TYPE_SESSION, InfAdoptedSession)) #define INF_ADOPTED_SESSION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INF_ADOPTED_TYPE_SESSION, InfAdoptedSessionClass)) #define INF_ADOPTED_IS_SESSION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INF_ADOPTED_TYPE_SESSION)) #define INF_ADOPTED_IS_SESSION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INF_ADOPTED_TYPE_SESSION)) #define INF_ADOPTED_SESSION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), INF_ADOPTED_TYPE_SESSION, InfAdoptedSessionClass)) typedef struct _InfAdoptedSession InfAdoptedSession; typedef struct _InfAdoptedSessionClass InfAdoptedSessionClass; /** * InfAdoptedSessionError: * @INF_ADOPTED_SESSION_ERROR_NO_SUCH_USER: The "user" field in a request * message does not contain a valid user ID. * @INF_ADOPTED_SESSION_ERROR_MISSING_OPERATION: A request message does not * contain an operation. * @INF_ADOPTED_SESSION_ERROR_INVALID_REQUEST: A request in a synchronized * request log is invalid. Invalid means that it is not the request that * was issued after the previous request in the log, or that it is an Undo * or Redo request without a request to Undo or Redo, respectively. * @INF_ADOPTED_SESSION_ERROR_MISSING_STATE_VECTOR: A synchronized user does * not contain that the state that user currently is in. * @INF_ADOPTED_SESSION_ERROR_FAILED: No further specified error code. * * Error codes for #InfAdoptedSession. These only occur when invalid requests * are received from the network. */ typedef enum _InfAdoptedSessionError { INF_ADOPTED_SESSION_ERROR_NO_SUCH_USER, INF_ADOPTED_SESSION_ERROR_MISSING_OPERATION, INF_ADOPTED_SESSION_ERROR_INVALID_REQUEST, INF_ADOPTED_SESSION_ERROR_MISSING_STATE_VECTOR, INF_ADOPTED_SESSION_ERROR_FAILED } InfAdoptedSessionError; /** * InfAdoptedSessionClass: * @xml_to_request: Virtual function to deserialize an #InfAdoptedRequest * from XML. The implementation of this function can use * inf_adopted_session_read_request_info() to read the common info. * @request_to_xml: Virtual function to serialize an #InfAdoptedRequest * to XML. This function should add properties and children to the given XML * node. At might use inf_adopted_session_write_request_info() to write the * common info. * * Virtual functions for #InfAdoptedSession. */ struct _InfAdoptedSessionClass { /*< private >*/ InfSessionClass parent_class; /* Virtual table */ /*< public >*/ InfAdoptedRequest*(*xml_to_request)(InfAdoptedSession* session, xmlNodePtr xml, InfAdoptedStateVector* diff_vec, gboolean for_sync, GError** error); void(*request_to_xml)(InfAdoptedSession* session, xmlNodePtr xml, InfAdoptedRequest* request, InfAdoptedStateVector* diff_vec, gboolean for_sync); }; /** * InfAdoptedSession: * * #InfAdoptedSession is an opaque data type. You should only access it via * the public API functions. */ struct _InfAdoptedSession { /*< private >*/ InfSession parent; }; GType inf_adopted_session_get_type(void); InfIo* inf_adopted_session_get_io(InfAdoptedSession* session); InfAdoptedAlgorithm* inf_adopted_session_get_algorithm(InfAdoptedSession* session); void inf_adopted_session_broadcast_request(InfAdoptedSession* session, InfAdoptedRequest* request); void inf_adopted_session_undo(InfAdoptedSession* session, InfAdoptedUser* user, guint n); void inf_adopted_session_redo(InfAdoptedSession* session, InfAdoptedUser* user, guint n); gboolean inf_adopted_session_read_request_info(InfAdoptedSession* session, xmlNodePtr xml, InfAdoptedStateVector* diff_vec, InfAdoptedUser** user, InfAdoptedStateVector** time, xmlNodePtr* operation, GError** error); void inf_adopted_session_write_request_info(InfAdoptedSession* session, InfAdoptedRequest* request, InfAdoptedStateVector* diff_vec, xmlNodePtr xml, xmlNodePtr operation); G_END_DECLS #endif /* __INF_ADOPTED_SESSION_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/adopted/inf-adopted-request.c0000644000175000017500000006305512264763732020773 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include /** * SECTION:inf-adopted-request * @title: InfAdoptedRequest * @short_description: Request processed by #InfAdoptedAlgorithm. * @include: libinfinity/adopted/inf-adopted-request.h * @see_also: #InfAdoptedAlgorithm * @stability: Unstable * * An #InfAdoptedRequest is basically an #InfAdoptedOperation with some * metadata used by #InfAdoptedAlgorithm to determine which operations to * transform against each other. If the type of the request is * %INF_ADOPTED_REQUEST_DO, then it contains the operation to perform, * otherwise it does not because the request does not know the operation, it * is computed by #InfAdoptedAlgorithm when required. A #InfAdoptedRequest * also contains the state in which the operation can be applied to the * buffer and the user ID of the #InfAdoptedUser having generated the request. */ typedef struct _InfAdoptedRequestPrivate InfAdoptedRequestPrivate; struct _InfAdoptedRequestPrivate { InfAdoptedRequestType type; InfAdoptedStateVector* vector; guint user_id; InfAdoptedOperation* operation; }; enum { PROP_0, /* construct only */ PROP_TYPE, PROP_VECTOR, PROP_USER_ID, PROP_OPERATION }; #define INF_ADOPTED_REQUEST_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), INF_ADOPTED_TYPE_REQUEST, InfAdoptedRequestPrivate)) #define INF_ADOPTED_REQUEST_PRIVATE(obj) ((InfAdoptedRequestPrivate*)(obj)->priv) static GObjectClass* parent_class; static void inf_adopted_request_init(GTypeInstance* instance, gpointer g_class) { InfAdoptedRequest* request; InfAdoptedRequestPrivate* priv; request = INF_ADOPTED_REQUEST(instance); request->priv = INF_ADOPTED_REQUEST_GET_PRIVATE(request); priv = INF_ADOPTED_REQUEST_PRIVATE(request); priv->type = INF_ADOPTED_REQUEST_DO; priv->vector = NULL; priv->user_id = 0; priv->operation = NULL; } static void inf_adopted_request_dispose(GObject* object) { InfAdoptedRequest* request; InfAdoptedRequestPrivate* priv; request = INF_ADOPTED_REQUEST(object); priv = INF_ADOPTED_REQUEST_PRIVATE(request); if(priv->operation != NULL) { g_object_unref(G_OBJECT(priv->operation)); priv->operation = NULL; } G_OBJECT_CLASS(parent_class)->dispose(object); } static void inf_adopted_request_finalize(GObject* object) { InfAdoptedRequest* request; InfAdoptedRequestPrivate* priv; request = INF_ADOPTED_REQUEST(object); priv = INF_ADOPTED_REQUEST_PRIVATE(request); if(priv->vector != NULL) inf_adopted_state_vector_free(priv->vector); G_OBJECT_CLASS(parent_class)->finalize(object); } static void inf_adopted_request_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec) { InfAdoptedRequest* request; InfAdoptedRequestPrivate* priv; request = INF_ADOPTED_REQUEST(object); priv = INF_ADOPTED_REQUEST_PRIVATE(request); switch(prop_id) { case PROP_TYPE: priv->type = g_value_get_enum(value); break; case PROP_VECTOR: g_assert(priv->vector == NULL); /* construct only */ priv->vector = g_value_dup_boxed(value); break; case PROP_USER_ID: g_assert(priv->user_id == 0); /* construct only */ g_assert(g_value_get_uint(value) != 0); /* 0 is invalid ID */ priv->user_id = g_value_get_uint(value); break; case PROP_OPERATION: g_assert(priv->operation == NULL); /* construct only */ priv->operation = INF_ADOPTED_OPERATION(g_value_dup_object(value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void inf_adopted_request_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec) { InfAdoptedRequest* request; InfAdoptedRequestPrivate* priv; request = INF_ADOPTED_REQUEST(object); priv = INF_ADOPTED_REQUEST_PRIVATE(request); switch(prop_id) { case PROP_TYPE: g_value_set_enum(value, priv->type); break; case PROP_VECTOR: g_value_set_boxed(value, priv->vector); break; case PROP_USER_ID: g_value_set_uint(value, priv->user_id); break; case PROP_OPERATION: g_value_set_object(value, G_OBJECT(priv->operation)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void inf_adopted_request_class_init(gpointer g_class, gpointer class_data) { GObjectClass* object_class; object_class = G_OBJECT_CLASS(g_class); parent_class = G_OBJECT_CLASS(g_type_class_peek_parent(g_class)); g_type_class_add_private(g_class, sizeof(InfAdoptedRequestPrivate)); object_class->dispose = inf_adopted_request_dispose; object_class->finalize = inf_adopted_request_finalize; object_class->set_property = inf_adopted_request_set_property; object_class->get_property = inf_adopted_request_get_property; g_object_class_install_property( object_class, PROP_TYPE, g_param_spec_enum( "type", "Type", "The type of the operation", INF_ADOPTED_TYPE_REQUEST_TYPE, INF_ADOPTED_REQUEST_DO, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); g_object_class_install_property( object_class, PROP_VECTOR, g_param_spec_boxed( "vector", "Vector", "The vector time at which the request was made", INF_ADOPTED_TYPE_STATE_VECTOR, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); g_object_class_install_property( object_class, PROP_USER_ID, g_param_spec_uint( "user-id", "User ID", "The ID of the user that made the request", 0, G_MAXUINT, 0, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); g_object_class_install_property( object_class, PROP_OPERATION, g_param_spec_object( "operation", "Operation", "The operation of the request", INF_ADOPTED_TYPE_OPERATION, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); } GType inf_adopted_request_type_get_type(void) { static GType request_type_type = 0; if(!request_type_type) { static const GEnumValue request_type_type_values[] = { { INF_ADOPTED_REQUEST_DO, "INF_ADOPTED_REQUEST_DO", "do", }, { INF_ADOPTED_REQUEST_UNDO, "INF_ADOPTED_REQUEST_UNDO", "undo", }, { INF_ADOPTED_REQUEST_REDO, "INF_ADOPTED_REQUEST_REDO", "redo" }, { 0, NULL, NULL } }; request_type_type = g_enum_register_static( "InfAdoptedRequestType", request_type_type_values ); } return request_type_type; } GType inf_adopted_request_get_type(void) { static GType request_type = 0; if(!request_type) { static const GTypeInfo request_type_info = { sizeof(InfAdoptedRequestClass), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ inf_adopted_request_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InfAdoptedRequest), /* instance_size */ 0, /* n_preallocs */ inf_adopted_request_init, /* instance_init */ NULL /* value_table */ }; request_type = g_type_register_static( G_TYPE_OBJECT, "InfAdoptedRequest", &request_type_info, 0 ); } return request_type; } /** * inf_adopted_request_new_do: * @vector: The vector time at which the request was made. * @user_id: The ID of the user that made the request. * @operation: The operation the user performed. * * Creates a new #InfAdoptedRequest with type %INF_ADOPTED_REQUEST_DO. * * Return Value: A new DO request. **/ InfAdoptedRequest* inf_adopted_request_new_do(InfAdoptedStateVector* vector, guint user_id, InfAdoptedOperation* operation) { GObject* object; g_return_val_if_fail(vector != NULL, NULL); g_return_val_if_fail(user_id != 0, NULL); g_return_val_if_fail(INF_ADOPTED_IS_OPERATION(operation), NULL); object = g_object_new( INF_ADOPTED_TYPE_REQUEST, "type", INF_ADOPTED_REQUEST_DO, "vector", vector, "user-id", user_id, "operation", operation, NULL ); return INF_ADOPTED_REQUEST(object); } /** * inf_adopted_request_new_undo: * @vector: The vector time at which the request was made. * @user_id: The ID of the user that made the request. * * Creates a new #InfAdoptedRequest with type %INF_ADOPTED_REQUEST_UNDO. * The operation performed is implicitely defined by reverting the operation * of the associated DO or REDO request, but must still be computed by * #InfAdoptedAlgorithm. * * Return Value: A new UNDO request. **/ InfAdoptedRequest* inf_adopted_request_new_undo(InfAdoptedStateVector* vector, guint user_id) { GObject* object; g_return_val_if_fail(vector != NULL, NULL); g_return_val_if_fail(user_id != 0, NULL); object = g_object_new( INF_ADOPTED_TYPE_REQUEST, "type", INF_ADOPTED_REQUEST_UNDO, "vector", vector, "user-id", user_id, NULL ); return INF_ADOPTED_REQUEST(object); } /** * inf_adopted_request_new_redo: * @vector: The vector time at which the request was made. * @user_id: The ID of the user that made the request. * * Creates a new #InfAdoptedRequest with type %INF_ADOPTED_REQUEST_REDO. The * operation performed is implicitely defined by reverting the operation of * the associated UNDO request, but must still be computed by * #InfAdoptedAlgorithm. * * Return Value: A new REDO request. **/ InfAdoptedRequest* inf_adopted_request_new_redo(InfAdoptedStateVector* vector, guint user_id) { GObject* object; g_return_val_if_fail(vector != NULL, NULL); g_return_val_if_fail(user_id != 0, NULL); object = g_object_new( INF_ADOPTED_TYPE_REQUEST, "type", INF_ADOPTED_REQUEST_REDO, "vector", vector, "user-id", user_id, NULL ); return INF_ADOPTED_REQUEST(object); } /** * inf_adopted_request_copy: * @request: The #InfAdoptedRequest to copy. * * Creates a copy of @request with an initial reference count of 1. * * Return Value: A new #InfAdoptedRequest. **/ InfAdoptedRequest* inf_adopted_request_copy(InfAdoptedRequest* request) { InfAdoptedRequestPrivate* priv; GObject* object; g_return_val_if_fail(INF_ADOPTED_IS_REQUEST(request), NULL); priv = INF_ADOPTED_REQUEST_PRIVATE(request); if(priv->type == INF_ADOPTED_REQUEST_DO) { object = g_object_new( INF_ADOPTED_TYPE_REQUEST, "type", priv->type, "vector", priv->vector, "user-id", priv->user_id, "operation", priv->operation, NULL ); } else { object = g_object_new( INF_ADOPTED_TYPE_REQUEST, "type", priv->type, "vector", priv->vector, "user-id", priv->user_id, NULL ); } return INF_ADOPTED_REQUEST(object); } /** * inf_adopted_request_get_request_type: * @request: A #InfAdoptedRequest. * * Returns the request type of @request. * * Return Value: The type of @request. **/ InfAdoptedRequestType inf_adopted_request_get_request_type(InfAdoptedRequest* request) { g_return_val_if_fail( INF_ADOPTED_IS_REQUEST(request), INF_ADOPTED_REQUEST_DO ); return INF_ADOPTED_REQUEST_PRIVATE(request)->type; } /** * inf_adopted_request_get_vector: * @request: A #InfAdoptedRequest. * * Returns the vector time the request was made i.e. its operation can be * applied to the buffer. * * Return Value: The state vector of @request. The returned value should * not be freed, it is owned by the #InfAdoptedRequest. **/ InfAdoptedStateVector* inf_adopted_request_get_vector(InfAdoptedRequest* request) { g_return_val_if_fail(INF_ADOPTED_IS_REQUEST(request), NULL); return INF_ADOPTED_REQUEST_PRIVATE(request)->vector; } /** * inf_adopted_request_get_user_id: * @request: A #InfAdoptedRequest. * * Returns the user ID of the user that issued @request. * * Return Value: The request's user ID. **/ guint inf_adopted_request_get_user_id(InfAdoptedRequest* request) { g_return_val_if_fail(INF_ADOPTED_IS_REQUEST(request), 0); return INF_ADOPTED_REQUEST_PRIVATE(request)->user_id; } /** * inf_adopted_request_get_operation: * @request: A #InfAdoptedRequest. * * Returns the operation carried by the request. This can only be called if * the request's type is %INF_ADOPTED_REQUEST_DO. * * Return Value: The request's operation. **/ InfAdoptedOperation* inf_adopted_request_get_operation(InfAdoptedRequest* request) { InfAdoptedRequestPrivate* priv; g_return_val_if_fail(INF_ADOPTED_IS_REQUEST(request), NULL); priv = INF_ADOPTED_REQUEST_PRIVATE(request); g_return_val_if_fail(priv->operation != NULL, NULL); return priv->operation; } /** * inf_adopted_request_get_index: * @request: A #InfAdoptedRequest. * * Returns the vector time component of the request's own users. This * corresponds to the request index by that user. * * Returns: The vector time component of the request's own user. */ guint inf_adopted_request_get_index(InfAdoptedRequest* request) { InfAdoptedRequestPrivate* priv; g_return_val_if_fail(INF_ADOPTED_IS_REQUEST(request), NULL); priv = INF_ADOPTED_REQUEST_PRIVATE(request); return inf_adopted_state_vector_get(priv->vector, priv->user_id); } /** * inf_adopted_request_need_concurrency_id: * @request: The request to transform. * @against: The request to transform against. * * Returns whether transforming @request against @against requires a * concurrency ID. You can still call inf_adopted_request_transform() with * a concurrency ID of %INF_ADOPTED_CONCURRENCY_NONE even if this function * returns %TRUE if you don't have another possibility to find a * concurrency ID in which case user IDs are used to determine which request * to transform. * * Both request need to be of type %INF_ADOPTED_REQUEST_DO, and their state * vectors must be the same. * * Returns: Whether transformation of @request against @against requires a * concurrency ID. */ gboolean inf_adopted_request_need_concurrency_id(InfAdoptedRequest* request, InfAdoptedRequest* against) { InfAdoptedRequestPrivate* request_priv; InfAdoptedRequestPrivate* against_priv; g_return_val_if_fail(INF_ADOPTED_IS_REQUEST(request), FALSE); g_return_val_if_fail(INF_ADOPTED_IS_REQUEST(against), FALSE); request_priv = INF_ADOPTED_REQUEST_PRIVATE(request); against_priv = INF_ADOPTED_REQUEST_PRIVATE(against); g_return_val_if_fail(request_priv->type == INF_ADOPTED_REQUEST_DO, FALSE); g_return_val_if_fail(against_priv->type == INF_ADOPTED_REQUEST_DO, FALSE); g_return_val_if_fail(request_priv->user_id != against_priv->user_id, FALSE); g_return_val_if_fail( inf_adopted_state_vector_compare( request_priv->vector, against_priv->vector ) == 0, FALSE ); return inf_adopted_operation_need_concurrency_id( request_priv->operation, against_priv->operation ); } /** * inf_adopted_request_get_concurrency_id: * @request: The request to transform. * @against: The request to transform against. * * Returns a concurrency ID for transformation of @operation against @against. * It always returns %INF_ADOPTED_CONCURRENCY_NONE when * inf_adopted_request_need_concurrency_id() returns %TRUE (but that's not * necessarily true the other way around), since it is not possible to decide * which operation to transform without any additional information. * * However, the function can be called on the same requests in a previous * state. In some cases, a decision can be made based on these previous * requests. This can be used as a concurrency ID for a call to * inf_adopted_request_transform(). If this does not yield a decision, it is * still possible to call inf_adopted_request_transform() with * %INF_ADOPTED_CONCURRENCY_NONE as concurrency ID in which case an arbitrary * request will be transformed, based on the user IDs of the requests. * * Both requests must be of type %INF_ADOPTED_REQUEST_DO, and their state * vectors must be the same. * * Returns: A concurrency ID between @operation and @against. Can be * %INF_ADOPTED_CONCURRENCY_NONE in case no decision can be made. */ InfAdoptedConcurrencyId inf_adopted_request_get_concurrency_id(InfAdoptedRequest* request, InfAdoptedRequest* against) { InfAdoptedRequestPrivate* request_priv; InfAdoptedRequestPrivate* against_priv; g_return_val_if_fail( INF_ADOPTED_IS_REQUEST(request), INF_ADOPTED_CONCURRENCY_NONE ); g_return_val_if_fail( INF_ADOPTED_IS_REQUEST(against), INF_ADOPTED_CONCURRENCY_NONE ); request_priv = INF_ADOPTED_REQUEST_PRIVATE(request); against_priv = INF_ADOPTED_REQUEST_PRIVATE(against); g_return_val_if_fail( request_priv->type == INF_ADOPTED_REQUEST_DO, INF_ADOPTED_CONCURRENCY_NONE ); g_return_val_if_fail( against_priv->type == INF_ADOPTED_REQUEST_DO, INF_ADOPTED_CONCURRENCY_NONE ); g_return_val_if_fail( request_priv->user_id != against_priv->user_id, INF_ADOPTED_CONCURRENCY_NONE ); g_return_val_if_fail( inf_adopted_state_vector_compare( request_priv->vector, against_priv->vector ) == 0, INF_ADOPTED_CONCURRENCY_NONE ); return inf_adopted_operation_get_concurrency_id( request_priv->operation, against_priv->operation ); } /** * inf_adopted_request_transform: * @request: The request to transform. * @against: The request to transform against. * @concurrency_id: A concurrency ID for the transformation. * * Transforms the operation of @request against the operation of @against. * Both requests must be of type %INF_ADOPTED_REQUEST_DO, and their state * vectors must be the same. * * @concurrency_id can be %INF_ADOPTED_CONCURRENCY_NONE even if the * transformation requires a concurrency ID (see * inf_adopted_request_need_concurrency_id()). In that case, it is assumed * that it does not matter which operation to transform, and user IDs are * used to determine a concurrency ID for the transformation. * * Returns: A new #InfAdoptedRequest, the result of the transformation. **/ InfAdoptedRequest* inf_adopted_request_transform(InfAdoptedRequest* request, InfAdoptedRequest* against, InfAdoptedConcurrencyId concurrency_id) { InfAdoptedRequestPrivate* request_priv; InfAdoptedRequestPrivate* against_priv; InfAdoptedOperation* new_operation; InfAdoptedStateVector* new_vector; InfAdoptedRequest* new_request; g_return_val_if_fail(INF_ADOPTED_IS_REQUEST(request), NULL); g_return_val_if_fail(INF_ADOPTED_IS_REQUEST(against), NULL); request_priv = INF_ADOPTED_REQUEST_PRIVATE(request); against_priv = INF_ADOPTED_REQUEST_PRIVATE(against); g_return_val_if_fail(request_priv->type == INF_ADOPTED_REQUEST_DO, NULL); g_return_val_if_fail(against_priv->type == INF_ADOPTED_REQUEST_DO, NULL); g_return_val_if_fail(request_priv->user_id != against_priv->user_id, NULL); g_return_val_if_fail( inf_adopted_state_vector_compare( request_priv->vector, against_priv->vector ) == 0, NULL ); if(concurrency_id != INF_ADOPTED_CONCURRENCY_NONE) { new_operation = inf_adopted_operation_transform( request_priv->operation, against_priv->operation, concurrency_id ); } else if(request_priv->user_id > against_priv->user_id) { new_operation = inf_adopted_operation_transform( request_priv->operation, against_priv->operation, INF_ADOPTED_CONCURRENCY_OTHER ); } else { new_operation = inf_adopted_operation_transform( request_priv->operation, against_priv->operation, INF_ADOPTED_CONCURRENCY_SELF ); } new_vector = inf_adopted_state_vector_copy(request_priv->vector); inf_adopted_state_vector_add(new_vector, against_priv->user_id, 1); new_request = inf_adopted_request_new_do( new_vector, request_priv->user_id, new_operation ); g_object_unref(new_operation); inf_adopted_state_vector_free(new_vector); return new_request; } /** * inf_adopted_request_mirror: * @request: A #InfAdoptedRequest. * @by: The number of requests between the original and the mirrored * operation. * * Mirrors @request as described in "Reducing the Problems of Group Undo" by * Matthias Ressel and Rul Gunzenhäuser * (http://portal.acm.org/citation.cfm?doid=320297.320312). * * Note that @by is the total amount of requests between the original and * mirrored request, and thus equivalent to 2j-1 in the paper's definition. * * @request must be of type %INF_ADOPTED_REQUEST_DO and its operation must * be reversible. * * Returns: The mirrored request as a new #InfAdoptedRequest. **/ InfAdoptedRequest* inf_adopted_request_mirror(InfAdoptedRequest* request, guint by) { InfAdoptedRequestPrivate* priv; InfAdoptedOperation* new_operation; InfAdoptedStateVector* new_vector; InfAdoptedRequest* new_request; g_return_val_if_fail(INF_ADOPTED_IS_REQUEST(request), NULL); g_return_val_if_fail(by % 2 == 1, NULL); priv = INF_ADOPTED_REQUEST_PRIVATE(request); g_return_val_if_fail(priv->type == INF_ADOPTED_REQUEST_DO, NULL); g_return_val_if_fail( inf_adopted_operation_is_reversible(priv->operation), NULL ); new_operation = inf_adopted_operation_revert(priv->operation); new_vector = inf_adopted_state_vector_copy(priv->vector); inf_adopted_state_vector_add(new_vector, priv->user_id, by); new_request = inf_adopted_request_new_do( new_vector, priv->user_id, new_operation ); g_object_unref(new_operation); inf_adopted_state_vector_free(new_vector); return new_request; } /** * inf_adopted_request_fold: * @request: A #InfAdoptedRequest. * @into: The direction into which to fold. * @by: The number of operations between the original and the fold request. * * Folds @request as described in "Reducing the Problems of Group Undo" by * Matthias Ressel and Rul Gunzenhäuser * (http://portal.acm.org/citation.cfm?doid=320297.320312). * * Note that @by is the total amount of requests between the original and * the fold request, and thus equivalent to 2j in the paper's definition. * * @into must not be the same user as the one that issued @request. * * Returns: The folded request as a new #InfAdoptedRequest. **/ InfAdoptedRequest* inf_adopted_request_fold(InfAdoptedRequest* request, guint into, guint by) { InfAdoptedRequestPrivate* priv; InfAdoptedStateVector* new_vector; InfAdoptedRequest* new_request; g_return_val_if_fail(INF_ADOPTED_IS_REQUEST(request), NULL); g_return_val_if_fail(into != 0, NULL); g_return_val_if_fail(by % 2 == 0, NULL); priv = INF_ADOPTED_REQUEST_PRIVATE(request); g_return_val_if_fail(priv->user_id != into, NULL); new_vector = inf_adopted_state_vector_copy(priv->vector); inf_adopted_state_vector_add(new_vector, into, by); if(priv->type == INF_ADOPTED_REQUEST_DO) { new_request = INF_ADOPTED_REQUEST( g_object_new( INF_ADOPTED_TYPE_REQUEST, "type", priv->type, "operation", priv->operation, "vector", new_vector, "user-id", priv->user_id, NULL ) ); } else { new_request = INF_ADOPTED_REQUEST( g_object_new( INF_ADOPTED_TYPE_REQUEST, "type", priv->type, "vector", new_vector, "user-id", priv->user_id, NULL ) ); } inf_adopted_state_vector_free(new_vector); return new_request; } /** * inf_adopted_request_affects_buffer: * @request: A #InfAdoptedRequest. * * Returns whether this request, when applied, changes the content of the * buffer. If this is a %INF_ADOPTED_REQUEST_UNDO or %INF_ADOPTED_REQUEST_REDO * request, than it always affects the buffer, because only requests that * affect the buffer can be undone or redone. If it is a * %INF_ADOPTED_REQUEST_DO request, than it returns whether its operation * has the %INF_ADOPTED_OPERATION_AFFECTS_BUFFER flag set. * * Returns: Whether @request affects the session's buffer. **/ gboolean inf_adopted_request_affects_buffer(InfAdoptedRequest* request) { InfAdoptedRequestPrivate* priv; g_return_val_if_fail(INF_ADOPTED_IS_REQUEST(request), FALSE); priv = INF_ADOPTED_REQUEST_PRIVATE(request); switch(priv->type) { case INF_ADOPTED_REQUEST_DO: if(inf_adopted_operation_get_flags(priv->operation) & INF_ADOPTED_OPERATION_AFFECTS_BUFFER) { return TRUE; } else { return FALSE; } case INF_ADOPTED_REQUEST_UNDO: case INF_ADOPTED_REQUEST_REDO: return TRUE; default: g_assert_not_reached(); return FALSE; } } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/inf-marshal.c0000644000175000017500000006453312264764552015677 00000000000000#include #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_schar (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) #define g_marshal_value_peek_variant(v) g_value_get_variant (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 #define g_marshal_value_peek_variant(v) (v)->data[0].v_pointer #endif /* !G_ENABLE_DEBUG */ /* VOID:VOID (inf-marshal.in:1) */ /* VOID:BOXED (inf-marshal.in:2) */ /* VOID:BOXED,DOUBLE,DOUBLE (inf-marshal.in:3) */ void inf_marshal_VOID__BOXED_DOUBLE_DOUBLE (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_DOUBLE_DOUBLE) (gpointer data1, gpointer arg_1, gdouble arg_2, gdouble arg_3, gpointer data2); register GMarshalFunc_VOID__BOXED_DOUBLE_DOUBLE callback; register GCClosure *cc = (GCClosure*) closure; register gpointer data1, data2; 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_VOID__BOXED_DOUBLE_DOUBLE*) (marshal_data ? &marshal_data : &cc->callback); callback (data1, g_marshal_value_peek_boxed (param_values + 1), g_marshal_value_peek_double (param_values + 2), g_marshal_value_peek_double (param_values + 3), data2); } /* VOID:OBJECT (inf-marshal.in:4) */ /* VOID:POINTER (inf-marshal.in:5) */ /* VOID:OBJECT,DOUBLE (inf-marshal.in:6) */ void inf_marshal_VOID__OBJECT_DOUBLE (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__OBJECT_DOUBLE) (gpointer data1, gpointer arg_1, gdouble arg_2, gpointer data2); register GMarshalFunc_VOID__OBJECT_DOUBLE 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__OBJECT_DOUBLE*) (marshal_data ? &marshal_data : &cc->callback); callback (data1, g_marshal_value_peek_object (param_values + 1), g_marshal_value_peek_double (param_values + 2), data2); } /* VOID:OBJECT,POINTER (inf-marshal.in:7) */ void inf_marshal_VOID__OBJECT_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 void (*GMarshalFunc_VOID__OBJECT_POINTER) (gpointer data1, gpointer arg_1, gpointer arg_2, gpointer data2); register GMarshalFunc_VOID__OBJECT_POINTER 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__OBJECT_POINTER*) (marshal_data ? &marshal_data : &cc->callback); callback (data1, g_marshal_value_peek_object (param_values + 1), g_marshal_value_peek_pointer (param_values + 2), data2); } /* VOID:POINTER,UINT (inf-marshal.in:8) */ void inf_marshal_VOID__POINTER_UINT (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__POINTER_UINT) (gpointer data1, gpointer arg_1, guint arg_2, gpointer data2); register GMarshalFunc_VOID__POINTER_UINT 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__POINTER_UINT*) (marshal_data ? &marshal_data : &cc->callback); callback (data1, g_marshal_value_peek_pointer (param_values + 1), g_marshal_value_peek_uint (param_values + 2), data2); } /* VOID:UINT (inf-marshal.in:9) */ /* VOID:UINT,UINT (inf-marshal.in:10) */ void inf_marshal_VOID__UINT_UINT (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__UINT_UINT) (gpointer data1, guint arg_1, guint arg_2, gpointer data2); register GMarshalFunc_VOID__UINT_UINT 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__UINT_UINT*) (marshal_data ? &marshal_data : &cc->callback); callback (data1, g_marshal_value_peek_uint (param_values + 1), g_marshal_value_peek_uint (param_values + 2), data2); } /* VOID:OBJECT,BOOLEAN (inf-marshal.in:11) */ void inf_marshal_VOID__OBJECT_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__OBJECT_BOOLEAN) (gpointer data1, gpointer arg_1, gboolean arg_2, gpointer data2); register GMarshalFunc_VOID__OBJECT_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__OBJECT_BOOLEAN*) (marshal_data ? &marshal_data : &cc->callback); callback (data1, g_marshal_value_peek_object (param_values + 1), g_marshal_value_peek_boolean (param_values + 2), data2); } /* VOID:UINT,BOXED,OBJECT (inf-marshal.in:12) */ void inf_marshal_VOID__UINT_BOXED_OBJECT (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__UINT_BOXED_OBJECT) (gpointer data1, guint arg_1, gpointer arg_2, gpointer arg_3, gpointer data2); register GMarshalFunc_VOID__UINT_BOXED_OBJECT callback; register GCClosure *cc = (GCClosure*) closure; register gpointer data1, data2; 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_VOID__UINT_BOXED_OBJECT*) (marshal_data ? &marshal_data : &cc->callback); callback (data1, g_marshal_value_peek_uint (param_values + 1), g_marshal_value_peek_boxed (param_values + 2), g_marshal_value_peek_object (param_values + 3), data2); } /* VOID:UINT,INT,BOOLEAN (inf-marshal.in:13) */ void inf_marshal_VOID__UINT_INT_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__UINT_INT_BOOLEAN) (gpointer data1, guint arg_1, gint arg_2, gboolean arg_3, gpointer data2); register GMarshalFunc_VOID__UINT_INT_BOOLEAN callback; register GCClosure *cc = (GCClosure*) closure; register gpointer data1, data2; 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_VOID__UINT_INT_BOOLEAN*) (marshal_data ? &marshal_data : &cc->callback); callback (data1, g_marshal_value_peek_uint (param_values + 1), g_marshal_value_peek_int (param_values + 2), g_marshal_value_peek_boolean (param_values + 3), data2); } /* VOID:OBJECT,OBJECT (inf-marshal.in:14) */ void inf_marshal_VOID__OBJECT_OBJECT (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__OBJECT_OBJECT) (gpointer data1, gpointer arg_1, gpointer arg_2, gpointer data2); register GMarshalFunc_VOID__OBJECT_OBJECT 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__OBJECT_OBJECT*) (marshal_data ? &marshal_data : &cc->callback); callback (data1, g_marshal_value_peek_object (param_values + 1), g_marshal_value_peek_object (param_values + 2), data2); } /* VOID:BOXED,OBJECT (inf-marshal.in:15) */ void inf_marshal_VOID__BOXED_OBJECT (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_OBJECT) (gpointer data1, gpointer arg_1, gpointer arg_2, gpointer data2); register GMarshalFunc_VOID__BOXED_OBJECT 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_OBJECT*) (marshal_data ? &marshal_data : &cc->callback); callback (data1, g_marshal_value_peek_boxed (param_values + 1), g_marshal_value_peek_object (param_values + 2), data2); } /* VOID:BOXED,BOXED,OBJECT (inf-marshal.in:16) */ void inf_marshal_VOID__BOXED_BOXED_OBJECT (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_BOXED_OBJECT) (gpointer data1, gpointer arg_1, gpointer arg_2, gpointer arg_3, gpointer data2); register GMarshalFunc_VOID__BOXED_BOXED_OBJECT callback; register GCClosure *cc = (GCClosure*) closure; register gpointer data1, data2; 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_VOID__BOXED_BOXED_OBJECT*) (marshal_data ? &marshal_data : &cc->callback); callback (data1, g_marshal_value_peek_boxed (param_values + 1), g_marshal_value_peek_boxed (param_values + 2), g_marshal_value_peek_object (param_values + 3), data2); } /* VOID:OBJECT,OBJECT,BOOLEAN (inf-marshal.in:17) */ void inf_marshal_VOID__OBJECT_OBJECT_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__OBJECT_OBJECT_BOOLEAN) (gpointer data1, gpointer arg_1, gpointer arg_2, gboolean arg_3, gpointer data2); register GMarshalFunc_VOID__OBJECT_OBJECT_BOOLEAN callback; register GCClosure *cc = (GCClosure*) closure; register gpointer data1, data2; 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_VOID__OBJECT_OBJECT_BOOLEAN*) (marshal_data ? &marshal_data : &cc->callback); callback (data1, g_marshal_value_peek_object (param_values + 1), g_marshal_value_peek_object (param_values + 2), g_marshal_value_peek_boolean (param_values + 3), data2); } /* VOID:DOUBLE (inf-marshal.in:18) */ /* VOID:ENUM (inf-marshal.in:19) */ /* BOOLEAN:OBJECT,OBJECT (inf-marshal.in:20) */ void inf_marshal_BOOLEAN__OBJECT_OBJECT (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__OBJECT_OBJECT) (gpointer data1, gpointer arg_1, gpointer arg_2, gpointer data2); register GMarshalFunc_BOOLEAN__OBJECT_OBJECT 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__OBJECT_OBJECT*) (marshal_data ? &marshal_data : &cc->callback); v_return = callback (data1, g_marshal_value_peek_object (param_values + 1), g_marshal_value_peek_object (param_values + 2), data2); g_value_set_boolean (return_value, v_return); } /* VOID:OBJECT,UINT (inf-marshal.in:21) */ void inf_marshal_VOID__OBJECT_UINT (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__OBJECT_UINT) (gpointer data1, gpointer arg_1, guint arg_2, gpointer data2); register GMarshalFunc_VOID__OBJECT_UINT 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__OBJECT_UINT*) (marshal_data ? &marshal_data : &cc->callback); callback (data1, g_marshal_value_peek_object (param_values + 1), g_marshal_value_peek_uint (param_values + 2), data2); } /* POINTER:POINTER (inf-marshal.in:22) */ void inf_marshal_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 gpointer (*GMarshalFunc_POINTER__POINTER) (gpointer data1, gpointer arg_1, gpointer data2); register GMarshalFunc_POINTER__POINTER callback; register GCClosure *cc = (GCClosure*) closure; register gpointer data1, data2; gpointer 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_POINTER__POINTER*) (marshal_data ? &marshal_data : &cc->callback); v_return = callback (data1, g_marshal_value_peek_pointer (param_values + 1), data2); g_value_set_pointer (return_value, v_return); } /* POINTER:OBJECT,POINTER (inf-marshal.in:23) */ void inf_marshal_POINTER__OBJECT_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 gpointer (*GMarshalFunc_POINTER__OBJECT_POINTER) (gpointer data1, gpointer arg_1, gpointer arg_2, gpointer data2); register GMarshalFunc_POINTER__OBJECT_POINTER callback; register GCClosure *cc = (GCClosure*) closure; register gpointer data1, data2; gpointer 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_POINTER__OBJECT_POINTER*) (marshal_data ? &marshal_data : &cc->callback); v_return = callback (data1, g_marshal_value_peek_object (param_values + 1), g_marshal_value_peek_pointer (param_values + 2), data2); g_value_set_pointer (return_value, v_return); } libinfinity-0.5.5/libinfinity/common/0000755000175000017500000000000012264766266014673 500000000000000libinfinity-0.5.5/libinfinity/common/inf-sasl-context.c0000644000175000017500000007530112264763732020156 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ /** * SECTION:inf-sasl-context * @title: InfSaslContext * @short_description: Asynchronous SASL processing * @include: libinfinity/common/inf-sasl-context.h * @stability: Unstable * * #InfSaslContext is a wrapper for the Gsasl library. It basically adds * functionality to provide properties asynchronously to Gsasl, so that for * example a dialog can be shown to the user before continuing with the * authentication process. With Gsasl, it is expected that the callback * function sets the requested property before returning, which makes it hard * to give control back to a main loop while waiting for user input. * * This wrapper makes sure the callback is called in another thread so that it * can block without affecting the rest of the program. * Use inf_sasl_context_session_feed() as a replacement for gsasl_step64(). * Instead of returning the result data directly, the function calls a * callback once all properties requested have been provided. * * All threading internals are hidden by the wrapper, so all callbacks are * issued in the user thread. However, it requires an #InfIo object to * dispatch messages to it. Also, all #InfSaslContext functions are fully * thread-safe. **/ #include #include #include #include typedef enum _InfSaslContextMessageType { /* main -> session */ INF_SASL_CONTEXT_MESSAGE_TERMINATE, INF_SASL_CONTEXT_MESSAGE_CONTINUE, INF_SASL_CONTEXT_MESSAGE_STEP, /* session -> main */ INF_SASL_CONTEXT_MESSAGE_QUERY, /* invoke callback to query a property */ INF_SASL_CONTEXT_MESSAGE_STEPPED /* step finished */ } InfSaslContextMessageType; typedef enum _InfSaslContextSessionStatus { INF_SASL_CONTEXT_SESSION_OUTER, INF_SASL_CONTEXT_SESSION_INNER, INF_SASL_CONTEXT_SESSION_TERMINATE, } InfSaslContextSessionStatus; struct _InfSaslContextSession { InfSaslContext* context; Gsasl_session* session; gpointer session_data; InfIo* main_io; InfStandaloneIo* session_io; /* query or stepped dispatch, protected by context mutex */ /* TODO: This is required because Inf(StandaloneIo) can not guarantee to * return before the dispatch is executed in another thread. We would not * need the mutex for this if InfIo would allow to set the * InfIoDispatch pointer before executing the dispatch. */ InfIoDispatch* dispatch; GThread* thread; /* used in session thread only */ gchar* step64; InfSaslContextSessionFeedFunc feed_func; gpointer feed_user_data; int retval; InfSaslContextSessionStatus status; }; typedef struct _InfSaslContextMessage InfSaslContextMessage; struct _InfSaslContextMessage { InfSaslContextSession* session; InfSaslContextMessageType type; union { struct { int retval; } cont; struct { gchar* data; InfSaslContextSessionFeedFunc func; gpointer user_data; } step; struct { Gsasl_property prop; } query; struct { gchar *data; int retval; InfSaslContextSessionFeedFunc func; gpointer user_data; } stepped; } shared; }; struct _InfSaslContext { Gsasl* gsasl; gint ref_count; GSList* sessions; InfSaslContextCallbackFunc callback; gpointer callback_user_data; /* protects the session list, the callback function and access to the * Gsasl object. */ GMutex* mutex; }; /* * Message handling */ static InfSaslContextMessage* inf_sasl_context_message_terminate(InfSaslContextSession* session) { InfSaslContextMessage* message; message = g_slice_new(InfSaslContextMessage); message->type = INF_SASL_CONTEXT_MESSAGE_TERMINATE; message->session = session; return message; } static InfSaslContextMessage* inf_sasl_context_message_continue(InfSaslContextSession* session, int retval) { InfSaslContextMessage* message; message = g_slice_new(InfSaslContextMessage); message->type = INF_SASL_CONTEXT_MESSAGE_CONTINUE; message->session = session; message->shared.cont.retval = retval; return message; } static InfSaslContextMessage* inf_sasl_context_message_step(InfSaslContextSession* session, const char* data, InfSaslContextSessionFeedFunc func, gpointer user_data) { InfSaslContextMessage* message; message = g_slice_new(InfSaslContextMessage); message->type = INF_SASL_CONTEXT_MESSAGE_STEP; message->session = session; message->shared.step.data = data ? g_strdup(data) : NULL; message->shared.step.func = func; message->shared.step.user_data = user_data; return message; } static InfSaslContextMessage* inf_sasl_context_message_query(InfSaslContextSession* session, Gsasl_property prop) { InfSaslContextMessage* message; message = g_slice_new(InfSaslContextMessage); message->type = INF_SASL_CONTEXT_MESSAGE_QUERY; message->session = session; message->shared.query.prop = prop; return message; } static InfSaslContextMessage* inf_sasl_context_message_stepped(InfSaslContextSession* session, char* data, int retval, InfSaslContextSessionFeedFunc func, gpointer user_data) { InfSaslContextMessage* message; message = g_slice_new(InfSaslContextMessage); message->type = INF_SASL_CONTEXT_MESSAGE_STEPPED; message->session = session; message->shared.stepped.data = data; message->shared.stepped.retval = retval; message->shared.stepped.func = func; message->shared.stepped.user_data = user_data; return message; } static void inf_sasl_context_message_free(gpointer message_) { InfSaslContextMessage* message; message = (InfSaslContextMessage*)message_; switch(message->type) { case INF_SASL_CONTEXT_MESSAGE_TERMINATE: case INF_SASL_CONTEXT_MESSAGE_CONTINUE: /* nothing to do */ break; case INF_SASL_CONTEXT_MESSAGE_STEP: g_free(message->shared.step.data); break; case INF_SASL_CONTEXT_MESSAGE_QUERY: /* nothing to do */ break; case INF_SASL_CONTEXT_MESSAGE_STEPPED: if(message->shared.stepped.data != NULL) gsasl_free(message->shared.stepped.data); break; default: g_assert_not_reached(); break; } g_slice_free(InfSaslContextMessage, message); } /* * Session thread and gsasl callback */ static void inf_sasl_context_session_message_func(gpointer user_data) { InfSaslContextMessage* message; InfSaslContextCallbackFunc func; gpointer func_user_data; gboolean needs_more; GError* error; message = (InfSaslContextMessage*)user_data; switch(message->type) { case INF_SASL_CONTEXT_MESSAGE_TERMINATE: /* session thread */ message->session->status = INF_SASL_CONTEXT_SESSION_TERMINATE; inf_standalone_io_loop_quit(message->session->session_io); break; case INF_SASL_CONTEXT_MESSAGE_CONTINUE: /* session thread */ g_assert(message->session->status == INF_SASL_CONTEXT_SESSION_INNER); message->session->retval = message->shared.cont.retval; inf_standalone_io_loop_quit(message->session->session_io); break; case INF_SASL_CONTEXT_MESSAGE_STEP: /* session thread */ g_assert(message->session->status == INF_SASL_CONTEXT_SESSION_OUTER); g_assert(message->shared.step.func != NULL); message->session->step64 = message->shared.step.data; message->session->feed_func = message->shared.step.func; message->session->feed_user_data = message->shared.step.user_data; message->shared.step.data = NULL; /* prevent deletion */ message->session->status = INF_SASL_CONTEXT_SESSION_INNER; inf_standalone_io_loop_quit(message->session->session_io); break; case INF_SASL_CONTEXT_MESSAGE_QUERY: /* main thread */ g_mutex_lock(message->session->context->mutex); g_assert(message->session->dispatch != NULL); message->session->dispatch = NULL; func = message->session->context->callback; func_user_data = message->session->context->callback_user_data; g_mutex_unlock(message->session->context->mutex); func( message->session, message->shared.query.prop, message->session->session_data, func_user_data ); break; case INF_SASL_CONTEXT_MESSAGE_STEPPED: /* main thread */ g_mutex_lock(message->session->context->mutex); g_assert(message->session->dispatch != NULL); message->session->dispatch = NULL; g_mutex_unlock(message->session->context->mutex); switch(message->shared.stepped.retval) { case GSASL_OK: error = NULL; needs_more = FALSE; break; case GSASL_NEEDS_MORE: error = NULL; needs_more = TRUE; break; default: inf_gsasl_set_error(&error, message->shared.stepped.retval); needs_more = FALSE; break; } message->shared.stepped.func( message->session, message->shared.stepped.data, needs_more, error, message->shared.stepped.user_data ); if(error != NULL) g_error_free(error); break; default: g_assert_not_reached(); break; } } static int inf_sasl_context_gsasl_callback(Gsasl* gsasl, Gsasl_session* gsasl_session, Gsasl_property prop) { InfSaslContextSession* session; session = (InfSaslContextSession*)gsasl_session_hook_get(gsasl_session); /* if the status is TERMINATE then get out of the inner loop by * returning from all SASL callbacks immediately. */ if(session->status == INF_SASL_CONTEXT_SESSION_TERMINATE) return GSASL_NO_CALLBACK; g_assert(session->status == INF_SASL_CONTEXT_SESSION_INNER); /* query the property from the main thread */ g_assert(session->dispatch == NULL); session->dispatch = inf_io_add_dispatch( INF_IO(session->main_io), inf_sasl_context_session_message_func, inf_sasl_context_message_query(session, prop), inf_sasl_context_message_free ); g_mutex_unlock(session->context->mutex); /* wait for continue */ inf_standalone_io_loop(session->session_io); g_mutex_lock(session->context->mutex); /* return on terminate */ if(session->status == INF_SASL_CONTEXT_SESSION_TERMINATE) return GSASL_NO_CALLBACK; g_assert(session->dispatch == NULL); return session->retval; } static void* inf_sasl_context_thread_func(gpointer data) { InfSaslContextSession* session; session = (InfSaslContextSession*)data; int retval; char* output; InfSaslContextSessionFeedFunc feed_func; gpointer feed_user_data; /* Wait for something to do */ while(session->status != INF_SASL_CONTEXT_SESSION_TERMINATE) { switch(session->status) { case INF_SASL_CONTEXT_SESSION_OUTER: inf_standalone_io_loop(session->session_io); break; case INF_SASL_CONTEXT_SESSION_INNER: g_mutex_lock(session->context->mutex); /* This might call the gsasl callback once or more in which we wait * for input from the main thread. */ retval = gsasl_step64( session->session, session->step64, &output ); g_mutex_unlock(session->context->mutex); g_free(session->step64); session->step64 = NULL; if(retval != GSASL_OK && retval != GSASL_NEEDS_MORE) output = NULL; /* Only process the result when we were not requested to terminate * within the gsasl callback. */ if(session->status != INF_SASL_CONTEXT_SESSION_TERMINATE) { feed_func = session->feed_func; feed_user_data = session->feed_user_data; session->feed_func = NULL; /* clear, so that feed can be called again */ session->status = INF_SASL_CONTEXT_SESSION_OUTER; g_mutex_lock(session->context->mutex); g_assert(session->dispatch == NULL); session->dispatch = inf_io_add_dispatch( INF_IO(session->main_io), inf_sasl_context_session_message_func, inf_sasl_context_message_stepped( session, output, retval, feed_func, feed_user_data ), inf_sasl_context_message_free ); g_mutex_unlock(session->context->mutex); } else { session->feed_func = NULL; if(output) gsasl_free(output); } break; case INF_SASL_CONTEXT_SESSION_TERMINATE: default: g_assert_not_reached(); break; } } return NULL; } /* * Helper functions */ static InfSaslContextSession* inf_sasl_context_start_session(InfSaslContext* context, InfIo* io, Gsasl_session* gsasl_session, gpointer session_data, GError** error) { InfSaslContextSession* session; session = g_slice_new(InfSaslContextSession); session->context = context; session->session = gsasl_session; session->session_data = session_data; session->main_io = io; g_object_ref(session->main_io); session->session_io = inf_standalone_io_new(); session->dispatch = NULL; session->thread = NULL; session->status = INF_SASL_CONTEXT_SESSION_OUTER; session->step64 = NULL; session->retval = GSASL_OK; session->feed_func = NULL; /*session->feed_user_data = NULL;*/ context->sessions = g_slist_prepend(context->sessions, session); gsasl_session_hook_set(gsasl_session, session); session->thread = g_thread_create( inf_sasl_context_thread_func, session, TRUE, error ); if(session->thread == NULL) { context->sessions = g_slist_remove(context->sessions, session); g_object_unref(session->session_io); g_object_unref(session->main_io); g_slice_free(InfSaslContextSession, session); return NULL; } return session; } /* * Public API */ GType inf_sasl_context_get_type(void) { static GType sasl_context_type = 0; if(!sasl_context_type) { sasl_context_type = g_boxed_type_register_static( "InfSaslContext", (GBoxedCopyFunc)inf_sasl_context_ref, (GBoxedFreeFunc)inf_sasl_context_unref ); } return sasl_context_type; } /** * inf_sasl_context_new: * @error: Location to store error information, if any. * * Creates a new #InfSaslContext with a reference count of 1. If the function * fails it returns %NULL and @error is set. * * Returns: A new #InfSaslContext, or %NULL on error. Free with * inf_sasl_context_unref() when no longer needed. */ InfSaslContext* inf_sasl_context_new(GError** error) { Gsasl* gsasl; int status; InfSaslContext* sasl; g_return_val_if_fail(error == NULL || *error == NULL, NULL); status = gsasl_init(&gsasl); if(status != GSASL_OK) { inf_gsasl_set_error(error, status); return NULL; } sasl = g_slice_new(InfSaslContext); sasl->gsasl = gsasl; sasl->ref_count = 1; sasl->sessions = NULL; sasl->callback = NULL; sasl->callback_user_data = NULL; gsasl_callback_set(gsasl, inf_sasl_context_gsasl_callback); gsasl_callback_hook_set(gsasl, sasl); sasl->mutex = g_mutex_new(); return sasl; } /** * inf_sasl_context_ref: * @context: A #InfSaslContext. * * Increases the reference count of @context by one. * * Returns: The passed in pointer, @context. */ InfSaslContext* inf_sasl_context_ref(InfSaslContext* context) { g_return_val_if_fail(context != NULL, NULL); g_atomic_int_inc(&context->ref_count); return context; } /** * inf_sasl_context_unref: * @context: A #InfSaslContext. * * Decreases the reference count of @sasl by one. When the reference count * reaches zero then the object is freed and may no longer be used. If that * happens then also all sessions created with * inf_sasl_context_client_start_session() or * inf_sasl_context_server_start_session() are stopped automatically. */ void inf_sasl_context_unref(InfSaslContext* context) { g_return_if_fail(context != NULL); if(g_atomic_int_dec_and_test(&context->ref_count)) { /* Note that we don't need to lock the mutex here since if nobody has a * reference anymore then they cannot access the session list concurrently * anyway. Also, the session threads do not access the list at all. */ while(context->sessions != NULL) { inf_sasl_context_stop_session( context, (InfSaslContextSession*)context->sessions->data ); } /* Again we don't need to lock the mutex for this since all session * threads have been stopped at this point. */ gsasl_done(context->gsasl); g_mutex_free(context->mutex); g_slice_free(InfSaslContext, context); } } /** * inf_sasl_context_set_callback: * @context: A #InfSaslContext. * @callback: A function to call to query properties for authentication. * @user_data: Additional context to pass to @callback. * * Sets the callback to call when, during authentication, a certain properties * needs to be provided, such as a username or a password. The callback * function is expected to set the requested property using * inf_sasl_context_session_set_property() and then call * inf_sasl_context_session_continue() with retval being GSASL_OK. If it * cannot provide the property then it should only call * inf_sasl_context_session_continue() with retval indicating the problem. * * The callback function does not need to provide the property immediately. * It is also allowed return and call inf_sasl_context_session_continue() * later. */ void inf_sasl_context_set_callback(InfSaslContext* context, InfSaslContextCallbackFunc callback, gpointer user_data) { g_return_if_fail(context != NULL); g_mutex_lock(context->mutex); context->callback = callback; context->callback_user_data = user_data; g_mutex_unlock(context->mutex); } /** * inf_sasl_context_client_start_session: * @context: A #InfSaslContext. * @io: The #InfIo main loop to which to dispatch callbacks. * @mech: The mechanism to use for the session. * @session_data: Session-specific data to provide to the * #InfSaslContextCallbackFunc. * @error: Location to store error information, if any. * * Starts a new client-side SASL session using @mech for authentication. When * the session finished, that is either when an error occurred or the * authentication finished successfully, use inf_sasl_context_stop_session(). * * The callback function will be called in the thread that @io runs in. * * Returns: A #InfSaslContextSession. */ InfSaslContextSession* inf_sasl_context_client_start_session(InfSaslContext* context, InfIo* io, const char* mech, gpointer session_data, GError** error) { Gsasl_session* gsasl_session; int status; InfSaslContextSession* session; g_return_val_if_fail(context != NULL, NULL); g_return_val_if_fail(INF_IS_IO(io), NULL); g_return_val_if_fail(mech != NULL, NULL); g_return_val_if_fail(error == NULL || *error == NULL, NULL); g_mutex_lock(context->mutex); status = gsasl_client_start(context->gsasl, mech, &gsasl_session); if(status != GSASL_OK) { g_mutex_unlock(context->mutex); inf_gsasl_set_error(error, status); return NULL; } session = inf_sasl_context_start_session( context, io, gsasl_session, session_data, error ); if(session == NULL) { gsasl_finish(gsasl_session); g_mutex_unlock(context->mutex); return NULL; } g_mutex_unlock(context->mutex); return session; } /** * inf_sasl_context_client_list_mechanisms: * @context: A #InfSaslContext. * @error: Location to store error information, if any. * * Returns a newly allocated space-separated string containing SASL mechanisms * that @context supports for client sessions. * * Returns: A newly allocated string. Free with gsasl_free() when no longer * in use. */ char* inf_sasl_context_client_list_mechanisms(InfSaslContext* context, GError** error) { int ret; char* out; g_return_val_if_fail(context != NULL, NULL); g_return_val_if_fail(error == NULL || *error == NULL, NULL); g_mutex_lock(context->mutex); ret = gsasl_client_mechlist(context->gsasl, &out); g_mutex_unlock(context->mutex); if(ret != GSASL_OK) { inf_gsasl_set_error(error, ret); if(out) gsasl_free(out); return NULL; } return out; } /** * inf_sasl_context_client_supports_mechanism: * @context: A #InfSaslContext. * @mech: The name of the mechanism to be tested. * * Checks whether @context supports the mechanism with name @mech for * client sessions. * * Returns: %TRUE if @mech is supported or %FALSE otherwise. */ gboolean inf_sasl_context_client_supports_mechanism(InfSaslContext* context, const char* mech) { int result; g_return_val_if_fail(context != NULL, FALSE); g_return_val_if_fail(mech != NULL, FALSE); g_mutex_lock(context->mutex); result = gsasl_client_support_p(context->gsasl, mech); g_mutex_unlock(context->mutex); return result != 0; } /** * inf_sasl_context_client_suggest_mechanism: * @context: A #InfSaslContext. * @mechanisms: Space-separated list of SASL mechanism names. * * Given a list of SASL mechanisms this function suggests the which is the * "best" one to be used. * * Returns: The name of the suggested mechanism. */ const char* inf_sasl_context_client_suggest_mechanism(InfSaslContext* context, const char* mechanisms) { const char* suggestion; g_return_val_if_fail(context != NULL, NULL); g_return_val_if_fail(mechanisms != NULL, NULL); g_mutex_lock(context->mutex); suggestion = gsasl_client_suggest_mechanism(context->gsasl, mechanisms); g_mutex_unlock(context->mutex); return suggestion; } /** * inf_sasl_context_server_start_session: * @context: A #InfSaslContext. * @io: The #InfIo main loop to which to dispatch callbacks. * @mech: The mechanism to use for the session. * @session_data: Session-specific data to provide to the * #InfSaslContextCallbackFunc. * @error: Location to store error information, if any. * * Starts a new server-side SASL session using @mech for authentication. When * the session finished, that is either when an error occurred or the * authentication finished successfully, use inf_sasl_context_stop_session(). * * The callback function will be called in the thread that @io runs in. * * Returns: A #InfSaslContextSession. */ InfSaslContextSession* inf_sasl_context_server_start_session(InfSaslContext* context, InfIo* io, const char* mech, gpointer session_data, GError** error) { Gsasl_session* gsasl_session; int status; InfSaslContextSession* session; g_return_val_if_fail(context != NULL, NULL); g_return_val_if_fail(INF_IS_IO(io), NULL); g_return_val_if_fail(mech != NULL, NULL); g_return_val_if_fail(error == NULL || *error == NULL, NULL); g_mutex_lock(context->mutex); status = gsasl_server_start(context->gsasl, mech, &gsasl_session); if(status != GSASL_OK) { g_mutex_unlock(context->mutex); inf_gsasl_set_error(error, status); return NULL; } session = inf_sasl_context_start_session( context, io, gsasl_session, session_data, error ); if(session == NULL) { gsasl_finish(gsasl_session); g_mutex_unlock(context->mutex); return NULL; } g_mutex_unlock(context->mutex); return session; } /** * inf_sasl_context_server_list_mechanisms: * @context: A #InfSaslContext. * @error: Location to store error information, if any. * * Returns a newly allocated space-separated string containing SASL mechanisms * that @context supports for server sessions. * * Returns: A newly allocated string. Free with gsasl_free() when no longer * in use. */ char* inf_sasl_context_server_list_mechanisms(InfSaslContext* context, GError** error) { int ret; char* out; g_return_val_if_fail(context != NULL, NULL); g_return_val_if_fail(error == NULL || *error == NULL, NULL); g_mutex_lock(context->mutex); ret = gsasl_server_mechlist(context->gsasl, &out); g_mutex_unlock(context->mutex); if(ret != GSASL_OK) { inf_gsasl_set_error(error, ret); if(out) gsasl_free(out); return NULL; } return out; } /** * inf_sasl_context_server_supports_mechanism: * @context: A #InfSaslContext. * @mech: The name of the mechanism to be tested. * * Checks whether @context supports the mechanism with name @mech for * server sessions. * * Returns: %TRUE if @mech is supported or %FALSE otherwise. */ gboolean inf_sasl_context_server_supports_mechanism(InfSaslContext* context, const char* mech) { int ret; g_return_val_if_fail(context != NULL, FALSE); g_return_val_if_fail(mech != NULL, FALSE); g_mutex_lock(context->mutex); ret = gsasl_server_support_p(context->gsasl, mech); g_mutex_unlock(context->mutex); return ret != 0; } /** * inf_sasl_context_stop_session: * @context: A #InfSaslContext. * @session: A #InfSaslContextSession created with @context. * * Finishes @session and frees all resources allocated to it. This can be used * to cancel an authentication session, or to free it after it finished * (either successfully or not). * * @session should no longer be used after this function was called. */ void inf_sasl_context_stop_session(InfSaslContext* context, InfSaslContextSession* session) { g_return_if_fail(context != NULL); g_return_if_fail(session != NULL); g_mutex_lock(context->mutex); g_return_if_fail(g_slist_find(context->sessions, session) != NULL); g_return_if_fail(session->context == context); g_mutex_unlock(context->mutex); /* Tell client thread to terminate */ inf_io_add_dispatch( INF_IO(session->session_io), inf_sasl_context_session_message_func, inf_sasl_context_message_terminate(session), inf_sasl_context_message_free ); g_thread_join(session->thread); g_mutex_lock(context->mutex); if(session->dispatch != NULL) inf_io_remove_dispatch(session->main_io, session->dispatch); context->sessions = g_slist_remove(context->sessions, session); gsasl_finish(session->session); g_mutex_unlock(context->mutex); g_object_unref(session->session_io); g_object_unref(session->main_io); g_free(session->step64); g_slice_free(InfSaslContextSession, session); } /** * inf_sasl_context_session_get_property: * @session: A #InfSaslContextSession. * @prop: A SASL property. * * Returns the value of the property @prop in @session. If the value does not * yet exist then this function returns %NULL. It does not invoke the * #InfSaslContextCallbackFunc to query it. * * Returns: The value of the property, or %NULL. The value is owned by the * session and must not be freed. */ const char* inf_sasl_context_session_get_property(InfSaslContextSession* session, Gsasl_property prop) { const char* property; g_return_val_if_fail(session != NULL, NULL); /* TODO: We should g_strdup the return value for thread safety reasons */ g_mutex_lock(session->context->mutex); property = gsasl_property_fast(session->session, prop); g_mutex_unlock(session->context->mutex); return property; } /** * inf_sasl_context_session_set_property: * @session: A #InfSaslContextSession. * @prop: A SASL property. * @value: The value to set the property to. * * Sets the property @prop in @session to @value. */ void inf_sasl_context_session_set_property(InfSaslContextSession* session, Gsasl_property prop, const char* value) { g_return_if_fail(session != NULL); g_mutex_lock(session->context->mutex); gsasl_property_set(session->session, prop, value); g_mutex_unlock(session->context->mutex); } /** * inf_sasl_context_session_continue: * @session: A #InfSaslContextSession. * @retval: Error code of the operation requested. * * When the callback function specified in inf_sasl_context_set_callback() * is called then @session waits for the user to call * inf_sasl_context_session_continue(). It should do so once it provided the * requested property using inf_sasl_context_session_set_property() with * @retval being %GSASL_OK. If it decides that the property cannot be provided * then it should still call this function with @retval being a SASL error * code specifying the problem. */ void inf_sasl_context_session_continue(InfSaslContextSession* session, int retval) { g_return_if_fail(session != NULL); inf_io_add_dispatch( INF_IO(session->session_io), inf_sasl_context_session_message_func, inf_sasl_context_message_continue(session, retval), inf_sasl_context_message_free ); } /** * inf_sasl_context_session_feed: * @session: A #InfSaslContextSession. * @data: The data to feed to the SASL session. * @func: The function to call when the data has been processed. * @user_data: Additional user data to pass to @func. * * This function feeds data from the session's remote counterpart to @session. * It should be base64 encoded. This function will, asynchronously, process * the data and query for properties it requires to do so. Once it has * finished, @func is called with output data to send to the remote side to * be fed to its session counterpart. * * This function must not be called again before @func was called. */ void inf_sasl_context_session_feed(InfSaslContextSession* session, const char* data, InfSaslContextSessionFeedFunc func, gpointer user_data) { g_return_if_fail(session != NULL); g_return_if_fail(func != NULL); /*g_return_if_fail(session->context->callback != NULL); not threadsafe */ inf_io_add_dispatch( INF_IO(session->session_io), inf_sasl_context_session_message_func, inf_sasl_context_message_step(session, data, func, user_data), inf_sasl_context_message_free ); } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/common/inf-user-table.c0000644000175000017500000004035712264763732017600 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include #include /** * SECTION:inf-user-table * @title: InfUserTable * @short_description: User information storage * @include: libinfinity/common/inf-user-table.h * @see_also: #InfUser, #InfSession * @stability: Unstable * * #InfUserTable manages multiple #InfUser objects and provides an easy way to * look up users by their ID and name. All users within a user table must have * a unique ID and name. The user table is used by #InfSession to store the * users within the session. */ typedef struct _InfUserTableForeachUserData InfUserTableForeachUserData; struct _InfUserTableForeachUserData { InfUserTableForeachUserFunc func; gpointer user_data; }; typedef struct _InfUserTablePrivate InfUserTablePrivate; struct _InfUserTablePrivate { GHashTable* table; GSList* locals; }; enum { ADD_USER, REMOVE_USER, ADD_LOCAL_USER, REMOVE_LOCAL_USER, LAST_SIGNAL }; #define INF_USER_TABLE_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), INF_TYPE_USER_TABLE, InfUserTablePrivate)) static GObjectClass* parent_class; static guint user_table_signals[LAST_SIGNAL]; static gboolean inf_user_table_is_local(InfUser* user) { /* User counts as local when it has the local flag set and is available */ if( (inf_user_get_flags(user) & INF_USER_LOCAL) == 0) return FALSE; if(inf_user_get_status(user) == INF_USER_UNAVAILABLE) return FALSE; return TRUE; } static void inf_user_table_check_local_cb(GObject* object, GParamSpec* pspec, gpointer user_data) { InfUserTable* user_table; InfUserTablePrivate* priv; GSList* item; user_table = INF_USER_TABLE(user_data); priv = INF_USER_TABLE_PRIVATE(user_table); item = g_slist_find(priv->locals, INF_USER(object)); if(inf_user_table_is_local(INF_USER(object)) && item == NULL) { g_signal_emit( G_OBJECT(user_table), user_table_signals[ADD_LOCAL_USER], 0, INF_USER(object) ); } if(!inf_user_table_is_local(INF_USER(object)) && item != NULL) { g_signal_emit( G_OBJECT(user_table), user_table_signals[REMOVE_LOCAL_USER], 0, INF_USER(object) ); } } static void inf_user_table_unref_user(InfUserTable* user_table, InfUser* user) { inf_signal_handlers_disconnect_by_func( G_OBJECT(user), G_CALLBACK(inf_user_table_check_local_cb), user_table ); g_object_unref(user); } static void inf_user_table_dispose_foreach_func(gpointer key, gpointer value, gpointer user_data) { inf_user_table_unref_user(INF_USER_TABLE(user_data), INF_USER(value)); } /* * User table callbacks. */ static gboolean inf_user_table_lookup_user_by_name_func(gpointer key, gpointer value, gpointer data) { const gchar* user_name; user_name = inf_user_get_name(INF_USER(value)); if(strcmp(user_name, (const gchar*)data) == 0) return TRUE; return FALSE; } static void inf_user_table_foreach_user_func(gpointer key, gpointer value, gpointer user_data) { InfUserTableForeachUserData* data; data = (InfUserTableForeachUserData*)user_data; data->func(INF_USER(value), data->user_data); } static void inf_user_table_init(GTypeInstance* instance, gpointer g_class) { InfUserTable* user_table; InfUserTablePrivate* priv; user_table = INF_USER_TABLE(instance); priv = INF_USER_TABLE_PRIVATE(user_table); priv->table = g_hash_table_new_full(NULL, NULL, NULL, NULL); priv->locals = NULL; } static void inf_user_table_dispose(GObject* object) { InfUserTable* user_table; InfUserTablePrivate* priv; user_table = INF_USER_TABLE(object); priv = INF_USER_TABLE_PRIVATE(user_table); g_slist_free(priv->locals); priv->locals = NULL; g_hash_table_foreach( priv->table, inf_user_table_dispose_foreach_func, user_table ); g_hash_table_remove_all(priv->table); G_OBJECT_CLASS(parent_class)->dispose(object); } static void inf_user_table_finalize(GObject* object) { InfUserTable* user_table; InfUserTablePrivate* priv; user_table = INF_USER_TABLE(object); priv = INF_USER_TABLE_PRIVATE(user_table); g_hash_table_destroy(priv->table); G_OBJECT_CLASS(parent_class)->finalize(object); } static void inf_user_table_add_user_handler(InfUserTable* user_table, InfUser* user) { InfUserTablePrivate* priv; guint id; priv = INF_USER_TABLE_PRIVATE(user_table); id = inf_user_get_id(user); g_assert(id > 0); g_assert(g_hash_table_lookup(priv->table, GUINT_TO_POINTER(id)) == NULL); g_hash_table_insert(priv->table, GUINT_TO_POINTER(id), user); g_object_ref(user); g_signal_connect( G_OBJECT(user), "notify::status", G_CALLBACK(inf_user_table_check_local_cb), user_table ); g_signal_connect( G_OBJECT(user), "notify::flags", G_CALLBACK(inf_user_table_check_local_cb), user_table ); if(inf_user_table_is_local(user)) { g_signal_emit( G_OBJECT(user_table), user_table_signals[ADD_LOCAL_USER], 0, user ); } } static void inf_user_table_remove_user_handler(InfUserTable* user_table, InfUser* user) { InfUserTablePrivate* priv; guint id; priv = INF_USER_TABLE_PRIVATE(user_table); id = inf_user_get_id(user); if(inf_user_table_is_local(user)) { g_signal_emit( G_OBJECT(user_table), user_table_signals[REMOVE_LOCAL_USER], 0, user ); } inf_user_table_unref_user(user_table, user); g_assert(g_hash_table_lookup(priv->table, GUINT_TO_POINTER(id)) == user); g_hash_table_remove(priv->table, GUINT_TO_POINTER(id)); } static void inf_user_table_add_local_user(InfUserTable* user_table, InfUser* user) { InfUserTablePrivate* priv; priv = INF_USER_TABLE_PRIVATE(user_table); g_assert(g_slist_find(priv->locals, user) == NULL); priv->locals = g_slist_prepend(priv->locals, user); } static void inf_user_table_remove_local_user(InfUserTable* user_table, InfUser* user) { InfUserTablePrivate* priv; priv = INF_USER_TABLE_PRIVATE(user_table); g_assert(g_slist_find(priv->locals, user) != NULL); priv->locals = g_slist_remove(priv->locals, user); } static void inf_user_table_class_init(gpointer g_class, gpointer class_data) { GObjectClass* object_class; InfUserTableClass* user_table_class; object_class = G_OBJECT_CLASS(g_class); user_table_class = INF_USER_TABLE_CLASS(g_class); parent_class = G_OBJECT_CLASS(g_type_class_peek_parent(g_class)); g_type_class_add_private(g_class, sizeof(InfUserTablePrivate)); object_class->dispose = inf_user_table_dispose; object_class->finalize = inf_user_table_finalize; user_table_class->add_user = inf_user_table_add_user_handler; user_table_class->remove_user = inf_user_table_remove_user_handler; user_table_class->add_local_user = inf_user_table_add_local_user; user_table_class->remove_local_user = inf_user_table_remove_local_user; /** * InfUserTable::add-user: * @user_table: The #InfUserTable into which @user has been added * @user: The #InfUser that has been added into @user_table * * This signal is emitted when inf_user_table_add_user() is called. Note * that this does not happen if @user rejoins the session and has already * been added to @user_table previously. * * #InfUserTable::add-local-user may also be emitted at this point if * @user has the %INF_USER_LOCAL flag set. */ user_table_signals[ADD_USER] = g_signal_new( "add-user", G_OBJECT_CLASS_TYPE(object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(InfUserTableClass, add_user), NULL, NULL, inf_marshal_VOID__OBJECT, G_TYPE_NONE, 1, INF_TYPE_USER ); /** * InfUserTable::remove-user: * @user_table: The #InfUserTable from which @user has been remove * @user: The #InfUser that has been removed from @user_table * * This signal is emitted when inf_user_table_remove_user() is called. This * does not usually happen, as users leaving a session do not get removed * from the table. * * #InfUserTable::remove-local-user may also be emitted at this point if * @user has the %INF_USER_LOCAL flag set. */ user_table_signals[REMOVE_USER] = g_signal_new( "remove-user", G_OBJECT_CLASS_TYPE(object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(InfUserTableClass, remove_user), NULL, NULL, inf_marshal_VOID__OBJECT, G_TYPE_NONE, 1, INF_TYPE_USER ); /** * InfUserTable::add-local-user: * @user_table: The #InfUserTable in which @user has been set as local * @user: The #InfUser that has set as local * * This signal is emitted when a user is added to the user table and has the * %INF_USER_LOCAL flag set. In this case, #InfUserTable::add-user is * emitted as well. * * This signal is also emitted when an existing user receives the * %INF_USER_LOCAL flag. This occurs when a user rejoins locally after * leaving the session (possibly having the %INF_USER_LOCAL flag removed * during their absence). #InfUserTable::add-user is not emitted in this * case. */ user_table_signals[ADD_LOCAL_USER] = g_signal_new( "add-local-user", G_OBJECT_CLASS_TYPE(object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(InfUserTableClass, add_local_user), NULL, NULL, inf_marshal_VOID__OBJECT, G_TYPE_NONE, 1, INF_TYPE_USER ); /** * InfUserTable::remove-local-user: * @user_table: The #InfUserTable in which @user is no longer local * @user: The #InfUser that is no longer local * * This signal is emitted when a user is removed from the user table and * had the %INF_USER_LOCAL flag set. In this case, * #InfUserTable::remove-user is emitted as well. * * This signal is also emitted when @user loses the %INF_USER_LOCAL flag. * This occurs when the local @user leaves the session. * #InfUserTable::remove-user is not emitted and the status of @user is set * to %INF_USER_UNAVAILABLE. */ user_table_signals[REMOVE_LOCAL_USER] = g_signal_new( "remove-local-user", G_OBJECT_CLASS_TYPE(object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(InfUserTableClass, remove_local_user), NULL, NULL, inf_marshal_VOID__OBJECT, G_TYPE_NONE, 1, INF_TYPE_USER ); } GType inf_user_table_get_type(void) { static GType user_table_type = 0; if(!user_table_type) { static const GTypeInfo user_table_type_info = { sizeof(InfUserTableClass), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ inf_user_table_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InfUserTable), /* instance_size */ 0, /* n_preallocs */ inf_user_table_init, /* instance_init */ NULL /* value_table */ }; user_table_type = g_type_register_static( G_TYPE_OBJECT, "InfUserTable", &user_table_type_info, 0 ); } return user_table_type; } /** * inf_user_table_new: * * Creates a new, empty user table. * * Return Value: A #InfUserTable. **/ InfUserTable* inf_user_table_new(void) { return INF_USER_TABLE(g_object_new(INF_TYPE_USER_TABLE, NULL)); } /** * inf_user_table_add_user: * @user_table: A #InfUserTable. * @user: A #InfUser not already contained in @user_table. * * Inserts @user into @user_table. */ void inf_user_table_add_user(InfUserTable* user_table, InfUser* user) { g_return_if_fail(INF_IS_USER_TABLE(user_table)); g_return_if_fail(INF_IS_USER(user)); g_signal_emit(G_OBJECT(user_table), user_table_signals[ADD_USER], 0, user); } /** * inf_user_table_remove_user: * @user_table: A #InfUserTable. * @user: A #InfUser contained in @table. * * Removes @user from @uesr_table. **/ void inf_user_table_remove_user(InfUserTable* user_table, InfUser* user) { g_return_if_fail(INF_IS_USER_TABLE(user_table)); g_return_if_fail(INF_IS_USER(user)); g_signal_emit( G_OBJECT(user_table), user_table_signals[REMOVE_USER], 0, user ); } /** * inf_user_table_lookup_user_by_id: * @user_table: A #InfUserTable. * @id: User ID to lookup. * * Returns the #InfUser with the given User ID in @user_table. * * Return Value: A #InfUser, or %NULL. **/ InfUser* inf_user_table_lookup_user_by_id(InfUserTable* user_table, guint id) { InfUserTablePrivate* priv; g_return_val_if_fail(INF_IS_USER_TABLE(user_table), NULL); priv = INF_USER_TABLE_PRIVATE(user_table); return INF_USER(g_hash_table_lookup(priv->table, GUINT_TO_POINTER(id))); } /** * inf_user_table_lookup_user_by_name: * @user_table: A #InfUserTable. * @name: User name to lookup. * * Returns an #InfUser with the given name if there is one. * * Return Value: A #InfUser, or %NULL. **/ InfUser* inf_user_table_lookup_user_by_name(InfUserTable* user_table, const gchar* name) { InfUserTablePrivate* priv; InfUser* user; g_return_val_if_fail(INF_IS_USER_TABLE(user_table), NULL); g_return_val_if_fail(name != NULL, NULL); priv = INF_USER_TABLE_PRIVATE(user_table); user = g_hash_table_find( priv->table, inf_user_table_lookup_user_by_name_func, *(gpointer*) (gpointer) &name /* cast const away without warning */ ); return user; } /** * inf_user_table_foreach_user: * @user_table: A #InfUserTable. * @func: The function to call for each user. * @user_data: User data to pass to the function. * * Calls the given function for each user in the user_table. You should not * add or remove users while this function is being executed. **/ void inf_user_table_foreach_user(InfUserTable* user_table, InfUserTableForeachUserFunc func, gpointer user_data) { InfUserTablePrivate* priv; InfUserTableForeachUserData data; g_return_if_fail(INF_IS_USER_TABLE(user_table)); g_return_if_fail(func != NULL); priv = INF_USER_TABLE_PRIVATE(user_table); data.func = func; data.user_data = user_data; g_hash_table_foreach( priv->table, inf_user_table_foreach_user_func, &data ); } /** * inf_user_table_foreach_local_user: * @user_table: A #InfUserTable. * @func: The function to call for each user. * @user_data: User data to pass to the function. * * Calls the given function for each local user in the user_table. A local * user is a user that has the %INF_USER_LOCAL flag set and that has not * status %INF_USER_UNAVAILABLE. You should not add or remove users while this * function is being executed. **/ void inf_user_table_foreach_local_user(InfUserTable* user_table, InfUserTableForeachUserFunc func, gpointer user_data) { InfUserTablePrivate* priv; GSList* item; g_return_if_fail(INF_IS_USER_TABLE(user_table)); g_return_if_fail(func != NULL); priv = INF_USER_TABLE_PRIVATE(user_table); for(item = priv->locals; item != NULL; item = g_slist_next(item)) func(INF_USER(item->data), user_data); } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/common/inf-buffer.h0000644000175000017500000000436412264763732017011 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_BUFFER_H__ #define __INF_BUFFER_H__ #include G_BEGIN_DECLS #define INF_TYPE_BUFFER (inf_buffer_get_type()) #define INF_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INF_TYPE_BUFFER, InfBuffer)) #define INF_IS_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INF_TYPE_BUFFER)) #define INF_BUFFER_GET_IFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE((inst), INF_TYPE_BUFFER, InfBufferIface)) typedef struct _InfBuffer InfBuffer; typedef struct _InfBufferIface InfBufferIface; /** * InfBufferIface: * @get_modified: Returns whether the buffer has been modified since the last * call to @set_modified set modified flag to %FALSE. * @set_modified: Set the current modified state of the buffer. * * The virtual methods of #InfBuffer. */ struct _InfBufferIface { /*< private >*/ GTypeInterface parent; /*< public >*/ gboolean (*get_modified)(InfBuffer* buffer); void (*set_modified)(InfBuffer* buffer, gboolean modified); }; /** * InfBuffer: * * #InfBuffer is an opaque data type. You should only access it * via the public API functions. */ GType inf_buffer_get_type(void) G_GNUC_CONST; gboolean inf_buffer_get_modified(InfBuffer* buffer); void inf_buffer_set_modified(InfBuffer* buffer, gboolean modified); G_END_DECLS #endif /* __INF_BUFFER_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/common/inf-simulated-connection.h0000644000175000017500000000770112264763732021662 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_SIMULATED_CONNECTION_H__ #define __INF_SIMULATED_CONNECTION_H__ #include #include #include G_BEGIN_DECLS #define INF_TYPE_SIMULATED_CONNECTION (inf_simulated_connection_get_type()) #define INF_SIMULATED_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INF_TYPE_SIMULATED_CONNECTION, InfSimulatedConnection)) #define INF_SIMULATED_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INF_TYPE_SIMULATED_CONNECTION, InfSimulatedConnectionClass)) #define INF_IS_SIMULATED_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INF_TYPE_SIMULATED_CONNECTION)) #define INF_IS_SIMULATED_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INF_TYPE_SIMULATED_CONNECTION)) #define INF_SIMULATED_CONNECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), INF_TYPE_SIMULATED_CONNECTION, InfSimulatedConnectionClass)) #define INF_TYPE_SIMULATED_CONNECTION_MODE (inf_simulated_connection_mode_get_type()) typedef struct _InfSimulatedConnection InfSimulatedConnection; typedef struct _InfSimulatedConnectionClass InfSimulatedConnectionClass; /** * InfSimulatedConnectionMode: * @INF_SIMULATED_CONNECTION_IMMEDIATE: Messages are received directly by the * target site when calling inf_xml_connection_send(). * @INF_SIMULATED_CONNECTION_DELAYED: Messages are queued, and delivered to * the target site when inf_simulated_connection_flush() is called. * @INF_SIMULATED_CONNECTION_IO_CONTROLLED: Messages are queued and delivered * once the application main loop regains control. This requires the simulated * connection to have been created with * inf_simulated_connection_new_with_io(). * * The mode of a simulated connection defines when sent messages arrive at * the target connection. */ typedef enum _InfSimulatedConnectionMode { INF_SIMULATED_CONNECTION_IMMEDIATE, INF_SIMULATED_CONNECTION_DELAYED, INF_SIMULATED_CONNECTION_IO_CONTROLLED } InfSimulatedConnectionMode; /** * InfSimulatedConnectionClass: * * This structure does not contain any public fields. */ struct _InfSimulatedConnectionClass { /*< private >*/ GObjectClass parent_class; }; /** * InfSimulatedConnection: * * #InfSimulatedConnection is an opaque data type. You should only access it * via the public API functions. */ struct _InfSimulatedConnection { /*< private >*/ GObject parent; }; GType inf_simulated_connection_mode_get_type(void) G_GNUC_CONST; GType inf_simulated_connection_get_type(void) G_GNUC_CONST; InfSimulatedConnection* inf_simulated_connection_new(void); InfSimulatedConnection* inf_simulated_connection_new_with_io(InfIo* io); void inf_simulated_connection_connect(InfSimulatedConnection* connection, InfSimulatedConnection* to); void inf_simulated_connection_set_mode(InfSimulatedConnection* connection, InfSimulatedConnectionMode mode); void inf_simulated_connection_flush(InfSimulatedConnection* connection); G_END_DECLS #endif /* __INF_SIMULATED_CONNECTION_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/common/inf-discovery-avahi.c0000644000175000017500000013466412264763732020637 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ /** * SECTION:inf-discovery-avahi * @short_description: Service Discovery via Avahi * @include: libinfinity/common/inf-discovery-avahi.h * @see_also: #InfDiscovery, #InfLocalPublisher * * #InfDiscoveryAvahi implements the #InfDiscovery and #InfLocalPublisher * interfaces on top of avahi. It resolves services to client-side * #InfXmppConnections. * * This class is only available if the macro * LIBINFINITY_HAVE_AVAHI is defined. */ #include #include #include #include #include /* LIBINFINITY_HAVE_AVAHI */ #ifdef LIBINFINITY_HAVE_AVAHI #include #include #include #include #include #include #include #include #include /* Required by FreeBSD, see #430 */ #include /* For if_indextoname */ #include struct AvahiWatch { InfDiscoveryAvahi* avahi; InfIoWatch* watch; InfNativeSocket socket; AvahiWatchEvent occured_events; AvahiWatchCallback callback; void* userdata; }; struct AvahiTimeout { InfDiscoveryAvahi* avahi; InfIoTimeout* timeout; AvahiTimeoutCallback callback; void* userdata; }; typedef struct _InfDiscoveryAvahiInfoResolv InfDiscoveryAvahiInfoResolv; struct _InfDiscoveryAvahiInfoResolv { InfDiscoveryResolvCompleteFunc complete_func; InfDiscoveryResolvErrorFunc error_func; gpointer user_data; }; struct _InfDiscoveryInfo { gchar* service_name; /* pointing to InfDiscoveryAvahiDiscoverInfo.type: */ const gchar* service_type; gchar* domain; AvahiIfIndex interface; AvahiProtocol protocol; AvahiServiceResolver* service_resolver; InfXmppConnection* resolved; GSList* resolv; }; struct _InfLocalPublisherItem { gchar* type; char* name; guint port; AvahiEntryGroup* entry_group; }; typedef struct _InfDiscoveryAvahiDiscoverInfo InfDiscoveryAvahiDiscoverInfo; struct _InfDiscoveryAvahiDiscoverInfo { gchar* type; /* also used as key in hash table */ AvahiServiceBrowser* service_browser; GSList* discovered; }; typedef struct _InfDiscoveryAvahiPrivate InfDiscoveryAvahiPrivate; struct _InfDiscoveryAvahiPrivate { AvahiPoll poll; InfIo* io; InfXmppManager* xmpp_manager; InfXmppConnectionSecurityPolicy security_policy; InfCertificateCredentials* creds; InfSaslContext* sasl_context; gchar* sasl_mechanisms; AvahiClient* client; GSList* published; GHashTable* discovered; /* type -> InfDiscoveryAvahiDiscoverInfo */ }; enum { PROP_0, /* construct only */ PROP_XMPP_MANAGER, PROP_IO, PROP_CREDENTIALS, PROP_SASL_CONTEXT, PROP_SASL_MECHANISMS, /* read/write */ PROP_SECURITY_POLICY }; #define INF_DISCOVERY_AVAHI_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), INF_TYPE_DISCOVERY_AVAHI, InfDiscoveryAvahiPrivate)) static GObjectClass* parent_class; static GQuark inf_discovery_avahi_error_quark; /* * Destroy notification callbacks */ static void inf_discovery_avahi_discovery_info_resolved_destroy_cb(gpointer user_data, GObject* object) { InfDiscoveryInfo* info; info = (InfDiscoveryInfo*)user_data; /* Connection has gone, next time we resolve this discovery we cannot use * the cached connection anymore. */ info->resolved = NULL; } static void inf_discovery_avahi_info_resolv_complete(InfDiscoveryInfo* info) { GSList* item; InfDiscoveryAvahiInfoResolv* resolv; g_assert(info->resolved != NULL); for(item = info->resolv; item != NULL; item = g_slist_next(item)) { resolv = (InfDiscoveryAvahiInfoResolv*)item->data; resolv->complete_func( info, INF_XML_CONNECTION(info->resolved), resolv->user_data ); g_slice_free(InfDiscoveryAvahiInfoResolv, resolv); } g_slist_free(info->resolv); info->resolv = NULL; } static void inf_discovery_avahi_info_resolv_error(InfDiscoveryInfo* info, const GError* error) { GSList* item; InfDiscoveryAvahiInfoResolv* resolv; for(item = info->resolv; item != NULL; item = g_slist_next(item)) { resolv = (InfDiscoveryAvahiInfoResolv*)item->data; resolv->error_func(info, error, resolv->user_data); g_slice_free(InfDiscoveryAvahiInfoResolv, resolv); } g_slist_free(info->resolv); info->resolv = NULL; } static void inf_discovery_avahi_discovery_info_free(InfDiscoveryInfo* info) { g_free(info->service_name); g_free(info->domain); if(info->service_resolver != NULL) avahi_service_resolver_free(info->service_resolver); if(info->resolved != NULL) { g_object_weak_unref( G_OBJECT(info->resolved), inf_discovery_avahi_discovery_info_resolved_destroy_cb, info ); } /* TODO: Get an error from somewhere. If the avahi daemon goes down, * all InfDiscoveryInfos are discarded, but it would be nice to show a * correct error message for pending resolvs. */ inf_discovery_avahi_info_resolv_error(info, NULL); g_slist_free(info->resolv); g_slice_free(InfDiscoveryInfo, info); } static void inf_discovery_avahi_publisher_item_free(gpointer data) { InfLocalPublisherItem* item; item = (InfLocalPublisherItem*)data; if(item->entry_group != NULL) avahi_entry_group_free(item->entry_group); g_free(item->type); avahi_free(item->name); g_slice_free(InfLocalPublisherItem, item); } static void inf_discovery_avahi_discover_info_free(gpointer data) { InfDiscoveryAvahiDiscoverInfo* info; GSList* item; info = (InfDiscoveryAvahiDiscoverInfo*)data; for(item = info->discovered; item != NULL; item = g_slist_next(item)) inf_discovery_avahi_discovery_info_free((InfDiscoveryInfo*)item->data); if(info->service_browser != NULL) avahi_service_browser_free(info->service_browser); g_slist_free(info->discovered); g_free(info->type); g_slice_free(InfDiscoveryAvahiDiscoverInfo, info); } /* * Avahi callbacks and utilities */ static void inf_discovery_avahi_service_resolver_callback(AvahiServiceResolver* resolver, AvahiIfIndex interface, AvahiProtocol protocol, AvahiResolverEvent event, const char* name, const char* type, const char* domain, const char* host_name, const AvahiAddress* address, uint16_t port, AvahiStringList* txt, AvahiLookupResultFlags flags, void* userdata) { InfDiscoveryAvahi* avahi; InfDiscoveryAvahiPrivate* priv; InfDiscoveryAvahiDiscoverInfo* info; InfDiscoveryInfo* discovery_info; GSList* item; InfIpAddress* inf_addr; InfTcpConnection* tcp; InfXmppConnection* xmpp; InfXmlConnectionStatus status; GError* error; avahi = INF_DISCOVERY_AVAHI(userdata); priv = INF_DISCOVERY_AVAHI_PRIVATE(avahi); info = g_hash_table_lookup(priv->discovered, type); g_assert(info != NULL); /* Lookup discovery info for this service resolver */ for(item = info->discovered; item != NULL; item = g_slist_next(item)) { discovery_info = (InfDiscoveryInfo*)item->data; if(discovery_info->service_resolver == resolver) break; } /* If there was no discovery_info, we should have deleted the service * resolver before this callback could happen. */ g_assert(item != NULL); /* There is no need to create a service resolver if this is * already resolved. */ g_assert(discovery_info->resolved == NULL); /* So that the callbacks can recreate the resolver by resolving this * info again: */ discovery_info->service_resolver = NULL; switch(event) { case AVAHI_RESOLVER_FOUND: switch(address->proto) { case AVAHI_PROTO_INET: inf_addr = inf_ip_address_new_raw4(address->data.ipv4.address); break; case AVAHI_PROTO_INET6: inf_addr = inf_ip_address_new_raw6(address->data.ipv6.address); break; default: g_assert_not_reached(); break; } xmpp = inf_xmpp_manager_lookup_connection_by_address( priv->xmpp_manager, inf_addr, port ); if(xmpp == NULL) { tcp = inf_tcp_connection_new(priv->io, inf_addr, port); g_object_set( G_OBJECT(tcp), "device-index", discovery_info->interface, NULL); error = NULL; if(inf_tcp_connection_open(tcp, &error) == FALSE) { inf_discovery_avahi_info_resolv_error(discovery_info, error); g_error_free(error); g_object_unref(tcp); } else { xmpp = inf_xmpp_connection_new( tcp, INF_XMPP_CONNECTION_CLIENT, NULL, host_name, priv->security_policy, priv->creds, priv->sasl_context, priv->sasl_context == NULL ? NULL : priv->sasl_mechanisms ); g_object_unref(tcp); inf_xmpp_manager_add_connection(priv->xmpp_manager, xmpp); discovery_info->resolved = xmpp; g_object_weak_ref( G_OBJECT(xmpp), inf_discovery_avahi_discovery_info_resolved_destroy_cb, discovery_info ); inf_discovery_avahi_info_resolv_complete(discovery_info); g_object_unref(xmpp); } } else { discovery_info->resolved = xmpp; g_object_weak_ref( G_OBJECT(xmpp), inf_discovery_avahi_discovery_info_resolved_destroy_cb, discovery_info ); g_object_get(G_OBJECT(xmpp), "status", &status, NULL); /* TODO: There is similar code in inf_discovery_avahi_resolve; should * probably go into an extra function. */ if(status == INF_XML_CONNECTION_CLOSING) { /* TODO: That's a bit a sad case here. We should wait for the * connection being closed, and then reopen it: */ inf_discovery_avahi_info_resolv_error(discovery_info, NULL); } else if(status == INF_XML_CONNECTION_CLOSED) { error = NULL; if(!inf_xml_connection_open(INF_XML_CONNECTION(xmpp), &error)) { inf_discovery_avahi_info_resolv_error(discovery_info, error); g_error_free(error); } else { inf_discovery_avahi_info_resolv_complete(discovery_info); } } else { inf_discovery_avahi_info_resolv_complete(discovery_info); } } inf_ip_address_free(inf_addr); break; case AVAHI_RESOLVER_FAILURE: error = NULL; g_set_error( &error, inf_discovery_avahi_error_quark, avahi_client_errno(avahi_service_resolver_get_client(resolver)), "%s", avahi_strerror( avahi_client_errno(avahi_service_resolver_get_client(resolver)) ) ); inf_discovery_avahi_info_resolv_error(discovery_info, error); g_error_free(error); break; } avahi_service_resolver_free(resolver); } static void inf_discovery_avahi_perform_undiscover(InfDiscoveryAvahi* avahi, InfDiscoveryAvahiDiscoverInfo* info); static void inf_discovery_avahi_perform_unpublish_item(InfLocalPublisherItem* item); static void inf_discovery_avahi_service_browser_callback(AvahiServiceBrowser* browser, AvahiIfIndex interface, AvahiProtocol protocol, AvahiBrowserEvent event, const char* name, const char* type, const char* domain, AvahiLookupResultFlags flags, void* userdata) { InfDiscoveryAvahi* avahi; InfDiscoveryAvahiPrivate* priv; InfDiscoveryAvahiDiscoverInfo* info; InfDiscoveryInfo* discovery_info; GSList* item; avahi = INF_DISCOVERY_AVAHI(userdata); priv = INF_DISCOVERY_AVAHI_PRIVATE(avahi); info = g_hash_table_lookup(priv->discovered, type); g_assert(info != NULL); switch(event) { case AVAHI_BROWSER_NEW: discovery_info = g_slice_new(InfDiscoveryInfo); discovery_info->service_name = g_strdup(name); discovery_info->service_type = info->type; discovery_info->domain = g_strdup(domain); discovery_info->interface = interface; discovery_info->protocol = protocol; discovery_info->service_resolver = NULL; discovery_info->resolved = NULL; discovery_info->resolv = NULL; info->discovered = g_slist_prepend(info->discovered, discovery_info); inf_discovery_discovered(INF_DISCOVERY(avahi), discovery_info); break; case AVAHI_BROWSER_REMOVE: for(item = info->discovered; item != NULL; item = g_slist_next(item)) { discovery_info = (InfDiscoveryInfo*)item->data; g_assert(strcmp(discovery_info->service_type, type) == 0); /* TODO: Do we need to compare domain? */ if(strcmp(discovery_info->service_name, name) == 0 && discovery_info->interface == interface && discovery_info->protocol == protocol) { inf_discovery_undiscovered(INF_DISCOVERY(avahi), discovery_info); info->discovered = g_slist_remove(info->discovered, discovery_info); inf_discovery_avahi_discovery_info_free(discovery_info); break; } } break; case AVAHI_BROWSER_CACHE_EXHAUSTED: /* Ignore */ break; case AVAHI_BROWSER_ALL_FOR_NOW: /* Ignore */ break; case AVAHI_BROWSER_FAILURE: g_warning( _("Avahi service browser is in failure state. Services of type '%s' " "are no longer discovered.\n\nThe failure was: %s\n"), info->type, avahi_strerror( avahi_client_errno(avahi_service_browser_get_client(browser)) ) ); inf_discovery_avahi_perform_undiscover(avahi, info); break; default: g_assert_not_reached(); break; } } static void inf_discovery_avahi_entry_group_add_service(InfLocalPublisherItem* item) { /* TODO: Error handling */ avahi_entry_group_add_service( item->entry_group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, item->name, item->type, NULL, NULL, item->port, NULL ); } static void inf_discovery_avahi_entry_group_callback(AvahiEntryGroup* group, AvahiEntryGroupState state, void* userdata) { InfLocalPublisherItem* item; char* new_name; item = (InfLocalPublisherItem*)userdata; switch(state) { case AVAHI_ENTRY_GROUP_UNCOMMITED: /* Not yet committed */ break; case AVAHI_ENTRY_GROUP_REGISTERING: /* This is currently being registered */ break; case AVAHI_ENTRY_GROUP_ESTABLISHED: /* The service is published */ break; case AVAHI_ENTRY_GROUP_COLLISION: /* There was a name collision, choose a new name */ new_name = avahi_alternative_service_name(item->name); avahi_free(item->name); item->name = new_name; /* TODO: Error handling */ avahi_entry_group_reset(item->entry_group); inf_discovery_avahi_entry_group_add_service(item); avahi_entry_group_commit(item->entry_group); break; case AVAHI_ENTRY_GROUP_FAILURE: g_warning( _("Avahi entry group is in failure state. The service '%s' of type " "'%s' is no longer published.\n\nThe failure was: %s\n"), item->name, item->type, avahi_strerror(avahi_client_errno(avahi_entry_group_get_client(group))) ); /* There was a failure, remove entry group */ inf_discovery_avahi_perform_unpublish_item(item); break; default: g_assert_not_reached(); break; } } static void inf_discovery_avahi_perform_publish_item(InfDiscoveryAvahi* avahi, InfLocalPublisherItem* item) { InfDiscoveryAvahiPrivate* priv; priv = INF_DISCOVERY_AVAHI_PRIVATE(avahi); if(item->entry_group == NULL) { /* TODO: Error handling if one of these calls fail */ item->entry_group = avahi_entry_group_new( priv->client, inf_discovery_avahi_entry_group_callback, item ); inf_discovery_avahi_entry_group_add_service(item); avahi_entry_group_commit(item->entry_group); } } static void inf_discovery_avahi_perform_unpublish_item(InfLocalPublisherItem* item) { if(item->entry_group != NULL) { avahi_entry_group_free(item->entry_group); item->entry_group = NULL; } } static void inf_discovery_avahi_perform_publish_all(InfDiscoveryAvahi* avahi) { InfDiscoveryAvahiPrivate* priv; GSList* item; priv = INF_DISCOVERY_AVAHI_PRIVATE(avahi); for(item = priv->published; item != NULL; item = g_slist_next(item)) { inf_discovery_avahi_perform_publish_item( avahi, (InfLocalPublisherItem*)item->data ); } } static void inf_discovery_avahi_perform_unpublish_all(InfDiscoveryAvahi* avahi) { InfDiscoveryAvahiPrivate* priv; GSList* item; priv = INF_DISCOVERY_AVAHI_PRIVATE(avahi); for(item = priv->published; item != NULL; item = g_slist_next(item)) { inf_discovery_avahi_perform_unpublish_item( (InfLocalPublisherItem*)item->data ); } } static void inf_discovery_avahi_perform_discover(InfDiscoveryAvahi* avahi, InfDiscoveryAvahiDiscoverInfo* info) { InfDiscoveryAvahiPrivate* priv; priv = INF_DISCOVERY_AVAHI_PRIVATE(avahi); if(info->service_browser == NULL) { info->service_browser = avahi_service_browser_new( priv->client, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, info->type, NULL, 0, inf_discovery_avahi_service_browser_callback, avahi ); } } static void inf_discovery_avahi_perform_undiscover(InfDiscoveryAvahi* avahi, InfDiscoveryAvahiDiscoverInfo* info) { /* Remove discovered infos, these might no longer be valid. They are * rediscovered when inf_discovery_avahi_perform_discover() is called * again. */ InfDiscoveryInfo* discovery_info; GSList* next; for(; info->discovered != NULL; info->discovered = next) { next = info->discovered->next; discovery_info = (InfDiscoveryInfo*)info->discovered->data; inf_discovery_undiscovered(INF_DISCOVERY(avahi), discovery_info); inf_discovery_avahi_discovery_info_free(discovery_info); info->discovered = g_slist_delete_link( info->discovered, info->discovered ); } if(info->service_browser != NULL) { avahi_service_browser_free(info->service_browser); info->service_browser = NULL; } } static void inf_discovery_avahi_perform_discover_all_foreach_func(gpointer key, gpointer value, gpointer user_data) { inf_discovery_avahi_perform_discover( INF_DISCOVERY_AVAHI(user_data), (InfDiscoveryAvahiDiscoverInfo*)value ); } static void inf_discovery_avahi_perform_undiscover_all_foreach_func(gpointer key, gpointer value, gpointer user_data) { inf_discovery_avahi_perform_undiscover( INF_DISCOVERY_AVAHI(user_data), (InfDiscoveryAvahiDiscoverInfo*)value ); } static void inf_discovery_avahi_perform_discover_all(InfDiscoveryAvahi* avahi) { InfDiscoveryAvahiPrivate* priv; priv = INF_DISCOVERY_AVAHI_PRIVATE(avahi); g_hash_table_foreach( priv->discovered, inf_discovery_avahi_perform_discover_all_foreach_func, avahi ); } static void inf_discovery_avahi_perform_undiscover_all(InfDiscoveryAvahi* avahi) { InfDiscoveryAvahiPrivate* priv; priv = INF_DISCOVERY_AVAHI_PRIVATE(avahi); g_hash_table_foreach( priv->discovered, inf_discovery_avahi_perform_undiscover_all_foreach_func, avahi ); } /* Required by inf_discovery_avahi_create_client() */ static void inf_discovery_avahi_client_callback(AvahiClient* client, AvahiClientState state, void* userdata); static void inf_discovery_avahi_create_client(InfDiscoveryAvahi* discovery) { InfDiscoveryAvahiPrivate* priv; int error; priv = INF_DISCOVERY_AVAHI_PRIVATE(discovery); priv->client = avahi_client_new( &priv->poll, AVAHI_CLIENT_NO_FAIL, inf_discovery_avahi_client_callback, discovery, &error ); /* This still seems to happen sometimes, even though we pass * AVAHI_CLIENT_NO_FAIL */ if(priv->client == NULL) { g_warning(_ ("Failed to start Avahi client. Service discovery or publishing " "will not be possible.\n\nThe occurred failure was: %s"), avahi_strerror(error) ); } } static void inf_discovery_avahi_client_callback(AvahiClient* client, AvahiClientState state, void* userdata) { InfDiscoveryAvahi* avahi; InfDiscoveryAvahiPrivate* priv; avahi = INF_DISCOVERY_AVAHI(userdata); priv = INF_DISCOVERY_AVAHI_PRIVATE(avahi); switch(state) { case AVAHI_CLIENT_S_COLLISION: /* TODO: What to do in that case. Should we handle this as an error, * i.e. withdraw service browsers and entry groups? */ break; case AVAHI_CLIENT_S_REGISTERING: /* Wait for client to become running */ break; case AVAHI_CLIENT_S_RUNNING: /* Discovery and publish when running */ inf_discovery_avahi_perform_publish_all(avahi); inf_discovery_avahi_perform_discover_all(avahi); break; case AVAHI_CLIENT_FAILURE: inf_discovery_avahi_perform_unpublish_all(avahi); inf_discovery_avahi_perform_undiscover_all(avahi); if(avahi_client_errno(client) != AVAHI_ERR_DISCONNECTED) { inf_discovery_avahi_create_client(avahi); } else { g_warning( _("Avahi client is in failure state. Service discovery or " "publishing is no longer possible.\n\nThe occured failure " "was: %s\n"), avahi_strerror(avahi_client_errno(client)) ); } case AVAHI_CLIENT_CONNECTING: /* Wait for connection */ break; default: g_assert_not_reached(); break; } } /* * AvahiPoll implementation */ static AvahiWatchEvent inf_discovery_avahi_from_io_event(InfIoEvent event) { AvahiWatchEvent res; res = 0; if(event & INF_IO_INCOMING) res |= AVAHI_WATCH_IN; if(event & INF_IO_OUTGOING) res |= AVAHI_WATCH_OUT; if(event & INF_IO_ERROR) res |= AVAHI_WATCH_ERR; return res; } static InfIoEvent inf_discovery_avahi_to_io_event(AvahiWatchEvent event) { InfIoEvent res; res = 0; if(event & AVAHI_WATCH_IN) res |= INF_IO_INCOMING; if(event & AVAHI_WATCH_OUT) res |= INF_IO_OUTGOING; if(event & (AVAHI_WATCH_ERR | AVAHI_WATCH_HUP)) res |= INF_IO_ERROR; return res; } static void inf_discovery_avahi_watch_cb(InfNativeSocket* socket, InfIoEvent event, gpointer user_data) { AvahiWatch* watch; watch = (AvahiWatch*)user_data; watch->occured_events = inf_discovery_avahi_from_io_event(event); watch->callback(watch, *socket, watch->occured_events, watch->userdata); } static void inf_discovery_avahi_timeout_cb(gpointer user_data) { AvahiTimeout* timeout; timeout = (AvahiTimeout*)user_data; timeout->timeout = NULL; timeout->callback(timeout, timeout->userdata); } static AvahiWatch* inf_discovery_avahi_watch_new(const AvahiPoll* api, int fd, AvahiWatchEvent event, AvahiWatchCallback callback, void* userdata) { InfDiscoveryAvahi* avahi; InfDiscoveryAvahiPrivate* priv; AvahiWatch* watch; avahi = INF_DISCOVERY_AVAHI(api->userdata); priv = INF_DISCOVERY_AVAHI_PRIVATE(avahi); watch = g_slice_new(AvahiWatch); watch->avahi = avahi; watch->socket = fd; watch->occured_events = 0; watch->callback = callback; watch->userdata = userdata; watch->watch = inf_io_add_watch( priv->io, &watch->socket, inf_discovery_avahi_to_io_event(event), inf_discovery_avahi_watch_cb, watch, NULL ); return watch; } static void inf_discovery_avahi_watch_update(AvahiWatch* watch, AvahiWatchEvent event) { InfDiscoveryAvahiPrivate* priv; priv = INF_DISCOVERY_AVAHI_PRIVATE(watch->avahi); inf_io_update_watch( priv->io, watch->watch, inf_discovery_avahi_to_io_event(event) ); } static AvahiWatchEvent inf_discovery_avahi_watch_get_events(AvahiWatch* watch) { return watch->occured_events; } static void inf_discovery_avahi_watch_free(AvahiWatch* watch) { InfDiscoveryAvahiPrivate* priv; priv = INF_DISCOVERY_AVAHI_PRIVATE(watch->avahi); inf_io_remove_watch(priv->io, watch->watch); g_slice_free(AvahiWatch, watch); } static AvahiTimeout* inf_discovery_avahi_timeout_new(const AvahiPoll* api, const struct timeval* tv, AvahiTimeoutCallback callback, void* userdata) { InfDiscoveryAvahi* avahi; InfDiscoveryAvahiPrivate* priv; AvahiTimeout* timeout; AvahiUsec usec; avahi = INF_DISCOVERY_AVAHI(api->userdata); priv = INF_DISCOVERY_AVAHI_PRIVATE(avahi); timeout = g_slice_new(AvahiTimeout); timeout->avahi = avahi; timeout->callback = callback; timeout->userdata = userdata; if(tv != NULL) { /* Timeout in the past is triggered instantly */ usec = avahi_age(tv); if(usec > 0) usec = 0; timeout->timeout = inf_io_add_timeout( priv->io, ((-usec) + 500) / 1000, inf_discovery_avahi_timeout_cb, timeout, NULL ); } else { timeout->timeout = NULL; } return timeout; } static void inf_discovery_avahi_timeout_update(AvahiTimeout* timeout, const struct timeval* tv) { InfDiscoveryAvahiPrivate* priv; AvahiUsec usec; priv = INF_DISCOVERY_AVAHI_PRIVATE(timeout->avahi); if(timeout->timeout != NULL) inf_io_remove_timeout(priv->io, timeout->timeout); if(tv != NULL) { /* Timeout in the past is triggered instantly */ usec = avahi_age(tv); if(usec > 0) usec = 0; timeout->timeout = inf_io_add_timeout( priv->io, ((-usec) + 500) / 1000, inf_discovery_avahi_timeout_cb, timeout, NULL ); } else { timeout->timeout = NULL; } } static void inf_discovery_avahi_timeout_free(AvahiTimeout* timeout) { InfDiscoveryAvahiPrivate* priv; priv = INF_DISCOVERY_AVAHI_PRIVATE(timeout->avahi); if(timeout->timeout != NULL) inf_io_remove_timeout(priv->io, timeout->timeout); g_slice_free(AvahiTimeout, timeout); } /* * GObject overrides */ static void inf_discovery_avahi_init(GTypeInstance* instance, gpointer g_class) { InfDiscoveryAvahi* avahi; InfDiscoveryAvahiPrivate* priv; avahi = INF_DISCOVERY_AVAHI(instance); priv = INF_DISCOVERY_AVAHI_PRIVATE(avahi); priv->poll.userdata = avahi; priv->poll.watch_new = inf_discovery_avahi_watch_new; priv->poll.watch_update = inf_discovery_avahi_watch_update; priv->poll.watch_get_events = inf_discovery_avahi_watch_get_events; priv->poll.watch_free = inf_discovery_avahi_watch_free; priv->poll.timeout_new = inf_discovery_avahi_timeout_new; priv->poll.timeout_update = inf_discovery_avahi_timeout_update; priv->poll.timeout_free = inf_discovery_avahi_timeout_free; priv->io = NULL; priv->xmpp_manager = NULL; priv->security_policy = INF_XMPP_CONNECTION_SECURITY_BOTH_PREFER_TLS; priv->creds = NULL; priv->sasl_context = NULL; priv->sasl_mechanisms = NULL; priv->client = NULL; priv->published = NULL; priv->discovered = g_hash_table_new_full( g_str_hash, g_str_equal, NULL, /* key is owned by value */ inf_discovery_avahi_discover_info_free ); } static GObject* inf_discovery_avahi_constructor(GType type, guint n_construct_properties, GObjectConstructParam* construct_properties) { GObject* object; InfDiscoveryAvahiPrivate* priv; object = G_OBJECT_CLASS(parent_class)->constructor( type, n_construct_properties, construct_properties ); priv = INF_DISCOVERY_AVAHI_PRIVATE(object); /* Must have been set as construct only property */ g_assert(priv->io != NULL); inf_discovery_avahi_create_client(INF_DISCOVERY_AVAHI(object)); return object; } static void inf_discovery_avahi_dispose(GObject* object) { InfDiscoveryAvahi* avahi; InfDiscoveryAvahiPrivate* priv; GSList* item; avahi = INF_DISCOVERY_AVAHI(object); priv = INF_DISCOVERY_AVAHI_PRIVATE(avahi); g_hash_table_destroy(priv->discovered); priv->discovered = NULL; for(item = priv->published; item != NULL; item = g_slist_next(item)) inf_discovery_avahi_publisher_item_free(item->data); g_slist_free(priv->published); priv->published = NULL; if(priv->client != NULL) { avahi_client_free(priv->client); priv->client = NULL; } if(priv->xmpp_manager != NULL) { g_object_unref(G_OBJECT(priv->xmpp_manager)); priv->xmpp_manager = NULL; } if(priv->creds != NULL) { inf_certificate_credentials_unref(priv->creds); priv->creds = NULL; } if(priv->sasl_context != NULL) { inf_sasl_context_unref(priv->sasl_context); priv->sasl_context = NULL; } if(priv->io != NULL) { g_object_unref(G_OBJECT(priv->io)); priv->io = NULL; } G_OBJECT_CLASS(parent_class)->dispose(object); } static void inf_discovery_avahi_finalize(GObject* object) { InfDiscoveryAvahi* avahi; InfDiscoveryAvahiPrivate* priv; avahi = INF_DISCOVERY_AVAHI(object); priv = INF_DISCOVERY_AVAHI_PRIVATE(avahi); g_free(priv->sasl_mechanisms); G_OBJECT_CLASS(parent_class)->finalize(object); } static void inf_discovery_avahi_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec) { InfDiscoveryAvahi* avahi; InfDiscoveryAvahiPrivate* priv; avahi = INF_DISCOVERY_AVAHI(object); priv = INF_DISCOVERY_AVAHI_PRIVATE(avahi); switch(prop_id) { case PROP_IO: g_assert(priv->io == NULL); /* construct only */ priv->io = INF_IO(g_value_dup_object(value)); break; case PROP_XMPP_MANAGER: g_assert(priv->xmpp_manager == NULL); /* construct only */ priv->xmpp_manager = INF_XMPP_MANAGER(g_value_dup_object(value)); break; case PROP_CREDENTIALS: if(priv->creds != NULL) inf_certificate_credentials_unref(priv->creds); priv->creds = (InfCertificateCredentials*)g_value_dup_boxed(value); break; case PROP_SASL_CONTEXT: priv->sasl_context = (InfSaslContext*)g_value_dup_boxed(value); break; case PROP_SASL_MECHANISMS: g_free(priv->sasl_mechanisms); priv->sasl_mechanisms = g_value_dup_string(value); break; case PROP_SECURITY_POLICY: priv->security_policy = g_value_get_enum(value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void inf_discovery_avahi_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec) { InfDiscoveryAvahi* avahi; InfDiscoveryAvahiPrivate* priv; avahi = INF_DISCOVERY_AVAHI(object); priv = INF_DISCOVERY_AVAHI_PRIVATE(avahi); switch(prop_id) { case PROP_IO: g_value_set_object(value, G_OBJECT(priv->io)); break; case PROP_XMPP_MANAGER: g_value_set_object(value, G_OBJECT(priv->xmpp_manager)); break; case PROP_CREDENTIALS: g_value_set_boxed(value, priv->creds); break; case PROP_SASL_CONTEXT: g_value_set_boxed(value, priv->sasl_context); break; case PROP_SASL_MECHANISMS: g_value_set_string(value, priv->sasl_mechanisms); break; case PROP_SECURITY_POLICY: g_value_set_enum(value, priv->security_policy); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } /* * InfDiscovery implementation. */ static void inf_discovery_avahi_discover(InfDiscovery* discovery, const gchar* type) { InfDiscoveryAvahiPrivate* priv; InfDiscoveryAvahiDiscoverInfo* info; priv = INF_DISCOVERY_AVAHI_PRIVATE(discovery); info = g_hash_table_lookup(priv->discovered, type); if(info == NULL) { info = g_slice_new(InfDiscoveryAvahiDiscoverInfo); info->type = g_strdup(type); info->service_browser = NULL; info->discovered = NULL; g_hash_table_insert(priv->discovered, info->type, info); if(priv->client != NULL && avahi_client_get_state(priv->client) == AVAHI_CLIENT_S_RUNNING) { inf_discovery_avahi_perform_discover( INF_DISCOVERY_AVAHI(discovery), info ); } } } static GSList* inf_discovery_avahi_get_discovered(InfDiscovery* discovery, const gchar* type) { InfDiscoveryAvahiPrivate* priv; InfDiscoveryAvahiDiscoverInfo* info; priv = INF_DISCOVERY_AVAHI_PRIVATE(discovery); info = g_hash_table_lookup(priv->discovered, type); if(info == NULL) return NULL; return g_slist_copy(info->discovered); } static void inf_discovery_avahi_resolve(InfDiscovery* discovery, InfDiscoveryInfo* info, InfDiscoveryResolvCompleteFunc complete_func, InfDiscoveryResolvErrorFunc error_func, gpointer user_data) { InfDiscoveryAvahiPrivate* priv; InfDiscoveryAvahiInfoResolv* resolv; InfXmlConnectionStatus status; int errno; GError* error; priv = INF_DISCOVERY_AVAHI_PRIVATE(discovery); g_assert(priv->client != NULL); g_assert(avahi_client_get_state(priv->client) == AVAHI_CLIENT_S_RUNNING); if(info->resolved != NULL) { g_object_get(G_OBJECT(info->resolved), "status", &status, NULL); switch(status) { case INF_XML_CONNECTION_CLOSED: error = NULL; if(!inf_xml_connection_open(INF_XML_CONNECTION(info->resolved), &error)) { error_func(info, error, user_data); g_error_free(error); } else { complete_func(info, INF_XML_CONNECTION(info->resolved), user_data); } break; case INF_XML_CONNECTION_CLOSING: /* TODO: We should add ourselves to the resolver list, and wait for * the connection being closed and reopen it afterwards. */ error_func(info, NULL, user_data); break; case INF_XML_CONNECTION_OPENING: case INF_XML_CONNECTION_OPEN: complete_func(info, INF_XML_CONNECTION(info->resolved), user_data); break; default: g_assert_not_reached(); break; } } else { resolv = g_slice_new(InfDiscoveryAvahiInfoResolv); resolv->complete_func = complete_func; resolv->error_func = error_func; resolv->user_data = user_data; info->resolv = g_slist_prepend(info->resolv, resolv); if(info->service_resolver == NULL) { info->service_resolver = avahi_service_resolver_new( priv->client, info->interface, info->protocol, info->service_name, info->service_type, info->domain, AVAHI_PROTO_UNSPEC, 0, inf_discovery_avahi_service_resolver_callback, discovery ); if(info->service_resolver == NULL) { error = NULL; errno = avahi_client_errno( avahi_service_resolver_get_client(info->service_resolver) ); g_set_error( &error, inf_discovery_avahi_error_quark, errno, "%s", avahi_strerror(errno) ); inf_discovery_avahi_info_resolv_error(info, error); g_error_free(error); } } } } static gchar* inf_discovery_avahi_info_get_service_name(InfDiscovery* discovery, InfDiscoveryInfo* info) { char device_name[IF_NAMESIZE]; if(if_indextoname(info->interface, device_name) == NULL) return NULL; return g_strdup_printf( info->protocol == AVAHI_PROTO_INET ? /* Translators: This is " (via on *
)", for example "ck (via eth0 on IPv4)". */ _("%s (via %s on IPv4)") : _("%s (via %s on IPv6)"), info->service_name, device_name ); } static const gchar* inf_discovery_avahi_info_get_service_type(InfDiscovery* discovery, InfDiscoveryInfo* info) { return info->service_type; } static InfLocalPublisherItem* inf_discovery_avahi_publish(InfLocalPublisher* publisher, const gchar* type, const gchar* name, guint port) { InfDiscoveryAvahiPrivate* priv; InfLocalPublisherItem* item; priv = INF_DISCOVERY_AVAHI_PRIVATE(publisher); item = g_slice_new(InfLocalPublisherItem); item->type = g_strdup(type); item->name = avahi_strdup(name); item->port = port; item->entry_group = NULL; priv->published = g_slist_prepend(priv->published, item); if(priv->client != NULL && avahi_client_get_state(priv->client) == AVAHI_CLIENT_S_RUNNING) { inf_discovery_avahi_perform_publish_item( INF_DISCOVERY_AVAHI(publisher), item ); } return item; } static void inf_discovery_avahi_unpublish(InfLocalPublisher* publisher, InfLocalPublisherItem* item) { InfDiscoveryAvahiPrivate* priv; priv = INF_DISCOVERY_AVAHI_PRIVATE(publisher); g_assert(g_slist_find(priv->published, item) != NULL); inf_discovery_avahi_publisher_item_free(item); priv->published = g_slist_remove(priv->published, item); } /* * Gype registration. */ static void inf_discovery_avahi_class_init(gpointer g_class, gpointer class_data) { GObjectClass* object_class; InfDiscoveryAvahiClass* avahi_class; object_class = G_OBJECT_CLASS(g_class); avahi_class = INF_DISCOVERY_AVAHI_CLASS(g_class); parent_class = G_OBJECT_CLASS(g_type_class_peek_parent(g_class)); g_type_class_add_private(g_class, sizeof(InfDiscoveryAvahiPrivate)); object_class->constructor = inf_discovery_avahi_constructor; object_class->dispose = inf_discovery_avahi_dispose; object_class->finalize = inf_discovery_avahi_finalize; object_class->set_property = inf_discovery_avahi_set_property; object_class->get_property = inf_discovery_avahi_get_property; inf_discovery_avahi_error_quark = g_quark_from_static_string( "INF_DISCOVERY_AVAHI_ERROR" ); g_object_class_install_property( object_class, PROP_IO, g_param_spec_object( "io", "IO", "The IO object used for watching sockets and timeouts", INF_TYPE_IO, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); g_object_class_install_property( object_class, PROP_XMPP_MANAGER, g_param_spec_object( "xmpp-manager", "XMPP manager", "The XMPP manager to register resolved XMPP connections", INF_TYPE_XMPP_MANAGER, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); g_object_class_install_property( object_class, PROP_CREDENTIALS, g_param_spec_boxed( "credentials", "Certificate credentials", "The GnuTLS certificate credentials used for encrypting XMPP streams", INF_TYPE_CERTIFICATE_CREDENTIALS, G_PARAM_READWRITE | G_PARAM_CONSTRUCT ) ); g_object_class_install_property( object_class, PROP_SASL_CONTEXT, g_param_spec_boxed( "sasl-context", "SASL context", "The SASL context used for authentication", INF_TYPE_SASL_CONTEXT, G_PARAM_READWRITE | G_PARAM_CONSTRUCT ) ); g_object_class_install_property( object_class, PROP_SASL_MECHANISMS, g_param_spec_string( "sasl-mechanisms", "SASL mechanisms", "The accepted SASL mechanisms for authentication", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT ) ); g_object_class_install_property( object_class, PROP_SECURITY_POLICY, g_param_spec_enum( "security-policy", "Security policy", "How to decide whether to use TLS", INF_TYPE_XMPP_CONNECTION_SECURITY_POLICY, INF_XMPP_CONNECTION_SECURITY_BOTH_PREFER_TLS, G_PARAM_READWRITE ) ); } static void inf_discovery_avahi_discovery_init(gpointer g_iface, gpointer iface_data) { InfDiscoveryIface* iface; iface = (InfDiscoveryIface*)g_iface; iface->discover = inf_discovery_avahi_discover; iface->get_discovered = inf_discovery_avahi_get_discovered; iface->resolve = inf_discovery_avahi_resolve; iface->info_get_service_name = inf_discovery_avahi_info_get_service_name; iface->info_get_service_type = inf_discovery_avahi_info_get_service_type; iface->discovered = NULL; iface->undiscovered = NULL; } static void inf_discovery_avahi_local_publisher_init(gpointer g_iface, gpointer iface_data) { InfLocalPublisherIface* iface; iface = (InfLocalPublisherIface*)g_iface; iface->publish = inf_discovery_avahi_publish; iface->unpublish = inf_discovery_avahi_unpublish; } GType inf_discovery_avahi_get_type(void) { static GType discovery_avahi_type = 0; if(!discovery_avahi_type) { static const GTypeInfo discovery_avahi_type_info = { sizeof(InfDiscoveryAvahiClass), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ inf_discovery_avahi_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InfDiscoveryAvahi), /* instance_size */ 0, /* n_preallocs */ inf_discovery_avahi_init, /* instance_init */ NULL /* value_table */ }; static const GInterfaceInfo discovery_info = { inf_discovery_avahi_discovery_init, NULL, NULL }; static const GInterfaceInfo local_publisher_info = { inf_discovery_avahi_local_publisher_init, NULL, NULL }; discovery_avahi_type = g_type_register_static( G_TYPE_OBJECT, "InfDiscoveryAvahi", &discovery_avahi_type_info, 0 ); g_type_add_interface_static( discovery_avahi_type, INF_TYPE_DISCOVERY, &discovery_info ); g_type_add_interface_static( discovery_avahi_type, INF_TYPE_LOCAL_PUBLISHER, &local_publisher_info ); } return discovery_avahi_type; } /* * Public API. */ /** * inf_discovery_avahi_new: * @io: A #InfIo object used for watching sockets and timeouts. * @manager: A #InfXmppManager. * @creds: The certificate credentials used for GnuTLS encryption. * @sasl_context: A SASL context used for authentication. * @sasl_mechanisms: A whitespace-separated list of accepted SASL mechanisms, * or %NULL. * * Created a new #InfDiscoveryAvahi object which can be used to publish and * discovery Infinote services on the local network. When resolving a * #InfDiscoveryInfo (which means obtaining a #InfXmlConnection for the * discovered service) a new #InfXmppConnection needs to be created if there * is not already one for the destination host in @manager. Such * connections are created with the @creds and @sasl_context parameters. * These may be %NULL in which case #InfXmppConnection uses builtin * credentials or a builtin context, respectively. * * If this #InfDiscoveryAvahi is not used to discover services but only to * publish any, then @creds, @sasl_context and @sasl_mechanisms are ignored * and can safely set to be %NULL. * * @sasl_mechanisms specifies allowed mechanisms used for authentication with * the server. It can be %NULL, in which case all available mechanisms are * accepted. * * Return Value: A new #InfDiscoveryAvahi. **/ InfDiscoveryAvahi* inf_discovery_avahi_new(InfIo* io, InfXmppManager* manager, InfCertificateCredentials* creds, InfSaslContext* sasl_context, const gchar* sasl_mechanisms) { GObject* object; g_return_val_if_fail(INF_IS_IO(io), NULL); g_return_val_if_fail(INF_IS_XMPP_MANAGER(manager), NULL); object = g_object_new( INF_TYPE_DISCOVERY_AVAHI, "io", io, "xmpp-manager", manager, "credentials", creds, "sasl-context", sasl_context, "sasl-mechanisms", sasl_mechanisms, NULL ); return INF_DISCOVERY_AVAHI(object); } /** * inf_discovery_avahi_set_security_policy: * @discovery: A #InfDiscoveryAvahi. * @plcy: The new security policy. * * Sets the #InfXmppConnectionSecurityPolicy for newly created * #InfXmppConnections. It does not affect already existing * connections. */ void inf_discovery_avahi_set_security_policy(InfDiscoveryAvahi* discovery, InfXmppConnectionSecurityPolicy plcy) { g_return_if_fail(INF_IS_DISCOVERY_AVAHI(discovery)); INF_DISCOVERY_AVAHI_PRIVATE(discovery)->security_policy = plcy; } /** * inf_discovery_avahi_get_security_policy: * @discovery: A #InfDiscoveryAvahi. * * Returns the current security policy used for new * #InfXmppConnections. * * Returns: The current security policy. */ InfXmppConnectionSecurityPolicy inf_discovery_avahi_get_security_policy(InfDiscoveryAvahi* discovery) { g_return_val_if_fail( INF_IS_DISCOVERY_AVAHI(discovery), INF_XMPP_CONNECTION_SECURITY_BOTH_PREFER_TLS ); return INF_DISCOVERY_AVAHI_PRIVATE(discovery)->security_policy; } #endif /* LIBINFINITY_HAVE_AVAHI */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/common/inf-chat-session.c0000644000175000017500000010173512264763732020133 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /** * SECTION:inf-chat-session * @title: InfChatSession * @short_description: Simple standalone chat * @include: libinfinity/common/inf-chat-session.h * @stability: Unstable * * #InfChatSession represents a chat session. Normally, there is one chat * session per server, and it can be enabled via infd_directory_enable_chat(). * Clients can subscribe to the chat session via * infc_browser_subscribe_chat(). **/ #include #include #include #include #include #include #include #include typedef struct _InfChatSessionLogUserlistForeachData InfChatSessionLogUserlistForeachData; struct _InfChatSessionLogUserlistForeachData { FILE* log_file; gchar* time_str; guint users_total; }; typedef struct _InfChatSessionPrivate InfChatSessionPrivate; struct _InfChatSessionPrivate { gchar* log_filename; FILE* log_file; }; enum { PROP_0, PROP_LOG_FILE }; enum { RECEIVE_MESSAGE, SEND_MESSAGE, LAST_SIGNAL }; #define INF_CHAT_SESSION_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), INF_TYPE_CHAT_SESSION, InfChatSessionPrivate)) static InfSessionClass* parent_class; static guint chat_session_signals[LAST_SIGNAL]; static GQuark inf_chat_session_error_quark; /* * Error functions */ /* Currently unused, but can be used for a later translate_error vfunc * implementation. */ #if 0 static const gchar* inf_chat_session_strerror(InfChatSessionError code) { switch(code) { case INF_CHAT_SESSION_ERROR_TYPE_INVALID: return _("An invalid message type was sent"); case INF_CHAT_SESSION_ERROR_NO_SUCH_USER: return _("A user with the requested ID does not exist"); case INF_CHAT_SESSION_ERROR_FAILED: return _("An unknown chat session error has occured"); default: return _("An error with unknown error code occured"); } } #endif /* * Message Type <-> string conversions */ static const gchar* inf_chat_session_message_type_to_string(InfChatBufferMessageType type) { switch(type) { case INF_CHAT_BUFFER_MESSAGE_NORMAL: return "normal"; case INF_CHAT_BUFFER_MESSAGE_EMOTE: return "emote"; case INF_CHAT_BUFFER_MESSAGE_USERJOIN: return "userjoin"; case INF_CHAT_BUFFER_MESSAGE_USERPART: return "userpart"; default: g_assert_not_reached(); return NULL; } } static gboolean inf_chat_session_message_type_from_string(const gchar* string, InfChatBufferMessageType* type, GError** error) { if(strcmp(string, "normal") == 0) { *type = INF_CHAT_BUFFER_MESSAGE_NORMAL; return TRUE; } else if(strcmp(string, "emote") == 0) { *type = INF_CHAT_BUFFER_MESSAGE_EMOTE; return TRUE; } else if(strcmp(string, "userjoin") == 0) { *type = INF_CHAT_BUFFER_MESSAGE_USERJOIN; return TRUE; } else if(strcmp(string, "userpart") == 0) { *type = INF_CHAT_BUFFER_MESSAGE_USERPART; return TRUE; } g_set_error( error, inf_chat_session_error_quark, INF_CHAT_SESSION_ERROR_TYPE_INVALID, "Invalid message type: \"%s\"", string ); return FALSE; } /* * Message XML functions */ static xmlNodePtr inf_chat_session_message_to_xml(InfChatSession* session, const InfChatBufferMessage* message, gboolean for_sync) { xmlNodePtr xml; xml = xmlNewNode(NULL, (const xmlChar*)"message"); if(message->type != INF_CHAT_BUFFER_MESSAGE_NORMAL) { inf_xml_util_set_attribute( xml, "type", inf_chat_session_message_type_to_string(message->type) ); } if(for_sync) inf_xml_util_set_attribute_long(xml, "time", (long)message->time); inf_xml_util_set_attribute_uint( xml, "user", inf_user_get_id(message->user) ); if(message->text != NULL) inf_xml_util_add_child_text(xml, message->text, message->length); return xml; } static gboolean inf_chat_session_message_from_xml(InfChatSession* session, InfChatBufferMessage* message, xmlNodePtr xml, gboolean for_sync, GError** error) { xmlChar* type; gboolean result; InfChatBufferMessageType message_type; InfChatBufferMessageFlags message_flags; long message_time; guint user_id; InfUserTable* user_table; InfUser* user; message_flags = 0; type = inf_xml_util_get_attribute(xml, "type"); if(type == NULL) { message_type = INF_CHAT_BUFFER_MESSAGE_NORMAL; } else { result = inf_chat_session_message_type_from_string( (const char*)type, &message_type, error ); xmlFree(type); if(result == FALSE) return FALSE; } if(for_sync) { result = inf_xml_util_get_attribute_long_required( xml, "time", &message_time, error ); if(result == FALSE) return FALSE; message_flags = INF_CHAT_BUFFER_MESSAGE_BACKLOG; } else { if(message_type == INF_CHAT_BUFFER_MESSAGE_USERJOIN || message_type == INF_CHAT_BUFFER_MESSAGE_USERPART) { g_set_error( error, inf_chat_session_error_quark, INF_CHAT_SESSION_ERROR_TYPE_INVALID, "Non-backlog message type cannot be \"%s\"", inf_chat_session_message_type_to_string(message_type) ); return FALSE; } message_time = time(NULL); } if(!inf_xml_util_get_attribute_uint_required(xml, "user", &user_id, error)) return FALSE; user_table = inf_session_get_user_table(INF_SESSION(session)); user = inf_user_table_lookup_user_by_id(user_table, user_id); if(user == NULL) { g_set_error( error, inf_chat_session_error_quark, INF_CHAT_SESSION_ERROR_NO_SUCH_USER, _("No such user with ID \"%u\""), user_id ); return FALSE; } if(message_type != INF_CHAT_BUFFER_MESSAGE_USERJOIN && message_type != INF_CHAT_BUFFER_MESSAGE_USERPART) { message->text = inf_xml_util_get_child_text(xml, &message->length, NULL, error); if(!message->text) return FALSE; } else { message->text = NULL; message->length = 0; } message->type = message_type; message->user = user; message->time = message_time; message->flags = message_flags; return TRUE; } /* * Logging functions */ static gchar* inf_chat_session_strdup_strftime(const char* format, const struct tm* tm, gsize* len) { gsize alloc; gchar* str; size_t result; alloc = 64; str = g_malloc(alloc * sizeof(gchar)); result = strftime(str, alloc, format, tm); while(result == 0 && alloc < 1024) { alloc *= 2; str = g_realloc(str, alloc * sizeof(gchar)); result = strftime(str, alloc, format, tm); } if(result == 0) { g_free(str); return NULL; } if(len) *len = result; return str; } static void inf_chat_session_log_message(InfChatSession* session, const InfChatBufferMessage* message) { InfChatSessionPrivate* priv; struct tm* tm; gchar* time_str; const gchar* name; const gchar* text; priv = INF_CHAT_SESSION_PRIVATE(session); if(priv->log_file != NULL) { tm = localtime(&message->time); time_str = inf_chat_session_strdup_strftime("%c", tm, NULL); name = inf_user_get_name(message->user); text = message->text; switch(message->type) { case INF_CHAT_BUFFER_MESSAGE_NORMAL: fprintf(priv->log_file, "%s <%s> %s\n", time_str, name, message->text); break; case INF_CHAT_BUFFER_MESSAGE_EMOTE: fprintf(priv->log_file, "%s * %s %s\n", time_str, name, message->text); break; case INF_CHAT_BUFFER_MESSAGE_USERJOIN: fprintf(priv->log_file, _("%s --- %s has joined\n"), time_str, name); break; case INF_CHAT_BUFFER_MESSAGE_USERPART: fprintf(priv->log_file, _("%s --- %s has left\n"), time_str, name); break; default: g_assert_not_reached(); break; } g_free(time_str); fflush(priv->log_file); } } static void inf_chat_session_log_userlist_foreach_func(InfUser* user, gpointer user_data) { InfChatSessionLogUserlistForeachData* data; data = (InfChatSessionLogUserlistForeachData*)user_data; if(inf_user_get_status(user) != INF_USER_UNAVAILABLE) { fprintf( data->log_file, "%s --- [%s]\n", data->time_str, inf_user_get_name(user) ); ++ data->users_total; } } static void inf_chat_session_log_userlist(InfChatSession* session) { InfChatSessionPrivate* priv; InfChatSessionLogUserlistForeachData data; time_t cur_time; struct tm* tm; priv = INF_CHAT_SESSION_PRIVATE(session); if(priv->log_file != NULL) { cur_time = time(NULL); tm = localtime(&cur_time); data.time_str = inf_chat_session_strdup_strftime("%c", tm, NULL); data.log_file = priv->log_file; data.users_total = 0; inf_user_table_foreach_user( inf_session_get_user_table(INF_SESSION(session)), inf_chat_session_log_userlist_foreach_func, &data ); fprintf( data.log_file, _("%s --- %u users total\n"), data.time_str, data.users_total ); g_free(data.time_str); fflush(data.log_file); } } /* * Message reception */ static gboolean inf_chat_session_receive_message(InfChatSession* session, InfXmlConnection* connection, xmlNodePtr xml, GError** error) { InfChatSessionPrivate* priv; InfChatBufferMessage message; gboolean sync; priv = INF_CHAT_SESSION_PRIVATE(session); if(inf_session_get_status(INF_SESSION(session)) == INF_SESSION_SYNCHRONIZING) { sync = TRUE; } else { sync = FALSE; } if(!inf_chat_session_message_from_xml(session, &message, xml, sync, error)) return FALSE; if(!sync && (inf_user_get_status(message.user) == INF_USER_UNAVAILABLE || inf_user_get_connection(message.user) != connection)) { g_set_error( error, inf_user_error_quark(), INF_USER_ERROR_NOT_JOINED, "%s", _("User did not join from this connection") ); g_free(message.text); return FALSE; } g_signal_emit( session, chat_session_signals[RECEIVE_MESSAGE], 0, &message ); g_free(message.text); return TRUE; } static void inf_chat_session_user_join(InfChatSession* session, InfUser* user) { InfChatBufferMessage message; message.type = INF_CHAT_BUFFER_MESSAGE_USERJOIN; message.user = user; message.text = NULL; message.length = 0; message.time = time(NULL); message.flags = 0; g_signal_emit(session, chat_session_signals[RECEIVE_MESSAGE], 0, &message); } static void inf_chat_session_user_part(InfChatSession* session, InfUser* user) { InfChatBufferMessage message; message.type = INF_CHAT_BUFFER_MESSAGE_USERPART; message.user = user; message.text = NULL; message.length = 0; message.time = time(NULL); message.flags = 0; g_signal_emit(session, chat_session_signals[RECEIVE_MESSAGE], 0, &message); } /* * Signal handlers */ static void inf_chat_session_set_status_cb(InfUser* user, InfUserStatus new_status, gpointer user_data) { InfSession* session; session = INF_SESSION(user_data); if(inf_session_get_status(session) == INF_SESSION_RUNNING) { if(inf_user_get_status(user) != INF_USER_UNAVAILABLE && new_status == INF_USER_UNAVAILABLE) { inf_chat_session_user_part(INF_CHAT_SESSION(session), user); } else if(inf_user_get_status(user) == INF_USER_UNAVAILABLE && new_status != INF_USER_UNAVAILABLE) { inf_chat_session_user_join(INF_CHAT_SESSION(session), user); } } } static void inf_chat_session_add_user_cb(InfUserTable* user_table, InfUser* user, gpointer user_data) { g_signal_connect( user, "set-status", G_CALLBACK(inf_chat_session_set_status_cb), user_data ); if(inf_session_get_status(INF_SESSION(user_data)) == INF_SESSION_RUNNING) if(inf_user_get_status(user) != INF_USER_UNAVAILABLE) inf_chat_session_user_join(INF_CHAT_SESSION(user_data), user); } static void inf_chat_session_remove_user_cb(InfUserTable* user_table, InfUser* user, gpointer user_data) { if(inf_session_get_status(INF_SESSION(user_data)) == INF_SESSION_RUNNING) if(inf_user_get_status(user) != INF_USER_UNAVAILABLE) inf_chat_session_user_part(INF_CHAT_SESSION(user_data), user); inf_signal_handlers_disconnect_by_func( user, G_CALLBACK(inf_chat_session_set_status_cb), user_data ); } static void inf_chat_session_add_message_cb(InfChatBuffer* buffer, const InfChatBufferMessage* message, gpointer user_data) { /* Ignore these messages, we cannot send them */ if(message->type != INF_CHAT_BUFFER_MESSAGE_USERJOIN && message->type != INF_CHAT_BUFFER_MESSAGE_USERPART) { /* A message has been added to the buffer, so send it */ g_signal_emit( user_data, chat_session_signals[SEND_MESSAGE], 0, message ); } } /* * GObject overrides */ static void inf_chat_session_init(GTypeInstance* instance, gpointer g_class) { InfChatSession* session; InfChatSessionPrivate* priv; session = INF_CHAT_SESSION(instance); priv = INF_CHAT_SESSION_PRIVATE(session); priv->log_filename = NULL; priv->log_file = NULL; } static void inf_chat_session_constructor_foreach_user_func(InfUser* user, gpointer user_data) { g_signal_connect( user, "set-status", G_CALLBACK(inf_chat_session_set_status_cb), user_data ); } static GObject* inf_chat_session_constructor(GType type, guint n_construct_properties, GObjectConstructParam* construct_properties) { GObject* object; InfUserTable* user_table; InfChatBuffer* buffer; object = G_OBJECT_CLASS(parent_class)->constructor( type, n_construct_properties, construct_properties ); user_table = inf_session_get_user_table(INF_SESSION(object)); g_signal_connect_after( user_table, "add-user", G_CALLBACK(inf_chat_session_add_user_cb), object ); g_signal_connect_after( user_table, "remove-user", G_CALLBACK(inf_chat_session_remove_user_cb), object ); inf_user_table_foreach_user( INF_USER_TABLE(user_table), inf_chat_session_constructor_foreach_user_func, object ); buffer = INF_CHAT_BUFFER(inf_session_get_buffer(INF_SESSION(object))); g_assert(INF_IS_CHAT_BUFFER(buffer)); g_signal_connect_after( buffer, "add-message", G_CALLBACK(inf_chat_session_add_message_cb), object ); return object; } static void inf_chat_session_dispose_foreach_user_func(InfUser* user, gpointer user_data) { inf_signal_handlers_disconnect_by_func( user, G_CALLBACK(inf_chat_session_set_status_cb), user_data ); } static void inf_chat_session_dispose(GObject* object) { InfChatSession* session; InfChatBuffer* buffer; InfUserTable* user_table; session = INF_CHAT_SESSION(object); user_table = inf_session_get_user_table(INF_SESSION(session)); buffer = INF_CHAT_BUFFER(inf_session_get_buffer(INF_SESSION(session))); inf_user_table_foreach_user( INF_USER_TABLE(user_table), inf_chat_session_dispose_foreach_user_func, session ); inf_signal_handlers_disconnect_by_func( user_table, G_CALLBACK(inf_chat_session_add_user_cb), session ); inf_signal_handlers_disconnect_by_func( user_table, G_CALLBACK(inf_chat_session_remove_user_cb), session ); inf_signal_handlers_disconnect_by_func( buffer, G_CALLBACK(inf_chat_session_add_message_cb), session ); G_OBJECT_CLASS(parent_class)->dispose(object); } static void inf_chat_session_finalize(GObject* object) { InfChatSession* session; InfChatSessionPrivate* priv; session = INF_CHAT_SESSION(object); priv = INF_CHAT_SESSION_PRIVATE(session); inf_chat_session_set_log_file(session, NULL, NULL); G_OBJECT_CLASS(parent_class)->finalize(object); } static void inf_chat_session_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec) { InfChatSession* session; InfChatSessionPrivate* priv; const gchar* log_file; GError* error; session = INF_CHAT_SESSION(object); priv = INF_CHAT_SESSION_PRIVATE(session); switch(prop_id) { case PROP_LOG_FILE: error = NULL; log_file = g_value_get_string(value); if(!inf_chat_session_set_log_file(session, log_file, &error)) { g_warning("Failed to set log file: %s\n", error->message); g_error_free(error); } break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void inf_chat_session_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec) { InfChatSession* session; InfChatSessionPrivate* priv; session = INF_CHAT_SESSION(object); priv = INF_CHAT_SESSION_PRIVATE(session); switch(prop_id) { case PROP_LOG_FILE: g_value_set_string(value, priv->log_filename); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } /* * InfSession virtual functions and default signal handlers */ static void inf_chat_session_to_xml_sync(InfSession* session, xmlNodePtr parent) { InfChatBuffer* buffer; const InfChatBufferMessage* message; xmlNodePtr child; guint i; buffer = INF_CHAT_BUFFER(inf_session_get_buffer(session)); g_assert(parent_class->to_xml_sync != NULL); parent_class->to_xml_sync(session, parent); for(i = 0; i < inf_chat_buffer_get_n_messages(buffer); ++i) { message = inf_chat_buffer_get_message(buffer, i); child = inf_chat_session_message_to_xml( INF_CHAT_SESSION(session), message, TRUE ); xmlAddChild(parent, child); } } static gboolean inf_chat_session_process_xml_sync(InfSession* session, InfXmlConnection* connection, xmlNodePtr xml, GError** error) { if(strcmp((const char*)xml->name, "message") == 0) { return inf_chat_session_receive_message( INF_CHAT_SESSION(session), connection, xml, error ); } else { g_assert(parent_class->process_xml_sync != NULL); return parent_class->process_xml_sync(session, connection, xml, error); } } static InfCommunicationScope inf_chat_session_process_xml_run(InfSession* session, InfXmlConnection* connection, xmlNodePtr xml, GError** error) { gboolean result; if(strcmp((const char*)xml->name, "message") == 0) { result = inf_chat_session_receive_message( INF_CHAT_SESSION(session), connection, xml, error ); if(!result) return INF_COMMUNICATION_SCOPE_PTP; else return INF_COMMUNICATION_SCOPE_GROUP; } else { g_assert(parent_class->process_xml_run != NULL); return parent_class->process_xml_run(session, connection, xml, error); } } static void inf_chat_session_synchronization_complete(InfSession* session, InfXmlConnection* connection) { if(inf_session_get_status(session) == INF_SESSION_SYNCHRONIZING) inf_chat_session_log_userlist(INF_CHAT_SESSION(session)); g_assert(parent_class->synchronization_complete != NULL); parent_class->synchronization_complete(session, connection); } static void inf_chat_session_synchronization_failed(InfSession* session, InfXmlConnection* connection, const GError* error) { InfChatSessionPrivate* priv; time_t cur_time; struct tm* tm; gchar* time_str; if(inf_session_get_status(session) == INF_SESSION_SYNCHRONIZING) { priv = INF_CHAT_SESSION_PRIVATE(session); if(priv->log_file != NULL) { cur_time = time(NULL); tm = localtime(&cur_time); time_str = inf_chat_session_strdup_strftime("%c", tm, NULL); fprintf( priv->log_file, "%s --- Synchronization failed: %s\n", time_str, error->message ); g_free(time_str); } } g_assert(parent_class->synchronization_failed != NULL); parent_class->synchronization_failed(session, connection, error); } static InfUser* inf_chat_session_user_new(InfSession* session, GParameter* params, guint n_params) { return g_object_newv(INF_TYPE_USER, n_params, params); } static void inf_chat_session_receive_message_handler(InfChatSession* session, const InfChatBufferMessage* message) { InfChatBuffer* buffer; buffer = INF_CHAT_BUFFER(inf_session_get_buffer(INF_SESSION(session))); /* The add_message signal handler would try to send the message, so prevent * this. */ inf_signal_handlers_block_by_func( buffer, G_CALLBACK(inf_chat_session_add_message_cb), session ); switch(message->type) { case INF_CHAT_BUFFER_MESSAGE_NORMAL: inf_chat_buffer_add_message( buffer, message->user, message->text, message->length, message->time, message->flags ); break; case INF_CHAT_BUFFER_MESSAGE_EMOTE: inf_chat_buffer_add_emote_message( buffer, message->user, message->text, message->length, message->time, message->flags ); break; case INF_CHAT_BUFFER_MESSAGE_USERJOIN: inf_chat_buffer_add_userjoin_message( buffer, message->user, message->time, message->flags ); break; case INF_CHAT_BUFFER_MESSAGE_USERPART: inf_chat_buffer_add_userpart_message( buffer, message->user, message->time, message->flags ); break; default: g_assert_not_reached(); break; } inf_signal_handlers_unblock_by_func( buffer, G_CALLBACK(inf_chat_session_add_message_cb), session ); /* Backlog messages (received during synchronization) are not yet logged. * We will need to parse the last messages in the log first and check * whether they have already been logged. */ if(inf_session_get_status(INF_SESSION(session)) == INF_SESSION_RUNNING) inf_chat_session_log_message(session, message); } static void inf_chat_session_send_message_handler(InfChatSession* session, const InfChatBufferMessage* message) { xmlNodePtr xml; /* Actually send the message over the network */ xml = inf_chat_session_message_to_xml(session, message, FALSE); inf_session_send_to_subscriptions(INF_SESSION(session), xml); inf_chat_session_log_message(session, message); } /* * GType registration */ static void inf_chat_session_class_init(gpointer g_class, gpointer class_data) { GObjectClass* object_class; InfSessionClass* session_class; InfChatSessionClass* chat_session_class; object_class = G_OBJECT_CLASS(g_class); session_class = INF_SESSION_CLASS(g_class); chat_session_class = INF_CHAT_SESSION_CLASS(g_class); parent_class = INF_SESSION_CLASS(g_type_class_peek_parent(g_class)); g_type_class_add_private(g_class, sizeof(InfChatSessionPrivate)); object_class->constructor = inf_chat_session_constructor; object_class->dispose = inf_chat_session_dispose; object_class->finalize = inf_chat_session_finalize; object_class->set_property = inf_chat_session_set_property; object_class->get_property = inf_chat_session_get_property; session_class->to_xml_sync = inf_chat_session_to_xml_sync; session_class->process_xml_sync = inf_chat_session_process_xml_sync; session_class->process_xml_run = inf_chat_session_process_xml_run; session_class->synchronization_complete = inf_chat_session_synchronization_complete; session_class->synchronization_failed = inf_chat_session_synchronization_failed; session_class->user_new = inf_chat_session_user_new; chat_session_class->receive_message = inf_chat_session_receive_message_handler; chat_session_class->send_message = inf_chat_session_send_message_handler; inf_chat_session_error_quark = g_quark_from_static_string("INF_CHAT_SESSION_ERROR"); g_object_class_install_property( object_class, PROP_LOG_FILE, g_param_spec_string( "log-file", "Log file", "The file into which to store all received messages", NULL, G_PARAM_READWRITE ) ); /** * InfChatSession::receive-message: * @session: The #InfChatSession that is receiving a message. * @message: The #InfChatBufferMessage that was received. * * This signal is emitted whenever a message has been received. If the * session is in %INF_SESSION_SYNCHRONIZING state the received message was * a backlog message. */ chat_session_signals[RECEIVE_MESSAGE] = g_signal_new( "receive-message", G_OBJECT_CLASS_TYPE(object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(InfChatSessionClass, receive_message), NULL, NULL, inf_marshal_VOID__BOXED, G_TYPE_NONE, 1, INF_TYPE_CHAT_BUFFER_MESSAGE | G_SIGNAL_TYPE_STATIC_SCOPE ); /** * InfChatSession::send-message: * @session: The #InfChatSession that is sending a message. * @message: The #InfChatBufferMessage that is sent. * * This signal is emitted whenever a message is sent. Messages can be sent * by calling inf_chat_buffer_add_message() or * inf_chat_buffer_add_emote_message() on the session's #InfChatBuffer. * Messages of type %INF_CHAT_BUFFER_MESSAGE_USERJOIN or * %INF_CHAT_BUFFER_MESSAGE_USERPART can not be sent explicitely, so this * signal will never be emitted for such messages. */ chat_session_signals[SEND_MESSAGE] = g_signal_new( "send-message", G_OBJECT_CLASS_TYPE(object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(InfChatSessionClass, send_message), NULL, NULL, inf_marshal_VOID__BOXED, G_TYPE_NONE, 1, INF_TYPE_CHAT_BUFFER_MESSAGE | G_SIGNAL_TYPE_STATIC_SCOPE ); } GType inf_chat_session_get_type(void) { static GType chat_session_type = 0; if(!chat_session_type) { static const GTypeInfo chat_session_type_info = { sizeof(InfChatSessionClass), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ inf_chat_session_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InfChatSession), /* instance_size */ 0, /* n_preallocs */ inf_chat_session_init, /* instance_init */ NULL /* value_table */ }; chat_session_type = g_type_register_static( INF_TYPE_SESSION, "InfChatSession", &chat_session_type_info, 0 ); } return chat_session_type; } /* * Public API */ /** * inf_chat_session_new: * @manager: A #InfCommunicationManager. * @backlog_size: The number of messages to store. * @status: Initial status of the session. If this is * %INF_SESSION_SYNCHRONIZING or %INF_SESSION_PRESYNC, then @sync_group and * @sync_connection need to be set. * @sync_group: A group in which the session is synchronized. Ignored if * @status is %INF_SESSION_RUNNING. * @sync_connection: A connection to synchronize the session from. Ignored if * @status is %INF_SESSION_RUNNING. * * Creates a new #InfChatSession with no initial messages. The communication * manager is used to send and receive requests from subscription and * synchronization. * * @backlog_size specifies how much messages to save before dropping old * messages. This also limits how many old messages are transferred when * synchronizing the session. * * If @status is %INF_SESSION_PRESYNC or %INF_SESSION_SYNCHRONIZING, then the * session will initially be synchronized, meaning an initial backlog is * retrieved from @sync_connection (which must not be %NULL in this case). If * you are subscribed to the session, set the subscription group via * inf_session_set_subscription_group(). * * Returns: A new #InfChatSession. */ InfChatSession* inf_chat_session_new(InfCommunicationManager* manager, guint backlog_size, InfSessionStatus status, InfCommunicationGroup* sync_group, InfXmlConnection* sync_connection) { InfChatBuffer* buffer; InfChatSession* session; g_return_val_if_fail(INF_COMMUNICATION_IS_MANAGER(manager), NULL); g_return_val_if_fail( (status == INF_SESSION_RUNNING && sync_group == NULL && sync_connection == NULL) || (status != INF_SESSION_RUNNING && INF_COMMUNICATION_IS_GROUP(sync_group) && INF_IS_XML_CONNECTION(sync_connection)), NULL ); /* This actually does more than just g_object_new, but I think language * bindings can just copy this. */ buffer = inf_chat_buffer_new(backlog_size); session = INF_CHAT_SESSION( g_object_new( INF_TYPE_CHAT_SESSION, "communication-manager", manager, "buffer", buffer, "status", status, "sync-group", sync_group, "sync-connection", sync_connection, NULL ) ); g_object_unref(buffer); return session; } /** * inf_chat_session_set_log_file: * @session: A #InfChatSession. * @log_file: A filename to store all received messages into. * @error: Location to store error information, if any. * * Sets a file onto which all received messages are appended. The file is * created if it does not exist. If a previous log file was set, then it is * closed before opening the new file. * * Backlog messages received upon synchronization are not logged. * * Returns: %TRUE if the log file could be opened, %FALSE otherwise (in which * case @error is set). */ gboolean inf_chat_session_set_log_file(InfChatSession* session, const gchar* log_file, GError** error) { InfChatSessionPrivate* priv; FILE* new_file; int save_errno; long offset; time_t cur_time; struct tm* tm; gchar* time_str; guint len; g_return_val_if_fail(INF_IS_CHAT_SESSION(session), FALSE); priv = INF_CHAT_SESSION_PRIVATE(session); /* Open the new log file before doing anything else, so that we keep * the current log file if this fails. */ if(log_file != NULL) { new_file = fopen(log_file, "a"); if(new_file == NULL) { save_errno = errno; } else { offset = ftell(new_file); if(offset == -1) { save_errno = errno; fclose(new_file); new_file = NULL; } } if(new_file == NULL) { g_set_error( error, G_FILE_ERROR, g_file_error_from_errno(save_errno), "%s", strerror(save_errno) ); return FALSE; } } cur_time = time(NULL); tm = localtime(&cur_time); time_str = inf_chat_session_strdup_strftime("%c", tm, NULL); if(priv->log_file != NULL) { fprintf(priv->log_file, _("%s --- Log closed\n"), time_str); fclose(priv->log_file); } if(log_file != NULL) { len = strlen(log_file); priv->log_filename = g_realloc(priv->log_filename, (len + 1) * sizeof(gchar)); memcpy(priv->log_filename, log_file, len); priv->log_filename[len] = '\0'; priv->log_file = new_file; if(offset > 0) fprintf(priv->log_file, "\n"); fprintf(priv->log_file, _("%s --- Log opened\n"), time_str); if(inf_session_get_status(INF_SESSION(session)) == INF_SESSION_RUNNING) inf_chat_session_log_userlist(session); else fflush(priv->log_file); } else { g_free(priv->log_filename); priv->log_filename = NULL; priv->log_file = NULL; } g_free(time_str); return TRUE; } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/common/inf-sasl-context.h0000644000175000017500000001462212264763732020162 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_SASL_CONTEXT_H__ #define __INF_SASL_CONTEXT_H__ #include #include #include G_BEGIN_DECLS #define INF_TYPE_SASL_CONTEXT (inf_sasl_context_get_type()) /** * InfSaslContext: * * #InfSaslContext is an opaque data type. You should only access it via the * public API functions. */ typedef struct _InfSaslContext InfSaslContext; /** * InfSaslContextSession: * * #InfSaslContextSession represents an ongoing authentication session. Create * with inf_sasl_context_server_start_session() or * inf_sasl_context_client_start_session(). */ typedef struct _InfSaslContextSession InfSaslContextSession; /** * InfSaslContextCallbackFunc: * @session: A #InfSaslContextSession. * @property: The property requested. * @session_data: The session data for session specified in * inf_sasl_context_server_start_session() or * inf_sasl_context_client_start_session(). * @user_data: The user data specified in inf_sasl_context_set_callback(). * * This callback is called whenever a property is required to proceed with * authentication. For example, when a password is required, the callback is * called with @property set to %GSASL_PASSCODE. * * The function is then expected to set that property using * inf_sasl_context_session_set_property() and, once it is done, call * inf_sasl_context_session_continue(). This can happen fully asynchronously, * that is it does not need to take place directly within the callback but the * callback can, for example, open a dialog for the user to enter a password * and then once the user closes the dialog call the two functions mentioned * above. */ typedef void(*InfSaslContextCallbackFunc)(InfSaslContextSession* session, Gsasl_property property, gpointer session_data, gpointer user_data); /** * InfSaslContextSessionFeedFunc: * @session: A #InfSaslContextSession. * @data: The response to the fed data, base64 encoded and null-terminated. * @needs_more: If %TRUE then inf_sasl_context_session_feed() needs to be * called again with more data, otherwise the authentication has finished. * @error: This is nonzero if an error occured while processing the input * data. * @user_data: The user data specified in inf_sasl_context_session_feed(). * * This function is called in response to inf_sasl_context_session_feed(). * When all required properties (if any) have been provided by the callback * function then this function is called with the response to send to the * remote site. * * If an error occurred then @error will be set and @data will be %NULL. */ typedef void(*InfSaslContextSessionFeedFunc)(InfSaslContextSession* session, const char* data, gboolean needs_more, const GError* error, gpointer user_data); GType inf_sasl_context_get_type(void) G_GNUC_CONST; InfSaslContext* inf_sasl_context_new(GError** error); InfSaslContext* inf_sasl_context_ref(InfSaslContext* context); void inf_sasl_context_unref(InfSaslContext* context); void inf_sasl_context_set_callback(InfSaslContext* context, InfSaslContextCallbackFunc callback, gpointer user_data); InfSaslContextSession* inf_sasl_context_client_start_session(InfSaslContext* context, InfIo* io, const char* mech, gpointer session_data, GError** error); char* inf_sasl_context_client_list_mechanisms(InfSaslContext* context, GError** error); gboolean inf_sasl_context_client_supports_mechanism(InfSaslContext* context, const char* mech); const char* inf_sasl_context_client_suggest_mechanism(InfSaslContext* context, const char* mechanisms); InfSaslContextSession* inf_sasl_context_server_start_session(InfSaslContext* context, InfIo* io, const char* mech, gpointer session_data, GError** error); char* inf_sasl_context_server_list_mechanisms(InfSaslContext* context, GError** error); gboolean inf_sasl_context_server_supports_mechanism(InfSaslContext* context, const char* mech); void inf_sasl_context_stop_session(InfSaslContext* context, InfSaslContextSession* session); const char* inf_sasl_context_session_get_property(InfSaslContextSession* session, Gsasl_property prop); void inf_sasl_context_session_set_property(InfSaslContextSession* session, Gsasl_property prop, const char* value); void inf_sasl_context_session_continue(InfSaslContextSession* session, int retval); void inf_sasl_context_session_feed(InfSaslContextSession* session, const char* data, InfSaslContextSessionFeedFunc func, gpointer user_data); G_END_DECLS #endif /* __INF_SASL_CONTEXT_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/common/inf-error.c0000644000175000017500000002304012264763732016654 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ /** * SECTION:inf-error * @short_description: Common error codes * @include: libinfinity/common/inf-error.h * @stability: Unstable * * This section defines some common error codes that are used on both client * and server side in infinote, and maps these to #GErrors. **/ #include #include #include #include /* Get ssize_t on MSVC, required by gnutls.h */ #include /* TODO: Cache GQuarks */ /** * inf_request_error_quark: * * Error domain for request errors. Errors in this domain will be from the * #InfRequestError enumeration. See #GError for information on error domains. * * Returns: A GQuark. */ GQuark inf_request_error_quark(void) { return g_quark_from_static_string("INF_REQUEST_ERROR"); } /** * inf_request_strerror: * @code: An error code from the #InfRequestError enumeration. * * Returns a human-readable string for the given error code. * * Returns: A static string that must not be freed. */ const gchar* inf_request_strerror(InfRequestError code) { switch(code) { case INF_REQUEST_ERROR_UNKNOWN_DOMAIN: return _("Received error from an unknown domain"); case INF_REQUEST_ERROR_REPLY_UNPROCESSED: return _("Failed to process server reply"); case INF_REQUEST_ERROR_INVALID_SEQ: return _("Server reply contains invalid sequence number"); case INF_REQUEST_ERROR_NO_SUCH_ATTRIBUTE: return _("A required attribute was not set in request"); case INF_REQUEST_ERROR_INVALID_NUMBER: return _("An attribute contained an invalid number"); case INF_REQUEST_ERROR_FAILED: return _("An unknown request error occured"); default: return _("An error with unknown error code occured"); } } /** * inf_user_error_quark: * * Error domain for user-related errors. Errors in this domain will be from * the #InfUserError enumeration. See #GError for information on error * domains. * * Returns: A GQuark. */ GQuark inf_user_error_quark(void) { return g_quark_from_static_string("INF_USER_ERROR"); } /** * inf_user_strerror: * @code: An error code from the #InfUserError enumeration. * * Returns a human-readable string for the given error code. * * Returns: A static string that must not be freed. */ const gchar* inf_user_strerror(InfUserError code) { switch(code) { case INF_USER_ERROR_NAME_IN_USE: return _("Name is already in use"); case INF_USER_ERROR_ID_PROVIDED: return _("'id' attribute provided in request"); case INF_USER_ERROR_NO_SUCH_USER: return _("There is no user with the given ID"); case INF_USER_ERROR_STATUS_UNAVAILABLE: return _("'status' attribute is 'unavailable' in join or rejoin request"); case INF_USER_ERROR_NOT_JOINED: return _("User did not join via this connection"); case INF_USER_ERROR_INVALID_STATUS: return _("'status' attribute has invalid value"); case INF_USER_ERROR_FAILED: return _("An unknown user error occured"); default: return _("An error with unknown error code occured"); } } /** * inf_directory_error_quark: * * Error domain for directory errors. Errors in this domain will be from the * #InfDirectoryError enumeration. See #GError for information on error * domains. * * Returns: A GQuark. */ GQuark inf_directory_error_quark(void) { return g_quark_from_static_string("INF_DIRECTORY_ERROR"); } /** * inf_directory_strerror: * @code: An error code from the #InfDirectoryError enumeration. * * Returns a human-readable string for the given error code. * * Returns: A static string that must not be freed. */ const gchar* inf_directory_strerror(InfDirectoryError code) { switch(code) { case INF_DIRECTORY_ERROR_NO_WELCOME_MESSAGE: return _("Server did not send an initial welcome message"); case INF_DIRECTORY_ERROR_VERSION_MISMATCH: return _("The server and client use different protocol versions"); case INF_DIRECTORY_ERROR_NODE_EXISTS: return _("A node with this name exists already"); case INF_DIRECTORY_ERROR_INVALID_NAME: return _("Invalid node name"); case INF_DIRECTORY_ERROR_NO_SUCH_NODE: return _("Node does not exist"); case INF_DIRECTORY_ERROR_NO_SUCH_SUBSCRIPTION_REQUEST: return _("No previous subscription request present"); case INF_DIRECTORY_ERROR_CHAT_DISABLED: return _("The chat is disabled on the server side"); case INF_DIRECTORY_ERROR_NOT_A_SUBDIRECTORY: return _("Node is not a subdirectory"); case INF_DIRECTORY_ERROR_NOT_A_NOTE: return _("Node is not a note"); case INF_DIRECTORY_ERROR_ROOT_NODE_REMOVE_ATTEMPT: return _("The root node cannot be removed"); case INF_DIRECTORY_ERROR_ALREADY_EXPLORED: return _("Subdirectory has already been explored"); case INF_DIRECTORY_ERROR_TYPE_UNKNOWN: return _("Note type is not supported"); case INF_DIRECTORY_ERROR_ALREADY_SUBSCRIBED: return _("Connection is already subscribed to this session"); case INF_DIRECTORY_ERROR_UNSUBSCRIBED: return _("The requesting connection is not subscribed to the session"); case INF_DIRECTORY_ERROR_TOO_MUCH_CHILDREN: return _("Server sent more explored nodes then announced"); case INF_DIRECTORY_ERROR_TOO_FEW_CHILDREN: return _("Server sent not as much explored nodes as announced"); case INF_DIRECTORY_ERROR_NETWORK_UNSUPPORTED: return _("The session does not support the network through which the " "connection attempt is being made."); case INF_DIRECTORY_ERROR_METHOD_UNSUPPORTED: return _("The session uses an unsupported communication method"); case INF_DIRECTORY_ERROR_UNEXPECTED_SYNC_IN: return _("Received sync-in message without having requested a sync-in"); case INF_DIRECTORY_ERROR_UNEXPECTED_MESSAGE: return _("Unexpected XML message"); case INF_DIRECTORY_ERROR_NO_STORAGE: return _("Server does not have a background storage"); case INF_DIRECTORY_ERROR_FAILED: return _("An unknown directory error has occured"); default: return _("An error with unknown code has occured"); } } /** * inf_authentication_detail_error_quark: * * Error domain for further information on authentication errors. Errors in * this domain will be from the #InfAuthenticationDetailError enumeration. * See #GError for information on error domains. * * Returns: A GQuark. */ GQuark inf_authentication_detail_error_quark(void) { return g_quark_from_static_string("INF_AUTHENTICATION_DETAIL_ERROR"); } /** * inf_authentication_detail_strerror: * @code: An error code from the #InfAuthenticationDetailError enumeration. * * Returns a human-readable string for the given error code. * * Returns: A static string that must not be freed. */ const gchar* inf_authentication_detail_strerror(InfAuthenticationDetailError code) { switch(code) { case INF_AUTHENTICATION_DETAIL_ERROR_AUTHENTICATION_FAILED: return _("User did not provide valid credentials."); case INF_AUTHENTICATION_DETAIL_ERROR_USER_NOT_AUTHORIZED: return _("User is not permitted to connect to this server."); case INF_AUTHENTICATION_DETAIL_ERROR_TRY_AGAIN: return _("Authentication was temporarily " "interrupted on the server side."); case INF_AUTHENTICATION_DETAIL_ERROR_SERVER_ERROR: return _("An error cocured while checking user permissions."); default: return _("An error with unknown code has occured"); } } /** * inf_gnutls_error_quark: * * Error domain for GnuTLS errors. Errors in this domain will be GnuTLS error * codes. See #GError for information on error domains. * * Returns: A GQuark. */ GQuark inf_gnutls_error_quark(void) { return g_quark_from_static_string("INF_GNUTLS_ERROR"); } /** * inf_gnutls_set_error: * @error: Location to store the error, or %NULL. * @error_code: A GnuTLS error code. * * Sets a #GError from a GnuTLS error code. If @error is %NULL, does nothing. */ void inf_gnutls_set_error(GError** error, int error_code) { if(error != NULL) { *error = g_error_new_literal( inf_gnutls_error_quark(), error_code, gnutls_strerror(error_code) ); } } /** * inf_gsasl_error_quark: * * Error domain for GNU SASL errors. Errors in this domain will be GNU SASL * error codes. See #GError for information on error domains. * * Returns: A GQuark. */ GQuark inf_gsasl_error_quark(void) { return g_quark_from_static_string("INF_GSASL_ERROR"); } /** * inf_gsasl_set_error: * @error: Location to store the error, or %NULL. * @error_code: A GNU SASL error code. * * Sets a #GError from a GNU SASL error code. If @error is %NULL, does nothing. */ void inf_gsasl_set_error(GError** error, int error_code) { if(error != NULL) { *error = g_error_new_literal( inf_gsasl_error_quark(), error_code, gsasl_strerror(error_code) ); } } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/common/inf-certificate-chain.h0000644000175000017500000000433212264763732021075 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_CERTIFICATE_CHAIN_H__ #define __INF_CERTIFICATE_CHAIN_H__ #include /* Get ssize_t on MSVC, required by gnutls.h */ #include #include G_BEGIN_DECLS #define INF_TYPE_CERTIFICATE_CHAIN (inf_certificate_chain_get_type()) /** * InfCertificateChain: * * #InfCertificateChain is an opaque data type. You should only access it * via the public API functions. */ typedef struct _InfCertificateChain InfCertificateChain; GType inf_certificate_chain_get_type(void) G_GNUC_CONST; InfCertificateChain* inf_certificate_chain_new(gnutls_x509_crt_t* certs, guint n_certs); InfCertificateChain* inf_certificate_chain_ref(InfCertificateChain* chain); void inf_certificate_chain_unref(InfCertificateChain* chain); gnutls_x509_crt_t* inf_certificate_chain_get_raw(const InfCertificateChain* chain); gnutls_x509_crt_t inf_certificate_chain_get_root_certificate(const InfCertificateChain* chain); gnutls_x509_crt_t inf_certificate_chain_get_own_certificate(const InfCertificateChain* chain); gnutls_x509_crt_t inf_certificate_chain_get_nth_certificate(const InfCertificateChain* chain, guint n); guint inf_certificate_chain_get_n_certificates(const InfCertificateChain* chain); G_END_DECLS #endif /* __INF_CERTIFICATE_CHAIN_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/common/inf-init.c0000644000175000017500000000550012264763732016467 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include /* Get ssize_t on MSVC, required by gnutls.h */ #include #include #ifdef G_OS_WIN32 # include #endif static guint inf_init_counter = 0; extern gboolean INF_XMPP_CONNECTION_PRINT_TRAFFIC; /** * inf_init: * @error: Location to store error information, if any. * * This function initializes the libinfinity library and should be called * before any other functions of the library. The function does nothing if * it has already been called before. * * Returns: Whether the initialization was successful or not. */ gboolean inf_init(GError** error) { #ifdef G_OS_WIN32 WSADATA data; int result; gchar* error_message; #endif if(!g_thread_supported()) g_thread_init(NULL); if(inf_init_counter == 0) { #ifdef G_OS_WIN32 result = WSAStartup(MAKEWORD(2, 2), &data); if(result != 0) { error_message = g_win32_error_message(result); g_set_error( error, g_quark_from_static_string("INF_INIT_ERROR"), 0, "%s", error_message ); g_free(error_message); return FALSE; } #endif g_type_init(); gnutls_global_init(); _inf_gettext_init(); } /* Initialize traffic debug */ if(g_getenv("LIBINFINITY_DEBUG_PRINT_TRAFFIC")) INF_XMPP_CONNECTION_PRINT_TRAFFIC = TRUE; else INF_XMPP_CONNECTION_PRINT_TRAFFIC = FALSE; ++inf_init_counter; return TRUE; } /** * inf_deinit: * * This functions deinitializes the libinfinity library. Make sure that all * objects the library provides have been freed before calling this function. * If inf_init() has been called multiple times, then inf_deinit() needs to be * called the same number of times to actually deinitialize the library. */ void inf_deinit(void) { if(--inf_init_counter == 0) { gnutls_global_deinit(); #ifdef G_OS_WIN32 WSACleanup(); #endif } } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/common/inf-init.h0000644000175000017500000000206312264763732016475 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_INIT_H__ #define __INF_INIT_H__ #include G_BEGIN_DECLS gboolean inf_init(GError** error); void inf_deinit(void); G_END_DECLS #endif /* __INF_INIT_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/common/inf-session.c0000644000175000017500000023662612264763732017226 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ /** * SECTION:inf-session * @title: InfSession * @short_description: Basic session object and synchronization * @include: libinfinity/common/inf-session.h * @stability: Unstable * * #InfSession represents an editing session. The actual type of document that * is edited is not specified, so instantiating #InfSession does not make * any sense. You rather want to use a derived class such as #InfTextSession. * Normally, the #InfcBrowser or #InfdDirectory, respectively, already take * care of instantiating the correct #InfSession. * * A session basically consists of the document being edited (also called * buffer, see #InfBuffer) and the users that are working on the document, * see #InfUserTable. * * A session can either start in %INF_SESSION_RUNNING state, in which it * is created with the initial buffer and user table. It may also start in * %INF_SESSION_SYNCHRONIZING state. In this case, both buffer and user table * are initially empty and are copied from another system over the network. * When the copy is complete, the session enters %INF_SESSION_RUNNING state. * * To be notified about changes other users make to a session, you need to * subscribe to the session (on client side), or wait for incoming * subscriptions (on server side). This is normally done by * infc_browser_iter_subscribe_session(). The first action that is performed * upon subscription is a synchronization as described above. When the * synchronization is complete, the #InfSession::synchronization-complete signal * is emitted. * * After subscription, one can observe modifications other users make, but it is * not possible to make own modifications. Before doing so, a #InfUser needs to * be joined. This is done by client/server specific API such as * infc_session_proxy_join_user() or infd_session_proxy_add_user(). The * required parameters still depend on the actual note type, which is why most * note implementations offer their own API to join a user. **/ #include #include #include #include #include #include #include #include #include /* TODO: Set buffer to non-editable during synchronization */ /* TODO: Cache requests received by other group members * during synchronization and process them afterwards */ typedef struct _InfSessionSync InfSessionSync; struct _InfSessionSync { InfCommunicationGroup* group; InfXmlConnection* conn; guint messages_total; guint messages_sent; InfSessionSyncStatus status; }; typedef struct _InfSessionPrivate InfSessionPrivate; struct _InfSessionPrivate { InfCommunicationManager* manager; InfBuffer* buffer; InfUserTable* user_table; InfSessionStatus status; /* Group of subscribed connections */ InfCommunicationGroup* subscription_group; union { /* INF_SESSION_PRESYNC */ struct { InfCommunicationGroup* group; InfXmlConnection* conn; gboolean closing; } presync; /* INF_SESSION_SYNCHRONIZING */ struct { InfCommunicationGroup* group; InfXmlConnection* conn; guint messages_total; guint messages_received; gboolean closing; } sync; /* INF_SESSION_RUNNING */ struct { GSList* syncs; } run; } shared; }; typedef struct _InfSessionXmlData InfSessionXmlData; struct _InfSessionXmlData { InfSession* session; xmlNodePtr xml; }; enum { PROP_0, /* construct only */ PROP_COMMUNICATION_MANAGER, PROP_BUFFER, PROP_USER_TABLE, PROP_STATUS, PROP_SYNC_CONNECTION, PROP_SYNC_GROUP, /* read/write */ PROP_SUBSCRIPTION_GROUP }; enum { CLOSE, SYNCHRONIZATION_BEGIN, SYNCHRONIZATION_PROGRESS, SYNCHRONIZATION_COMPLETE, SYNCHRONIZATION_FAILED, LAST_SIGNAL }; #define INF_SESSION_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), INF_TYPE_SESSION, InfSessionPrivate)) static GObjectClass* parent_class; static guint session_signals[LAST_SIGNAL]; static GQuark inf_session_sync_error_quark; /* * Utility functions. */ static const gchar* inf_session_sync_strerror(InfSessionSyncError errcode) { switch(errcode) { case INF_SESSION_SYNC_ERROR_GOT_MESSAGE_IN_PRESYNC: return _("Unexpectedly got an XML message in presync"); case INF_SESSION_SYNC_ERROR_UNEXPECTED_NODE: return _("Got unexpected XML node during synchronization"); case INF_SESSION_SYNC_ERROR_ID_NOT_PRESENT: return _("'id' attribute in user message is missing"); case INF_SESSION_SYNC_ERROR_ID_IN_USE: return _("User ID is already in use"); case INF_SESSION_SYNC_ERROR_NAME_NOT_PRESENT: return _("'name' attribute in user message is missing"); case INF_SESSION_SYNC_ERROR_NAME_IN_USE: return _("User Name is already in use"); case INF_SESSION_SYNC_ERROR_CONNECTION_CLOSED: return _("The connection was closed unexpectedly"); case INF_SESSION_SYNC_ERROR_SENDER_CANCELLED: return _("The sender cancelled the synchronization"); case INF_SESSION_SYNC_ERROR_RECEIVER_CANCELLED: return _("The receiver cancelled the synchronization"); case INF_SESSION_SYNC_ERROR_UNEXPECTED_BEGIN_OF_SYNC: return _("Got begin-of-sync message, but synchronization is already " "in progress"); case INF_SESSION_SYNC_ERROR_NUM_MESSAGES_MISSING: return _("begin-of-sync message does not contain the number of messages " "to expect"); case INF_SESSION_SYNC_ERROR_UNEXPECTED_END_OF_SYNC: return _("Got end-of-sync message, but synchronization is still in " "progress"); case INF_SESSION_SYNC_ERROR_EXPECTED_BEGIN_OF_SYNC: return _("Expected begin-of-sync message as first message during " "synchronization"); case INF_SESSION_SYNC_ERROR_EXPECTED_END_OF_SYNC: return _("Expected end-of-sync message as last message during " "synchronization"); case INF_SESSION_SYNC_ERROR_FAILED: return _("An unknown synchronization error has occured"); default: return _("An error with unknown error code occured"); } } static const gchar* inf_session_get_sync_error_message(GQuark domain, guint code) { if(domain == inf_session_sync_error_quark) return inf_session_sync_strerror(code); /* TODO: Add a possibilty for sub classes to register their error domains * that can occur in process_xml_sync. Maybe via a translate_error_sync * vfunc. */ return _("An error with unknown error domain occured"); } static GSList* inf_session_find_sync_item_by_connection(InfSession* session, InfXmlConnection* conn) { InfSessionPrivate* priv; GSList* item; priv = INF_SESSION_PRIVATE(session); g_return_val_if_fail(priv->status == INF_SESSION_RUNNING, NULL); for(item = priv->shared.run.syncs; item != NULL; item = g_slist_next(item)) { if( ((InfSessionSync*)item->data)->conn == conn) return item; } return NULL; } static InfSessionSync* inf_session_find_sync_by_connection(InfSession* session, InfXmlConnection* conn) { GSList* item; item = inf_session_find_sync_item_by_connection(session, conn); if(item == NULL) return NULL; return (InfSessionSync*)item->data; } /* Required by inf_session_release_connection() */ static void inf_session_connection_notify_status_cb(InfXmlConnection* connection, GParamSpec* pspec, gpointer user_data); static void inf_session_release_connection(InfSession* session, InfXmlConnection* connection) { InfSessionPrivate* priv; InfSessionSync* sync; GSList* item; /* gboolean has_connection;*/ priv = INF_SESSION_PRIVATE(session); switch(priv->status) { case INF_SESSION_PRESYNC: g_assert(priv->shared.presync.conn == connection); g_assert(priv->shared.presync.group != NULL); g_object_unref(priv->shared.presync.group); priv->shared.presync.conn = NULL; priv->shared.presync.group = NULL; break; case INF_SESSION_SYNCHRONIZING: g_assert(priv->shared.sync.conn == connection); g_assert(priv->shared.sync.group != NULL); g_object_unref(priv->shared.sync.group); priv->shared.sync.conn = NULL; priv->shared.sync.group = NULL; break; case INF_SESSION_RUNNING: item = inf_session_find_sync_item_by_connection(session, connection); g_assert(item != NULL); sync = item->data; g_object_unref(sync->group); g_slice_free(InfSessionSync, sync); priv->shared.run.syncs = g_slist_delete_link( priv->shared.run.syncs, item ); break; case INF_SESSION_CLOSED: default: g_assert_not_reached(); break; } inf_signal_handlers_disconnect_by_func( G_OBJECT(connection), G_CALLBACK(inf_session_connection_notify_status_cb), session ); g_object_unref(connection); } static void inf_session_send_sync_error(InfSession* session, GError* error) { InfSessionPrivate* priv; xmlNodePtr node; priv = INF_SESSION_PRIVATE(session); g_return_if_fail(priv->status == INF_SESSION_SYNCHRONIZING); g_return_if_fail(priv->shared.sync.conn != NULL); node = inf_xml_util_new_node_from_error(error, NULL, "sync-error"); inf_communication_group_send_message( priv->shared.sync.group, priv->shared.sync.conn, node ); } /* * Signal handlers. */ static void inf_session_connection_notify_status_cb(InfXmlConnection* connection, GParamSpec* pspec, gpointer user_data) { InfSession* session; InfSessionPrivate* priv; InfXmlConnectionStatus status; GError* error; session = INF_SESSION(user_data); priv = INF_SESSION_PRIVATE(session); error = NULL; g_object_get(G_OBJECT(connection), "status", &status, NULL); if(status == INF_XML_CONNECTION_CLOSED || status == INF_XML_CONNECTION_CLOSING) { g_set_error( &error, inf_session_sync_error_quark, INF_SESSION_SYNC_ERROR_CONNECTION_CLOSED, "%s", inf_session_sync_strerror(INF_SESSION_SYNC_ERROR_CONNECTION_CLOSED) ); switch(priv->status) { case INF_SESSION_PRESYNC: g_assert(connection == priv->shared.presync.conn); g_signal_emit( G_OBJECT(session), session_signals[SYNCHRONIZATION_FAILED], 0, connection, error ); break; case INF_SESSION_SYNCHRONIZING: g_assert(connection == priv->shared.sync.conn); g_signal_emit( G_OBJECT(session), session_signals[SYNCHRONIZATION_FAILED], 0, connection, error ); break; case INF_SESSION_RUNNING: g_assert( inf_session_find_sync_by_connection(session, connection) != NULL ); g_signal_emit( G_OBJECT(session), session_signals[SYNCHRONIZATION_FAILED], 0, connection, error ); break; case INF_SESSION_CLOSED: default: g_assert_not_reached(); break; } g_error_free(error); } } /* * GObject overrides. */ static void inf_session_register_sync(InfSession* session) { /* TODO: Use _constructor */ InfSessionPrivate* priv; priv = INF_SESSION_PRIVATE(session); /* Register CommunicationObject when all requirements for initial * synchronization are met. */ if(priv->status == INF_SESSION_SYNCHRONIZING && priv->manager != NULL && priv->shared.sync.conn != NULL && priv->shared.sync.group != NULL) { g_object_ref(priv->shared.sync.group); } } static void inf_session_init(GTypeInstance* instance, gpointer g_class) { InfSession* session; InfSessionPrivate* priv; session = INF_SESSION(instance); priv = INF_SESSION_PRIVATE(session); priv->manager = NULL; priv->buffer = NULL; priv->user_table = NULL; priv->status = INF_SESSION_RUNNING; priv->shared.run.syncs = NULL; } static GObject* inf_session_constructor(GType type, guint n_construct_properties, GObjectConstructParam* construct_properties) { GObject* object; InfSessionPrivate* priv; InfXmlConnection* sync_conn; object = G_OBJECT_CLASS(parent_class)->constructor( type, n_construct_properties, construct_properties ); priv = INF_SESSION_PRIVATE(object); /* Create empty user table if property was not initialized */ if(priv->user_table == NULL) priv->user_table = inf_user_table_new(); switch(priv->status) { case INF_SESSION_PRESYNC: g_assert(priv->shared.presync.conn != NULL && priv->shared.presync.group != NULL); sync_conn = priv->shared.presync.conn; break; case INF_SESSION_SYNCHRONIZING: g_assert(priv->shared.sync.conn != NULL && priv->shared.sync.group != NULL); sync_conn = priv->shared.sync.conn; break; case INF_SESSION_RUNNING: case INF_SESSION_CLOSED: sync_conn = NULL; break; default: g_assert_not_reached(); break; } if(sync_conn != NULL) { g_signal_connect( G_OBJECT(sync_conn), "notify::status", G_CALLBACK(inf_session_connection_notify_status_cb), object ); } return object; } static void inf_session_dispose(GObject* object) { InfSession* session; InfSessionPrivate* priv; session = INF_SESSION(object); priv = INF_SESSION_PRIVATE(session); if(priv->status != INF_SESSION_CLOSED) { /* Close session. This cancells all running synchronizations and tells * everyone that the session no longer exists. */ inf_session_close(session); } g_object_unref(G_OBJECT(priv->user_table)); priv->user_table = NULL; g_object_unref(G_OBJECT(priv->buffer)); priv->buffer = NULL; g_object_unref(G_OBJECT(priv->manager)); priv->manager = NULL; G_OBJECT_CLASS(parent_class)->dispose(object); } static void inf_session_finalize(GObject* object) { InfSession* session; InfSessionPrivate* priv; session = INF_SESSION(object); priv = INF_SESSION_PRIVATE(session); G_OBJECT_CLASS(parent_class)->finalize(object); } static void inf_session_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec) { InfSession* session; InfSessionPrivate* priv; session = INF_SESSION(object); priv = INF_SESSION_PRIVATE(session); switch(prop_id) { case PROP_COMMUNICATION_MANAGER: g_assert(priv->manager == NULL); /* construct only */ priv->manager = INF_COMMUNICATION_MANAGER(g_value_dup_object(value)); inf_session_register_sync(session); break; case PROP_BUFFER: g_assert(priv->buffer == NULL); /* construct only */ priv->buffer = INF_BUFFER(g_value_dup_object(value)); break; case PROP_USER_TABLE: g_assert(priv->user_table == NULL); /* construct only */ priv->user_table = INF_USER_TABLE(g_value_dup_object(value)); break; case PROP_STATUS: /* construct only, INF_SESSION_RUNNING is the default */ g_assert(priv->status == INF_SESSION_RUNNING); priv->status = g_value_get_enum(value); switch(priv->status) { case INF_SESSION_PRESYNC: priv->shared.presync.conn = NULL; priv->shared.presync.group = NULL; priv->shared.presync.closing = FALSE; break; case INF_SESSION_SYNCHRONIZING: priv->shared.sync.conn = NULL; priv->shared.sync.group = NULL; priv->shared.sync.messages_total = 0; priv->shared.sync.messages_received = 0; priv->shared.sync.closing = FALSE; break; case INF_SESSION_RUNNING: /* was default */ g_assert(priv->shared.run.syncs == NULL); break; case INF_SESSION_CLOSED: break; default: g_assert_not_reached(); break; } break; case PROP_SYNC_CONNECTION: /* Need to have status sync or presync to set sync-connection */ switch(priv->status) { case INF_SESSION_PRESYNC: g_assert(priv->shared.presync.conn == NULL); /* construct only */ priv->shared.presync.conn = INF_XML_CONNECTION(g_value_dup_object(value)); break; case INF_SESSION_SYNCHRONIZING: g_assert(priv->shared.sync.conn == NULL); /* construct only */ priv->shared.sync.conn = INF_XML_CONNECTION(g_value_dup_object(value)); break; case INF_SESSION_RUNNING: g_assert(g_value_get_object(value) == NULL); break; case INF_SESSION_CLOSED: default: g_assert_not_reached(); break; } break; case PROP_SYNC_GROUP: switch(priv->status) { case INF_SESSION_PRESYNC: g_assert(priv->shared.presync.group == NULL); /* construct only */ priv->shared.presync.group = INF_COMMUNICATION_GROUP(g_value_dup_object(value)); break; case INF_SESSION_SYNCHRONIZING: g_assert(priv->shared.sync.group == NULL); /* construct only */ priv->shared.sync.group = INF_COMMUNICATION_GROUP(g_value_dup_object(value)); break; case INF_SESSION_RUNNING: g_assert(g_value_get_object(value) == NULL); break; case INF_SESSION_CLOSED: default: g_assert_not_reached(); break; } break; case PROP_SUBSCRIPTION_GROUP: if(priv->subscription_group != NULL) g_object_unref(priv->subscription_group); priv->subscription_group = INF_COMMUNICATION_GROUP(g_value_dup_object(value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void inf_session_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec) { InfSession* session; InfSessionPrivate* priv; session = INF_SESSION(object); priv = INF_SESSION_PRIVATE(session); switch(prop_id) { case PROP_COMMUNICATION_MANAGER: g_value_set_object(value, G_OBJECT(priv->manager)); break; case PROP_BUFFER: g_value_set_object(value, G_OBJECT(priv->buffer)); break; case PROP_USER_TABLE: g_value_set_object(value, G_OBJECT(priv->user_table)); break; case PROP_STATUS: g_value_set_enum(value, priv->status); break; case PROP_SYNC_CONNECTION: switch(priv->status) { case INF_SESSION_PRESYNC: g_value_set_object(value, G_OBJECT(priv->shared.presync.conn)); break; case INF_SESSION_SYNCHRONIZING: g_value_set_object(value, G_OBJECT(priv->shared.sync.conn)); break; case INF_SESSION_RUNNING: case INF_SESSION_CLOSED: g_value_set_object(value, NULL); break; default: g_assert_not_reached(); break; } break; case PROP_SYNC_GROUP: switch(priv->status) { case INF_SESSION_PRESYNC: g_value_set_object(value, G_OBJECT(priv->shared.presync.group)); break; case INF_SESSION_SYNCHRONIZING: g_value_set_object(value, G_OBJECT(priv->shared.sync.group)); break; case INF_SESSION_RUNNING: case INF_SESSION_CLOSED: g_value_set_object(value, NULL); break; default: g_assert_not_reached(); break; } break; case PROP_SUBSCRIPTION_GROUP: g_value_set_object(value, G_OBJECT(priv->subscription_group)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } /* * Network messages */ static InfCommunicationScope inf_session_handle_user_status_change(InfSession* session, InfXmlConnection* connection, xmlNodePtr xml, GError** error) { InfSessionPrivate* priv; InfUser* user; guint id; xmlChar* status_attr; gboolean has_status; InfUserStatus status; priv = INF_SESSION_PRIVATE(session); if(!inf_xml_util_get_attribute_uint_required(xml, "id", &id, error)) return INF_COMMUNICATION_SCOPE_PTP; user = inf_user_table_lookup_user_by_id(priv->user_table, id); if(user == NULL) { g_set_error( error, inf_user_error_quark(), INF_USER_ERROR_NO_SUCH_USER, _("No such user with ID %u"), id ); return INF_COMMUNICATION_SCOPE_PTP; } if(inf_user_get_status(user) == INF_USER_UNAVAILABLE || inf_user_get_connection(user) != connection) { g_set_error( error, inf_user_error_quark(), INF_USER_ERROR_NOT_JOINED, "%s", _("User did not join from this connection") ); return INF_COMMUNICATION_SCOPE_PTP; } status_attr = xmlGetProp(xml, (const xmlChar*)"status"); has_status = inf_user_status_from_string((const char*)status_attr, &status, error); xmlFree(status_attr); if(!has_status) return FALSE; if(inf_user_get_status(user) != status) g_object_set(G_OBJECT(user), "status", status, NULL); return INF_COMMUNICATION_SCOPE_GROUP; } /* * VFunc implementations. */ static void inf_session_to_xml_sync_impl_foreach_func(InfUser* user, gpointer user_data) { InfSessionXmlData* data; xmlNodePtr usernode; data = (InfSessionXmlData*)user_data; usernode = xmlNewNode(NULL, (const xmlChar*)"sync-user"); inf_session_user_to_xml(data->session, user, usernode); xmlAddChild(data->xml, usernode); } static void inf_session_to_xml_sync_impl(InfSession* session, xmlNodePtr parent) { InfSessionPrivate* priv; InfSessionXmlData data; priv = INF_SESSION_PRIVATE(session); data.session = session; data.xml = parent; inf_user_table_foreach_user( priv->user_table, inf_session_to_xml_sync_impl_foreach_func, &data ); } static gboolean inf_session_process_xml_sync_impl(InfSession* session, InfXmlConnection* connection, const xmlNodePtr xml, GError** error) { InfSessionPrivate* priv; InfSessionClass* session_class; GArray* user_props; InfUser* user; guint i; const GParameter* param; GParameter* connparam; priv = INF_SESSION_PRIVATE(session); session_class = INF_SESSION_GET_CLASS(session); g_return_val_if_fail(session_class->get_xml_user_props != NULL, FALSE); g_return_val_if_fail(priv->status == INF_SESSION_SYNCHRONIZING, FALSE); g_return_val_if_fail(connection == priv->shared.sync.conn, FALSE); if(strcmp((const char*)xml->name, "sync-user") == 0) { user_props = session_class->get_xml_user_props( session, connection, xml ); param = inf_session_lookup_user_property( (const GParameter*)user_props->data, user_props->len, "status" ); if(param != NULL && g_value_get_enum(¶m->value) != INF_USER_UNAVAILABLE) { /* Assume that the connection for this available user is the one that * the synchronization comes from if the "connection" property is * not given. */ connparam = inf_session_get_user_property(user_props, "connection"); if(!G_IS_VALUE(&connparam->value)) { g_value_init(&connparam->value, INF_TYPE_XML_CONNECTION); g_value_set_object(&connparam->value, G_OBJECT(connection)); } } user = inf_session_add_user( session, (GParameter*)user_props->data, user_props->len, error ); for(i = 0; i < user_props->len; ++ i) g_value_unset(&g_array_index(user_props, GParameter, i).value); g_array_free(user_props, TRUE); if(user == NULL) return FALSE; return TRUE; } else { g_set_error( error, inf_session_sync_error_quark, INF_SESSION_SYNC_ERROR_UNEXPECTED_NODE, "Received unexpected XML message \"%s\" during synchronization", (const gchar*)xml->name ); return FALSE; } } static InfCommunicationScope inf_session_process_xml_run_impl(InfSession* session, InfXmlConnection* connection, const xmlNodePtr xml, GError** error) { if(strcmp((const char*)xml->name, "user-status-change") == 0) { return inf_session_handle_user_status_change( session, connection, xml, error ); } else { /* TODO: Proper error quark and code */ g_set_error( error, g_quark_from_static_string("INF_SESSION_ERROR"), 0, _("Received unhandled XML message '%s'"), (const gchar*)xml->name ); return INF_COMMUNICATION_SCOPE_PTP; } } static GArray* inf_session_get_xml_user_props_impl(InfSession* session, InfXmlConnection* conn, const xmlNodePtr xml) { InfSessionPrivate* priv; GArray* array; GParameter* parameter; xmlChar* name; xmlChar* id; xmlChar* status; #if 0 xmlChar* connection; InfXmlConnection* real_conn; #endif priv = INF_SESSION_PRIVATE(session); array = g_array_sized_new(FALSE, FALSE, sizeof(GParameter), 16); name = xmlGetProp(xml, (const xmlChar*)"name"); id = xmlGetProp(xml, (const xmlChar*)"id"); status = xmlGetProp(xml, (const xmlChar*)"status"); #if 0 connection = xmlGetProp(xml, (const xmlChar*)"connection"); #endif if(id != NULL) { parameter = inf_session_get_user_property(array, "id"); g_value_init(¶meter->value, G_TYPE_UINT); g_value_set_uint(¶meter->value, strtoul((const gchar*)id, NULL, 10)); xmlFree(id); } if(name != NULL) { parameter = inf_session_get_user_property(array, "name"); g_value_init(¶meter->value, G_TYPE_STRING); g_value_set_string(¶meter->value, (const gchar*)name); xmlFree(name); } if(status != NULL) { parameter = inf_session_get_user_property(array, "status"); g_value_init(¶meter->value, INF_TYPE_USER_STATUS); if(strcmp((const char*)status, "active") == 0) g_value_set_enum(¶meter->value, INF_USER_ACTIVE); else if(strcmp((const char*)status, "inactive") == 0) g_value_set_enum(¶meter->value, INF_USER_INACTIVE); else /* TODO: Error reporting for get_xml_user_props */ g_value_set_enum(¶meter->value, INF_USER_UNAVAILABLE); xmlFree(status); } #if 0 if(connection != NULL) { real_conn = inf_connection_manager_group_lookup_connection( priv->subscription_group, connection ); if(real_conn != NULL) { parameter = inf_session_get_user_property(array, "connection"); g_value_init(¶meter->value, INF_TYPE_XML_CONNECTION); g_value_set_object(¶meter->value, G_OBJECT(real_conn)); } else { /* TODO: This should be an error. */ } } #endif return array; } static void inf_session_set_xml_user_props_impl(InfSession* session, const GParameter* params, guint n_params, xmlNodePtr xml) { guint i; gchar id_buf[16]; const gchar* name; InfUserStatus status; #if 0 InfXmlConnection* conn; gchar* remote_address; #endif for(i = 0; i < n_params; ++ i) { if(strcmp(params[i].name, "id") == 0) { sprintf(id_buf, "%u", g_value_get_uint(¶ms[i].value)); xmlNewProp(xml, (const xmlChar*)"id", (const xmlChar*)id_buf); } else if(strcmp(params[i].name, "name") == 0) { name = g_value_get_string(¶ms[i].value); xmlNewProp(xml, (const xmlChar*)"name", (const xmlChar*)name); } else if(strcmp(params[i].name, "status") == 0) { status = g_value_get_enum(¶ms[i].value); inf_xml_util_set_attribute( xml, "status", inf_user_status_to_string(status) ); } /* else if(strcmp(params[i].name, "connection") == 0) { connection = INF_XML_CONNECTION(g_value_get_object(¶ms[i].value)); g_object_get_property( G_OBJECT(connection), "remote-address", &remote_address, NULL ); g_free(addr); }*/ } } static gboolean inf_session_validate_user_props_impl(InfSession* session, const GParameter* params, guint n_params, InfUser* exclude, GError** error) { InfSessionPrivate* priv; const GParameter* parameter; const gchar* name; InfUser* user; guint id; priv = INF_SESSION_PRIVATE(session); /* TODO: Use InfSessionError and/or InfRequestError here */ parameter = inf_session_lookup_user_property(params, n_params, "id"); if(parameter == NULL) { g_set_error( error, inf_session_sync_error_quark, INF_SESSION_SYNC_ERROR_ID_NOT_PRESENT, "%s", inf_session_sync_strerror(INF_SESSION_SYNC_ERROR_ID_NOT_PRESENT) ); return FALSE; } id = g_value_get_uint(¶meter->value); user = inf_user_table_lookup_user_by_id(priv->user_table, id); if(user != NULL && user != exclude) { g_set_error( error, inf_session_sync_error_quark, INF_SESSION_SYNC_ERROR_ID_IN_USE, "%s", inf_session_sync_strerror(INF_SESSION_SYNC_ERROR_ID_IN_USE) ); return FALSE; } parameter = inf_session_lookup_user_property(params, n_params, "name"); if(parameter == NULL) { g_set_error( error, inf_session_sync_error_quark, INF_SESSION_SYNC_ERROR_NAME_NOT_PRESENT, "%s", inf_session_sync_strerror(INF_SESSION_SYNC_ERROR_NAME_NOT_PRESENT) ); return FALSE; } name = g_value_get_string(¶meter->value); user = inf_user_table_lookup_user_by_name(priv->user_table, name); if(user != NULL && user != exclude) { g_set_error( error, inf_session_sync_error_quark, INF_SESSION_SYNC_ERROR_NAME_IN_USE, "%s", inf_session_sync_strerror(INF_SESSION_SYNC_ERROR_NAME_IN_USE) ); return FALSE; } return TRUE; } /* * InfCommunicationObject implementation. */ static gboolean inf_session_handle_received_sync_message(InfSession* session, InfXmlConnection* connection, const xmlNodePtr node, GError** error) { InfSessionClass* session_class; InfSessionPrivate* priv; xmlChar* num_messages; gboolean result; xmlNodePtr xml_reply; GError* local_error; session_class = INF_SESSION_GET_CLASS(session); priv = INF_SESSION_PRIVATE(session); g_assert(session_class->process_xml_sync != NULL); g_assert(priv->status == INF_SESSION_SYNCHRONIZING); if(strcmp((const gchar*)node->name, "sync-cancel") == 0) { local_error = NULL; g_set_error( &local_error, inf_session_sync_error_quark, INF_SESSION_SYNC_ERROR_SENDER_CANCELLED, "%s", inf_session_sync_strerror(INF_SESSION_SYNC_ERROR_SENDER_CANCELLED) ); g_signal_emit( G_OBJECT(session), session_signals[SYNCHRONIZATION_FAILED], 0, connection, local_error ); #if 0 /* Synchronization was cancelled by remote site, so release connection * prior to closure, otherwise we would try to tell the remote site * that the session was closed, but there is no point in this because * it just was the other way around. */ /* Note: This is actually done by the default handler of the * synchronization-failed signal. */ inf_session_close(session); #endif g_error_free(local_error); /* Return FALSE, but do not set error because we handled it. Otherwise, * inf_session_communication_object_received() would try to send a * sync-error to the synchronizer which is pointless as mentioned * above. */ return FALSE; } else if(strcmp((const gchar*)node->name, "sync-begin") == 0) { if(priv->shared.sync.messages_total > 0) { g_set_error( error, inf_session_sync_error_quark, INF_SESSION_SYNC_ERROR_UNEXPECTED_BEGIN_OF_SYNC, "%s", inf_session_sync_strerror( INF_SESSION_SYNC_ERROR_UNEXPECTED_BEGIN_OF_SYNC ) ); return FALSE; } else { num_messages = xmlGetProp(node, (const xmlChar*)"num-messages"); if(num_messages == NULL) { g_set_error( error, inf_session_sync_error_quark, INF_SESSION_SYNC_ERROR_NUM_MESSAGES_MISSING, "%s", inf_session_sync_strerror( INF_SESSION_SYNC_ERROR_NUM_MESSAGES_MISSING ) ); return FALSE; } else { /* 2 + [...] because we also count this initial sync-begin message * and the sync-end. This way, we can use a messages_total of 0 to * indicate that we did not yet get a sync-begin, even if the * whole sync does not contain any messages. */ priv->shared.sync.messages_total = 2 + strtoul( (const gchar*)num_messages, NULL, 0 ); priv->shared.sync.messages_received = 1; xmlFree(num_messages); g_signal_emit( G_OBJECT(session), session_signals[SYNCHRONIZATION_PROGRESS], 0, connection, 1.0 / (double)priv->shared.sync.messages_total ); return TRUE; } } } else if(strcmp((const gchar*)node->name, "sync-end") == 0) { ++ priv->shared.sync.messages_received; if(priv->shared.sync.messages_received != priv->shared.sync.messages_total) { g_set_error( error, inf_session_sync_error_quark, INF_SESSION_SYNC_ERROR_UNEXPECTED_END_OF_SYNC, "%s", inf_session_sync_strerror( INF_SESSION_SYNC_ERROR_UNEXPECTED_END_OF_SYNC ) ); return FALSE; } else { /* Server is waiting for ACK so that he knows the synchronization cannot * fail anymore. */ xml_reply = xmlNewNode(NULL, (const xmlChar*)"sync-ack"); inf_communication_group_send_message( priv->shared.sync.group, connection, xml_reply ); /* Synchronization complete */ g_signal_emit( G_OBJECT(session), session_signals[SYNCHRONIZATION_COMPLETE], 0, connection ); return TRUE; } } else { if(priv->shared.sync.messages_received == 0) { g_set_error( error, inf_session_sync_error_quark, INF_SESSION_SYNC_ERROR_EXPECTED_BEGIN_OF_SYNC, "%s", inf_session_sync_strerror( INF_SESSION_SYNC_ERROR_EXPECTED_BEGIN_OF_SYNC ) ); return FALSE; } else if(priv->shared.sync.messages_received == priv->shared.sync.messages_total - 1) { g_set_error( error, inf_session_sync_error_quark, INF_SESSION_SYNC_ERROR_EXPECTED_END_OF_SYNC, "%s", inf_session_sync_strerror(INF_SESSION_SYNC_ERROR_EXPECTED_END_OF_SYNC) ); return FALSE; } else { result = session_class->process_xml_sync( session, connection, node, error ); if(result == FALSE) return FALSE; /* Some callback could have cancelled the synchronization via * inf_session_cancel_synchronization. */ if(priv->status == INF_SESSION_CLOSED) return TRUE; ++ priv->shared.sync.messages_received; g_signal_emit( G_OBJECT(session), session_signals[SYNCHRONIZATION_PROGRESS], 0, connection, (double)priv->shared.sync.messages_received / (double)priv->shared.sync.messages_total ); return TRUE; } } } static void inf_session_communication_object_sent(InfCommunicationObject* comm_object, InfXmlConnection* connection, const xmlNodePtr node) { InfSession* session; InfSessionPrivate* priv; InfSessionSync* sync; session = INF_SESSION(comm_object); priv = INF_SESSION_PRIVATE(session); if(priv->status == INF_SESSION_RUNNING) { sync = inf_session_find_sync_by_connection(session, connection); /* This can be any message from some session that is not related to * the synchronization, so do not assert here. Also, we might already have * sent stuff that is meant to be processed after the synchronization, so * make sure here that this messages still belongs to the * synchronization. */ if(sync != NULL && sync->messages_sent < sync->messages_total) { ++ sync->messages_sent; g_signal_emit( G_OBJECT(comm_object), session_signals[SYNCHRONIZATION_PROGRESS], 0, connection, (gdouble)sync->messages_sent / (gdouble)sync->messages_total ); /* We need to wait for the sync-ack before synchronization is * completed so that the synchronizee still has a chance to tell * us if something goes wrong. */ } } } static void inf_session_communication_object_enqueued(InfCommunicationObject* comm_object, InfXmlConnection* connection, const xmlNodePtr node) { InfSessionSync* sync; if(strcmp((const gchar*)node->name, "sync-end") == 0) { /* Remember when the last synchronization messages is enqueued because * we cannot cancel any synchronizations beyond that point. */ sync = inf_session_find_sync_by_connection( INF_SESSION(comm_object), connection ); /* This should really be in the list if the node's name is sync-end, * otherwise most probably someone else sent a sync-end message via * this communication object. */ g_assert(sync != NULL); g_assert(sync->status == INF_SESSION_SYNC_IN_PROGRESS); sync->status = INF_SESSION_SYNC_AWAITING_ACK; } } static InfCommunicationScope inf_session_communication_object_received(InfCommunicationObject* comm_object, InfXmlConnection* connection, const xmlNodePtr node, GError** error) { InfSessionClass* session_class; InfSession* session; InfSessionPrivate* priv; InfSessionSync* sync; gboolean result; GError* local_error; const gchar* local_message; session = INF_SESSION(comm_object); priv = INF_SESSION_PRIVATE(session); switch(priv->status) { case INF_SESSION_PRESYNC: g_assert(connection == priv->shared.presync.conn); /* We do not expect any messages in presync. The whole idea of presync is * that one can keep a session around that is going to be synchronized * later, ie. when telling the remote site about it. */ g_set_error( error, inf_session_sync_error_quark, INF_SESSION_SYNC_ERROR_GOT_MESSAGE_IN_PRESYNC, _("Unexpectedly received XML message \"%s\" in presync"), (const gchar*)node->name ); /* Don't forward unexpected message */ return INF_COMMUNICATION_SCOPE_PTP; case INF_SESSION_SYNCHRONIZING: g_assert(connection == priv->shared.sync.conn); local_error = NULL; result = inf_session_handle_received_sync_message( session, connection, node, &local_error ); if(result == FALSE && local_error != NULL) { inf_session_send_sync_error(session, local_error); /* Note the default handler resets shared->sync.conn and * shared->sync.group. */ g_signal_emit( G_OBJECT(session), session_signals[SYNCHRONIZATION_FAILED], 0, connection, local_error ); g_error_free(local_error); } /* Synchronization is always ptp only, don't forward */ return INF_COMMUNICATION_SCOPE_PTP; case INF_SESSION_RUNNING: sync = inf_session_find_sync_by_connection(session, connection); if(sync != NULL) { if(strcmp((const gchar*)node->name, "sync-error") == 0) { /* There was an error during synchronization, cancel remaining * messages. */ inf_communication_group_cancel_messages(sync->group, connection); local_error = inf_xml_util_new_error_from_node(node); if(local_error != NULL) { local_message = inf_session_get_sync_error_message(local_error->domain, local_error->code); if(local_message != NULL) { if(local_error->message != NULL) g_free(local_error->message); local_error->message = g_strdup(local_message); } } else { g_set_error( &local_error, inf_session_sync_error_quark, INF_SESSION_SYNC_ERROR_FAILED, "%s", inf_session_sync_strerror(INF_SESSION_SYNC_ERROR_FAILED) ); } /* Note the default handler actually removes the sync */ g_signal_emit( G_OBJECT(session), session_signals[SYNCHRONIZATION_FAILED], 0, connection, local_error ); g_error_free(local_error); } else if(strcmp((const gchar*)node->name, "sync-ack") == 0 && sync->status == INF_SESSION_SYNC_AWAITING_ACK) { /* Got ack we were waiting for */ g_signal_emit( G_OBJECT(comm_object), session_signals[SYNCHRONIZATION_COMPLETE], 0, connection ); } else { g_set_error( error, inf_session_sync_error_quark, INF_SESSION_SYNC_ERROR_UNEXPECTED_NODE, _("Received unexpected XML message \"%s\" while synchronizing"), (const gchar*)node->name ); } /* Synchronization is always ptp only, don't forward */ return INF_COMMUNICATION_SCOPE_PTP; } else { session_class = INF_SESSION_GET_CLASS(session); g_assert(session_class->process_xml_run != NULL); return session_class->process_xml_run(session, connection, node, error); } break; case INF_SESSION_CLOSED: default: g_assert_not_reached(); break; } } /* * Default signal handlers. */ static void inf_session_close_handler(InfSession* session) { InfSessionPrivate* priv; InfSessionSync* sync; xmlNodePtr xml; GError* error; InfXmlConnectionStatus status; priv = INF_SESSION_PRIVATE(session); error = NULL; g_set_error( &error, inf_session_sync_error_quark, INF_SESSION_SYNC_ERROR_RECEIVER_CANCELLED, "%s", inf_session_sync_strerror(INF_SESSION_SYNC_ERROR_RECEIVER_CANCELLED) ); g_object_freeze_notify(G_OBJECT(session)); switch(priv->status) { case INF_SESSION_PRESYNC: if(priv->shared.presync.closing == FALSE) { /* So that the "synchronization-failed" default signal handler does * does not emit the close signal again: */ priv->shared.presync.closing = TRUE; g_signal_emit( G_OBJECT(session), session_signals[SYNCHRONIZATION_FAILED], 0, priv->shared.presync.conn, error ); } inf_session_release_connection(session, priv->shared.presync.conn); break; case INF_SESSION_SYNCHRONIZING: if(priv->shared.sync.closing == FALSE) { /* So that the "synchronization-failed" default signal handler does * does not emit the close signal again: */ priv->shared.sync.closing = TRUE; /* If the connection was closed, another signal handler could close() * the session explicitely (for example by disposing it), in which case * we cannot send anything anymore through the connection even though * sync.closing was not set already. */ g_object_get(G_OBJECT(priv->shared.sync.conn), "status", &status, NULL); if(status == INF_XML_CONNECTION_OPEN) { inf_session_send_sync_error(session, error); } g_signal_emit( G_OBJECT(session), session_signals[SYNCHRONIZATION_FAILED], 0, priv->shared.sync.conn, error ); } inf_session_release_connection(session, priv->shared.sync.conn); break; case INF_SESSION_RUNNING: /* TODO: Set status of all users (except local) to unavailable? We * probably should do that here instead of in the session proxies, * or at least in addition (InfcSessionProxy needs to do it anway, * because it keeps the running state even on disconnection...) */ while(priv->shared.run.syncs != NULL) { sync = (InfSessionSync*)priv->shared.run.syncs->data; /* If the sync-end message has already been enqueued within the * connection manager, we cannot cancel it anymore, so the remote * site will receive the full sync nevertheless, so we do not need * to cancel anything. */ if(sync->status == INF_SESSION_SYNC_IN_PROGRESS) { inf_communication_group_cancel_messages(sync->group, sync->conn); xml = xmlNewNode(NULL, (const xmlChar*)"sync-cancel"); inf_communication_group_send_message(sync->group, sync->conn, xml); } /* We had to cancel the synchronization, so the synchronization * actually failed. */ g_signal_emit( G_OBJECT(session), session_signals[SYNCHRONIZATION_FAILED], 0, sync->conn, error ); /* Note that the synchronization_failed default handler actualy * removes the sync. */ } break; case INF_SESSION_CLOSED: default: g_assert_not_reached(); break; } if(priv->subscription_group != NULL) { g_object_unref(priv->subscription_group); priv->subscription_group = NULL; g_object_notify(G_OBJECT(session), "subscription-group"); } g_error_free(error); priv->status = INF_SESSION_CLOSED; g_object_notify(G_OBJECT(session), "status"); g_object_thaw_notify(G_OBJECT(session)); } static void inf_session_synchronization_begin_handler(InfSession* session, InfCommunicationGroup* group, InfXmlConnection* connection) { InfSessionPrivate* priv; InfSessionClass* session_class; InfSessionSync* sync; xmlNodePtr messages; xmlNodePtr next; xmlNodePtr xml; gchar num_messages_buf[16]; priv = INF_SESSION_PRIVATE(session); g_assert(priv->status == INF_SESSION_RUNNING); g_assert(inf_session_find_sync_by_connection(session, connection) == NULL); session_class = INF_SESSION_GET_CLASS(session); g_return_if_fail(session_class->to_xml_sync != NULL); sync = g_slice_new(InfSessionSync); sync->conn = connection; sync->messages_sent = 0; sync->messages_total = 2; /* including sync-begin and sync-end */ sync->status = INF_SESSION_SYNC_IN_PROGRESS; g_object_ref(G_OBJECT(connection)); priv->shared.run.syncs = g_slist_prepend(priv->shared.run.syncs, sync); g_signal_connect_after( G_OBJECT(connection), "notify::status", G_CALLBACK(inf_session_connection_notify_status_cb), session ); sync->group = group; g_object_ref(sync->group); /* The group needs to contain that connection, of course. */ g_assert(inf_communication_group_is_member(sync->group, connection)); /* Name is irrelevant because the node is only used to collect the child * nodes via the to_xml_sync vfunc. */ messages = xmlNewNode(NULL, (const xmlChar*)"sync-container"); session_class->to_xml_sync(session, messages); for(xml = messages->children; xml != NULL; xml = xml->next) ++ sync->messages_total; sprintf(num_messages_buf, "%u", sync->messages_total - 2); xml = xmlNewNode(NULL, (const xmlChar*)"sync-begin"); xmlNewProp( xml, (const xmlChar*)"num-messages", (const xmlChar*)num_messages_buf ); inf_communication_group_send_message(sync->group, connection, xml); /* TODO: Add a function that can send multiple messages */ for(xml = messages->children; xml != NULL; xml = next) { next = xml->next; xmlUnlinkNode(xml); inf_communication_group_send_message(sync->group, connection, xml); } xmlFreeNode(messages); xml = xmlNewNode(NULL, (const xmlChar*)"sync-end"); inf_communication_group_send_message(sync->group, connection, xml); } static void inf_session_synchronization_complete_handler(InfSession* session, InfXmlConnection* connection) { InfSessionPrivate* priv; priv = INF_SESSION_PRIVATE(session); switch(priv->status) { case INF_SESSION_PRESYNC: g_assert_not_reached(); break; case INF_SESSION_SYNCHRONIZING: g_assert(connection == priv->shared.sync.conn); inf_session_release_connection(session, connection); priv->status = INF_SESSION_RUNNING; priv->shared.run.syncs = NULL; g_object_notify(G_OBJECT(session), "status"); break; case INF_SESSION_RUNNING: g_assert( inf_session_find_sync_by_connection(session, connection) != NULL ); inf_session_release_connection(session, connection); break; case INF_SESSION_CLOSED: default: g_assert_not_reached(); break; } } static void inf_session_synchronization_failed_handler(InfSession* session, InfXmlConnection* connection, const GError* error) { InfSessionPrivate* priv; priv = INF_SESSION_PRIVATE(session); switch(priv->status) { case INF_SESSION_PRESYNC: g_assert(connection == priv->shared.presync.conn); if(priv->shared.presync.closing == FALSE) { /* So that the "close" default signal handler does not emit the * "synchronization failed" signal again. */ priv->shared.presync.closing = TRUE; inf_session_close(session); } break; case INF_SESSION_SYNCHRONIZING: g_assert(connection == priv->shared.sync.conn); if(priv->shared.sync.closing == FALSE) { /* So that the "close" default signal handler does not emit the * "synchronization failed" signal again. */ priv->shared.sync.closing = TRUE; inf_session_close(session); } break; case INF_SESSION_RUNNING: g_assert( inf_session_find_sync_by_connection(session, connection) != NULL ); inf_session_release_connection(session, connection); break; case INF_SESSION_CLOSED: /* Don't assert, some signal handler could have called inf_session_close() * between the start of the signal emission and the run of the default * handler. */ break; default: g_assert_not_reached(); break; } } /* * Gype registration. */ static void inf_session_class_init(gpointer g_class, gpointer class_data) { GObjectClass* object_class; InfSessionClass* session_class; object_class = G_OBJECT_CLASS(g_class); session_class = INF_SESSION_CLASS(g_class); parent_class = G_OBJECT_CLASS(g_type_class_peek_parent(g_class)); g_type_class_add_private(g_class, sizeof(InfSessionPrivate)); object_class->constructor = inf_session_constructor; object_class->dispose = inf_session_dispose; object_class->finalize = inf_session_finalize; object_class->set_property = inf_session_set_property; object_class->get_property = inf_session_get_property; session_class->to_xml_sync = inf_session_to_xml_sync_impl; session_class->process_xml_sync = inf_session_process_xml_sync_impl; session_class->process_xml_run = inf_session_process_xml_run_impl; session_class->get_xml_user_props = inf_session_get_xml_user_props_impl; session_class->set_xml_user_props = inf_session_set_xml_user_props_impl; session_class->validate_user_props = inf_session_validate_user_props_impl; session_class->user_new = NULL; session_class->close = inf_session_close_handler; session_class->synchronization_begin = inf_session_synchronization_begin_handler; session_class->synchronization_progress = NULL; session_class->synchronization_complete = inf_session_synchronization_complete_handler; session_class->synchronization_failed = inf_session_synchronization_failed_handler; inf_session_sync_error_quark = g_quark_from_static_string( "INF_SESSION_SYNC_ERROR" ); g_object_class_install_property( object_class, PROP_COMMUNICATION_MANAGER, g_param_spec_object( "communication-manager", "Communication manager", "The communication manager used for sending requests", INF_COMMUNICATION_TYPE_MANAGER, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); g_object_class_install_property( object_class, PROP_BUFFER, g_param_spec_object( "buffer", "Buffer", "The buffer in which the document content is stored", INF_TYPE_BUFFER, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); g_object_class_install_property( object_class, PROP_USER_TABLE, g_param_spec_object( "user-table", "User table", "User table containing the users of the session", INF_TYPE_USER_TABLE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); g_object_class_install_property( object_class, PROP_STATUS, g_param_spec_enum( "status", "Session Status", "Current status of the session", INF_TYPE_SESSION_STATUS, INF_SESSION_RUNNING, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); g_object_class_install_property( object_class, PROP_SYNC_CONNECTION, g_param_spec_object( "sync-connection", "Synchronizing connection", "Connection which synchronizes the initial session state", INF_TYPE_XML_CONNECTION, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); g_object_class_install_property( object_class, PROP_SYNC_GROUP, g_param_spec_object( "sync-group", "Synchronization group", "Communication group in which to perform synchronization", INF_COMMUNICATION_TYPE_GROUP, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); g_object_class_install_property( object_class, PROP_SUBSCRIPTION_GROUP, g_param_spec_object( "subscription-group", "Subscription group", "Communication group of subscribed connections", INF_COMMUNICATION_TYPE_GROUP, G_PARAM_READWRITE ) ); /** * InfSession::close: * @session: The #InfSession that is being closed * * This signal is emitted if the session is closed. Note that this signal * is not called as a client if the connection to the sessions has merely * been lost, only the relevant #InfXmlConnection has its * #InfXmlConnection:status property changed. */ session_signals[CLOSE] = g_signal_new( "close", G_OBJECT_CLASS_TYPE(object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(InfSessionClass, close), NULL, NULL, inf_marshal_VOID__VOID, G_TYPE_NONE, 0 ); /** * InfSession::synchronization-begin: * @session: The #InfSession that is synchronizing. * @group: The #InfCommunicationGroup used for synchronization. * @connection: The #InfXmlConnection to which the session is synchronized. * * This signal is emitted whenever the session is started to be synchronized * to another connection. Note that, in contrast to * #InfSession::synchronization-progress, * #InfSession::synchronization-failed and * #InfSession::synchronization-complete it cannot happen that the signal * is emitted when @session is being synchronized itself, because that can * happen at construction time only when no one had a chance to connect * signal handlers anyway. **/ session_signals[SYNCHRONIZATION_BEGIN] = g_signal_new( "synchronization-begin", G_OBJECT_CLASS_TYPE(object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(InfSessionClass, synchronization_begin), NULL, NULL, inf_marshal_VOID__OBJECT_OBJECT, G_TYPE_NONE, 2, INF_COMMUNICATION_TYPE_GROUP, INF_TYPE_XML_CONNECTION ); /** * InfSession::synchronization-progress: * @session: The #InfSession that is synchronizing or being synchronized * @connection: The #InfXmlConnection through which progress is made * @progress: A #gdouble value ranging from 0.0 to 1.0. * * This signal is emitted whenever a new XML node has been sent or received * over @connection as part of a synchronization. The process is completed * when @progress reaches the value 1.0. At this point, * #InfSession::synchronization-complete is also emitted. * * If @session's status is %INF_SESSION_SYNCHRONIZING, the local * side is being synchronized by the remote side. If the status is * %INF_SESSION_RUNNING, the local side is updating the remote side. */ session_signals[SYNCHRONIZATION_PROGRESS] = g_signal_new( "synchronization-progress", G_OBJECT_CLASS_TYPE(object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(InfSessionClass, synchronization_progress), NULL, NULL, inf_marshal_VOID__OBJECT_DOUBLE, G_TYPE_NONE, 2, INF_TYPE_XML_CONNECTION, G_TYPE_DOUBLE ); /** * InfSession::synchronization-complete: * @session: The #InfSession that has or was synchronized * @connection: The #InfXmlConnection through which synchronization happened * * This signal is emitted when synchronization has completed, in addition * to #InfSession::synchronization-progress with a progress value of 1.0. * * If a callback is connected before the default handler, it can find out * whether the remote side is synchronizing the local side by comparing * @sessions's status with %INF_SESSION_SYNCHRONIZING. The default * signal handler sets the status to %INF_SESSION_RUNNING, so checking * afterwards is not too useful. */ session_signals[SYNCHRONIZATION_COMPLETE] = g_signal_new( "synchronization-complete", G_OBJECT_CLASS_TYPE(object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(InfSessionClass, synchronization_complete), NULL, NULL, inf_marshal_VOID__OBJECT, G_TYPE_NONE, 1, INF_TYPE_XML_CONNECTION ); /** * InfSession::synchronization-failed: * @session: The #InfSession that failed to synchronize or be synchronized * @connection: The #InfXmlConnection through which synchronization happened * @error: A pointer to a #GError object with details on the error * * This signal is emitted when synchronization has failed before its * completion due to malformed data from the other side or network failure. * * If this happens during initial synchronization, #InfSession::close is * emitted as well at this point. */ session_signals[SYNCHRONIZATION_FAILED] = g_signal_new( "synchronization-failed", G_OBJECT_CLASS_TYPE(object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(InfSessionClass, synchronization_failed), NULL, NULL, inf_marshal_VOID__OBJECT_POINTER, G_TYPE_NONE, 2, INF_TYPE_XML_CONNECTION, G_TYPE_POINTER /* actually a GError* */ ); } static void inf_session_communication_object_init(gpointer g_iface, gpointer iface_data) { InfCommunicationObjectIface* iface; iface = (InfCommunicationObjectIface*)g_iface; iface->sent = inf_session_communication_object_sent; iface->enqueued = inf_session_communication_object_enqueued; iface->received = inf_session_communication_object_received; } GType inf_session_status_get_type(void) { static GType session_status_type = 0; if(!session_status_type) { static const GEnumValue session_status_type_values[] = { { INF_SESSION_PRESYNC, "INF_SESSION_PRESYNC", "presync" }, { INF_SESSION_SYNCHRONIZING, "INF_SESSION_SYNCHRONIZING", "synchronizing" }, { INF_SESSION_RUNNING, "INF_SESSION_RUNNING", "running" }, { INF_SESSION_CLOSED, "INF_SESSION_CLOSED", "closed" }, { 0, NULL, NULL } }; session_status_type = g_enum_register_static( "InfSessionStatus", session_status_type_values ); } return session_status_type; } GType inf_session_get_type(void) { static GType session_type = 0; if(!session_type) { static const GTypeInfo session_type_info = { sizeof(InfSessionClass), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ inf_session_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InfSession), /* instance_size */ 0, /* n_preallocs */ inf_session_init, /* instance_init */ NULL /* value_table */ }; static const GInterfaceInfo communication_object_info = { inf_session_communication_object_init, NULL, NULL }; session_type = g_type_register_static( G_TYPE_OBJECT, "InfSession", &session_type_info, 0 ); g_type_add_interface_static( session_type, INF_COMMUNICATION_TYPE_OBJECT, &communication_object_info ); } return session_type; } /* * Public API. */ /** * inf_session_lookup_user_property: * @params: A pointer to an array of containing #GParameter values. * @n_params: The number of elements in the aforementioned array * @name: Name to look up. * * Looks up the parameter with the given name in @array. * * Return Value: A #GParameter, or %NULL. **/ const GParameter* inf_session_lookup_user_property(const GParameter* params, guint n_params, const gchar* name) { guint i; g_return_val_if_fail(params != NULL || n_params == 0, NULL); g_return_val_if_fail(name != NULL, NULL); for(i = 0; i < n_params; ++ i) if(strcmp(params[i].name, name) == 0) return ¶ms[i]; return NULL; } /** * inf_session_get_user_property: * @array: A #GArray containing #GParameter values. * @name: Name to look up. * * Looks up the paremeter with the given name in @array. If there is no such * parameter, a new one will be created. * * Return Value: A #GParameter. **/ GParameter* inf_session_get_user_property(GArray* array, const gchar* name) { GParameter* parameter; guint i; g_return_val_if_fail(array != NULL, NULL); g_return_val_if_fail(name != NULL, NULL); for(i = 0; i < array->len; ++ i) if(strcmp(g_array_index(array, GParameter, i).name, name) == 0) return &g_array_index(array, GParameter, i); g_array_set_size(array, array->len + 1); parameter = &g_array_index(array, GParameter, array->len - 1); parameter->name = name; memset(¶meter->value, 0, sizeof(GValue)); return parameter; } /** * inf_session_user_to_xml: * @session: A #InfSession. * @user: A #InfUser contained in @session. * @xml: An XML node to which to add user information. * * This is a convenience function that queries @user's properties and * calls set_xml_user_props with them. This adds the properties of @user * to @xml. * * An equivalent user object may be built by calling the get_xml_user_props * vfunc on @xml and then calling the user_new vfunc with the resulting * properties. **/ void inf_session_user_to_xml(InfSession* session, InfUser* user, xmlNodePtr xml) { InfSessionClass* session_class; GParamSpec** pspecs; GParameter* params; guint n_params; guint i; g_return_if_fail(INF_IS_SESSION(session)); g_return_if_fail(INF_IS_USER(user)); g_return_if_fail(xml != NULL); session_class = INF_SESSION_GET_CLASS(session); g_return_if_fail(session_class->set_xml_user_props != NULL); pspecs = g_object_class_list_properties( G_OBJECT_CLASS(INF_USER_GET_CLASS(user)), &n_params ); params = g_malloc(n_params * sizeof(GParameter)); for(i = 0; i < n_params; ++ i) { params[i].name = pspecs[i]->name; memset(¶ms[i].value, 0, sizeof(GValue)); g_value_init(¶ms[i].value, pspecs[i]->value_type); g_object_get_property(G_OBJECT(user), params[i].name, ¶ms[i].value); } session_class->set_xml_user_props(session, params, n_params, xml); for(i = 0; i < n_params; ++ i) g_value_unset(¶ms[i].value); g_free(params); g_free(pspecs); } /** * inf_session_close: * @session: A #InfSession. * * Closes a running session. When a session is closed, it unrefs all * connections and no longer handles requests. */ void inf_session_close(InfSession* session) { g_return_if_fail(INF_IS_SESSION(session)); g_return_if_fail(inf_session_get_status(session) != INF_SESSION_CLOSED); g_signal_emit(G_OBJECT(session), session_signals[CLOSE], 0); } /** * inf_session_get_communication_manager: * @session: A #InfSession. * * Returns the communication manager for @session. * * Return Value: A #InfCommunicationManager. **/ InfCommunicationManager* inf_session_get_communication_manager(InfSession* session) { g_return_val_if_fail(INF_IS_SESSION(session), NULL); return INF_SESSION_PRIVATE(session)->manager; } /** * inf_session_get_buffer: * @session: A #InfSession. * * Returns the buffer used by @session. * * Return Value: A #InfBuffer. **/ InfBuffer* inf_session_get_buffer(InfSession* session) { g_return_val_if_fail(INF_IS_SESSION(session), NULL); return INF_SESSION_PRIVATE(session)->buffer; } /** * inf_session_get_user_table: * @session:A #InfSession. * * Returns the user table used by @session. * * Return Value: A #InfUserTable. **/ InfUserTable* inf_session_get_user_table(InfSession* session) { g_return_val_if_fail(INF_IS_SESSION(session), NULL); return INF_SESSION_PRIVATE(session)->user_table; } /** * inf_session_get_status: * @session: A #InfSession. * * Returns the session's status. * * Return Value: The status of @session. **/ InfSessionStatus inf_session_get_status(InfSession* session) { g_return_val_if_fail(INF_IS_SESSION(session), INF_SESSION_CLOSED); return INF_SESSION_PRIVATE(session)->status; } /** * inf_session_add_user: * @session: A #InfSession. * @params: Construction parameters for the #InfUser (or derived) object. * @n_params: Number of parameters. * @error: Location to store error information. * * Adds a user to @session. The user object is constructed via the * user_new vfunc of #InfSessionClass. This will create a new #InfUser * object by default, but may be overridden by subclasses to create * different kinds of users. * * Note that this function does not tell the other participants that the * user was added. To avoid conflicts, normally only the publisher of the * session can add users and notifies others accordingly. This is handled * by #InfdSessionProxy or #InfcSessionProxy, respectively. * * You should not call this function unless you know what you are doing. * * Return Value: The new #InfUser, or %NULL in case of an error. **/ InfUser* inf_session_add_user(InfSession* session, const GParameter* params, guint n_params, GError** error) { InfSessionPrivate* priv; InfSessionClass* session_class; InfUser* user; gboolean result; g_return_val_if_fail(INF_IS_SESSION(session), NULL); session_class = INF_SESSION_GET_CLASS(session); g_return_val_if_fail(session_class->validate_user_props != NULL, NULL); g_return_val_if_fail(session_class->user_new != NULL, NULL); priv = INF_SESSION_PRIVATE(session); result = session_class->validate_user_props( session, params, n_params, NULL, error ); if(result == TRUE) { /* No idea why g_object_newv wants unconst GParameter list */ user = session_class->user_new(session, *(GParameter**)(gpointer)¶ms, n_params); inf_user_table_add_user(priv->user_table, user); g_object_unref(user); /* We rely on the usertable holding a reference */ return user; } return NULL; } /** * inf_session_set_user_status: * @session: A #InfSession. * @user: A local #InfUser from @session's user table. * @status: New status for @user. * * Changes the status of the given @user which needs to have the * %INF_USER_LOCAL flag set for this function to be called. If the status * is changed to %INF_USER_UNAVAILABLE, then the user leaves the session. To * rejoin use infc_session_proxy_join_user() or infd_session_proxy_add_user(), * respectively for a proxy proxying @session. **/ void inf_session_set_user_status(InfSession* session, InfUser* user, InfUserStatus status) { InfSessionPrivate* priv; xmlNodePtr xml; g_return_if_fail(INF_IS_SESSION(session)); g_return_if_fail(INF_IS_USER(user)); g_return_if_fail(inf_session_get_status(session) == INF_SESSION_RUNNING); g_return_if_fail(inf_user_get_status(user) != INF_USER_UNAVAILABLE); g_return_if_fail( (inf_user_get_flags(user) & INF_USER_LOCAL) != 0); priv = INF_SESSION_PRIVATE(session); if(inf_user_get_status(user) != status) { xml = xmlNewNode(NULL, (const xmlChar*)"user-status-change"); inf_xml_util_set_attribute_uint(xml, "id", inf_user_get_id(user)); inf_xml_util_set_attribute( xml, "status", inf_user_status_to_string(status) ); if(priv->subscription_group != NULL) inf_session_send_to_subscriptions(session, xml); g_object_set(G_OBJECT(user), "status", status, NULL); } } /** * inf_session_synchronize_from: * @session: A #InfSession in status %INF_SESSION_PRESYNC. * * Switches @session's status to %INF_SESSION_SYNCHRONIZING. In * %INF_SESSION_PRESYNC, all messages from incoming the synchronizing * connection are ignored, and no cancellation request is sent to the remote * site if the status changes to %INF_SESSION_CLOSED. The rationale behind * that status is that one can prepare a session for synchronization but start * the actual synchronization later, after having made sure that the remote * site is ready to perform the synchronization. */ void inf_session_synchronize_from(InfSession* session) { InfSessionPrivate* priv; InfCommunicationGroup* group; InfXmlConnection* connection; /* TODO: Maybe add InfCommunicationGroup*, InfXmlConnection* arguments, * and remove them from the priv->shared.presync. This might simplify code * elsewhere. */ g_return_if_fail(inf_session_get_status(session) == INF_SESSION_PRESYNC); priv = INF_SESSION_PRIVATE(session); g_return_if_fail(priv->shared.presync.closing == FALSE); group = priv->shared.presync.group; connection = priv->shared.presync.conn; priv->status = INF_SESSION_SYNCHRONIZING; priv->shared.sync.group = group; priv->shared.sync.conn = connection; priv->shared.sync.messages_total = 0; priv->shared.sync.messages_received = 0; priv->shared.sync.closing = FALSE; g_object_notify(G_OBJECT(session), "status"); } /** * inf_session_synchronize_to: * @session: A #InfSession in status %INF_SESSION_RUNNING. * @group: A #InfCommunicationGroup. * @connection: A #InfConnection. * * Initiates a synchronization to @connection. On the other end of * @connection, a new session with the sync-connection and sync-group * construction properties set should have been created. @group is used * as a group in the connection manager. It is allowed for @group to have * another #InfCommunicationObject than @session, however, you should forward * the #InfCommunicationObject messages your object receives to @session then. * Also, @connection must already be present in @group, and should not be * removed until synchronization finished. * * A synchronization can only be initiated if @session is in state * %INF_SESSION_RUNNING. **/ void inf_session_synchronize_to(InfSession* session, InfCommunicationGroup* group, InfXmlConnection* connection) { g_return_if_fail(INF_IS_SESSION(session)); g_return_if_fail(group != NULL); g_return_if_fail(INF_IS_XML_CONNECTION(connection)); g_return_if_fail(inf_session_get_status(session) == INF_SESSION_RUNNING); g_return_if_fail( inf_session_find_sync_by_connection(session, connection) == NULL ); g_signal_emit( G_OBJECT(session), session_signals[SYNCHRONIZATION_BEGIN], 0, group, connection ); } /** * inf_session_get_synchronization_status: * @session: A #InfSession. * @connection: A #InfXmlConnection. * * If @session is in status %INF_SESSION_SYNCHRONIZING, this always returns * %INF_SESSION_SYNC_IN_PROGRESS if @connection is the connection with which * the session is synchronized, and %INF_SESSION_SYNC_NONE otherwise. * * If @session is in status %INF_SESSION_RUNNING, this returns the status * of the synchronization to @connection. %INF_SESSION_SYNC_NONE is returned, * when there is currently no synchronization ongoing to @connection, * %INF_SESSION_SYNC_IN_PROGRESS is returned, if there is one, and * %INF_SESSION_SYNC_AWAITING_ACK if the synchronization is finished but we * are waiting for the acknowledgement from the remote site that all * synchronization data has been progressed successfully. The synchronization * can still fail in this state but it can no longer by cancelled. * * If @session is in status $INF_SESSION_CLOSED, this always returns * %INF_SESSION_SYNC_NONE. * * Return Value: The synchronization status of @connection. **/ InfSessionSyncStatus inf_session_get_synchronization_status(InfSession* session, InfXmlConnection* connection) { InfSessionPrivate* priv; InfSessionSync* sync; g_return_val_if_fail(INF_IS_SESSION(session), INF_SESSION_SYNC_NONE); g_return_val_if_fail( INF_IS_XML_CONNECTION(connection), INF_SESSION_SYNC_NONE ); priv = INF_SESSION_PRIVATE(session); switch(priv->status) { case INF_SESSION_SYNCHRONIZING: if(connection == priv->shared.sync.conn) return INF_SESSION_SYNC_IN_PROGRESS; return INF_SESSION_SYNC_NONE; case INF_SESSION_RUNNING: sync = inf_session_find_sync_by_connection(session, connection); if(sync == NULL) return INF_SESSION_SYNC_NONE; return sync->status; case INF_SESSION_CLOSED: return INF_SESSION_SYNC_NONE; default: g_assert_not_reached(); break; } } /** * inf_session_get_synchronization_progress: * @session: A #InfSession. * @connection: A #InfXmlConnection. * * This function requires that the synchronization status of @connection * is %INF_SESSION_SYNC_IN_PROGRESS or %INF_SESSION_SYNC_AWAITING_ACK * (see inf_session_get_synchronization_status()). Then, it returns a value * between 0.0 and 1.0 specifying how much synchronization data has already * been transferred to the remote site. * * Note that if the session is in status %INF_SESSION_RUNNING, it is * possible that this function returns 1.0 (i.e. all data has been * transmitted) but the synchronization is not yet complete, because the * remote site must still acknowledge the synchronization. The synchronization * then is in status %INF_SESSION_SYNC_AWAITING_ACK. * * Return Value: A value between 0.0 and 1.0. **/ gdouble inf_session_get_synchronization_progress(InfSession* session, InfXmlConnection* connection) { InfSessionPrivate* priv; InfSessionSync* sync; g_return_val_if_fail(INF_IS_SESSION(session), 0.0); g_return_val_if_fail(INF_IS_XML_CONNECTION(connection), 0.0); g_return_val_if_fail( inf_session_get_synchronization_status( session, connection ) != INF_SESSION_SYNC_NONE, 0.0 ); priv = INF_SESSION_PRIVATE(session); switch(priv->status) { case INF_SESSION_PRESYNC: g_assert(connection == priv->shared.presync.conn); return 0.0; case INF_SESSION_SYNCHRONIZING: g_assert(connection == priv->shared.sync.conn); /* messages_total is still zero in case we did not yet even receive * sync-begin. We are at the very beginning of the synchronization in * that case. */ if(priv->shared.sync.messages_total == 0) return 0.0; return (gdouble)priv->shared.sync.messages_received / (gdouble)priv->shared.sync.messages_total; case INF_SESSION_RUNNING: sync = inf_session_find_sync_by_connection(session, connection); g_assert(sync != NULL); return (gdouble)sync->messages_sent / (gdouble)sync->messages_total; case INF_SESSION_CLOSED: default: g_assert_not_reached(); return 0.0; } } /** * inf_session_has_synchronizations: * @session: A #InfSession. * * Returns whether there are currently ongoing synchronizations. If the * session is in status %INF_SESSION_SYNCHRONIZING, then this returns always * %TRUE, if it is in %INF_SESSION_CLOSED, then it returns always %FALSE. * If the session is in status %INF_SESSION_RUNNING, then it returns %TRUE * when the session is currently at least synchronized to one connection and * %FALSE otherwise. * * Returns: Whether there are ongoing synchronizations. **/ gboolean inf_session_has_synchronizations(InfSession* session) { InfSessionPrivate* priv; g_return_val_if_fail(INF_IS_SESSION(session), FALSE); priv = INF_SESSION_PRIVATE(session); switch(priv->status) { case INF_SESSION_PRESYNC: case INF_SESSION_SYNCHRONIZING: return TRUE; case INF_SESSION_RUNNING: if(priv->shared.run.syncs == NULL) return FALSE; else return TRUE; case INF_SESSION_CLOSED: return FALSE; default: g_assert_not_reached(); return FALSE; } } /** * inf_session_get_subscription_group: * @session: A #InfSession. * * Returns the subscription group for @session, if any. * * Return Value: A #InfCommunicationGroup, or %NULL. **/ InfCommunicationGroup* inf_session_get_subscription_group(InfSession* session) { g_return_val_if_fail(INF_IS_SESSION(session), NULL); return INF_SESSION_PRIVATE(session)->subscription_group; } /** * inf_session_set_subscription_group: * @session: A #InfSession. * @group: A #InfCommunicationGroup. * * Sets the subscription group for @session. The subscription group is the * group in which all connections subscribed to the session are a member of. * * #InfSession itself does not deal with subscriptions, so it is your job * to keep @group up-to-date (for example if you add non-local users to * @session). This is normally done by a so-called session proxy such as * #InfcSessionProxy or #InfdSessionProxy, respectively. **/ void inf_session_set_subscription_group(InfSession* session, InfCommunicationGroup* group) { InfSessionPrivate* priv; g_return_if_fail(INF_IS_SESSION(session)); priv = INF_SESSION_PRIVATE(session); if(priv->subscription_group != group) { if(priv->subscription_group != NULL) g_object_unref(priv->subscription_group); priv->subscription_group = group; if(group != NULL) g_object_ref(group); g_object_notify(G_OBJECT(session), "subscription-group"); } } /** * inf_session_send_to_subscriptions: * @session: A #InfSession. * @xml: The message to send. * * Sends a XML message to the all members of @session's subscription group. * This function can only be called if the subscription group is non-%NULL. It * takes ownership of @xml. **/ void inf_session_send_to_subscriptions(InfSession* session, xmlNodePtr xml) { InfSessionPrivate* priv; g_return_if_fail(INF_IS_SESSION(session)); g_return_if_fail(xml != NULL); priv = INF_SESSION_PRIVATE(session); g_return_if_fail(priv->subscription_group != NULL); inf_communication_group_send_group_message(priv->subscription_group, xml); } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/common/Makefile.am0000644000175000017500000000257312264763732016651 00000000000000libinfinity_common_la_CPPFLAGS = \ -I$(top_srcdir) \ $(infinity_CFLAGS) \ $(avahi_CFLAGS) noinst_LTLIBRARIES = libinfinity_common.la libinfinity_common_ladir = \ $(includedir)/libinfinity-$(LIBINFINITY_API_VERSION)/libinfinity/common libinfinity_common_la_SOURCES = \ inf-buffer.c \ inf-certificate-chain.c \ inf-certificate-credentials.c \ inf-cert-util.c \ inf-chat-buffer.c \ inf-chat-session.c \ inf-discovery-avahi.c \ inf-discovery.c \ inf-error.c \ inf-init.c \ inf-io.c \ inf-ip-address.c \ inf-local-publisher.c \ inf-protocol.c \ inf-sasl-context.c \ inf-session.c \ inf-simulated-connection.c \ inf-standalone-io.c \ inf-tcp-connection.c \ inf-user.c \ inf-user-table.c \ inf-xml-connection.c \ inf-xml-util.c \ inf-xmpp-connection.c \ inf-xmpp-manager.c libinfinity_common_la_HEADERS = \ inf-buffer.h \ inf-certificate-chain.h \ inf-certificate-credentials.h \ inf-cert-util.h \ inf-chat-buffer.h \ inf-chat-session.h \ inf-discovery.h \ inf-discovery-avahi.h \ inf-error.h \ inf-init.h \ inf-io.h \ inf-ip-address.h \ inf-local-publisher.h \ inf-protocol.h \ inf-sasl-context.h \ inf-session.h \ inf-simulated-connection.h \ inf-standalone-io.h \ inf-tcp-connection.h \ inf-user.h \ inf-user-table.h \ inf-xml-connection.h \ inf-xml-util.h \ inf-xmpp-connection.h \ inf-xmpp-manager.h noinst_HEADERS = inf-tcp-connection-private.h libinfinity-0.5.5/libinfinity/common/inf-chat-buffer.h0000644000175000017500000001336512264763732017727 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef __INF_CHAT_BUFFER_H__ #define __INF_CHAT_BUFFER_H__ #include #include #include G_BEGIN_DECLS #define INF_TYPE_CHAT_BUFFER (inf_chat_buffer_get_type()) #define INF_CHAT_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INF_TYPE_CHAT_BUFFER, InfChatBuffer)) #define INF_CHAT_BUFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INF_TYPE_CHAT_BUFFER, InfChatBufferClass)) #define INF_IS_CHAT_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INF_TYPE_CHAT_BUFFER)) #define INF_IS_CHAT_BUFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INF_TYPE_CHAT_BUFFER)) #define INF_CHAT_BUFFER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), INF_TYPE_CHAT_BUFFER, InfChatBufferClass)) #define INF_TYPE_CHAT_BUFFER_MESSAGE_TYPE (inf_chat_buffer_message_type_get_type()) #define INF_TYPE_CHAT_BUFFER_MESSAGE (inf_chat_buffer_message_get_type()) typedef struct _InfChatBuffer InfChatBuffer; typedef struct _InfChatBufferClass InfChatBufferClass; typedef struct _InfChatBufferMessage InfChatBufferMessage; /** * InfChatBufferMessageType: * @INF_CHAT_BUFFER_MESSAGE_NORMAL: A normal chat message. * @INF_CHAT_BUFFER_MESSAGE_EMOTE: An emote chat message (/me is doing * something). * @INF_CHAT_BUFFER_MESSAGE_USERJOIN: A user join notification. * @INF_CHAT_BUFFER_MESSAGE_USERPART: A user part notification. * * Possible chat message types. */ typedef enum _InfChatBufferMessageType { INF_CHAT_BUFFER_MESSAGE_NORMAL, INF_CHAT_BUFFER_MESSAGE_EMOTE, INF_CHAT_BUFFER_MESSAGE_USERJOIN, INF_CHAT_BUFFER_MESSAGE_USERPART } InfChatBufferMessageType; /** * InfChatBufferMessageFlags: * @INF_CHAT_BUFFER_MESSAGE_BACKLOG: The message is a backlog message, i.e. * it originated in a previous session. * * Possible chat message flags. */ typedef enum _InfChatBufferMessageFlags { INF_CHAT_BUFFER_MESSAGE_BACKLOG = 1 << 0 } InfChatBufferMessageFlags; /** * InfChatBufferMessage: * @type: The #InfChatBufferMessageType of the message. * @user: The #InfUser that issued the message. * @text: The UTF-8 encoded text of the message. * @length: The length of the message, in bytes. * @time: The time at which the message was received. * @flags: Additional flags for the message, see #InfChatBufferMessageFlags. * * Represents a chat message. */ struct _InfChatBufferMessage { InfChatBufferMessageType type; InfUser* user; gchar* text; gsize length; time_t time; InfChatBufferMessageFlags flags; }; /** * InfChatBufferClass: * @add_message: Default signal handler for the #InfChatBuffer::add-message * signal. * * This structure contains default signal handlers for #InfChatBuffer. */ struct _InfChatBufferClass { /*< private >*/ GObjectClass parent_class; /*< public >*/ void (*add_message)(InfChatBuffer* buffer, const InfChatBufferMessage* message); }; /** * InfChatBuffer: * * #InfChatBuffer is an opaque data type. You should only access it via the * public API functions. */ struct _InfChatBuffer { /*< private >*/ GObject parent; }; GType inf_chat_buffer_message_get_type(void) G_GNUC_CONST; GType inf_chat_buffer_message_type_get_type(void) G_GNUC_CONST; GType inf_chat_buffer_message_flags_get_type(void) G_GNUC_CONST; GType inf_chat_buffer_get_type(void) G_GNUC_CONST; InfChatBufferMessage* inf_chat_buffer_message_copy(const InfChatBufferMessage* message); void inf_chat_buffer_message_free(InfChatBufferMessage* message); InfChatBuffer* inf_chat_buffer_new(guint size); void inf_chat_buffer_add_message(InfChatBuffer* buffer, InfUser* by, const gchar* message, gsize length, time_t time, InfChatBufferMessageFlags flags); void inf_chat_buffer_add_emote_message(InfChatBuffer* buffer, InfUser* by, const gchar* message, gsize length, time_t time, InfChatBufferMessageFlags flags); void inf_chat_buffer_add_userjoin_message(InfChatBuffer* buffer, InfUser* user, time_t time, InfChatBufferMessageFlags flags); void inf_chat_buffer_add_userpart_message(InfChatBuffer* buffer, InfUser* user, time_t time, InfChatBufferMessageFlags flags); const InfChatBufferMessage* inf_chat_buffer_get_message(InfChatBuffer* buffer, guint n); guint inf_chat_buffer_get_n_messages(InfChatBuffer* buffer); guint inf_chat_buffer_get_size(InfChatBuffer* buffer); G_END_DECLS #endif /* __INF_CHAT_BUFFER_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/common/inf-protocol.h0000644000175000017500000000243512264763732017376 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_PROTOCOL_H__ #define __INF_PROTOCOL_H__ #include G_BEGIN_DECLS const gchar* inf_protocol_get_version(void); gboolean inf_protocol_parse_version(const gchar* version, guint* major, guint* minor, GError** error); guint inf_protocol_get_default_port(void); G_END_DECLS #endif /* __INF_PROTOCOL_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/common/inf-cert-util.h0000644000175000017500000000432112264763732017441 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_CERT_UTIL_H__ #define __INF_CERT_UTIL_H__ #include #include /* Get ssize_t on MSVC, required by gnutls.h */ #include G_BEGIN_DECLS GPtrArray* inf_cert_util_load_file(const gchar* filename, GPtrArray* current, GError** error); gboolean inf_cert_util_save_file(gnutls_x509_crt_t* certs, guint n_certs, const gchar* file, GError** error); int inf_cert_util_copy(gnutls_x509_crt_t* dest, gnutls_x509_crt_t src); gchar* inf_cert_util_get_dn_by_oid(gnutls_x509_crt_t cert, const char* oid, unsigned int index); gchar* inf_cert_util_get_issuer_dn_by_oid(gnutls_x509_crt_t crt, const char* oid, unsigned int index); gchar* inf_cert_util_get_hostname(gnutls_x509_crt_t cert); gchar* inf_cert_util_get_serial_number(gnutls_x509_crt_t cert); gchar* inf_cert_util_get_fingerprint(gnutls_x509_crt_t cert, gnutls_digest_algorithm_t algo); gchar* inf_cert_util_get_activation_time(gnutls_x509_crt_t cert); gchar* inf_cert_util_get_expiration_time(gnutls_x509_crt_t cert); G_END_DECLS #endif /* __INF_CERT_UTIL_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/common/inf-chat-buffer.c0000644000175000017500000005567112264763732017730 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /** * SECTION:inf-chat-buffer * @title: InfChatBuffer * @short_description: A ring buffer for chat messages * @include: libinfinity/common/inf-chat-buffer.h * @stability: Unstable * * #InfChatBuffer contains the chat messages for a #InfChatSession. **/ #include #include #include #include typedef struct _InfChatBufferPrivate InfChatBufferPrivate; struct _InfChatBufferPrivate { InfChatBufferMessage* messages; guint alloc_messages; guint num_messages; guint first_message; /* Total size of buffer */ guint size; gboolean modified; }; enum { PROP_0, /* construct only */ PROP_SIZE, /* Read/write */ PROP_MODIFIED }; enum { ADD_MESSAGE, LAST_SIGNAL }; #define INF_CHAT_BUFFER_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), INF_TYPE_CHAT_BUFFER, InfChatBufferPrivate)) static GObjectClass* parent_class; static guint chat_buffer_signals[LAST_SIGNAL]; /* * Message handling functions */ /* Allocate a new InfChatMessage for the given time, possibly removing an * old one if the buffer is full. Messages are ordered according to their time, * if there are multiple messages with the time, the new message is inserted * after the messages with the same time. */ /* The function returns NULL if the new message is older than all other * messages in the buffer. Make sure to initalize all fields of the new * message to sensible values after having called this function. */ static InfChatBufferMessage* inf_chat_buffer_reserve_message(InfChatBuffer* buffer, time_t time) { InfChatBufferPrivate* priv; InfChatBufferMessage* message; guint begin; guint end; guint n; priv = INF_CHAT_BUFFER_PRIVATE(buffer); begin = 0; end = priv->num_messages; /* Find the place at which to insert the new message */ while(begin != end) { n = (begin + end) / 2; message = &priv->messages[(priv->first_message + n) % priv->size]; if(message->time <= time) begin = (begin + end + 1)/2; else end = (begin + end)/2; } while(begin != end); n = begin; /* Can't insert at the beginning if there is no more space in the buffer */ if(n == 0 && priv->num_messages == priv->size) return NULL; if(priv->num_messages < priv->size) { /* We have buffer space available, so we don't need to drop an existing * message. */ /* We rely on the messages not wrapping around yet when the buffer is * not yet full. */ g_assert(priv->first_message + priv->num_messages <= priv->alloc_messages); if(priv->num_messages == priv->alloc_messages) { /* We need to allocate more space */ priv->alloc_messages = MAX(priv->alloc_messages * 2, 16); priv->alloc_messages = MIN(priv->alloc_messages, priv->size); g_assert(priv->alloc_messages > priv->num_messages); priv->messages = g_realloc( priv->messages, priv->alloc_messages * sizeof(InfChatBufferMessage) ); } if(n == 0 && priv->first_message == 0) { /* The new message is the first one, but there is no space at the * beginning of the array, so we need to shift the other messages */ end = (priv->alloc_messages - priv->num_messages + 1) / 2; g_assert(end > 0); memmove( priv->messages + end, priv->messages /* + priv->first_message */, priv->num_messages * sizeof(InfChatBufferMessage) ); priv->first_message = end - 1; } else if(n == priv->num_messages && priv->first_message + priv->num_messages == priv->alloc_messages) { /* The new message is the last one, but there is no space at the end of * the array, so we need to shift the other messages */ end = (priv->alloc_messages - priv->num_messages) / 2; g_assert(end + priv->num_messages < priv->alloc_messages); memmove( priv->messages + end, priv->messages + priv->first_message, priv->num_messages * sizeof(InfChatBufferMessage) ); priv->first_message = end; } else if(n > 0 && n < priv->num_messages) { /* The new message is inserted in the middle, so we need to shift either * the messages before or the ones after, depending on where we have * space available. */ if((n < priv->num_messages / 2 && priv->first_message > 0) || (n > priv->num_messages / 2 && priv->first_message + priv->num_messages == priv->alloc_messages)) { begin = priv->first_message; memmove( priv->messages + begin - 1, priv->messages + begin, (n + 1) * sizeof(InfChatBufferMessage) ); --priv->first_message; } else { memmove( priv->messages + n + 1, priv->messages + n, (priv->num_messages - n) * sizeof(InfChatBufferMessage) ); } } ++ priv->num_messages; } else { /* The buffer is full. This means we need to remove the oldest message */ g_assert(n > 0); /* we have catched this before */ begin = priv->first_message; end = (priv->first_message + n) % priv->size; if(n == priv->num_messages) { /* We insert at the end, so the first message is going to be freed */ g_free(priv->messages[priv->first_message].text); priv->first_message = (priv->first_message + 1) % priv->size; } else { /* Clear the oldest message */ g_free(priv->messages[end].text); if(begin < end) { memmove( priv->messages + begin + 1, priv->messages + begin, (end - begin) * sizeof(InfChatBufferMessage) ); } else { memmove( priv->messages + end + 1, priv->messages + end, (begin - end) * sizeof(InfChatBufferMessage) ); priv->first_message = (priv->first_message + 1) % priv->size; } } /* We increased first_message, so adapt the new message's number */ --n; } return &priv->messages[(priv->first_message + n) % priv->size]; } /* * GObject overrides */ static void inf_chat_buffer_init(GTypeInstance* instance, gpointer g_class) { InfChatBuffer* buffer; InfChatBufferPrivate* priv; buffer = INF_CHAT_BUFFER(instance); priv = INF_CHAT_BUFFER_PRIVATE(buffer); priv->messages = NULL; priv->alloc_messages = 0; priv->num_messages = 0; priv->first_message = 0; priv->size = 256; priv->modified = FALSE; } static void inf_chat_buffer_finalize(GObject* object) { InfChatBuffer* buffer; InfChatBufferPrivate* priv; guint i; buffer = INF_CHAT_BUFFER(object); priv = INF_CHAT_BUFFER_PRIVATE(buffer); /* Note that the messages array is not necessarily filled from its * beginning - we might have preallocated some space for prepending * entries. */ for(i = 0; i < priv->num_messages; ++i) g_free(priv->messages[(priv->first_message + i) % priv->size].text); g_free(priv->messages); G_OBJECT_CLASS(parent_class)->finalize(object); } static void inf_chat_buffer_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec) { InfChatBuffer* session; InfChatBufferPrivate* priv; session = INF_CHAT_BUFFER(object); priv = INF_CHAT_BUFFER_PRIVATE(session); switch(prop_id) { case PROP_SIZE: g_assert(priv->num_messages == 0); /* construct only */ priv->size = g_value_get_uint(value); break; case PROP_MODIFIED: priv->modified = g_value_get_boolean(value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void inf_chat_buffer_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec) { InfChatBuffer* session; InfChatBufferPrivate* priv; session = INF_CHAT_BUFFER(object); priv = INF_CHAT_BUFFER_PRIVATE(session); switch(prop_id) { case PROP_SIZE: g_value_set_uint(value, priv->size); break; case PROP_MODIFIED: g_value_set_boolean(value, priv->modified); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } /* * Default signal handlers */ static void inf_chat_buffer_add_message_handler(InfChatBuffer* buffer, const InfChatBufferMessage* message) { InfChatBufferPrivate* priv; InfChatBufferMessage* new_message; priv = INF_CHAT_BUFFER_PRIVATE(buffer); new_message = inf_chat_buffer_reserve_message(buffer, message->time); /* new_message can be NULL if the buffer is already full, and the new * message is older than all existing messages. */ if(new_message != NULL) { new_message->type = message->type; new_message->user = message->user; new_message->text = g_strndup(message->text, message->length); new_message->length = message->length; new_message->time = message->time; new_message->flags = message->flags; } } /* * InfBuffer implementation */ static gboolean inf_chat_buffer_buffer_get_modified(InfBuffer* buffer) { return INF_CHAT_BUFFER_PRIVATE(buffer)->modified; } static void inf_chat_buffer_buffer_set_modified(InfBuffer* buffer, gboolean modified) { InfChatBuffer* chat_buffer; InfChatBufferPrivate* priv; chat_buffer = INF_CHAT_BUFFER(buffer); priv = INF_CHAT_BUFFER_PRIVATE(chat_buffer); if(priv->modified != modified) { priv->modified = modified; g_object_notify(G_OBJECT(buffer), "modified"); } } /* * GType registration */ static void inf_chat_buffer_class_init(gpointer g_class, gpointer class_data) { GObjectClass* object_class; InfChatBufferClass* buffer_class; object_class = G_OBJECT_CLASS(g_class); buffer_class = INF_CHAT_BUFFER_CLASS(g_class); parent_class = G_OBJECT_CLASS(g_type_class_peek_parent(g_class)); g_type_class_add_private(g_class, sizeof(InfChatBufferPrivate)); object_class->finalize = inf_chat_buffer_finalize; object_class->set_property = inf_chat_buffer_set_property; object_class->get_property = inf_chat_buffer_get_property; buffer_class->add_message = inf_chat_buffer_add_message_handler; g_object_class_install_property( object_class, PROP_SIZE, g_param_spec_uint( "size", "size", "The maxmimum number of messages saved", 0, G_MAXUINT, 256, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); g_object_class_override_property(object_class, PROP_MODIFIED, "modified"); /** * InfChatBuffer::add-message: * @buffer: The #InfChatBuffer that is receiving a message. * @message: The #InfChatBufferMessage that was received. * * This signal is emitted whenever a message has been added to @buffer. */ chat_buffer_signals[ADD_MESSAGE] = g_signal_new( "add-message", G_OBJECT_CLASS_TYPE(object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(InfChatBufferClass, add_message), NULL, NULL, inf_marshal_VOID__BOXED, G_TYPE_NONE, 1, INF_TYPE_CHAT_BUFFER_MESSAGE | G_SIGNAL_TYPE_STATIC_SCOPE ); } GType inf_chat_buffer_message_type_get_type(void) { static GType chat_buffer_message_type_type = 0; if(!chat_buffer_message_type_type) { static const GEnumValue chat_buffer_message_type_type_values[] = { { INF_CHAT_BUFFER_MESSAGE_NORMAL, "INF_CHAT_BUFFER_MESSAGE_NORMAL", "normal" }, { INF_CHAT_BUFFER_MESSAGE_EMOTE, "INF_CHAT_BUFFER_MESSAGE_EMOTE", "emote" }, { INF_CHAT_BUFFER_MESSAGE_USERJOIN, "INF_CHAT_BUFFER_MESSAGE_USERJOIN", "userjoin" }, { INF_CHAT_BUFFER_MESSAGE_USERPART, "INF_CHAT_BUFFER_MESSAGE_USERPART", "userpart" }, { 0, NULL, NULL } }; chat_buffer_message_type_type = g_enum_register_static( "InfChatBufferMessageType", chat_buffer_message_type_type_values ); } return chat_buffer_message_type_type; } GType inf_chat_buffer_message_flags_get_type(void) { static GType chat_buffer_message_flags_type = 0; if(!chat_buffer_message_flags_type) { static const GFlagsValue chat_buffer_message_flags_type_values[] = { { INF_CHAT_BUFFER_MESSAGE_BACKLOG, "INF_CHAT_BUFFER_MESSAGE_BACKLOG", "backlog" }, { 0, NULL, NULL } }; chat_buffer_message_flags_type = g_flags_register_static( "InfChatBufferMessageFlags", chat_buffer_message_flags_type_values ); } return chat_buffer_message_flags_type; } GType inf_chat_buffer_message_get_type(void) { static GType chat_buffer_message_type = 0; if(!chat_buffer_message_type) { chat_buffer_message_type = g_boxed_type_register_static( "InfChatBufferMessage", (GBoxedCopyFunc)inf_chat_buffer_message_copy, (GBoxedFreeFunc)inf_chat_buffer_message_free ); } return chat_buffer_message_type; } static void inf_chat_buffer_buffer_init(gpointer g_iface, gpointer iface_data) { InfBufferIface* iface; iface = (InfBufferIface*)g_iface; iface->get_modified = inf_chat_buffer_buffer_get_modified; iface->set_modified = inf_chat_buffer_buffer_set_modified; } GType inf_chat_buffer_get_type(void) { static GType chat_buffer_type = 0; if(!chat_buffer_type) { static const GTypeInfo chat_buffer_type_info = { sizeof(InfChatBufferClass), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ inf_chat_buffer_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InfChatBuffer), /* instance_size */ 0, /* n_preallocs */ inf_chat_buffer_init, /* instance_init */ NULL /* value_table */ }; static const GInterfaceInfo buffer_info = { inf_chat_buffer_buffer_init, NULL, NULL }; chat_buffer_type = g_type_register_static( G_TYPE_OBJECT, "InfChatBuffer", &chat_buffer_type_info, 0 ); g_type_add_interface_static( chat_buffer_type, INF_TYPE_BUFFER, &buffer_info ); } return chat_buffer_type; } /* * Public API */ /** * inf_chat_buffer_message_copy: * @message: The #InfChatBufferMessage to copy. * * Creates a copy of the given message. * * Returns: A new #InfChatBufferMessage. Free with * inf_chat_buffer_message_free() when no longer needed. */ InfChatBufferMessage* inf_chat_buffer_message_copy(const InfChatBufferMessage* message) { InfChatBufferMessage* new_message; g_return_val_if_fail(message != NULL, NULL); new_message = g_slice_new(InfChatBufferMessage); new_message->type = message->type; new_message->user = message->user; new_message->text = g_strndup(message->text, message->length); new_message->length = message->length; new_message->time = message->time; new_message->flags = message->flags; return new_message; } /** * inf_chat_buffer_message_free: * @message: A #InfChatBufferMessage. * * Frees the given #InfChatBufferMessage which must have been created with * inf_chat_buffer_message_copy(). */ void inf_chat_buffer_message_free(InfChatBufferMessage* message) { g_return_if_fail(message != NULL); g_free(message->text); g_slice_free(InfChatBufferMessage, message); } /** * inf_chat_buffer_new: * @size: The number of messages to store. * * Creates a new #InfChatBuffer which contains no initial messages. @size * specifies how many messages to store before dropping old messages. * * Returns: A new #InfChatBuffer. */ InfChatBuffer* inf_chat_buffer_new(guint size) { return g_object_new( INF_TYPE_CHAT_BUFFER, "size", size, NULL ); } /** * inf_chat_buffer_add_message: * @buffer: A #InfChatBuffer. * @by: A #InfUser who wrote the message. * @message: The message text. * @length: The length of @message, in bytes. * @time: The time at which the user has written the message. * @flags: Flags to set for the message to add. * * Adds a new message to the chat buffer. If the buffer is full (meaning the * number of messages in the buffer equals its size), then an old message will * get discarded. If the message to be added is older than all other messages * in the buffer, then it will not be added at all. */ void inf_chat_buffer_add_message(InfChatBuffer* buffer, InfUser* by, const gchar* message, gsize length, time_t time, InfChatBufferMessageFlags flags) { InfChatBufferMessage msg; g_return_if_fail(INF_IS_CHAT_BUFFER(buffer)); g_return_if_fail(INF_IS_USER(by)); g_return_if_fail(message != NULL); msg.type = INF_CHAT_BUFFER_MESSAGE_NORMAL; msg.user = by; /* cast const away without warning */ msg.text = *(gchar**) (gpointer) &message; msg.length = length; msg.time = time; msg.flags = flags; g_signal_emit(buffer, chat_buffer_signals[ADD_MESSAGE], 0, &msg); } /** * inf_chat_buffer_add_emote_message: * @buffer: A #InfChatBuffer. * @by: A #InfUser who wrote the message. * @message: The message text. * @length: The length of @message, in bytes. * @time: The time at which the user has written the message. * @flags: Flags to set for the message to add. * * Adds a new emote message to the chat buffer. If the buffer is full * (meaning the number of messages in the buffer equals its size), then an * old message will get discarded. If the message to be added is older than * all other messages in the buffer, then it will not be added at all. */ void inf_chat_buffer_add_emote_message(InfChatBuffer* buffer, InfUser* by, const gchar* message, gsize length, time_t time, InfChatBufferMessageFlags flags) { InfChatBufferMessage msg; g_return_if_fail(INF_IS_CHAT_BUFFER(buffer)); g_return_if_fail(INF_IS_USER(by)); g_return_if_fail(message != NULL); msg.type = INF_CHAT_BUFFER_MESSAGE_EMOTE; msg.user = by; /* cast const away without warning */ msg.text = *(gchar**) (gpointer) &message; msg.length = length; msg.time = time; msg.flags = flags; g_signal_emit(buffer, chat_buffer_signals[ADD_MESSAGE], 0, &msg); } /** * inf_chat_buffer_add_userjoin_message: * @buffer: A #InfChatBuffer. * @user: A #InfUser who wrote the message. * @time: The time at which the user has written the message. * @flags: Flags to set for the message to add. * * Adds a new userjoin message to the chat buffer. If the buffer is full * (meaning the number of messages in the buffer equals its size), then an * old message will get discarded. If the message to be added is older than * all other messages in the buffer, then it will not be added at all. */ void inf_chat_buffer_add_userjoin_message(InfChatBuffer* buffer, InfUser* user, time_t time, InfChatBufferMessageFlags flags) { InfChatBufferMessage msg; g_return_if_fail(INF_IS_CHAT_BUFFER(buffer)); g_return_if_fail(INF_IS_USER(user)); msg.type = INF_CHAT_BUFFER_MESSAGE_USERJOIN; msg.user = user; msg.text = NULL; msg.length = 0; msg.time = time; msg.flags = flags; g_signal_emit(buffer, chat_buffer_signals[ADD_MESSAGE], 0, &msg); } /** * inf_chat_buffer_add_userpart_message: * @buffer: A #InfChatBuffer. * @user: A #InfUser who wrote the message. * @time: The time at which the user has written the message. * @flags: Flags to set for the message to add. * * Adds a new userpart message to the chat buffer. If the buffer is full * (meaning the number of messages in the buffer equals its size), then an * old message will get discarded. If the message to be added is older than * all other messages in the buffer, then it will not be added at all. */ void inf_chat_buffer_add_userpart_message(InfChatBuffer* buffer, InfUser* user, time_t time, InfChatBufferMessageFlags flags) { InfChatBufferMessage msg; g_return_if_fail(INF_IS_CHAT_BUFFER(buffer)); g_return_if_fail(INF_IS_USER(user)); msg.type = INF_CHAT_BUFFER_MESSAGE_USERPART; msg.user = user; msg.text = NULL; msg.length = 0; msg.time = time; msg.flags = flags; g_signal_emit(buffer, chat_buffer_signals[ADD_MESSAGE], 0, &msg); } /** * inf_chat_buffer_get_message: * @buffer: A #InfChatBuffer. * @n: The index of the message to obtain. * * Returns the message with the given index from the buffer. The oldest * message in the buffer has index 0, and the most recent one has index * inf_chat_buffer_get_n_messages() - 1. * * Returns: The #InfChatBufferMessage with the given index. */ const InfChatBufferMessage* inf_chat_buffer_get_message(InfChatBuffer* buffer, guint n) { InfChatBufferPrivate* priv; g_return_val_if_fail(INF_IS_CHAT_BUFFER(buffer), NULL); g_return_val_if_fail(n < inf_chat_buffer_get_n_messages(buffer), NULL); priv = INF_CHAT_BUFFER_PRIVATE(buffer); return &priv->messages[ (priv->first_message + n) % priv->size ]; } /** * inf_chat_buffer_get_n_messages: * @buffer: A #InfChatBuffer. * * Returns the number of messages in the buffer. * * Returns: The number of messages in the buffer. */ guint inf_chat_buffer_get_n_messages(InfChatBuffer* buffer) { g_return_val_if_fail(INF_IS_CHAT_BUFFER(buffer), 0); return INF_CHAT_BUFFER_PRIVATE(buffer)->num_messages; } /** * inf_chat_buffer_get_size: * @buffer: A #InfChatBuffer. * * Returns the size of the chat buffer, which is the maximum number of * messages that can be stored in the buffer. * * Returns: The number of messages in the chat buffer. */ guint inf_chat_buffer_get_size(InfChatBuffer* buffer) { g_return_val_if_fail(INF_IS_CHAT_BUFFER(buffer), 0); return INF_CHAT_BUFFER_PRIVATE(buffer)->size; } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/common/inf-xml-util.c0000644000175000017500000006556012264763732017313 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ /** * SECTION:inf-xml-util * @title: XML utility functions * @short_description: Helper functions to read basic data types from XML * @include: libinfinity/common/inf-xml-util.h * @stability: Unstable * * In the infinote protocol XML attributes are often required to contain * numbers. These function provide some convenience to set and retrieve them. * They are mostly used in libinfinity itself but can also be useful when * implementing new session types so they are public API. **/ #include #include #include #include #include #include /* HUGE_VAL */ #include static gboolean inf_xml_util_string_to_long(const gchar* attribute, const xmlChar* value, glong* output, GError** error) { long converted; char* endptr; errno = 0; converted = strtol((const char*)value, &endptr, 0); if(*value == '\0' || *endptr != '\0') { g_set_error( error, inf_request_error_quark(), INF_REQUEST_ERROR_INVALID_NUMBER, _("Attribute '%s' does not contain a valid number"), attribute ); return FALSE; } else if( (errno == ERANGE && converted == LONG_MAX)) { g_set_error( error, inf_request_error_quark(), INF_REQUEST_ERROR_INVALID_NUMBER, _("Attribute '%s' causes overflow (%s)"), attribute, (const gchar*)value ); return FALSE; } else if( (errno == ERANGE && converted == LONG_MIN)) { g_set_error( error, inf_request_error_quark(), INF_REQUEST_ERROR_INVALID_NUMBER, _("Attribute '%s' causes underflow (%s)"), attribute, (const gchar*)value ); return FALSE; } else { *output = converted; return TRUE; } } static gboolean inf_xml_util_string_to_ulong(const gchar* attribute, const xmlChar* value, gulong* output, GError** error) { unsigned long converted; char* endptr; errno = 0; converted = strtoul((const char*)value, &endptr, 0); if(*value == '\0' || *endptr != '\0') { g_set_error( error, inf_request_error_quark(), INF_REQUEST_ERROR_INVALID_NUMBER, _("Attribute '%s' does not contain a valid number"), attribute ); return FALSE; } else if(errno == ERANGE) { g_set_error( error, inf_request_error_quark(), INF_REQUEST_ERROR_INVALID_NUMBER, _("Attribute '%s' causes overflow (%s)"), attribute, (const gchar*)value ); return FALSE; } else { *output = converted; return TRUE; } } static gboolean inf_xml_util_string_to_int(const gchar* attribute, const xmlChar* value, gint* output, GError** error) { glong converted; if(!inf_xml_util_string_to_long(attribute, value, &converted, error)) return FALSE; if(converted > (long)G_MAXINT) { g_set_error( error, inf_request_error_quark(), INF_REQUEST_ERROR_INVALID_NUMBER, _("Attribute '%s' causes overflow (%s)"), attribute, (const gchar*)value ); return FALSE; } else if(converted < (long)G_MININT) { g_set_error( error, inf_request_error_quark(), INF_REQUEST_ERROR_INVALID_NUMBER, _("Attribute '%s' causes underflow (%s)"), attribute, (const gchar*)value ); return FALSE; } else { *output = (gint)converted; return TRUE; } } static gboolean inf_xml_util_string_to_uint(const gchar* attribute, const xmlChar* value, guint* output, GError** error) { unsigned long converted; if(!inf_xml_util_string_to_ulong(attribute, value, &converted, error)) return FALSE; if(converted > (unsigned long)G_MAXUINT) { g_set_error( error, inf_request_error_quark(), INF_REQUEST_ERROR_INVALID_NUMBER, _("Attribute '%s' causes overflow (%s)"), attribute, (const gchar*)value ); return FALSE; } else { *output = (guint)converted; return TRUE; } } static gboolean inf_xml_util_string_to_double(const gchar* attribute, const xmlChar* value, gdouble* output, GError** error) { double converted; char* endptr; errno = 0; converted = g_ascii_strtod((const char*)value, &endptr); if(*value == '\0' || *endptr != '\0') { g_set_error( error, inf_request_error_quark(), INF_REQUEST_ERROR_INVALID_NUMBER, _("Attribute '%s' does not contain a valid number"), attribute ); return FALSE; } else if(errno == ERANGE && (converted == HUGE_VAL || converted == -HUGE_VAL)) { g_set_error( error, inf_request_error_quark(), INF_REQUEST_ERROR_INVALID_NUMBER, _("Attribute '%s' causes overflow (%s)"), attribute, (const gchar*)value ); return FALSE; } else if(errno == ERANGE && converted == 0.0) { g_set_error( error, inf_request_error_quark(), INF_REQUEST_ERROR_INVALID_NUMBER, _("Attribute '%s' causes underflow (%s)"), attribute, (const gchar*)value ); return FALSE; } else { *output = converted; return TRUE; } } static gboolean inf_xml_util_valid_xml_char(gunichar codepoint) { /* cf. http://www.w3.org/TR/REC-xml/#dt-text */ return (codepoint >= 0x00020 && codepoint <= 0x00d7ff) /* probably most common */ || codepoint == 0xd || codepoint == 0xa || codepoint == 0x9 || (codepoint >= 0x0e000 && codepoint <= 0x00fffd) || (codepoint >= 0x10000 && codepoint <= 0x10ffff); } /* like the g_utf8_next_char macro, but without the cast to char* at the end */ #define inf_utf8_next_char(p) ((p) + g_utf8_skip[*(const guchar *)(p)]) /** * inf_xml_util_add_child_text: * @xml: A #xmlNodePtr. * @text: The child text to add. * @bytes: The number of bytes of @text. * * Adds the given text as child text to @xml in the same way * xmlNodeAddContentLen() would do. The difference is that @text is allowed * to contain characters that are not valid in * XML text, such * as formfeed characters \f. In case one occurs in @text, the function adds * an <uchar /> element node instead to @xml as specified in the * infinote protocol. */ void inf_xml_util_add_child_text(xmlNodePtr xml, const gchar* text, gsize bytes) { const gchar* p; const gchar* next; gchar* node_value; xmlNodePtr child_node; gunichar ch; gsize i; for(i = 0, p = text; i < bytes; i += next - p, p = next) { next = inf_utf8_next_char(p); ch = g_utf8_get_char(p); if(!inf_xml_util_valid_xml_char(ch)) { xmlNodeAddContentLen(xml, (const xmlChar*) text, p - text); child_node = xmlNewNode(NULL, (const xmlChar*)"uchar"); node_value = g_strdup_printf("%"G_GUINT32_FORMAT, ch); xmlNewProp(child_node, (const xmlChar*) "codepoint", (const xmlChar*) node_value); g_free(node_value); xmlAddChild(xml, child_node); text = next; } } if(p != text) xmlNodeAddContentLen(xml, (const xmlChar*) text, p - text); } /** * inf_xml_util_get_child_text: * @xml: A #xmlNodePtr * @bytes: Location to store number of bytes of child text, or %NULL. * @chars: Location to store number of characters of child text, or %NULL. * @error: Locatian to store error information if any, or %NULL. * * Reads a node's child text. If there are <uchar /> child elements, as * added by inf_xml_util_add_child_text() this function will convert them * back to character codes. There should not be any other child elements in * @xml. * * Returns: The node's child text, or %NULL on error. Free with g_free() when * no longer needed. */ gchar* inf_xml_util_get_child_text(xmlNodePtr xml, gsize* bytes, guint* chars, GError** error) { xmlNodePtr child; /* Every keypress will have to be get_child_text'ed, so * we assume that most child texts are very short. */ GString* result = g_string_sized_new(16); guint num_codepoint; gsize char_count = 0; for(child = xml->children; child; child = child->next) { switch(child->type) { case XML_TEXT_NODE: g_string_append(result, (const gchar*)child->content); char_count += g_utf8_strlen((const gchar*)child->content, -1); break; case XML_ELEMENT_NODE: if(strcmp((const char*) child->name, "uchar") != 0) { g_warning("unexpected child element in child text: %s", child->name); break; } if(!inf_xml_util_get_attribute_uint_required(child, "codepoint", &num_codepoint, error)) { g_string_free(result, TRUE); return NULL; } g_string_append_unichar(result, (gunichar) num_codepoint); ++char_count; break; default: g_warning( "unexpected node type in child text: %d", (int) child->type); break; } } if(chars) *chars = char_count; if(bytes) *bytes = result->len; return g_string_free(result, FALSE); } /** * inf_xml_util_get_attribute: * @xml: A #xmlNodePtr. * @attribute: The name of the attribute to query. * * Returns the value of the attribute called @attribute in the XML element * @xml. This function is a thin wrapper around xmlGetProp() which exists * mostly for consistency, and for not having to cast the @attribute argument * from char* to xmlChar*. The return value is a xmlChar*, though. * * Returns: The value of the attribute, or %NULL. Free with xmlFree() when no * longer needed. */ xmlChar* inf_xml_util_get_attribute(xmlNodePtr xml, const gchar* attribute) { return xmlGetProp(xml, (const xmlChar*)attribute); } /** * inf_xml_util_get_attribute_required: * @xml: A #xmlNodePtr. * @attribute: The name of the attribute to query. * @error: Location to store error information, if any. * * Returns the value of the attribute called @attribute in the XML element * @xml. If there is no such attribute then the function returns %NULL and * @error is set. * * Returns: The attribute's value, or %NULL on error. Free with xmlFree() * when no longer needed. */ xmlChar* inf_xml_util_get_attribute_required(xmlNodePtr xml, const gchar* attribute, GError** error) { xmlChar* value; value = xmlGetProp(xml, (const xmlChar*)attribute); if(value == NULL) { g_set_error( error, inf_request_error_quark(), INF_REQUEST_ERROR_NO_SUCH_ATTRIBUTE, _("Request '%s' does not contain required attribute '%s'"), (const gchar*)xml->name, attribute ); } return value; } /** * inf_xml_util_get_attribute_int: * @xml: A #xmlNodePtr. * @attribute: The name of the attribute to query. * @result: Location to store the read value. * @error: Location to store error information, if any. * * Reads the attribute named @attribute from the XML element @xml. The * attribute value is expected to be a signed integral number. If it is the * function converts the text to an integere and stores the result into * @result. In this case, %TRUE is returned and @error is left untouched. * * If the value is not a signed integral number, then the function returns * %FALSE, @error is set and @result is left untouched. * * If the attribute does not exist the function returns %FALSE but @error is * not set. * * Returns: Whether @result was set. */ gboolean inf_xml_util_get_attribute_int(xmlNodePtr xml, const gchar* attribute, gint* result, GError** error) { xmlChar* value; gboolean retval; value = xmlGetProp(xml, (const xmlChar*)attribute); if(value == NULL) return FALSE; retval = inf_xml_util_string_to_int(attribute, value, result, error); xmlFree(value); return retval; } /** * inf_xml_util_get_attribute_int_required: * @xml: A #xmlNodePtr. * @attribute: The name of the attribute to query. * @result: Location to store the read value. * @error: Location to store error information, if any. * * Reads the attribute named @attribute from the XML element @xml. The * attribute value is expected to be a signed integral number. If it is the * function converts the text to an integere and stores the result into * @result. In this case, %TRUE is returned and @error is left untouched. * * If the value is not a signed integral number or the attribute does not * exist, then the function returns %FALSE, @error is set and @result is * left untouched. * * Returns: Whether @result was set. */ gboolean inf_xml_util_get_attribute_int_required(xmlNodePtr xml, const gchar* attribute, gint* result, GError** error) { xmlChar* value; gboolean retval; value = inf_xml_util_get_attribute_required(xml, attribute, error); if(value == NULL) return FALSE; retval = inf_xml_util_string_to_int(attribute, value, result, error); xmlFree(value); return retval; } /** * inf_xml_util_get_attribute_long: * @xml: A #xmlNodePtr. * @attribute: The name of the attribute to query. * @result: Location to store the read value. * @error: Location to store error information, if any. * * Behaves exactly like inf_xml_util_get_attribute_int(). The only difference * is that the function reads a signed long integral number. * * Returns: Whether @result was set. */ gboolean inf_xml_util_get_attribute_long(xmlNodePtr xml, const gchar* attribute, glong* result, GError** error) { xmlChar* value; gboolean retval; value = xmlGetProp(xml, (const xmlChar*)attribute); if(value == NULL) return FALSE; retval = inf_xml_util_string_to_long(attribute, value, result, error); xmlFree(value); return retval; } /** * inf_xml_util_get_attribute_long_required: * @xml: A #xmlNodePtr. * @attribute: The name of the attribute to query. * @result: Location to store the read value. * @error: Location to store error information, if any. * * Behaves exactly like inf_xml_util_get_attribute_int_required(). The only * difference is that the function reads a signed long integral number. * * Returns: Whether @result was set. */ gboolean inf_xml_util_get_attribute_long_required(xmlNodePtr xml, const gchar* attribute, glong* result, GError** error) { xmlChar* value; gboolean retval; value = inf_xml_util_get_attribute_required(xml, attribute, error); if(value == NULL) return FALSE; retval = inf_xml_util_string_to_long(attribute, value, result, error); xmlFree(value); return retval; } /** * inf_xml_util_get_attribute_uint: * @xml: A #xmlNodePtr. * @attribute: The name of the attribute to query. * @result: Location to store the read value. * @error: Location to store error information, if any. * * Behaves exactly like inf_xml_util_get_attribute_int(). The only difference * is that the function reads an unsigned integral number. * * Returns: Whether @result was set. */ gboolean inf_xml_util_get_attribute_uint(xmlNodePtr xml, const gchar* attribute, guint* result, GError** error) { xmlChar* value; gboolean retval; value = xmlGetProp(xml, (const xmlChar*)attribute); if(value == NULL) return FALSE; retval = inf_xml_util_string_to_uint(attribute, value, result, error); xmlFree(value); return retval; } /** * inf_xml_util_get_attribute_uint_required: * @xml: A #xmlNodePtr. * @attribute: The name of the attribute to query. * @result: Location to store the read value. * @error: Location to store error information, if any. * * Behaves exactly like inf_xml_util_get_attribute_int_required(). The only * difference is that the function reads an unsigned integral number. * * Returns: Whether @result was set. */ gboolean inf_xml_util_get_attribute_uint_required(xmlNodePtr xml, const gchar* attribute, guint* result, GError** error) { xmlChar* value; gboolean retval; value = inf_xml_util_get_attribute_required(xml, attribute, error); if(value == NULL) return FALSE; retval = inf_xml_util_string_to_uint(attribute, value, result, error); xmlFree(value); return retval; } /** * inf_xml_util_get_attribute_ulong: * @xml: A #xmlNodePtr. * @attribute: The name of the attribute to query. * @result: Location to store the read value. * @error: Location to store error information, if any. * * Behaves exactly like inf_xml_util_get_attribute_int(). The only difference * is that the function reads an unsigned long integral number. * * Returns: Whether @result was set. */ gboolean inf_xml_util_get_attribute_ulong(xmlNodePtr xml, const gchar* attribute, gulong* result, GError** error) { xmlChar* value; gboolean retval; value = xmlGetProp(xml, (const xmlChar*)attribute); if(value == NULL) return FALSE; retval = inf_xml_util_string_to_ulong(attribute, value, result, error); xmlFree(value); return retval; } /** * inf_xml_util_get_attribute_ulong_required: * @xml: A #xmlNodePtr. * @attribute: The name of the attribute to query. * @result: Location to store the read value. * @error: Location to store error information, if any. * * Behaves exactly like inf_xml_util_get_attribute_int_required(). The only * difference is that the function reads an unsigned long integral number. * * Returns: Whether @result was set. */ gboolean inf_xml_util_get_attribute_ulong_required(xmlNodePtr xml, const gchar* attribute, gulong* result, GError** error) { xmlChar* value; gboolean retval; value = inf_xml_util_get_attribute_required(xml, attribute, error); if(value == NULL) return FALSE; retval = inf_xml_util_string_to_ulong(attribute, value, result, error); xmlFree(value); return retval; } /** * inf_xml_util_get_attribute_double: * @xml: A #xmlNodePtr. * @attribute: The name of the attribute to query. * @result: Location to store the read value. * @error: Location to store error information, if any. * * Behaves exactly like inf_xml_util_get_attribute_int(). The only difference * is that the function reads a double-precision floating point number. * * Returns: Whether @result was set. */ gboolean inf_xml_util_get_attribute_double(xmlNodePtr xml, const gchar* attribute, gdouble* result, GError** error) { xmlChar* value; gboolean retval; value = xmlGetProp(xml, (const xmlChar*)attribute); if(value == NULL) return FALSE; retval = inf_xml_util_string_to_double(attribute, value, result, error); xmlFree(value); return retval; } /** * inf_xml_util_get_attribute_double_required: * @xml: A #xmlNodePtr. * @attribute: The name of the attribute to query. * @result: Location to store the read value. * @error: Location to store error information, if any. * * Behaves exactly like inf_xml_util_get_attribute_int_required(). The only * difference is that the function reads a double-precision floating point * number. * * Returns: Whether @result was set. */ gboolean inf_xml_util_get_attribute_double_required(xmlNodePtr xml, const gchar* attribute, gdouble* result, GError** error) { xmlChar* value; gboolean retval; value = inf_xml_util_get_attribute_required(xml, attribute, error); if(value == NULL) return FALSE; retval = inf_xml_util_string_to_double(attribute, value, result, error); xmlFree(value); return retval; } /** * inf_xml_util_set_attribute: * @xml: A #xmlNodePtr. * @attribute: The name of the attribute to set. * @value: The value to set. * * Sets the attribute named @attribute to the given value of the XML element * @xml. This is a thin wrapper around xmlSetProp(), mainly provided for * consistency and for not having to cast the arguments to xmlChar*. */ void inf_xml_util_set_attribute(xmlNodePtr xml, const gchar* attribute, const gchar* value) { xmlSetProp(xml, (const xmlChar*)attribute, (const xmlChar*)value); } /** * inf_xml_util_set_attribute_int: * @xml: A #xmlNodePtr. * @attribute: The name of the attribute to set. * @value: The value to set. * * Sets the attribute named @attribute to the given signed integral value * converted to text. */ void inf_xml_util_set_attribute_int(xmlNodePtr xml, const gchar* attribute, gint value) { char buffer[sizeof(gint) * 3]; sprintf(buffer, "%d", value); xmlSetProp(xml, (const xmlChar*)attribute, (const xmlChar*)buffer); } /** * inf_xml_util_set_attribute_long: * @xml: A #xmlNodePtr. * @attribute: The name of the attribute to set. * @value: The value to set. * * Sets the attribute named @attribute to the given signed long integral value * converted to text. */ void inf_xml_util_set_attribute_long(xmlNodePtr xml, const gchar* attribute, glong value) { char buffer[sizeof(glong) * 3]; sprintf(buffer, "%ld", value); xmlSetProp(xml, (const xmlChar*)attribute, (const xmlChar*)buffer); } /** * inf_xml_util_set_attribute_uint: * @xml: A #xmlNodePtr. * @attribute: The name of the attribute to set. * @value: The value to set. * * Sets the attribute named @attribute to the given unsigned integral value * converted to text. */ void inf_xml_util_set_attribute_uint(xmlNodePtr xml, const gchar* attribute, guint value) { char buffer[sizeof(guint) * 3]; sprintf(buffer, "%u", value); xmlSetProp(xml, (const xmlChar*)attribute, (const xmlChar*)buffer); } /** * inf_xml_util_set_attribute_ulong: * @xml: A #xmlNodePtr. * @attribute: The name of the attribute to set. * @value: The value to set. * * Sets the attribute named @attribute to the given unsigned long integral * value converted to text. */ void inf_xml_util_set_attribute_ulong(xmlNodePtr xml, const gchar* attribute, gulong value) { char buffer[sizeof(gulong) * 3]; sprintf(buffer, "%lu", value); xmlSetProp(xml, (const xmlChar*)attribute, (const xmlChar*)buffer); } /** * inf_xml_util_set_attribute_double: * @xml: A #xmlNodePtr. * @attribute: The name of the attribute to set. * @value: The value to set. * * Sets the attribute named @attribute to the given double-precision * floating point number converted to text. */ void inf_xml_util_set_attribute_double(xmlNodePtr xml, const gchar* attribute, gdouble value) { char buffer[G_ASCII_DTOSTR_BUF_SIZE]; g_ascii_dtostr(buffer, G_ASCII_DTOSTR_BUF_SIZE, value); xmlSetProp(xml, (const xmlChar*)attribute, (const xmlChar*)buffer); } /** * inf_xml_util_new_node_from_error: * @error: The error object to represent in xml. * @name_space: The element's namespace, or %NULL. * @name: An element name, or %NULL. * * Creates a new #xmlNode that encodes @error. The element's name is * optionally specified by @name, or "error" by default, @error's domain * and code are set as attributes and its message is set as child text using * inf_xml_util_add_child_text(). @name_space is set as the element's * namespace, if not %NULL. * * Returns: A new #xmlNodePtr. It is the caller's responsibility to dispose it * using xmlFreeNode(). */ xmlNodePtr inf_xml_util_new_node_from_error(GError* error, xmlNsPtr name_space, const gchar* name) { xmlNodePtr xml; if(name == NULL) name = "error"; xml = xmlNewNode(name_space, (const xmlChar*) name); inf_xml_util_set_attribute_int(xml, "code", error->code); xmlNewProp( xml, (const xmlChar*) "domain", (const xmlChar*) g_quark_to_string(error->domain) ); inf_xml_util_add_child_text(xml, error->message, strlen(error->message)); return xml; } /** * inf_xml_util_new_error_from_node: * @xml: A #xmlNodePtr as returned by inf_xml_util_new_node_from_error(). * * Creates a new #GError with the domain and erro code given in @xml's * attributes. The message is parsed from the child text as with * inf_xml_util_get_child_text(). The element name and namespace are ignored. * If @xml does not have the attributes as expected, %NULL is returned. * * Returns: A pointer to a new #GError, or %NULL on failure. It is the * caller's responsibility to dispose the #GError object using g_error_free(). */ GError* inf_xml_util_new_error_from_node(xmlNodePtr xml) { GError* result; xmlChar* domain_str; int code; if(!inf_xml_util_get_attribute_int(xml, "code", &code, NULL)) return NULL; domain_str = xmlGetProp(xml, (const xmlChar*) "domain"); if(domain_str == NULL) return NULL; result = g_slice_new(GError); result->code = code; result->domain = g_quark_from_string((const gchar*) domain_str); result->message = inf_xml_util_get_child_text(xml, NULL, NULL, NULL); xmlFree(domain_str); return result; } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/common/inf-local-publisher.h0000644000175000017500000000643312264763732020624 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_LOCAL_PUBLISHER_H__ #define __INF_LOCAL_PUBLISHER_H__ #include #include G_BEGIN_DECLS #define INF_TYPE_LOCAL_PUBLISHER (inf_local_publisher_get_type()) #define INF_LOCAL_PUBLISHER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INF_TYPE_LOCAL_PUBLISHER, InfLocalPublisher)) #define INF_IS_LOCAL_PUBLISHER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INF_TYPE_LOCAL_PUBLISHER)) #define INF_LOCAL_PUBLISHER_GET_IFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE((inst), INF_TYPE_LOCAL_PUBLISHER, InfLocalPublisherIface)) /** * InfLocalPublisher: * * #InfLocalPublisher is an opaque data type. You should only access it * via the public API functions. */ typedef struct _InfLocalPublisher InfLocalPublisher; typedef struct _InfLocalPublisherIface InfLocalPublisherIface; /** * InfLocalPublisherItem: * * #InfLocalPublisherItem is an opaque data type. You should only access it * via the public API functions. */ typedef struct _InfLocalPublisherItem InfLocalPublisherItem; /** * InfLocalPublisherIface: * @publish: Virtual function to announce a service of the given type with * the given name on the given port. The returned #InfLocalPublisherItem is * valid as long as the service is published and the #InfLocalPublisher is * alive. It can be used to unpublish the service again using the @unpublish * function. * @unpublish: Virtual function to unpublish a previously published service. * * Virtual functions for #InfLocalPublisher. */ struct _InfLocalPublisherIface { /*< private >*/ GTypeInterface parent; /* Virtual table */ /*< public >*/ InfLocalPublisherItem* (*publish)(InfLocalPublisher* publisher, const gchar* type, const gchar* name, guint port); void (*unpublish)(InfLocalPublisher* publisher, InfLocalPublisherItem* item); }; GType inf_local_publisher_get_type(void) G_GNUC_CONST; InfLocalPublisherItem* inf_local_publisher_publish(InfLocalPublisher* publisher, const gchar* type, const gchar* name, guint port); void inf_local_publisher_unpublish(InfLocalPublisher* publisher, InfLocalPublisherItem* item); G_END_DECLS #endif /* __INF_LOCAL_PUBLISHER_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/common/inf-xmpp-manager.h0000644000175000017500000000670312264763732020133 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_XMPP_MANAGER_H__ #define __INF_XMPP_MANAGER_H__ #include #include G_BEGIN_DECLS #define INF_TYPE_XMPP_MANAGER (inf_xmpp_manager_get_type()) #define INF_XMPP_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INF_TYPE_XMPP_MANAGER, InfXmppManager)) #define INF_XMPP_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INF_TYPE_XMPP_MANAGER, InfXmppManagerClass)) #define INF_IS_XMPP_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INF_TYPE_XMPP_MANAGER)) #define INF_IS_XMPP_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INF_TYPE_XMPP_MANAGER)) #define INF_XMPP_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), INF_TYPE_XMPP_MANAGER, InfXmppManagerClass)) typedef struct _InfXmppManager InfXmppManager; typedef struct _InfXmppManagerClass InfXmppManagerClass; /** * InfXmppManagerClass: * @add_connection: Default signal handler for the * #InfXmppManager::add-connection signal. It adds the connection to the * manager's internal storage. * @remove_connection: Default signal handler for the * #InfXmppManager::remove-connection signal. It removes the connection from * the manager's internal storage. * * This structure contains the default signal handlers for #InfXmppManager. */ struct _InfXmppManagerClass { /*< private >*/ GObjectClass parent_class; /*< public >*/ void(*add_connection)(InfXmppManager* manager, InfXmppConnection* connection); void(*remove_connection)(InfXmppManager* manager, InfXmppConnection* connection); }; /** * InfXmppManager: * * #InfXmppManager is an opaque data type. You should only access it via the * public API functions. */ struct _InfXmppManager { /*< private >*/ GObject parent; }; GType inf_xmpp_manager_get_type(void) G_GNUC_CONST; InfXmppManager* inf_xmpp_manager_new(void); InfXmppConnection* inf_xmpp_manager_lookup_connection_by_address(InfXmppManager* manager, InfIpAddress* address, guint port); gboolean inf_xmpp_manager_contains_connection(InfXmppManager* manager, InfXmppConnection* connection); void inf_xmpp_manager_add_connection(InfXmppManager* manager, InfXmppConnection* connection); void inf_xmpp_manager_remove_connection(InfXmppManager* manager, InfXmppConnection* connection); G_END_DECLS #endif /* __INF_XMPP_MANAGER_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/common/inf-user.h0000644000175000017500000000537512264763732016521 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_USER_H__ #define __INF_USER_H__ #include #include G_BEGIN_DECLS #define INF_TYPE_USER (inf_user_get_type()) #define INF_USER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INF_TYPE_USER, InfUser)) #define INF_USER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INF_TYPE_USER, InfUserClass)) #define INF_IS_USER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INF_TYPE_USER)) #define INF_IS_USER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INF_TYPE_USER)) #define INF_USER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), INF_TYPE_USER, InfUserClass)) #define INF_TYPE_USER_STATUS (inf_user_status_get_type()) #define INF_TYPE_USER_FLAGS (inf_user_flags_get_type()) typedef struct _InfUser InfUser; typedef struct _InfUserClass InfUserClass; typedef enum _InfUserStatus { INF_USER_ACTIVE, INF_USER_INACTIVE, INF_USER_UNAVAILABLE } InfUserStatus; typedef enum InfUserFlags { INF_USER_LOCAL = 1 << 0 } InfUserFlags; struct _InfUserClass { GObjectClass parent_class; void (*set_status)(InfUser* user, InfUserStatus status); }; struct _InfUser { GObject parent; gpointer priv; }; GType inf_user_status_get_type(void) G_GNUC_CONST; GType inf_user_flags_get_type(void) G_GNUC_CONST; GType inf_user_get_type(void) G_GNUC_CONST; guint inf_user_get_id(InfUser* user); const gchar* inf_user_get_name(InfUser* user); InfUserStatus inf_user_get_status(InfUser* user); InfUserFlags inf_user_get_flags(InfUser* user); InfXmlConnection* inf_user_get_connection(InfUser* user); const gchar* inf_user_status_to_string(InfUserStatus status); gboolean inf_user_status_from_string(const gchar* string, InfUserStatus* status, GError** error); G_END_DECLS #endif /* __INF_USER_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/common/inf-protocol.c0000644000175000017500000000741512264763732017374 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ /** * SECTION:inf-protocol * @short_description: Infinote protocol parameters * @include: libinfinity/common/inf-protocol.h * @see_also: InfError * @stability: Unstable * * This section defines common protocol parameters used by libinfinity. **/ #include #include #include #include #include /** * inf_protocol_get_version: * * Returns the version of the Infinote protocol implemented by this * version of libinfinity. * * Returns: The supported infinote version. */ const gchar* inf_protocol_get_version(void) { return "1.0"; } /** * inf_protocol_parse_version: * @version: A version string, such as "1.0" * @major: A location to store the major version number to. * @minor: A location to store the minor version number to * @error: Location to store error information, if any. * * Splits the given version string into it's major and minor version number. * If the string is badly formatted then the function returns %FALSE, @error * is set and @major and @minor are left untouched. * * It is guaranteed that, if @version is inf_protocol_get_version(), the * function does not fail. * * Returns: %TRUE on success, or %FALSE on error. */ gboolean inf_protocol_parse_version(const gchar* version, guint* major, guint* minor, GError** error) { gchar* endptr; unsigned long maj; unsigned long min; errno = 0; maj = strtoul(version, &endptr, 10); if(errno == ERANGE || maj > (unsigned long)G_MAXUINT) { g_set_error( error, inf_request_error_quark(), INF_REQUEST_ERROR_INVALID_NUMBER, "%s", _("Major part of version number causes overflow") ); return FALSE; } if(*endptr != '.') { g_set_error( error, inf_request_error_quark(), INF_REQUEST_ERROR_INVALID_NUMBER, "%s", _("Version number parts are not separated by '.'") ); return FALSE; } errno = 0; min = strtoul(endptr+1, &endptr, 10); if(errno == ERANGE || min > (unsigned long)G_MAXUINT) { g_set_error( error, inf_request_error_quark(), INF_REQUEST_ERROR_INVALID_NUMBER, "%s", _("Minor part of version number causes overflow") ); return FALSE; } if(*endptr != '\0') { g_set_error( error, inf_request_error_quark(), INF_REQUEST_ERROR_INVALID_NUMBER, "%s", _("Trailing characters after version number") ); return FALSE; } if(major) *major = maj; if(minor) *minor = min; return TRUE; } /** * inf_protocol_get_default_port: * * Returns the default port on which the infinote daemon listens for new * connections. * * Returns: The default port. */ guint inf_protocol_get_default_port(void) { return 6523; } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/common/inf-standalone-io.c0000644000175000017500000010054212264763732020263 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include /* TODO: Modularize the FD handling, then add epoll support */ #ifdef G_OS_WIN32 # include #else # include # include # include #endif /* !G_OS_WIN32 */ #include #ifdef G_OS_WIN32 typedef WSAEVENT InfStandaloneIoNativeEvent; typedef DWORD InfStandaloneIoPollTimeout; typedef DWORD InfStandaloneIoPollResult; static const InfStandaloneIoPollResult INF_STANDALONE_IO_POLL_TIMEOUT = WSA_WAIT_TIMEOUT; static const InfStandaloneIoPollTimeout INF_STANDALONE_IO_POLL_INFINITE = WSA_INFINITE; #define inf_standalone_io_poll(events, num_events, timeout) \ ((num_events) == 0 ? \ (Sleep(timeout), WSA_WAIT_TIMEOUT) : \ (WSAWaitForMultipleEvents(num_events, events, FALSE, timeout, TRUE))) #else typedef struct pollfd InfStandaloneIoNativeEvent; typedef int InfStandaloneIoPollTimeout; typedef int InfStandaloneIoPollResult; static const InfStandaloneIoPollResult INF_STANDALONE_IO_POLL_TIMEOUT = 0; static const InfStandaloneIoPollTimeout INF_STANDALONE_IO_POLL_INFINITE = -1; #define inf_standalone_io_poll(events, num_events, timeout) \ (poll(events, (nfds_t)num_events, timeout)) #endif struct _InfIoWatch { /* TODO: Do we actually need this? We can access the event by * priv->events[watchindex+1]. */ InfStandaloneIoNativeEvent* event; InfNativeSocket* socket; InfIoWatchFunc func; gpointer user_data; GDestroyNotify notify; /* Protection flags to avoid freeing the watch object when running * the callback */ gboolean executing; gboolean disposed; }; struct _InfIoTimeout { GTimeVal begin; guint msecs; InfIoTimeoutFunc func; gpointer user_data; GDestroyNotify notify; }; struct _InfIoDispatch { InfIoDispatchFunc func; gpointer user_data; GDestroyNotify notify; }; typedef struct _InfStandaloneIoPrivate InfStandaloneIoPrivate; struct _InfStandaloneIoPrivate { InfStandaloneIoNativeEvent* events; GMutex* mutex; guint fd_size; guint fd_alloc; /* this array has fd_size-1 entries and fd_alloc-1 allocations: */ InfIoWatch** watches; GList* timeouts; GList* dispatchs; #ifndef G_OS_WIN32 int wakeup_pipe[2]; #endif gboolean polling; gboolean loop_running; }; #ifdef G_OS_WIN32 /* Mapping between WSAEventSelect's FD_ flags and libinfinity's * INF_IO flags */ typedef struct _InfStandaloneIoEventTableEntry InfStandaloneIoEventTableEntry; struct _InfStandaloneIoEventTableEntry { guint flag_val; guint flag_bit; guint io_val; }; static const InfStandaloneIoEventTableEntry inf_standalone_io_event_table[] = { { FD_READ, FD_READ_BIT, INF_IO_INCOMING }, { FD_CLOSE, FD_CLOSE_BIT, INF_IO_INCOMING }, { FD_ACCEPT, FD_ACCEPT_BIT, INF_IO_INCOMING }, { FD_WRITE, FD_WRITE_BIT, INF_IO_OUTGOING }, { FD_CONNECT, FD_CONNECT_BIT, INF_IO_OUTGOING } }; #endif #define INF_STANDALONE_IO_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), INF_TYPE_STANDALONE_IO, InfStandaloneIoPrivate)) static GObjectClass* parent_class; static guint inf_standalone_io_timeval_diff(GTimeVal* first, GTimeVal* second) { g_assert(first->tv_sec > second->tv_sec || (first->tv_sec == second->tv_sec && first->tv_usec >= second->tv_usec)); /* Don't risk overflow, don't need to convert to signed int */ return (first->tv_sec - second->tv_sec) * 1000 + (first->tv_usec+500)/1000 - (second->tv_usec+500)/1000; } /* Run one iteration of the main loop. Call this only with the mutex locked * and a local reference added to io. */ static void inf_standalone_io_iteration_impl(InfStandaloneIo* io, InfStandaloneIoPollTimeout timeout) { InfStandaloneIoPrivate* priv; InfIoEvent events; InfStandaloneIoPollResult result; guint i; GList* item; GTimeVal current; InfIoWatch* watch; InfIoTimeout* cur_timeout; InfIoDispatch* dispatch; guint elapsed; #ifdef G_OS_WIN32 gchar* error_message; WSANETWORKEVENTS wsa_events; const InfStandaloneIoEventTableEntry* entry; #else ssize_t ret; char buf[1]; #endif priv = INF_STANDALONE_IO_PRIVATE(io); /* Find number of milliseconds to wait */ if(priv->dispatchs != NULL) { /* TODO: Don't even poll */ timeout = 0; } else { g_get_current_time(¤t); for(item = priv->timeouts; item != NULL; item = g_list_next(item)) { cur_timeout = (InfIoTimeout*)item->data; elapsed = inf_standalone_io_timeval_diff(¤t, &cur_timeout->begin); if(elapsed >= cur_timeout->msecs) { /* already elapsed */ /* TODO: Don't even poll */ timeout = 0; /* no need to check other timeouts */ break; } else { if(timeout == INF_STANDALONE_IO_POLL_INFINITE || cur_timeout->msecs - elapsed < (guint)timeout) { timeout = cur_timeout->msecs - elapsed; } } } } priv->polling = TRUE; g_mutex_unlock(priv->mutex); result = inf_standalone_io_poll(priv->events, priv->fd_size, timeout); g_mutex_lock(priv->mutex); priv->polling = FALSE; #ifdef G_OS_WIN32 switch(result) { case WSA_WAIT_FAILED: error_message = g_win32_error_message(WSAGetLastError()); g_warning("WSAWaitForMultipleEvents() failed: %s\n", error_message); g_free(error_message); return; case WSA_WAIT_IO_COMPLETION: return; default: break; } #else if(result == -1) { if(errno != EINTR) g_warning("poll() failed: %s\n", strerror(errno)); return; } #endif if(result == INF_STANDALONE_IO_POLL_TIMEOUT) { /* No file descriptor is active, so check whether a timeout elapsed */ g_get_current_time(¤t); for(item = priv->timeouts; item != NULL; item = g_list_next(item)) { cur_timeout = (InfIoTimeout*)item->data; elapsed = inf_standalone_io_timeval_diff(¤t, &cur_timeout->begin); if(elapsed >= cur_timeout->msecs) { priv->timeouts = g_list_delete_link(priv->timeouts, item); g_mutex_unlock(priv->mutex); cur_timeout->func(cur_timeout->user_data); if(cur_timeout->notify) cur_timeout->notify(cur_timeout->user_data); g_slice_free(InfIoTimeout, cur_timeout); g_mutex_lock(priv->mutex); return; } } } #ifdef G_OS_WIN32 else if(result >= WSA_WAIT_EVENT_0 && result < WSA_WAIT_EVENT_0 + priv->fd_size) { if(result == WSA_WAIT_EVENT_0) { /* wakeup call */ WSAResetEvent(priv->events[0]); } else { watch = priv->watches[result - WSA_WAIT_EVENT_0 - 1]; if(WSAEnumNetworkEvents(*watch->socket, *watch->event, &wsa_events) == SOCKET_ERROR) { error_message = g_win32_error_message(WSAGetLastError()); g_warning("WSAEnumNetworkEvents failed: %s\n", error_message); g_free(error_message); events = INF_IO_ERROR; } else { events = 0; for(i = 0; i < G_N_ELEMENTS(inf_standalone_io_event_table); ++ i) { entry = &inf_standalone_io_event_table[i]; if(wsa_events.lNetworkEvents & entry->flag_val) { events |= entry->io_val; if(wsa_events.iErrorCode[entry->flag_bit]) events |= INF_IO_ERROR; } } } /* protect from removing the watch object via * inf_io_remove_watch() when running the callback. */ watch->executing = TRUE; g_mutex_unlock(priv->mutex); watch->func(watch->socket, events, watch->user_data); g_mutex_lock(priv->mutex); watch->executing = FALSE; if(watch->disposed == TRUE) { g_mutex_unlock(priv->mutex); if(watch->notify) watch->notify(watch->user_data); g_slice_free(InfIoWatch, watch); g_mutex_lock(priv->mutex); } return; } } #else else if(result > 0) { while(result--) { for(i = 0; i < priv->fd_size; ++ i) { if(priv->events[i].revents != 0) { events = 0; if(priv->events[i].revents & POLLIN) events |= INF_IO_INCOMING; if(priv->events[i].revents & POLLOUT) events |= INF_IO_OUTGOING; /* We treat POLLPRI as error because it should not occur in * infinote. */ if(priv->events[i].revents & (POLLERR | POLLPRI | POLLHUP | POLLNVAL)) events |= INF_IO_ERROR; priv->events[i].revents = 0; if(i == 0) { /* wakeup call */ /* we were not polling for outgoing */ g_assert(~events & INF_IO_OUTGOING); if(events & INF_IO_ERROR) { /* TODO: Read error from FD? */ g_warning("Error condition on wakeup pipe"); /* TODO: Is there anything we could do here? * Try to re-establish pipe? */ } else { ret = read(priv->events[0].fd, &buf, 1); if(ret == -1) { g_warning( "read() on wakeup pipe failed: %s", strerror(errno) ); /* TODO: Is there anything we could do here? * Try to re-establish pipe? */ } else if(ret == 0) { g_warning("Wakeup pipe received EOF"); /* TODO: Is there anything we could do here? * Try to re-establish pipe? */ } else { /* this is what we send as wakeup call */ g_assert(buf[0] == 'c'); } } } else { watch = priv->watches[i-1]; /* protect from removing the watch object via * inf_io_remove_watch() when running the callback. */ watch->executing = TRUE; g_mutex_unlock(priv->mutex); watch->func(watch->socket, events, watch->user_data); g_mutex_lock(priv->mutex); watch->executing = FALSE; if(watch->disposed == TRUE) { g_mutex_unlock(priv->mutex); if(watch->notify) watch->notify(watch->user_data); g_slice_free(InfIoWatch, watch); g_mutex_lock(priv->mutex); } return; } } } } } #endif /* neither timeout nor IO fired, so try a dispatched message */ if(priv->dispatchs != NULL) { dispatch = (InfIoDispatch*)priv->dispatchs->data; priv->dispatchs = g_list_delete_link(priv->dispatchs, priv->dispatchs); g_mutex_unlock(priv->mutex); dispatch->func(dispatch->user_data); if(dispatch->notify) dispatch->notify(dispatch->user_data); g_slice_free(InfIoDispatch, dispatch); g_mutex_lock(priv->mutex); } } static void inf_standalone_io_init(GTypeInstance* instance, gpointer g_class) { InfStandaloneIo* io; InfStandaloneIoPrivate* priv; #ifdef G_OS_WIN32 gchar* error_message; #endif io = INF_STANDALONE_IO(instance); priv = INF_STANDALONE_IO_PRIVATE(io); priv->mutex = g_mutex_new(); priv->fd_size = 0; priv->fd_alloc = 4; priv->events = g_malloc(sizeof(InfStandaloneIoNativeEvent) * priv->fd_alloc); #ifdef G_OS_WIN32 priv->events[0] = WSACreateEvent(); if(priv->events[0] == WSA_INVALID_EVENT) { error_message = g_win32_error_message(WSAGetLastError()); g_error("Failed to create wakeup event: %s", error_message); g_free(error_message); /* will not be called since g_error abort()s */ } else { ++priv->fd_size; } #else if(pipe(priv->wakeup_pipe) == -1) { g_error("Failed to create wakeup pipe: %s", strerror(errno)); } else { priv->events[0].fd = priv->wakeup_pipe[0]; priv->events[0].events = POLLIN | POLLERR; priv->events[0].revents = 0; ++priv->fd_size; } #endif priv->watches = g_malloc(sizeof(InfIoWatch*) * (priv->fd_alloc - 1) ); priv->timeouts = NULL; priv->dispatchs = NULL; priv->polling = FALSE; priv->loop_running = FALSE; } static void inf_standalone_io_finalize(GObject* object) { InfStandaloneIo* io; InfStandaloneIoPrivate* priv; guint i; GList* item; InfIoWatch* watch; InfIoTimeout* timeout; InfIoDispatch* dispatch; #ifdef G_OS_WIN32 gchar* error_message; #endif io = INF_STANDALONE_IO(object); priv = INF_STANDALONE_IO_PRIVATE(io); g_mutex_lock(priv->mutex); for(i = 1; i < priv->fd_size; ++i) { watch = priv->watches[i - 1]; /* cannot dispose the IO while running a callback since the IO is * reffed on the stack. */ g_assert(watch->executing == FALSE); #ifdef G_OS_WIN32 if(WSAEventSelect(*watch->socket, *watch->event, 0) == SOCKET_ERROR) { error_message = g_win32_error_message(WSAGetLastError()); g_warning("WSAEventSelect() failed: %s", error_message); g_free(error_message); } #endif if(watch->notify) watch->notify(watch->user_data); g_slice_free(InfIoWatch, watch); } for(item = priv->timeouts; item != NULL; item = g_list_next(item)) { timeout = (InfIoTimeout*)item->data; if(timeout->notify) timeout->notify(timeout->user_data); g_slice_free(InfIoTimeout, timeout); } for(item = priv->dispatchs; item != NULL; item = g_list_next(item)) { dispatch = (InfIoDispatch*)item->data; if(dispatch->notify) dispatch->notify(dispatch->user_data); g_slice_free(InfIoDispatch, dispatch); } #ifdef G_OS_WIN32 for(i = 0; i < priv->fd_size; ++ i) { if(WSACloseEvent(priv->events[i]) == FALSE) { error_message = g_win32_error_message(WSAGetLastError()); g_warning("WSACloseEvent() failed: %s", error_message); g_free(error_message); } } #endif g_free(priv->events); g_free(priv->watches); g_list_free(priv->timeouts); g_list_free(priv->dispatchs); #ifndef G_OS_WIN32 if(close(priv->wakeup_pipe[0]) == -1) { g_warning( "Failed to close reading end of wakeup pipe: %s", strerror(errno) ); } if(close(priv->wakeup_pipe[1]) == -1) { g_warning( "Failed to close writing end of wakeup pipe: %s", strerror(errno) ); } #endif g_mutex_unlock(priv->mutex); g_mutex_free(priv->mutex); G_OBJECT_CLASS(parent_class)->finalize(object); } static InfIoWatch** inf_standalone_io_find_watch(InfStandaloneIo* io, InfIoWatch* watch) { InfStandaloneIoPrivate* priv; guint i; priv = INF_STANDALONE_IO_PRIVATE(io); for(i = 1; i < priv->fd_size; ++i) if(priv->watches[i-1] == watch) return &priv->watches[i-1]; return NULL; } static InfIoWatch** inf_standalone_io_find_watch_by_socket(InfStandaloneIo* io, InfNativeSocket* socket) { InfStandaloneIoPrivate* priv; guint i; priv = INF_STANDALONE_IO_PRIVATE(io); for(i = 1; i < priv->fd_size; ++i) if(priv->watches[i-1]->socket == socket) return &priv->watches[i-1]; return NULL; } static void inf_standalone_io_wakeup(InfStandaloneIo* io) { /* Wake up the main loop in case it is currently sleeping. This function is * called whenever a watch changes or a timeout or dispatch is added, so * that the new event is taken into account. */ /* Should only ever be called with the IO's mutex being locked. */ /* TODO: Turn this into a noop if called from the same thread the loop * runs in? */ InfStandaloneIoPrivate* priv; #ifndef G_OS_WIN32 char c; ssize_t ret; #else gchar* error_message; #endif priv = INF_STANDALONE_IO_PRIVATE(io); if(priv->polling) { #ifdef G_OS_WIN32 if(WSASetEvent(priv->events[0]) == FALSE) { error_message = g_win32_error_message(WSAGetLastError()); g_warning( "WSASetEvent() failed when attempting to wake up the main loop: %s", error_message ); g_free(error_message); } #else c = 'c'; ret = write(priv->wakeup_pipe[1], &c, 1); if(ret == -1) { g_warning( "write() failed when attempting to wake up the main loop: %s", strerror(errno) ); /* TODO: Is there anything we could do here? * Try to re-establish pipe? */ } else if(ret == 0) { g_warning( "Received EOF from weakup pipe when attempting to wake " "up the main loop" ); /* TODO: Is there anything we could do here? * Try to re-establish pipe? */ } #endif } } static InfIoWatch* inf_standalone_io_io_add_watch(InfIo* io, InfNativeSocket* socket, InfIoEvent events, InfIoWatchFunc func, gpointer user_data, GDestroyNotify notify) { InfStandaloneIoPrivate* priv; InfIoWatch* watch; long pevents; guint i; #ifdef G_OS_WIN32 gchar* error_message; #endif priv = INF_STANDALONE_IO_PRIVATE(io); #ifdef G_OS_WIN32 pevents = 0; if(events & INF_IO_INCOMING) pevents |= (FD_READ | FD_ACCEPT | FD_CLOSE); if(events & INF_IO_OUTGOING) pevents |= (FD_WRITE | FD_CONNECT); #else pevents = 0; if(events & INF_IO_INCOMING) pevents |= POLLIN; if(events & INF_IO_OUTGOING) pevents |= POLLOUT; if(events & INF_IO_ERROR) pevents |= (POLLERR | POLLHUP | POLLNVAL | POLLPRI); #endif g_mutex_lock(priv->mutex); /* Watching the same socket for different events at least won't work on * Windows since WSAEventSelect cancels the effect of previous * WSAEventSelect calls for the same socket. */ if(inf_standalone_io_find_watch_by_socket(INF_STANDALONE_IO(io), socket)) { g_mutex_unlock(priv->mutex); return NULL; } /* TODO: If we are currently polling we should not modify the fds array * array but do this after wakeup directly after the poll call. */ /* Socket is not already present, so create new watch */ if(priv->fd_size == priv->fd_alloc) { priv->fd_alloc += 4; priv->events = g_realloc( priv->events, priv->fd_alloc * sizeof(InfStandaloneIoNativeEvent) ); priv->watches = g_realloc( priv->watches, (priv->fd_alloc - 1) * sizeof(InfIoWatch*) ); /* Update event pointers, the location of the events in memory might have * changed after realloc. */ for(i = 1; i < priv->fd_size; ++i) priv->watches[i-1]->event = &priv->events[i]; } #ifdef G_OS_WIN32 priv->events[priv->fd_size] = WSACreateEvent(); if(priv->events[priv->fd_size] == WSA_INVALID_EVENT) { error_message = g_win32_error_message(WSAGetLastError()); g_warning("WSACreateEvent() failed: %s", error_message); g_free(error_message); g_mutex_unlock(priv->mutex); return NULL; } if(WSAEventSelect(*socket, priv->events[priv->fd_size], pevents) == SOCKET_ERROR) { error_message = g_win32_error_message(WSAGetLastError()); g_warning("WSAEventSelect() failed: %s", error_message); g_free(error_message); WSACloseEvent(priv->events[priv->fd_size]); g_mutex_unlock(priv->mutex); return NULL; } #else priv->events[priv->fd_size].fd = *socket; priv->events[priv->fd_size].events = pevents; priv->events[priv->fd_size].revents = 0; #endif watch = g_slice_new(InfIoWatch); watch->event = &priv->events[priv->fd_size]; watch->socket = socket; watch->func = func; watch->user_data = user_data; watch->notify = notify; watch->executing = FALSE; watch->disposed = FALSE; priv->watches[priv->fd_size-1] = watch; ++priv->fd_size; inf_standalone_io_wakeup(INF_STANDALONE_IO(io)); g_mutex_unlock(priv->mutex); return watch; } static void inf_standalone_io_io_update_watch(InfIo* io, InfIoWatch* watch, InfIoEvent events) { InfStandaloneIoPrivate* priv; InfIoWatch** watch_iter; long pevents; #ifdef G_OS_WIN32 gchar* error_message; #endif priv = INF_STANDALONE_IO_PRIVATE(io); #ifdef G_OS_WIN32 pevents = 0; if(events & INF_IO_INCOMING) pevents |= (FD_READ | FD_ACCEPT | FD_CLOSE); if(events & INF_IO_OUTGOING) pevents |= (FD_WRITE | FD_CONNECT); #else pevents = 0; if(events & INF_IO_INCOMING) pevents |= POLLIN; if(events & INF_IO_OUTGOING) pevents |= POLLOUT; if(events & INF_IO_ERROR) pevents |= (POLLERR | POLLHUP | POLLNVAL | POLLPRI); #endif g_mutex_lock(priv->mutex); watch_iter = inf_standalone_io_find_watch(INF_STANDALONE_IO(io), watch); if(watch_iter != NULL) { /* TODO: If we are currently polling we should not modify the fds array * array but do this after wakeup directly after the poll call. */ /* Update */ #ifdef G_OS_WIN32 if(WSAEventSelect(*watch->socket, *watch->event, pevents) == SOCKET_ERROR) { error_message = g_win32_error_message(WSAGetLastError()); g_warning("WSAEventSelect() failed: %s", error_message); g_free(error_message); } #else watch->event->events = pevents; #endif inf_standalone_io_wakeup(INF_STANDALONE_IO(io)); } g_mutex_unlock(priv->mutex); } static void inf_standalone_io_io_remove_watch(InfIo* io, InfIoWatch* watch) { InfStandaloneIoPrivate* priv; InfIoWatch** watch_iter; guint index; #ifdef G_OS_WIN32 gchar* error_message; #endif priv = INF_STANDALONE_IO_PRIVATE(io); g_mutex_lock(priv->mutex); watch_iter = inf_standalone_io_find_watch(INF_STANDALONE_IO(io), watch); if(watch_iter != NULL) { /* TODO: If we are currently polling we should not modify the fds array * array but do this after wakeup directly after the poll call. */ if(watch->executing) { /* The callback of the watch is currently running. We don't want to * destroy the user data while it is, so we just remove it from the * watches array, wait for the callback to return and then free the * user_data and the InfIoWatch struct. */ watch->disposed = TRUE; } else { /* Free user_data */ if(watch->notify) watch->notify(watch->user_data); g_slice_free(InfIoWatch, watch); } #ifdef G_OS_WIN32 if(WSAEventSelect(*watch->socket, *watch->event, 0) == SOCKET_ERROR) { error_message = g_win32_error_message(WSAGetLastError()); g_warning("WSAEventSelect() failed: %s", error_message); g_free(error_message); } if(WSACloseEvent(*watch->event) == FALSE) { error_message = g_win32_error_message(WSAGetLastError()); g_warning("WSACloseEvent() failed: %s", error_message); g_free(error_message); } #endif /* Remove watch by replacing it by the last pollfd/watch */ index = 1 + watch_iter - priv->watches; if(index != priv->fd_size - 1) { memcpy( &priv->events[index], &priv->events[priv->fd_size - 1], sizeof(InfStandaloneIoNativeEvent) ); memcpy( &priv->watches[index - 1], &priv->watches[priv->fd_size - 2], sizeof(InfIoWatch*) ); priv->watches[index - 1]->event = &priv->events[index]; } --priv->fd_size; inf_standalone_io_wakeup(INF_STANDALONE_IO(io)); } g_mutex_unlock(priv->mutex); } static InfIoTimeout* inf_standalone_io_io_add_timeout(InfIo* io, guint msecs, InfIoTimeoutFunc func, gpointer user_data, GDestroyNotify notify) { InfStandaloneIoPrivate* priv; InfIoTimeout* timeout; priv = INF_STANDALONE_IO_PRIVATE(io); timeout = g_slice_new(InfIoTimeout); g_get_current_time(&timeout->begin); timeout->msecs = msecs; timeout->func = func; timeout->user_data = user_data; timeout->notify = notify; g_mutex_lock(priv->mutex); priv->timeouts = g_list_prepend(priv->timeouts, timeout); inf_standalone_io_wakeup(INF_STANDALONE_IO(io)); g_mutex_unlock(priv->mutex); return timeout; } static void inf_standalone_io_io_remove_timeout(InfIo* io, InfIoTimeout* timeout) { InfStandaloneIoPrivate* priv; GList* item; priv = INF_STANDALONE_IO_PRIVATE(io); g_mutex_lock(priv->mutex); item = g_list_find(priv->timeouts, timeout); if(item != NULL) { priv->timeouts = g_list_delete_link(priv->timeouts, item); g_mutex_unlock(priv->mutex); if(timeout->notify) timeout->notify(timeout->user_data); g_slice_free(InfIoTimeout, timeout); /* No need to wake up the main loop; it might run into its timeout sooner * than necessary now, but that's OK. */ } else { g_mutex_unlock(priv->mutex); } } static InfIoDispatch* inf_standalone_io_io_add_dispatch(InfIo* io, InfIoDispatchFunc func, gpointer user_data, GDestroyNotify notify) { InfStandaloneIoPrivate* priv; InfIoDispatch* dispatch; priv = INF_STANDALONE_IO_PRIVATE(io); dispatch = g_slice_new(InfIoDispatch); dispatch->func = func; dispatch->user_data = user_data; dispatch->notify = notify; g_mutex_lock(priv->mutex); priv->dispatchs = g_list_prepend(priv->dispatchs, dispatch); inf_standalone_io_wakeup(INF_STANDALONE_IO(io)); g_mutex_unlock(priv->mutex); return dispatch; } static void inf_standalone_io_io_remove_dispatch(InfIo* io, InfIoDispatch* dispatch) { InfStandaloneIoPrivate* priv; GList* item; priv = INF_STANDALONE_IO_PRIVATE(io); g_mutex_lock(priv->mutex); item = g_list_find(priv->dispatchs, dispatch); if(item != NULL) { priv->dispatchs = g_list_delete_link(priv->dispatchs, item); g_mutex_unlock(priv->mutex); if(dispatch->notify) dispatch->notify(dispatch->user_data); g_slice_free(InfIoDispatch, dispatch); /* No need to wake up the main loop; it might run into its timeout sooner * than necessary now, but that's OK. */ } else { g_mutex_unlock(priv->mutex); } } static void inf_standalone_io_class_init(gpointer g_class, gpointer class_data) { GObjectClass* object_class; object_class = G_OBJECT_CLASS(g_class); parent_class = G_OBJECT_CLASS(g_type_class_peek_parent(g_class)); g_type_class_add_private(g_class, sizeof(InfStandaloneIoPrivate)); object_class->finalize = inf_standalone_io_finalize; } static void inf_standalone_io_io_init(gpointer g_iface, gpointer iface_data) { InfIoIface* iface; iface = (InfIoIface*)g_iface; iface->add_watch = inf_standalone_io_io_add_watch; iface->update_watch = inf_standalone_io_io_update_watch; iface->remove_watch = inf_standalone_io_io_remove_watch; iface->add_timeout = inf_standalone_io_io_add_timeout; iface->remove_timeout = inf_standalone_io_io_remove_timeout; iface->add_dispatch = inf_standalone_io_io_add_dispatch; iface->remove_dispatch = inf_standalone_io_io_remove_dispatch; } GType inf_standalone_io_get_type(void) { static GType standalone_io_type = 0; if(!standalone_io_type) { static const GTypeInfo standalone_io_type_info = { sizeof(InfStandaloneIoClass), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ inf_standalone_io_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InfStandaloneIo), /* instance_size */ 0, /* n_preallocs */ inf_standalone_io_init, /* instance_init */ NULL /* value_table */ }; static const GInterfaceInfo io_info = { inf_standalone_io_io_init, NULL, NULL }; standalone_io_type = g_type_register_static( G_TYPE_OBJECT, "InfStandaloneIo", &standalone_io_type_info, 0 ); g_type_add_interface_static( standalone_io_type, INF_TYPE_IO, &io_info ); } return standalone_io_type; } /** * inf_standalone_io_new: * * Creates a new #InfStandaloneIo. * * Returns: A new #InfStandaloneIo. Free with g_object_unref() when no longer * needed. **/ InfStandaloneIo* inf_standalone_io_new(void) { GObject* object; object = g_object_new(INF_TYPE_STANDALONE_IO, NULL); return INF_STANDALONE_IO(object); } /** * inf_standalone_io_iteration: * @io: A #InfStandaloneIo. * * Performs a single iteration of @io. The call will block until a first * event has occured. Then, it will process that event and return. **/ void inf_standalone_io_iteration(InfStandaloneIo* io) { InfStandaloneIoPrivate* priv; g_return_if_fail(INF_IS_STANDALONE_IO(io)); priv = INF_STANDALONE_IO_PRIVATE(io); g_object_ref(io); g_mutex_lock(priv->mutex); g_return_val_if_fail(priv->polling == FALSE, g_mutex_unlock(priv->mutex)); inf_standalone_io_iteration_impl(io, INF_STANDALONE_IO_POLL_INFINITE); g_mutex_unlock(priv->mutex); g_object_unref(io); } /** * inf_standalone_io_iteration_timeout: * @io: A #InfStandaloneIo. * @timeout: Maximum number of milliseconds to block. * * Performs a single iteration of @io. The call will block until either an * event occured or @timeout milliseconds have elapsed. If an event occured, * the event will be processed before returning. **/ void inf_standalone_io_iteration_timeout(InfStandaloneIo* io, guint timeout) { InfStandaloneIoPrivate* priv; g_return_if_fail(INF_IS_STANDALONE_IO(io)); priv = INF_STANDALONE_IO_PRIVATE(io); g_object_ref(io); g_mutex_lock(priv->mutex); g_return_val_if_fail(priv->polling == FALSE, g_mutex_unlock(priv->mutex)); inf_standalone_io_iteration_impl(io, (int)timeout); g_mutex_unlock(priv->mutex); g_object_unref(io); } /** * inf_standalone_io_loop: * @io: A #InfStandaloneIo. * * This call will cause @io to wait for events and process them, but not * return until inf_standalone_io_loop_quit() is called. **/ void inf_standalone_io_loop(InfStandaloneIo* io) { InfStandaloneIoPrivate* priv; g_return_if_fail(INF_IS_STANDALONE_IO(io)); priv = INF_STANDALONE_IO_PRIVATE(io); g_object_ref(io); g_mutex_lock(priv->mutex); g_return_val_if_fail( priv->loop_running == FALSE, g_mutex_unlock(priv->mutex) ); g_return_val_if_fail( priv->polling == FALSE, g_mutex_unlock(priv->mutex) ); /* TODO: Actually we need to make sure that a previous loop() call in * another thread has exited the loop below, otherwise we will end up with * two loops running one of which is supposed to have quit. */ priv->loop_running = TRUE; while(priv->loop_running == TRUE) inf_standalone_io_iteration_impl(io, -1); g_mutex_unlock(priv->mutex); g_object_unref(io); } /** * inf_standalone_io_loop_quit: * @io: A #InfStandaloneIo. * * Exits a loop in which @io is running through a call to * inf_standalone_io_loop(). **/ void inf_standalone_io_loop_quit(InfStandaloneIo* io) { InfStandaloneIoPrivate* priv; g_return_if_fail(INF_IS_STANDALONE_IO(io)); priv = INF_STANDALONE_IO_PRIVATE(io); g_mutex_lock(priv->mutex); g_return_if_fail(priv->loop_running == TRUE); priv->loop_running = FALSE; inf_standalone_io_wakeup(io); g_mutex_unlock(priv->mutex); } /** * inf_standalone_io_loop_running: * @io: A #InfStandaloneIo. * * Returns whether @io runs currently in a loop initiated with * inf_standalone_io_loop(). * * Return Value: Whether @io runs in a loop. **/ gboolean inf_standalone_io_loop_running(InfStandaloneIo* io) { InfStandaloneIoPrivate* priv; gboolean running; g_return_val_if_fail(INF_IS_STANDALONE_IO(io), FALSE); priv = INF_STANDALONE_IO_PRIVATE(io); g_mutex_lock(priv->mutex); running = priv->loop_running; g_mutex_unlock(priv->mutex); return running; } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/common/inf-discovery-avahi.h0000644000175000017500000000612212264763732020627 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_DISCOVERY_AVAHI_H__ #define __INF_DISCOVERY_AVAHI_H__ #include #include #include #include /* For LIBINFINITY_HAVE_AVAHI */ #include #include #ifdef LIBINFINITY_HAVE_AVAHI G_BEGIN_DECLS #define INF_TYPE_DISCOVERY_AVAHI (inf_discovery_avahi_get_type()) #define INF_DISCOVERY_AVAHI(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INF_TYPE_DISCOVERY_AVAHI, InfDiscoveryAvahi)) #define INF_DISCOVERY_AVAHI_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INF_TYPE_DISCOVERY_AVAHI, InfDiscoveryAvahiClass)) #define INF_IS_DISCOVERY_AVAHI(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INF_TYPE_DISCOVERY_AVAHI)) #define INF_IS_DISCOVERY_AVAHI_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INF_TYPE_DISCOVERY_AVAHI)) #define INF_DISCOVERY_AVAHI_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), INF_TYPE_DISCOVERY_AVAHI, InfDiscoveryAvahiClass)) typedef struct _InfDiscoveryAvahi InfDiscoveryAvahi; typedef struct _InfDiscoveryAvahiClass InfDiscoveryAvahiClass; /** * InfDiscoveryAvahiClass: * * This structure does not contain any public fields. */ struct _InfDiscoveryAvahiClass { /*< private >*/ GObjectClass parent_class; }; /** * InfDiscoveryAvahi: * * #InfDiscoveryAvahi is an opaque data type. You should only access it * via the public API functions. */ struct _InfDiscoveryAvahi { /*< private >*/ GObject parent; }; GType inf_discovery_avahi_get_type(void) G_GNUC_CONST; InfDiscoveryAvahi* inf_discovery_avahi_new(InfIo* io, InfXmppManager* manager, InfCertificateCredentials* creds, InfSaslContext* sasl_context, const gchar* sasl_mechanisms); void inf_discovery_avahi_set_security_policy(InfDiscoveryAvahi* discovery, InfXmppConnectionSecurityPolicy plcy); InfXmppConnectionSecurityPolicy inf_discovery_avahi_get_security_policy(InfDiscoveryAvahi* discovery); G_END_DECLS #endif /* LIBINFINITY_HAVE_AVAHI */ #endif /* __INF_DISCOVERY_AVAHI_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/common/inf-certificate-chain.c0000644000175000017500000001152612264763732021073 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ /** * SECTION:inf-certificate-chain * @title: InfCertificateChain * @short_description: X.509 certificate chains * @see_also: #InfXmppConnection * @include: libinfinity/common/inf-certificate-chain.h * @stability: Unstable * * #InfCertificateChain is a reference-counted wrapper around an array of * gnutls_x509_crt_t structures, representing a certificate chain. **/ #include #include struct _InfCertificateChain { guint ref_count; gnutls_x509_crt_t* certs; guint n_certs; }; GType inf_certificate_chain_get_type(void) { static GType certificate_chain_type = 0; if(!certificate_chain_type) { certificate_chain_type = g_boxed_type_register_static( "InfCertificateChain", (GBoxedCopyFunc)inf_certificate_chain_ref, (GBoxedFreeFunc)inf_certificate_chain_unref ); } return certificate_chain_type; } /** * inf_certificate_chain_new: * @certs: Array of certificates. * @n_certs: Number of elements in @certs. * * Creates a new #InfCertificateChain with the given certificates. The @certs * array needs to be allocated with g_malloc. This function takes ownership * of @certs. * * Return Value: A new #InfCertificateChain. **/ InfCertificateChain* inf_certificate_chain_new(gnutls_x509_crt_t* certs, guint n_certs) { InfCertificateChain* chain; chain = g_slice_new(InfCertificateChain); chain->ref_count = 1; chain->certs = certs; chain->n_certs = n_certs; return chain; } /** * inf_certificate_chain_ref: * @chain: A #InfCertificateChain: * * Increases the reference count of @chain by one. * * Returns: The same @chain. */ InfCertificateChain* inf_certificate_chain_ref(InfCertificateChain* chain) { ++ chain->ref_count; return chain; } /** * inf_certificate_chain_unref: * @chain: A #InfCertificateChain. * * Decreases the reference count of @chain by one. If the reference count * reaches zero, then @chain is freed. */ void inf_certificate_chain_unref(InfCertificateChain* chain) { guint i; -- chain->ref_count; if(chain->ref_count == 0) { for(i = 0; i < chain->n_certs; ++ i) gnutls_x509_crt_deinit(chain->certs[i]); g_free(chain->certs); g_slice_free(InfCertificateChain, chain); } } /** * inf_certificate_chain_get_raw: * @chain: A #InfCertificateChain. * * Returns the raw array of certificates in the chain. * * Returns: An array of certificates owned by the chain. */ gnutls_x509_crt_t* inf_certificate_chain_get_raw(const InfCertificateChain* chain) { return chain->certs; } /** * inf_certificate_chain_get_root_certificate: * @chain: A #InfCertificateChain. * * Returns the last certificate in the chain. * * Returns: The last certificate in the chain. */ gnutls_x509_crt_t inf_certificate_chain_get_root_certificate(const InfCertificateChain* chain) { return chain->certs[chain->n_certs - 1]; } /** * inf_certificate_chain_get_own_certificate: * @chain: A #InfCertificateChain. * * TODO: Rename this function into something more appropriate. * * Returns the first certificate in the chain. * * Returns: The first certificate in the chain. */ gnutls_x509_crt_t inf_certificate_chain_get_own_certificate(const InfCertificateChain* chain) { return chain->certs[0]; } /** * inf_certificate_chain_get_nth_certificate: * @chain: A #InfCertificateChain. * @n: Index of the certificate to retrieve. * * Returns the @nth certificate in the chain. * * Returns: The nth certificate in the chain. */ gnutls_x509_crt_t inf_certificate_chain_get_nth_certificate(const InfCertificateChain* chain, guint n) { g_return_val_if_fail(n < chain->n_certs, NULL); return chain->certs[n]; } /** * inf_certificate_get_n_certificates: * @chain: A #InfCertificateChain. * * Returns the number of certificates in @chain. * * Returns: The number of certificates in @chain. */ guint inf_certificate_chain_get_n_certificates(const InfCertificateChain* chain) { return chain->n_certs; } libinfinity-0.5.5/libinfinity/common/Makefile.in0000644000175000017500000016067012264766066016670 00000000000000# Makefile.in generated by automake 1.13.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = libinfinity/common DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/mkinstalldirs $(top_srcdir)/depcomp \ $(libinfinity_common_la_HEADERS) $(noinst_HEADERS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/libinfinity/inf-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libinfinity_common_la_LIBADD = am_libinfinity_common_la_OBJECTS = \ libinfinity_common_la-inf-buffer.lo \ libinfinity_common_la-inf-certificate-chain.lo \ libinfinity_common_la-inf-certificate-credentials.lo \ libinfinity_common_la-inf-cert-util.lo \ libinfinity_common_la-inf-chat-buffer.lo \ libinfinity_common_la-inf-chat-session.lo \ libinfinity_common_la-inf-discovery-avahi.lo \ libinfinity_common_la-inf-discovery.lo \ libinfinity_common_la-inf-error.lo \ libinfinity_common_la-inf-init.lo \ libinfinity_common_la-inf-io.lo \ libinfinity_common_la-inf-ip-address.lo \ libinfinity_common_la-inf-local-publisher.lo \ libinfinity_common_la-inf-protocol.lo \ libinfinity_common_la-inf-sasl-context.lo \ libinfinity_common_la-inf-session.lo \ libinfinity_common_la-inf-simulated-connection.lo \ libinfinity_common_la-inf-standalone-io.lo \ libinfinity_common_la-inf-tcp-connection.lo \ libinfinity_common_la-inf-user.lo \ libinfinity_common_la-inf-user-table.lo \ libinfinity_common_la-inf-xml-connection.lo \ libinfinity_common_la-inf-xml-util.lo \ libinfinity_common_la-inf-xmpp-connection.lo \ libinfinity_common_la-inf-xmpp-manager.lo libinfinity_common_la_OBJECTS = $(am_libinfinity_common_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -I$(top_builddir)/libinfinity 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) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libinfinity_common_la_SOURCES) DIST_SOURCES = $(libinfinity_common_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libinfinity_common_ladir)" HEADERS = $(libinfinity_common_la_HEADERS) $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBINFINITY_API_VERSION = @LIBINFINITY_API_VERSION@ LIBINFINITY_LIBTOOL_VERSION = @LIBINFINITY_LIBTOOL_VERSION@ LIBINFINITY_VERSION = @LIBINFINITY_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ avahi_CFLAGS = @avahi_CFLAGS@ avahi_LIBS = @avahi_LIBS@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gtk_requirement = @gtk_requirement@ gtk_version = @gtk_version@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infgtk_CFLAGS = @infgtk_CFLAGS@ infgtk_LIBS = @infgtk_LIBS@ infinity_CFLAGS = @infinity_CFLAGS@ infinity_LIBS = @infinity_LIBS@ infinoted_CFLAGS = @infinoted_CFLAGS@ infinoted_LIBS = @infinoted_LIBS@ infodir = @infodir@ inftext_CFLAGS = @inftext_CFLAGS@ inftext_LIBS = @inftext_LIBS@ inftextgtk_CFLAGS = @inftextgtk_CFLAGS@ inftextgtk_LIBS = @inftextgtk_LIBS@ install_sh = @install_sh@ libdaemon_CFLAGS = @libdaemon_CFLAGS@ libdaemon_LIBS = @libdaemon_LIBS@ 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@ libinfinity_common_la_CPPFLAGS = \ -I$(top_srcdir) \ $(infinity_CFLAGS) \ $(avahi_CFLAGS) noinst_LTLIBRARIES = libinfinity_common.la libinfinity_common_ladir = \ $(includedir)/libinfinity-$(LIBINFINITY_API_VERSION)/libinfinity/common libinfinity_common_la_SOURCES = \ inf-buffer.c \ inf-certificate-chain.c \ inf-certificate-credentials.c \ inf-cert-util.c \ inf-chat-buffer.c \ inf-chat-session.c \ inf-discovery-avahi.c \ inf-discovery.c \ inf-error.c \ inf-init.c \ inf-io.c \ inf-ip-address.c \ inf-local-publisher.c \ inf-protocol.c \ inf-sasl-context.c \ inf-session.c \ inf-simulated-connection.c \ inf-standalone-io.c \ inf-tcp-connection.c \ inf-user.c \ inf-user-table.c \ inf-xml-connection.c \ inf-xml-util.c \ inf-xmpp-connection.c \ inf-xmpp-manager.c libinfinity_common_la_HEADERS = \ inf-buffer.h \ inf-certificate-chain.h \ inf-certificate-credentials.h \ inf-cert-util.h \ inf-chat-buffer.h \ inf-chat-session.h \ inf-discovery.h \ inf-discovery-avahi.h \ inf-error.h \ inf-init.h \ inf-io.h \ inf-ip-address.h \ inf-local-publisher.h \ inf-protocol.h \ inf-sasl-context.h \ inf-session.h \ inf-simulated-connection.h \ inf-standalone-io.h \ inf-tcp-connection.h \ inf-user.h \ inf-user-table.h \ inf-xml-connection.h \ inf-xml-util.h \ inf-xmpp-connection.h \ inf-xmpp-manager.h noinst_HEADERS = inf-tcp-connection-private.h all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libinfinity/common/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu libinfinity/common/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libinfinity_common.la: $(libinfinity_common_la_OBJECTS) $(libinfinity_common_la_DEPENDENCIES) $(EXTRA_libinfinity_common_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libinfinity_common_la_OBJECTS) $(libinfinity_common_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_common_la-inf-buffer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_common_la-inf-cert-util.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_common_la-inf-certificate-chain.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_common_la-inf-certificate-credentials.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_common_la-inf-chat-buffer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_common_la-inf-chat-session.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_common_la-inf-discovery-avahi.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_common_la-inf-discovery.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_common_la-inf-error.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_common_la-inf-init.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_common_la-inf-io.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_common_la-inf-ip-address.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_common_la-inf-local-publisher.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_common_la-inf-protocol.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_common_la-inf-sasl-context.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_common_la-inf-session.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_common_la-inf-simulated-connection.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_common_la-inf-standalone-io.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_common_la-inf-tcp-connection.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_common_la-inf-user-table.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_common_la-inf-user.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_common_la-inf-xml-connection.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_common_la-inf-xml-util.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_common_la-inf-xmpp-connection.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_common_la-inf-xmpp-manager.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< libinfinity_common_la-inf-buffer.lo: inf-buffer.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_common_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_common_la-inf-buffer.lo -MD -MP -MF $(DEPDIR)/libinfinity_common_la-inf-buffer.Tpo -c -o libinfinity_common_la-inf-buffer.lo `test -f 'inf-buffer.c' || echo '$(srcdir)/'`inf-buffer.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_common_la-inf-buffer.Tpo $(DEPDIR)/libinfinity_common_la-inf-buffer.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-buffer.c' object='libinfinity_common_la-inf-buffer.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_common_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_common_la-inf-buffer.lo `test -f 'inf-buffer.c' || echo '$(srcdir)/'`inf-buffer.c libinfinity_common_la-inf-certificate-chain.lo: inf-certificate-chain.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_common_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_common_la-inf-certificate-chain.lo -MD -MP -MF $(DEPDIR)/libinfinity_common_la-inf-certificate-chain.Tpo -c -o libinfinity_common_la-inf-certificate-chain.lo `test -f 'inf-certificate-chain.c' || echo '$(srcdir)/'`inf-certificate-chain.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_common_la-inf-certificate-chain.Tpo $(DEPDIR)/libinfinity_common_la-inf-certificate-chain.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-certificate-chain.c' object='libinfinity_common_la-inf-certificate-chain.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_common_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_common_la-inf-certificate-chain.lo `test -f 'inf-certificate-chain.c' || echo '$(srcdir)/'`inf-certificate-chain.c libinfinity_common_la-inf-certificate-credentials.lo: inf-certificate-credentials.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_common_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_common_la-inf-certificate-credentials.lo -MD -MP -MF $(DEPDIR)/libinfinity_common_la-inf-certificate-credentials.Tpo -c -o libinfinity_common_la-inf-certificate-credentials.lo `test -f 'inf-certificate-credentials.c' || echo '$(srcdir)/'`inf-certificate-credentials.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_common_la-inf-certificate-credentials.Tpo $(DEPDIR)/libinfinity_common_la-inf-certificate-credentials.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-certificate-credentials.c' object='libinfinity_common_la-inf-certificate-credentials.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_common_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_common_la-inf-certificate-credentials.lo `test -f 'inf-certificate-credentials.c' || echo '$(srcdir)/'`inf-certificate-credentials.c libinfinity_common_la-inf-cert-util.lo: inf-cert-util.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_common_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_common_la-inf-cert-util.lo -MD -MP -MF $(DEPDIR)/libinfinity_common_la-inf-cert-util.Tpo -c -o libinfinity_common_la-inf-cert-util.lo `test -f 'inf-cert-util.c' || echo '$(srcdir)/'`inf-cert-util.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_common_la-inf-cert-util.Tpo $(DEPDIR)/libinfinity_common_la-inf-cert-util.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-cert-util.c' object='libinfinity_common_la-inf-cert-util.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_common_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_common_la-inf-cert-util.lo `test -f 'inf-cert-util.c' || echo '$(srcdir)/'`inf-cert-util.c libinfinity_common_la-inf-chat-buffer.lo: inf-chat-buffer.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_common_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_common_la-inf-chat-buffer.lo -MD -MP -MF $(DEPDIR)/libinfinity_common_la-inf-chat-buffer.Tpo -c -o libinfinity_common_la-inf-chat-buffer.lo `test -f 'inf-chat-buffer.c' || echo '$(srcdir)/'`inf-chat-buffer.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_common_la-inf-chat-buffer.Tpo $(DEPDIR)/libinfinity_common_la-inf-chat-buffer.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-chat-buffer.c' object='libinfinity_common_la-inf-chat-buffer.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_common_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_common_la-inf-chat-buffer.lo `test -f 'inf-chat-buffer.c' || echo '$(srcdir)/'`inf-chat-buffer.c libinfinity_common_la-inf-chat-session.lo: inf-chat-session.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_common_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_common_la-inf-chat-session.lo -MD -MP -MF $(DEPDIR)/libinfinity_common_la-inf-chat-session.Tpo -c -o libinfinity_common_la-inf-chat-session.lo `test -f 'inf-chat-session.c' || echo '$(srcdir)/'`inf-chat-session.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_common_la-inf-chat-session.Tpo $(DEPDIR)/libinfinity_common_la-inf-chat-session.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-chat-session.c' object='libinfinity_common_la-inf-chat-session.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_common_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_common_la-inf-chat-session.lo `test -f 'inf-chat-session.c' || echo '$(srcdir)/'`inf-chat-session.c libinfinity_common_la-inf-discovery-avahi.lo: inf-discovery-avahi.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_common_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_common_la-inf-discovery-avahi.lo -MD -MP -MF $(DEPDIR)/libinfinity_common_la-inf-discovery-avahi.Tpo -c -o libinfinity_common_la-inf-discovery-avahi.lo `test -f 'inf-discovery-avahi.c' || echo '$(srcdir)/'`inf-discovery-avahi.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_common_la-inf-discovery-avahi.Tpo $(DEPDIR)/libinfinity_common_la-inf-discovery-avahi.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-discovery-avahi.c' object='libinfinity_common_la-inf-discovery-avahi.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_common_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_common_la-inf-discovery-avahi.lo `test -f 'inf-discovery-avahi.c' || echo '$(srcdir)/'`inf-discovery-avahi.c libinfinity_common_la-inf-discovery.lo: inf-discovery.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_common_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_common_la-inf-discovery.lo -MD -MP -MF $(DEPDIR)/libinfinity_common_la-inf-discovery.Tpo -c -o libinfinity_common_la-inf-discovery.lo `test -f 'inf-discovery.c' || echo '$(srcdir)/'`inf-discovery.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_common_la-inf-discovery.Tpo $(DEPDIR)/libinfinity_common_la-inf-discovery.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-discovery.c' object='libinfinity_common_la-inf-discovery.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_common_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_common_la-inf-discovery.lo `test -f 'inf-discovery.c' || echo '$(srcdir)/'`inf-discovery.c libinfinity_common_la-inf-error.lo: inf-error.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_common_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_common_la-inf-error.lo -MD -MP -MF $(DEPDIR)/libinfinity_common_la-inf-error.Tpo -c -o libinfinity_common_la-inf-error.lo `test -f 'inf-error.c' || echo '$(srcdir)/'`inf-error.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_common_la-inf-error.Tpo $(DEPDIR)/libinfinity_common_la-inf-error.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-error.c' object='libinfinity_common_la-inf-error.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_common_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_common_la-inf-error.lo `test -f 'inf-error.c' || echo '$(srcdir)/'`inf-error.c libinfinity_common_la-inf-init.lo: inf-init.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_common_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_common_la-inf-init.lo -MD -MP -MF $(DEPDIR)/libinfinity_common_la-inf-init.Tpo -c -o libinfinity_common_la-inf-init.lo `test -f 'inf-init.c' || echo '$(srcdir)/'`inf-init.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_common_la-inf-init.Tpo $(DEPDIR)/libinfinity_common_la-inf-init.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-init.c' object='libinfinity_common_la-inf-init.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_common_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_common_la-inf-init.lo `test -f 'inf-init.c' || echo '$(srcdir)/'`inf-init.c libinfinity_common_la-inf-io.lo: inf-io.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_common_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_common_la-inf-io.lo -MD -MP -MF $(DEPDIR)/libinfinity_common_la-inf-io.Tpo -c -o libinfinity_common_la-inf-io.lo `test -f 'inf-io.c' || echo '$(srcdir)/'`inf-io.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_common_la-inf-io.Tpo $(DEPDIR)/libinfinity_common_la-inf-io.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-io.c' object='libinfinity_common_la-inf-io.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_common_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_common_la-inf-io.lo `test -f 'inf-io.c' || echo '$(srcdir)/'`inf-io.c libinfinity_common_la-inf-ip-address.lo: inf-ip-address.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_common_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_common_la-inf-ip-address.lo -MD -MP -MF $(DEPDIR)/libinfinity_common_la-inf-ip-address.Tpo -c -o libinfinity_common_la-inf-ip-address.lo `test -f 'inf-ip-address.c' || echo '$(srcdir)/'`inf-ip-address.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_common_la-inf-ip-address.Tpo $(DEPDIR)/libinfinity_common_la-inf-ip-address.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-ip-address.c' object='libinfinity_common_la-inf-ip-address.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_common_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_common_la-inf-ip-address.lo `test -f 'inf-ip-address.c' || echo '$(srcdir)/'`inf-ip-address.c libinfinity_common_la-inf-local-publisher.lo: inf-local-publisher.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_common_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_common_la-inf-local-publisher.lo -MD -MP -MF $(DEPDIR)/libinfinity_common_la-inf-local-publisher.Tpo -c -o libinfinity_common_la-inf-local-publisher.lo `test -f 'inf-local-publisher.c' || echo '$(srcdir)/'`inf-local-publisher.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_common_la-inf-local-publisher.Tpo $(DEPDIR)/libinfinity_common_la-inf-local-publisher.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-local-publisher.c' object='libinfinity_common_la-inf-local-publisher.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_common_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_common_la-inf-local-publisher.lo `test -f 'inf-local-publisher.c' || echo '$(srcdir)/'`inf-local-publisher.c libinfinity_common_la-inf-protocol.lo: inf-protocol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_common_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_common_la-inf-protocol.lo -MD -MP -MF $(DEPDIR)/libinfinity_common_la-inf-protocol.Tpo -c -o libinfinity_common_la-inf-protocol.lo `test -f 'inf-protocol.c' || echo '$(srcdir)/'`inf-protocol.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_common_la-inf-protocol.Tpo $(DEPDIR)/libinfinity_common_la-inf-protocol.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-protocol.c' object='libinfinity_common_la-inf-protocol.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_common_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_common_la-inf-protocol.lo `test -f 'inf-protocol.c' || echo '$(srcdir)/'`inf-protocol.c libinfinity_common_la-inf-sasl-context.lo: inf-sasl-context.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_common_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_common_la-inf-sasl-context.lo -MD -MP -MF $(DEPDIR)/libinfinity_common_la-inf-sasl-context.Tpo -c -o libinfinity_common_la-inf-sasl-context.lo `test -f 'inf-sasl-context.c' || echo '$(srcdir)/'`inf-sasl-context.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_common_la-inf-sasl-context.Tpo $(DEPDIR)/libinfinity_common_la-inf-sasl-context.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-sasl-context.c' object='libinfinity_common_la-inf-sasl-context.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_common_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_common_la-inf-sasl-context.lo `test -f 'inf-sasl-context.c' || echo '$(srcdir)/'`inf-sasl-context.c libinfinity_common_la-inf-session.lo: inf-session.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_common_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_common_la-inf-session.lo -MD -MP -MF $(DEPDIR)/libinfinity_common_la-inf-session.Tpo -c -o libinfinity_common_la-inf-session.lo `test -f 'inf-session.c' || echo '$(srcdir)/'`inf-session.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_common_la-inf-session.Tpo $(DEPDIR)/libinfinity_common_la-inf-session.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-session.c' object='libinfinity_common_la-inf-session.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_common_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_common_la-inf-session.lo `test -f 'inf-session.c' || echo '$(srcdir)/'`inf-session.c libinfinity_common_la-inf-simulated-connection.lo: inf-simulated-connection.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_common_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_common_la-inf-simulated-connection.lo -MD -MP -MF $(DEPDIR)/libinfinity_common_la-inf-simulated-connection.Tpo -c -o libinfinity_common_la-inf-simulated-connection.lo `test -f 'inf-simulated-connection.c' || echo '$(srcdir)/'`inf-simulated-connection.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_common_la-inf-simulated-connection.Tpo $(DEPDIR)/libinfinity_common_la-inf-simulated-connection.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-simulated-connection.c' object='libinfinity_common_la-inf-simulated-connection.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_common_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_common_la-inf-simulated-connection.lo `test -f 'inf-simulated-connection.c' || echo '$(srcdir)/'`inf-simulated-connection.c libinfinity_common_la-inf-standalone-io.lo: inf-standalone-io.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_common_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_common_la-inf-standalone-io.lo -MD -MP -MF $(DEPDIR)/libinfinity_common_la-inf-standalone-io.Tpo -c -o libinfinity_common_la-inf-standalone-io.lo `test -f 'inf-standalone-io.c' || echo '$(srcdir)/'`inf-standalone-io.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_common_la-inf-standalone-io.Tpo $(DEPDIR)/libinfinity_common_la-inf-standalone-io.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-standalone-io.c' object='libinfinity_common_la-inf-standalone-io.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_common_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_common_la-inf-standalone-io.lo `test -f 'inf-standalone-io.c' || echo '$(srcdir)/'`inf-standalone-io.c libinfinity_common_la-inf-tcp-connection.lo: inf-tcp-connection.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_common_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_common_la-inf-tcp-connection.lo -MD -MP -MF $(DEPDIR)/libinfinity_common_la-inf-tcp-connection.Tpo -c -o libinfinity_common_la-inf-tcp-connection.lo `test -f 'inf-tcp-connection.c' || echo '$(srcdir)/'`inf-tcp-connection.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_common_la-inf-tcp-connection.Tpo $(DEPDIR)/libinfinity_common_la-inf-tcp-connection.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-tcp-connection.c' object='libinfinity_common_la-inf-tcp-connection.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_common_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_common_la-inf-tcp-connection.lo `test -f 'inf-tcp-connection.c' || echo '$(srcdir)/'`inf-tcp-connection.c libinfinity_common_la-inf-user.lo: inf-user.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_common_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_common_la-inf-user.lo -MD -MP -MF $(DEPDIR)/libinfinity_common_la-inf-user.Tpo -c -o libinfinity_common_la-inf-user.lo `test -f 'inf-user.c' || echo '$(srcdir)/'`inf-user.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_common_la-inf-user.Tpo $(DEPDIR)/libinfinity_common_la-inf-user.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-user.c' object='libinfinity_common_la-inf-user.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_common_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_common_la-inf-user.lo `test -f 'inf-user.c' || echo '$(srcdir)/'`inf-user.c libinfinity_common_la-inf-user-table.lo: inf-user-table.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_common_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_common_la-inf-user-table.lo -MD -MP -MF $(DEPDIR)/libinfinity_common_la-inf-user-table.Tpo -c -o libinfinity_common_la-inf-user-table.lo `test -f 'inf-user-table.c' || echo '$(srcdir)/'`inf-user-table.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_common_la-inf-user-table.Tpo $(DEPDIR)/libinfinity_common_la-inf-user-table.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-user-table.c' object='libinfinity_common_la-inf-user-table.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_common_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_common_la-inf-user-table.lo `test -f 'inf-user-table.c' || echo '$(srcdir)/'`inf-user-table.c libinfinity_common_la-inf-xml-connection.lo: inf-xml-connection.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_common_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_common_la-inf-xml-connection.lo -MD -MP -MF $(DEPDIR)/libinfinity_common_la-inf-xml-connection.Tpo -c -o libinfinity_common_la-inf-xml-connection.lo `test -f 'inf-xml-connection.c' || echo '$(srcdir)/'`inf-xml-connection.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_common_la-inf-xml-connection.Tpo $(DEPDIR)/libinfinity_common_la-inf-xml-connection.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-xml-connection.c' object='libinfinity_common_la-inf-xml-connection.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_common_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_common_la-inf-xml-connection.lo `test -f 'inf-xml-connection.c' || echo '$(srcdir)/'`inf-xml-connection.c libinfinity_common_la-inf-xml-util.lo: inf-xml-util.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_common_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_common_la-inf-xml-util.lo -MD -MP -MF $(DEPDIR)/libinfinity_common_la-inf-xml-util.Tpo -c -o libinfinity_common_la-inf-xml-util.lo `test -f 'inf-xml-util.c' || echo '$(srcdir)/'`inf-xml-util.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_common_la-inf-xml-util.Tpo $(DEPDIR)/libinfinity_common_la-inf-xml-util.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-xml-util.c' object='libinfinity_common_la-inf-xml-util.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_common_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_common_la-inf-xml-util.lo `test -f 'inf-xml-util.c' || echo '$(srcdir)/'`inf-xml-util.c libinfinity_common_la-inf-xmpp-connection.lo: inf-xmpp-connection.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_common_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_common_la-inf-xmpp-connection.lo -MD -MP -MF $(DEPDIR)/libinfinity_common_la-inf-xmpp-connection.Tpo -c -o libinfinity_common_la-inf-xmpp-connection.lo `test -f 'inf-xmpp-connection.c' || echo '$(srcdir)/'`inf-xmpp-connection.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_common_la-inf-xmpp-connection.Tpo $(DEPDIR)/libinfinity_common_la-inf-xmpp-connection.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-xmpp-connection.c' object='libinfinity_common_la-inf-xmpp-connection.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_common_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_common_la-inf-xmpp-connection.lo `test -f 'inf-xmpp-connection.c' || echo '$(srcdir)/'`inf-xmpp-connection.c libinfinity_common_la-inf-xmpp-manager.lo: inf-xmpp-manager.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_common_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_common_la-inf-xmpp-manager.lo -MD -MP -MF $(DEPDIR)/libinfinity_common_la-inf-xmpp-manager.Tpo -c -o libinfinity_common_la-inf-xmpp-manager.lo `test -f 'inf-xmpp-manager.c' || echo '$(srcdir)/'`inf-xmpp-manager.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_common_la-inf-xmpp-manager.Tpo $(DEPDIR)/libinfinity_common_la-inf-xmpp-manager.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-xmpp-manager.c' object='libinfinity_common_la-inf-xmpp-manager.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_common_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_common_la-inf-xmpp-manager.lo `test -f 'inf-xmpp-manager.c' || echo '$(srcdir)/'`inf-xmpp-manager.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-libinfinity_common_laHEADERS: $(libinfinity_common_la_HEADERS) @$(NORMAL_INSTALL) @list='$(libinfinity_common_la_HEADERS)'; test -n "$(libinfinity_common_ladir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(libinfinity_common_ladir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libinfinity_common_ladir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libinfinity_common_ladir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(libinfinity_common_ladir)" || exit $$?; \ done uninstall-libinfinity_common_laHEADERS: @$(NORMAL_UNINSTALL) @list='$(libinfinity_common_la_HEADERS)'; test -n "$(libinfinity_common_ladir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(libinfinity_common_ladir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libinfinity_common_ladir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-libinfinity_common_laHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libinfinity_common_laHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-libinfinity_common_laHEADERS \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-libinfinity_common_laHEADERS # 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: libinfinity-0.5.5/libinfinity/common/inf-standalone-io.h0000644000175000017500000000452012264763732020267 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_STANDALONE_IO_H__ #define __INF_STANDALONE_IO_H__ #include G_BEGIN_DECLS #define INF_TYPE_STANDALONE_IO (inf_standalone_io_get_type()) #define INF_STANDALONE_IO(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INF_TYPE_STANDALONE_IO, InfStandaloneIo)) #define INF_STANDALONE_IO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INF_TYPE_STANDALONE_IO, InfStandaloneIoClass)) #define INF_IS_STANDALONE_IO(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INF_TYPE_STANDALONE_IO)) #define INF_IS_STANDALONE_IO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INF_TYPE_STANDALONE_IO)) #define INF_STANDALONE_IO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), INF_TYPE_STANDALONE_IO, InfStandaloneIoClass)) typedef struct _InfStandaloneIo InfStandaloneIo; typedef struct _InfStandaloneIoClass InfStandaloneIoClass; struct _InfStandaloneIoClass { GObjectClass parent_class; }; struct _InfStandaloneIo { GObject parent; }; GType inf_standalone_io_get_type(void) G_GNUC_CONST; InfStandaloneIo* inf_standalone_io_new(void); void inf_standalone_io_iteration(InfStandaloneIo* io); void inf_standalone_io_iteration_timeout(InfStandaloneIo* io, guint timeout); void inf_standalone_io_loop(InfStandaloneIo* io); void inf_standalone_io_loop_quit(InfStandaloneIo* io); gboolean inf_standalone_io_loop_running(InfStandaloneIo* io); G_END_DECLS #endif /* __INF_STANDALONE_IO_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/common/inf-tcp-connection.h0000644000175000017500000000676312264763732020470 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_TCP_CONNECTION_H__ #define __INF_TCP_CONNECTION_H__ #include #include #include G_BEGIN_DECLS #define INF_TYPE_TCP_CONNECTION (inf_tcp_connection_get_type()) #define INF_TCP_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INF_TYPE_TCP_CONNECTION, InfTcpConnection)) #define INF_TCP_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INF_TYPE_TCP_CONNECTION, InfTcpConnectionClass)) #define INF_IS_TCP_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INF_TYPE_TCP_CONNECTION)) #define INF_IS_TCP_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INF_TYPE_TCP_CONNECTION)) #define INF_TCP_CONNECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), INF_TYPE_TCP_CONNECTION, InfTcpConnectionClass)) #define INF_TYPE_TCP_CONNECTION_STATUS (inf_tcp_connection_status_get_type()) typedef struct _InfTcpConnection InfTcpConnection; typedef struct _InfTcpConnectionClass InfTcpConnectionClass; struct _InfTcpConnectionClass { GObjectClass parent_class; /* Signals */ void (*sent)(InfTcpConnection* connection, gconstpointer data, guint len); void (*received)(InfTcpConnection* connection, gconstpointer data, guint len); void (*error)(InfTcpConnection* connection, GError* error); }; struct _InfTcpConnection { GObject parent; }; typedef enum _InfTcpConnectionStatus { INF_TCP_CONNECTION_CONNECTING, INF_TCP_CONNECTION_CONNECTED, INF_TCP_CONNECTION_CLOSED } InfTcpConnectionStatus; GType inf_tcp_connection_status_get_type(void) G_GNUC_CONST; GType inf_tcp_connection_get_type(void) G_GNUC_CONST; InfTcpConnection* inf_tcp_connection_new(InfIo* io, InfIpAddress* remote_addr, guint remote_port); InfTcpConnection* inf_tcp_connection_new_and_open(InfIo* io, InfIpAddress* remote_addr, guint remote_port, GError** error); gboolean inf_tcp_connection_open(InfTcpConnection* connection, GError** error); void inf_tcp_connection_close(InfTcpConnection* connection); void inf_tcp_connection_send(InfTcpConnection* connection, gconstpointer data, guint len); InfIpAddress* inf_tcp_connection_get_remote_address(InfTcpConnection* connection); guint inf_tcp_connection_get_remote_port(InfTcpConnection* connection); G_END_DECLS #endif /* __INF_TCP_CONNECTION_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/common/inf-user.c0000644000175000017500000003160712264763732016511 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include #include #include typedef struct _InfUserPrivate InfUserPrivate; struct _InfUserPrivate { guint id; gchar* name; InfUserStatus status; InfUserFlags flags; InfXmlConnection* connection; }; enum { PROP_0, PROP_ID, PROP_NAME, PROP_STATUS, PROP_FLAGS, PROP_CONNECTION }; enum { SET_STATUS, LAST_SIGNAL }; #define INF_USER_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), INF_TYPE_USER, InfUserPrivate)) #define INF_USER_PRIVATE(obj) ((InfUserPrivate*)(obj)->priv) static GObjectClass* parent_class; static guint user_signals[LAST_SIGNAL]; static void inf_user_init(GTypeInstance* instance, gpointer g_class) { InfUser* user; InfUserPrivate* priv; user = INF_USER(instance); user->priv = INF_USER_GET_PRIVATE(user); priv = INF_USER_PRIVATE(user); priv->id = 0; priv->name = NULL; priv->status = INF_USER_UNAVAILABLE; priv->flags = 0; priv->connection = NULL; } static void inf_user_dispose(GObject* object) { InfUser* user; user = INF_USER(object); G_OBJECT_CLASS(parent_class)->dispose(object); } static void inf_user_finalize(GObject* object) { InfUser* user; InfUserPrivate* priv; user = INF_USER(object); priv = INF_USER_PRIVATE(user); g_free(priv->name); G_OBJECT_CLASS(parent_class)->finalize(object); } static void inf_user_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec) { InfUser* user; InfUserPrivate* priv; user = INF_USER(object); priv = INF_USER_PRIVATE(user); /* TODO: Check if properties are still valid. * There are several combinations possible: * * Status | Flags | Connection | Desc * UNAVAIL | 0 | unset | User not available, was non-local last time * AVAIL | 0 | unset | INVALID * UNAVAIL | LOCAL | unset | User not available, was local last time * AVAIL | LOCAL | unset | User is available, and local * UNAVAIL | 0 | set | INVALID * AVAIL | 0 | set | User is available, non-local * UNAVAIL | LOCAL | set | INVALID * AVAIL | LOCAL | set | INVALID */ switch(prop_id) { case PROP_ID: priv->id = g_value_get_uint(value); break; case PROP_NAME: g_free(priv->name); priv->name = g_value_dup_string(value); break; case PROP_STATUS: g_signal_emit( object, user_signals[SET_STATUS], 0, g_value_get_enum(value) ); break; case PROP_FLAGS: priv->flags = g_value_get_flags(value); break; case PROP_CONNECTION: if(priv->connection != NULL) g_object_unref(priv->connection); priv->connection = INF_XML_CONNECTION(g_value_dup_object(value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void inf_user_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec) { InfUser* user; InfUserPrivate* priv; user = INF_USER(object); priv = INF_USER_PRIVATE(user); switch(prop_id) { case PROP_ID: g_value_set_uint(value, priv->id); break; case PROP_NAME: g_value_set_string(value, priv->name); break; case PROP_STATUS: g_value_set_enum(value, priv->status); break; case PROP_FLAGS: g_value_set_flags(value, priv->flags); break; case PROP_CONNECTION: g_value_set_object(value, G_OBJECT(priv->connection)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void inf_user_set_status_handler(InfUser* user, InfUserStatus status) { InfUserPrivate* priv; priv = INF_USER_PRIVATE(user); priv->status = status; } static void inf_user_class_init(gpointer g_class, gpointer class_data) { GObjectClass* object_class; InfUserClass* user_class; object_class = G_OBJECT_CLASS(g_class); user_class = INF_USER_CLASS(g_class); parent_class = G_OBJECT_CLASS(g_type_class_peek_parent(g_class)); g_type_class_add_private(g_class, sizeof(InfUserPrivate)); object_class->dispose = inf_user_dispose; object_class->finalize = inf_user_finalize; object_class->set_property = inf_user_set_property; object_class->get_property = inf_user_get_property; user_class->set_status = inf_user_set_status_handler; g_object_class_install_property( object_class, PROP_ID, g_param_spec_uint( "id", "User ID", "A Unique User ID", 0, G_MAXUINT, 0, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); g_object_class_install_property( object_class, PROP_NAME, g_param_spec_string( "name", "User Name", "The Name with which a user joined a session. Most servers " "ensure that it is unique.", "", G_PARAM_READWRITE ) ); g_object_class_install_property( object_class, PROP_STATUS, g_param_spec_enum( "status", "User Status", "Whether the user is currently available or not.", INF_TYPE_USER_STATUS, INF_USER_UNAVAILABLE, G_PARAM_READWRITE ) ); g_object_class_install_property( object_class, PROP_FLAGS, g_param_spec_flags( "flags", "Flags", "Flags the user currently has", INF_TYPE_USER_FLAGS, 0, G_PARAM_READWRITE ) ); g_object_class_install_property( object_class, PROP_CONNECTION, g_param_spec_object( "connection", "Connection", "Connection to the user", INF_TYPE_XML_CONNECTION, G_PARAM_READWRITE ) ); /** * InfUser::set-status: * @user: The #InfUser that changes status. * @status: The new user status. * * This signal is emitted whenever the user's status changes. This is * basically the same as a notification for the #InfUser:status property, * but it allows to access the previous user status when connecting before * the default signal handler. */ user_signals[SET_STATUS] = g_signal_new( "set-status", G_OBJECT_CLASS_TYPE(object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(InfUserClass, set_status), NULL, NULL, inf_marshal_VOID__ENUM, G_TYPE_NONE, 1, INF_TYPE_USER_STATUS ); } GType inf_user_flags_get_type(void) { static GType user_flags_type = 0; if(!user_flags_type) { static const GFlagsValue user_flags_type_values[] = { { INF_USER_LOCAL, "INF_USER_LOCAL", "local" }, { 0, NULL, NULL } }; user_flags_type = g_flags_register_static( "InfUserFlags", user_flags_type_values ); } return user_flags_type; } GType inf_user_status_get_type(void) { static GType user_status_type = 0; if(!user_status_type) { static const GEnumValue user_status_type_values[] = { { INF_USER_ACTIVE, "INF_USER_ACTIVE", "active" }, { INF_USER_INACTIVE, "INF_USER_INACTIVE", "inactive" }, { INF_USER_UNAVAILABLE, "INF_USER_UNAVAILABLE", "unavailable" }, { 0, NULL, NULL } }; user_status_type = g_enum_register_static( "InfUserStatus", user_status_type_values ); } return user_status_type; } GType inf_user_get_type(void) { static GType user_type = 0; if(!user_type) { static const GTypeInfo user_type_info = { sizeof(InfUserClass), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ inf_user_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InfUser), /* instance_size */ 0, /* n_preallocs */ inf_user_init, /* instance_init */ NULL /* value_table */ }; user_type = g_type_register_static( G_TYPE_OBJECT, "InfUser", &user_type_info, 0 ); } return user_type; } /** * inf_user_get_id: * @user: A #InfUser. * * Returns the ID of the given #InfUser. * * Return Value: A numerical User ID. **/ guint inf_user_get_id(InfUser* user) { g_return_val_if_fail(INF_IS_USER(user), 0); return INF_USER_PRIVATE(user)->id; } /** * inf_user_get_name: * @user: A #InfUser. * * Returns the name of the given #InfUser. * * Return Value: The user's name. **/ const gchar* inf_user_get_name(InfUser* user) { g_return_val_if_fail(INF_IS_USER(user), NULL); return INF_USER_PRIVATE(user)->name; } /** * inf_user_get_status: * @user: A #InfUser. * * Returns the status of the given #InfUser. * * Return Value: The user's status. **/ InfUserStatus inf_user_get_status(InfUser* user) { g_return_val_if_fail(INF_IS_USER(user), INF_USER_UNAVAILABLE); return INF_USER_PRIVATE(user)->status; } /** * inf_user_get_flags: * @user: A #InfUser. * * Returns the flags for the given #InfUser. * * Return Value: The user's flags. **/ InfUserFlags inf_user_get_flags(InfUser* user) { g_return_val_if_fail(INF_IS_USER(user), 0); return INF_USER_PRIVATE(user)->flags; } /** * inf_user_get_connection: * @user: A #InfUser. * * Returns a connection to the given #InfUser, or %NULL. If a non-%NULL * connection is returned, then this is the connection through which records * from that user come from. This means that, when this connection is closed, * then the user is no longer available. However, you cannot send something * to this connection expecting the user will receive it. For example, * in central messaging mode, this connection is always the publisher, because * all records from the user are relayed via the publisher. * * If this functions returns %NULL, this either means @user is a local user * (%INF_USER_LOCAL flag set) or it is not available (status is * %INF_USER_UNAVAILBALE). * * Return Value: A #InfXmlConnection, or %NULL. **/ InfXmlConnection* inf_user_get_connection(InfUser* user) { g_return_val_if_fail(INF_IS_USER(user), NULL); return INF_USER_PRIVATE(user)->connection; } /** * inf_user_status_to_string: * @status: A value from the #InfUserStatus enumeration. * * Returns a non-localized string identifying the given status. This is not * meant to be shown to a user, but rather to serialize a user status, for * example to store it in XML. * * Returns: A static string representation of @status. */ const gchar* inf_user_status_to_string(InfUserStatus status) { switch(status) { case INF_USER_ACTIVE: return "active"; case INF_USER_INACTIVE: return "inactive"; case INF_USER_UNAVAILABLE: return "unavailable"; default: g_assert_not_reached(); } } /** * inf_user_status_from_string: * @string: A string representation of a #InfUserStatus. * @status: A pointer to a #InfUserStatus value, or %NULL. * @error: Location to store error information, if any. * * This function does the opposite of inf_user_status_to_string(). It turns * the given string back to a #InfUserStatus, storing the result in @status * if @status is non-%NULL. If @string is invalid, then @status is left * untouched, @error is set and %FALSE is returned. Otherwise, the function * returns %TRUE. * * Returns: When an error occured during the conversion, %FALSE is returned, * and %TRUE otherwise. */ gboolean inf_user_status_from_string(const gchar* string, InfUserStatus* status, GError** error) { InfUserStatus tmp_status; if(strcmp(string, "active") == 0) tmp_status = INF_USER_ACTIVE; else if(strcmp(string, "inactive") == 0) tmp_status = INF_USER_INACTIVE; else if(strcmp(string, "unavailable") == 0) tmp_status = INF_USER_UNAVAILABLE; else { g_set_error( error, inf_user_error_quark(), INF_USER_ERROR_INVALID_STATUS, _("Invalid user status: '%s'"), string ); return FALSE; } if(status) *status = tmp_status; return TRUE; } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/common/inf-tcp-connection.c0000644000175000017500000011114412264763742020452 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include #include #include #include #include /* For ssize_t */ #include "config.h" #ifndef G_OS_WIN32 # include # include # include # include # include # include # include # include # include #else # include #endif #ifdef G_OS_WIN32 # define INF_TCP_CONNECTION_SENDRECV_FLAGS 0 # define INF_TCP_CONNECTION_LAST_ERROR WSAGetLastError() # define INF_TCP_CONNECTION_EINTR WSAEINTR # define INF_TCP_CONNECTION_EAGAIN WSAEWOULDBLOCK /* This is not a typo here. On Windows, connect() returns WSAEWOULDBLOCK on * a non-blocking socket. */ # define INF_TCP_CONNECTION_EINPROGRESS WSAEWOULDBLOCK #else # ifdef HAVE_MSG_NOSIGNAL # define INF_TCP_CONNECTION_SENDRECV_FLAGS MSG_NOSIGNAL # else # define INF_TCP_CONNECTION_SENDRECV_FLAGS 0 # endif # define INF_TCP_CONNECTION_LAST_ERROR errno # define INF_TCP_CONNECTION_EINTR EINTR # define INF_TCP_CONNECTION_EAGAIN EAGAIN # define INF_TCP_CONNECTION_EINPROGRESS EINPROGRESS # define closesocket(s) close(s) # define INVALID_SOCKET -1 #endif typedef struct _InfTcpConnectionPrivate InfTcpConnectionPrivate; struct _InfTcpConnectionPrivate { InfIo* io; InfIoEvent events; InfIoWatch* watch; InfTcpConnectionStatus status; InfNativeSocket socket; InfIpAddress* remote_address; guint remote_port; unsigned int device_index; guint8* queue; gsize front_pos; gsize back_pos; gsize alloc; }; enum { PROP_0, PROP_IO, PROP_STATUS, PROP_REMOTE_ADDRESS, PROP_REMOTE_PORT, PROP_LOCAL_ADDRESS, PROP_LOCAL_PORT, PROP_DEVICE_INDEX, PROP_DEVICE_NAME }; enum { SENT, RECEIVED, ERROR_, /* ERROR is a #define on Win32 */ LAST_SIGNAL }; #define INF_TCP_CONNECTION_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), INF_TYPE_TCP_CONNECTION, InfTcpConnectionPrivate)) static GObjectClass* parent_class; static guint tcp_connection_signals[LAST_SIGNAL]; static GQuark inf_tcp_connection_error_quark(void) { return g_quark_from_static_string("INF_TCP_CONNECTION_ERROR"); } static void inf_tcp_connection_make_system_error(int code, GError** error) { #ifdef G_OS_WIN32 gchar* error_message; error_message = g_win32_error_message(code); g_set_error( error, inf_tcp_connection_error_quark(), code, "%s", error_message ); g_free(error_message); #else g_set_error( error, inf_tcp_connection_error_quark(), code, "%s", strerror(code) ); #endif } static gboolean inf_tcp_connection_addr_info(InfNativeSocket socket, gboolean local, InfIpAddress** address, guint* port, GError** error) { union { struct sockaddr in_generic; struct sockaddr_in in; struct sockaddr_in6 in6; } native_addr; socklen_t len; int res; int code; len = sizeof(native_addr); if(local == TRUE) res = getsockname(socket, &native_addr.in_generic, &len); else res = getpeername(socket, &native_addr.in_generic, &len); if(res == -1) { code = INF_TCP_CONNECTION_LAST_ERROR; inf_tcp_connection_make_system_error(code, error); return FALSE; } switch(native_addr.in_generic.sa_family) { case AF_INET: if(address != NULL) *address = inf_ip_address_new_raw4(native_addr.in.sin_addr.s_addr); if(port != NULL) *port = ntohs(native_addr.in.sin_port); break; case AF_INET6: if(address != NULL) *address = inf_ip_address_new_raw6(native_addr.in6.sin6_addr.s6_addr); if(port != NULL) *port = ntohs(native_addr.in6.sin6_port); break; default: g_assert_not_reached(); break; } return TRUE; } static void inf_tcp_connection_system_error(InfTcpConnection* connection, int code) { GError* error; error = NULL; inf_tcp_connection_make_system_error(code, &error); g_signal_emit( G_OBJECT(connection), tcp_connection_signals[ERROR_], 0, error ); g_error_free(error); } static gboolean inf_tcp_connection_send_real(InfTcpConnection* connection, gconstpointer data, guint* len) { InfTcpConnectionPrivate* priv; gconstpointer send_data; guint send_len; int errcode; ssize_t result; priv = INF_TCP_CONNECTION_PRIVATE(connection); g_assert(priv->status == INF_TCP_CONNECTION_CONNECTED); g_assert(data != NULL); g_assert(len != NULL); send_data = data; send_len = *len; do { result = send( priv->socket, send_data, send_len, INF_TCP_CONNECTION_SENDRECV_FLAGS ); /* Preserve error code so that it is not modified by future calls */ errcode = INF_TCP_CONNECTION_LAST_ERROR; if(result < 0 && errcode != INF_TCP_CONNECTION_EINTR && errcode != INF_TCP_CONNECTION_EAGAIN) { inf_tcp_connection_system_error(connection, errcode); return FALSE; } else if(result == 0) { inf_tcp_connection_close(connection); return FALSE; } else if(result > 0) { send_data = (const char*)send_data + result; send_len -= result; } } while( (send_len > 0) && (result > 0 || errcode == INF_TCP_CONNECTION_EINTR) && (priv->socket != INVALID_SOCKET) ); *len -= send_len; return TRUE; } /* Required by inf_tcp_connection_connected */ static void inf_tcp_connection_io(InfNativeSocket* socket, InfIoEvent events, gpointer user_data); static void inf_tcp_connection_connected(InfTcpConnection* connection) { InfTcpConnectionPrivate* priv; priv = INF_TCP_CONNECTION_PRIVATE(connection); priv->status = INF_TCP_CONNECTION_CONNECTED; priv->front_pos = 0; priv->back_pos = 0; priv->events = INF_IO_INCOMING | INF_IO_ERROR; if(priv->watch == NULL) { priv->watch = inf_io_add_watch( priv->io, &priv->socket, priv->events, inf_tcp_connection_io, connection, NULL ); } else { inf_io_update_watch(priv->io, priv->watch, priv->events); } g_object_freeze_notify(G_OBJECT(connection)); g_object_notify(G_OBJECT(connection), "status"); g_object_notify(G_OBJECT(connection), "local-address"); g_object_notify(G_OBJECT(connection), "local-port"); g_object_thaw_notify(G_OBJECT(connection)); } static void inf_tcp_connection_io_incoming(InfTcpConnection* connection) { InfTcpConnectionPrivate* priv; gchar buf[2048]; int errcode; ssize_t result; priv = INF_TCP_CONNECTION_PRIVATE(connection); g_assert(priv->status == INF_TCP_CONNECTION_CONNECTED); do { result = recv(priv->socket, buf, 2048, INF_TCP_CONNECTION_SENDRECV_FLAGS); errcode = INF_TCP_CONNECTION_LAST_ERROR; if(result < 0 && errcode != INF_TCP_CONNECTION_EINTR && errcode != INF_TCP_CONNECTION_EAGAIN) { inf_tcp_connection_system_error(connection, errcode); } else if(result == 0) { inf_tcp_connection_close(connection); } else if(result > 0) { g_signal_emit( G_OBJECT(connection), tcp_connection_signals[RECEIVED], 0, buf, (guint)result ); } } while( ((result > 0) || (result < 0 && errcode == INF_TCP_CONNECTION_EINTR)) && (priv->status != INF_TCP_CONNECTION_CLOSED)); } static void inf_tcp_connection_io_outgoing(InfTcpConnection* connection) { InfTcpConnectionPrivate* priv; socklen_t len; int errcode; gconstpointer data; guint data_len; priv = INF_TCP_CONNECTION_PRIVATE(connection); switch(priv->status) { case INF_TCP_CONNECTION_CONNECTING: len = sizeof(int); #ifdef G_OS_WIN32 getsockopt(priv->socket, SOL_SOCKET, SO_ERROR, (char*)&errcode, &len); #else getsockopt(priv->socket, SOL_SOCKET, SO_ERROR, &errcode, &len); #endif if(errcode == 0) { inf_tcp_connection_connected(connection); } else { inf_tcp_connection_system_error(connection, errcode); } break; case INF_TCP_CONNECTION_CONNECTED: g_assert(priv->back_pos < priv->front_pos); g_assert(priv->events & INF_IO_OUTGOING); data = priv->queue + priv->back_pos; data_len = priv->front_pos - priv->back_pos; if(inf_tcp_connection_send_real(connection, data, &data_len) == TRUE) { priv->back_pos += data_len; if(priv->front_pos == priv->back_pos) { /* sent everything */ priv->front_pos = 0; priv->back_pos = 0; priv->events &= ~INF_IO_OUTGOING; inf_io_update_watch(priv->io, priv->watch, priv->events); } g_signal_emit( G_OBJECT(connection), tcp_connection_signals[SENT], 0, data, data_len ); } break; case INF_TCP_CONNECTION_CLOSED: default: g_assert_not_reached(); break; } } static void inf_tcp_connection_io(InfNativeSocket* socket, InfIoEvent events, gpointer user_data) { InfTcpConnection* connection; InfTcpConnectionPrivate* priv; socklen_t len; int errcode; connection = INF_TCP_CONNECTION(user_data); priv = INF_TCP_CONNECTION_PRIVATE(connection); g_object_ref(G_OBJECT(connection)); if(events & INF_IO_ERROR) { len = sizeof(int); #ifdef G_OS_WIN32 getsockopt(priv->socket, SOL_SOCKET, SO_ERROR, (char*)&errcode, &len); #else getsockopt(priv->socket, SOL_SOCKET, SO_ERROR, &errcode, &len); #endif /* On Windows, we get INF_IO_ERROR on disconnection (at least with the * InfGtkIo, because FD_CLOSE is mapped to G_IO_HUP) with errcode * being 0. */ /* TODO: Maybe we should change this by mapping G_IO_HUP to * INF_IO_INCOMING, hoping recv() does the right thing then. */ if(errcode != 0) inf_tcp_connection_system_error(connection, errcode); else inf_tcp_connection_close(connection); } else { if(events & INF_IO_INCOMING) { inf_tcp_connection_io_incoming(connection); } /* It may happen that the above closes the connection and we received * events for both INCOMING & OUTGOING here. */ if((priv->status != INF_TCP_CONNECTION_CLOSED) && (events & INF_IO_OUTGOING)) { inf_tcp_connection_io_outgoing(connection); } } g_object_unref(G_OBJECT(connection)); } static void inf_tcp_connection_init(GTypeInstance* instance, gpointer g_class) { InfTcpConnection* connection; InfTcpConnectionPrivate* priv; connection = INF_TCP_CONNECTION(instance); priv = INF_TCP_CONNECTION_PRIVATE(connection); priv->io = NULL; priv->events = 0; priv->watch = NULL; priv->status = INF_TCP_CONNECTION_CLOSED; priv->socket = INVALID_SOCKET; priv->remote_address = NULL; priv->remote_port = 0; priv->device_index = 0; priv->queue = g_malloc(1024); priv->front_pos = 0; priv->back_pos = 0; priv->alloc = 1024; } static void inf_tcp_connection_dispose(GObject* object) { InfTcpConnection* connection; InfTcpConnectionPrivate* priv; connection = INF_TCP_CONNECTION(object); priv = INF_TCP_CONNECTION_PRIVATE(connection); if(priv->status != INF_TCP_CONNECTION_CLOSED) inf_tcp_connection_close(connection); if(priv->io != NULL) { g_object_unref(G_OBJECT(priv->io)); priv->io = NULL; } G_OBJECT_CLASS(parent_class)->dispose(object); } static void inf_tcp_connection_finalize(GObject* object) { InfTcpConnection* connection; InfTcpConnectionPrivate* priv; connection = INF_TCP_CONNECTION(object); priv = INF_TCP_CONNECTION_PRIVATE(connection); if(priv->remote_address != NULL) inf_ip_address_free(priv->remote_address); if(priv->socket != INVALID_SOCKET) closesocket(priv->socket); g_free(priv->queue); G_OBJECT_CLASS(parent_class)->finalize(object); } static void inf_tcp_connection_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec) { InfTcpConnection* connection; InfTcpConnectionPrivate* priv; #ifndef G_OS_WIN32 const gchar* device_string; unsigned int new_index; #endif connection = INF_TCP_CONNECTION(object); priv = INF_TCP_CONNECTION_PRIVATE(connection); switch(prop_id) { case PROP_IO: g_assert(priv->status == INF_TCP_CONNECTION_CLOSED); if(priv->io != NULL) g_object_unref(G_OBJECT(priv->io)); priv->io = INF_IO(g_value_dup_object(value)); break; case PROP_REMOTE_ADDRESS: g_assert(priv->status == INF_TCP_CONNECTION_CLOSED); if(priv->remote_address != NULL) inf_ip_address_free(priv->remote_address); priv->remote_address = (InfIpAddress*)g_value_dup_boxed(value); break; case PROP_REMOTE_PORT: g_assert(priv->status == INF_TCP_CONNECTION_CLOSED); priv->remote_port = g_value_get_uint(value); break; case PROP_DEVICE_INDEX: g_assert(priv->status == INF_TCP_CONNECTION_CLOSED); /* TODO: Verify that such a device exists */ priv->device_index = g_value_get_uint(value); g_object_notify(G_OBJECT(object), "device-name"); break; case PROP_DEVICE_NAME: #ifdef G_OS_WIN32 /* TODO: We can probably implement this using GetInterfaceInfo() */ g_warning("The device-name property is not implemented on Win32"); #else g_assert(priv->status == INF_TCP_CONNECTION_CLOSED); device_string = g_value_get_string(value); if(device_string == NULL) priv->device_index = 0; new_index = if_nametoindex(device_string); if(new_index == 0) { g_warning(_("Interface `%s' does not exist"), device_string); } else { priv->device_index = new_index; g_object_notify(G_OBJECT(object), "device-index"); } #endif break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void inf_tcp_connection_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec) { InfTcpConnection* connection; InfTcpConnectionPrivate* priv; InfIpAddress* address; guint port; GError* error; #ifndef G_OS_WIN32 char device_name[IF_NAMESIZE]; #endif connection = INF_TCP_CONNECTION(object); priv = INF_TCP_CONNECTION_PRIVATE(connection); switch(prop_id) { case PROP_IO: g_value_set_object(value, G_OBJECT(priv->io)); break; case PROP_STATUS: g_value_set_enum(value, priv->status); break; case PROP_REMOTE_ADDRESS: g_value_set_static_boxed(value, priv->remote_address); break; case PROP_REMOTE_PORT: g_value_set_uint(value, priv->remote_port); break; case PROP_LOCAL_ADDRESS: g_assert(priv->socket != INVALID_SOCKET); error = NULL; inf_tcp_connection_addr_info(priv->socket, TRUE, &address, NULL, &error); if(error != NULL) { g_warning(_("Failed to retrieve local address: %s"), error->message); g_error_free(error); g_value_set_boxed(value, NULL); } else { g_value_take_boxed(value, address); } break; case PROP_LOCAL_PORT: g_assert(priv->socket != INVALID_SOCKET); error = NULL; inf_tcp_connection_addr_info(priv->socket, TRUE, NULL, &port, &error); if(error != NULL) { g_warning(_("Failed to retrieve local port: %s"), error->message); g_error_free(error); g_value_set_uint(value, 0); } else { g_value_set_uint(value, port); } break; case PROP_DEVICE_INDEX: g_value_set_uint(value, priv->device_index); break; case PROP_DEVICE_NAME: #ifdef G_OS_WIN32 /* TODO: We can probably implement this using GetInterfaceInfo() */ g_warning(_("The device-name property is not implemented on Win32")); g_value_set_string(value, NULL); #else if(priv->device_index == 0) { g_value_set_string(value, NULL); } else { if(if_indextoname(priv->device_index, device_name) == NULL) { g_warning( /* Failed to get name for device : */ _("Failed to get name for device %u: %s"), priv->device_index, strerror(errno) ); g_value_set_string(value, NULL); } else { g_value_set_string(value, device_name); } } #endif break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void inf_tcp_connection_error(InfTcpConnection* connection, GError* error) { InfTcpConnectionPrivate* priv; priv = INF_TCP_CONNECTION_PRIVATE(connection); /* Normally, it would be enough to check one of both conditions, but socket * may be already set with status still being CLOSED during * inf_tcp_connection_open(). */ if(priv->watch != NULL) { priv->events = 0; inf_io_remove_watch(priv->io, priv->watch); priv->watch = NULL; } if(priv->status != INF_TCP_CONNECTION_CLOSED) { priv->status = INF_TCP_CONNECTION_CLOSED; g_object_notify(G_OBJECT(connection), "status"); } } static void inf_tcp_connection_class_init(gpointer g_class, gpointer class_data) { GObjectClass* object_class; InfTcpConnectionClass* tcp_connection_class; object_class = G_OBJECT_CLASS(g_class); tcp_connection_class = INF_TCP_CONNECTION_CLASS(g_class); parent_class = G_OBJECT_CLASS(g_type_class_peek_parent(g_class)); g_type_class_add_private(g_class, sizeof(InfTcpConnectionPrivate)); object_class->dispose = inf_tcp_connection_dispose; object_class->finalize = inf_tcp_connection_finalize; object_class->set_property = inf_tcp_connection_set_property; object_class->get_property = inf_tcp_connection_get_property; tcp_connection_class->sent = NULL; tcp_connection_class->received = NULL; tcp_connection_class->error = inf_tcp_connection_error; g_object_class_install_property( object_class, PROP_IO, g_param_spec_object( "io", "IO", "I/O handler", INF_TYPE_IO, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); g_object_class_install_property( object_class, PROP_STATUS, g_param_spec_enum( "status", "Status", "Status of the TCP connection", INF_TYPE_TCP_CONNECTION_STATUS, INF_TCP_CONNECTION_CLOSED, G_PARAM_READABLE ) ); g_object_class_install_property( object_class, PROP_REMOTE_ADDRESS, g_param_spec_boxed( "remote-address", "Remote address", "Address to connect to", INF_TYPE_IP_ADDRESS, G_PARAM_READWRITE ) ); g_object_class_install_property( object_class, PROP_REMOTE_PORT, g_param_spec_uint( "remote-port", "Remote port", "Port to connect to", 0, 65535, 0, G_PARAM_READWRITE ) ); g_object_class_install_property( object_class, PROP_LOCAL_ADDRESS, g_param_spec_boxed( "local-address", "Local address", "The local address of the connection", INF_TYPE_IP_ADDRESS, G_PARAM_READABLE ) ); g_object_class_install_property( object_class, PROP_LOCAL_PORT, g_param_spec_uint( "local-port", "Local port", "The local port of the connection", 0, 65535, 0, G_PARAM_READABLE ) ); g_object_class_install_property( object_class, PROP_DEVICE_INDEX, g_param_spec_uint( "device-index", "Device index", "The index of the device to use for the connection", 0, G_MAXUINT, 0, G_PARAM_READWRITE ) ); g_object_class_install_property( object_class, PROP_DEVICE_NAME, g_param_spec_string( "device-name", "Device name", "The name of the device to use for the connection, such as `eth0'", NULL, G_PARAM_READWRITE ) ); /** * InfTcpConnection::sent: * @connection: The #InfTcpConnection through which the data has been sent * @data: A #gpointer refering to the data that has been sent * @length: A #guint holding the number of bytes that has been sent */ tcp_connection_signals[SENT] = g_signal_new( "sent", G_OBJECT_CLASS_TYPE(object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(InfTcpConnectionClass, sent), NULL, NULL, inf_marshal_VOID__POINTER_UINT, G_TYPE_NONE, 2, G_TYPE_POINTER, G_TYPE_UINT ); /** * InfTcpConnection::received: * @connection: The #InfTcpConnection through which the data has been received * @data: A #gpointer refering to the data that has been received * @length: A #guint holding the number of bytes that has been received */ tcp_connection_signals[RECEIVED] = g_signal_new( "received", G_OBJECT_CLASS_TYPE(object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(InfTcpConnectionClass, received), NULL, NULL, inf_marshal_VOID__POINTER_UINT, G_TYPE_NONE, 2, G_TYPE_POINTER, G_TYPE_UINT ); /** * InfTcpConnection::error: * @connection: The erroneous #InfTcpConnection * @error: A pointer to a #GError object with details on the error */ tcp_connection_signals[ERROR_] = g_signal_new( "error", G_OBJECT_CLASS_TYPE(object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(InfTcpConnectionClass, error), NULL, NULL, inf_marshal_VOID__POINTER, G_TYPE_NONE, 1, G_TYPE_POINTER /* actually a GError* */ ); } GType inf_tcp_connection_status_get_type(void) { static GType tcp_connection_status_type = 0; if(!tcp_connection_status_type) { static const GEnumValue tcp_connection_status_values[] = { { INF_TCP_CONNECTION_CONNECTING, "INF_TCP_CONNECTION_CONNECTING", "connecting" }, { INF_TCP_CONNECTION_CONNECTED, "INF_TCP_CONNECTION_CONNECTED", "connected" }, { INF_TCP_CONNECTION_CLOSED, "INF_TCP_CONNECTION_CLOSED", "closed" }, { 0, NULL, NULL } }; tcp_connection_status_type = g_enum_register_static( "InfTcpConnectionStatus", tcp_connection_status_values ); } return tcp_connection_status_type; } GType inf_tcp_connection_get_type(void) { static GType tcp_connection_type = 0; if(!tcp_connection_type) { static const GTypeInfo tcp_connection_type_info = { sizeof(InfTcpConnectionClass), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ inf_tcp_connection_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InfTcpConnection), /* instance_size */ 0, /* n_preallocs */ inf_tcp_connection_init, /* instance_init */ NULL /* value_table */ }; tcp_connection_type = g_type_register_static( G_TYPE_OBJECT, "InfTcpConnection", &tcp_connection_type_info, 0 ); } return tcp_connection_type; } /** * inf_tcp_connection_new: * @io: A #InfIo object used to watch for activity. * @remote_addr: The address to eventually connect to. * @remote_port: The port to eventually connect to. * * Creates a new #InfTcpConnection. The arguments are stored as properties for * an eventual inf_tcp_connection_open() call, this function itself does not * establish a connection. * * Returns: A new #InfTcpConnection. Free with g_object_unref(). **/ InfTcpConnection* inf_tcp_connection_new(InfIo* io, InfIpAddress* remote_addr, guint remote_port) { InfTcpConnection* tcp; g_return_val_if_fail(INF_IS_IO(io), NULL); g_return_val_if_fail(remote_addr != NULL, NULL); g_return_val_if_fail(remote_port <= 65535, NULL); tcp = INF_TCP_CONNECTION( g_object_new( INF_TYPE_TCP_CONNECTION, "io", io, "remote-address", remote_addr, "remote-port", remote_port, NULL)); return tcp; } /** * inf_tcp_connection_new_and_open: * @io: A #InfIo object used to watch for activity. * @remote_addr: The address to connect to. * @remote_port: The port to connect to. * @error: Location to store error information. * * Creates a new #InfTcpConnection and connects it to the given TCP endpoint. * Like inf_tcp_connection_new, but calls inf_tcp_connection_open(). * * Returns: A new #InfTcpConnection, or %NULL on error. Free with * g_object_unref(). **/ InfTcpConnection* inf_tcp_connection_new_and_open(InfIo* io, InfIpAddress* remote_addr, guint remote_port, GError** error) { InfTcpConnection* tcp; g_return_val_if_fail(INF_IS_IO(io), NULL); g_return_val_if_fail(remote_addr != NULL, NULL); g_return_val_if_fail(remote_port <= 65535, NULL); g_return_val_if_fail(error == NULL || *error == NULL, NULL); tcp = inf_tcp_connection_new(io, remote_addr, remote_port); if(inf_tcp_connection_open(tcp, error) == FALSE) { g_object_unref(tcp); return NULL; } return tcp; } /** * inf_tcp_connection_open: * @connection: A #InfTcpConnection. * @error: Location to store error information. * * Attempts to open @connection. Make sure to have set the "remote-address" * and "remote-port" property before calling this function. If an error * occurs, the function returns %FALSE and @error is set. Note however that * the connection might not be fully open when the function returns * (check the "status" property if you need to know). If an asynchronous * error occurs while the connection is being opened, the "error" signal * is emitted. * * Returns: %FALSE if an error occured and %TRUE otherwise. **/ gboolean inf_tcp_connection_open(InfTcpConnection* connection, GError** error) { InfTcpConnectionPrivate* priv; /* char device_name[IF_NAMESIZE];*/ #ifdef G_OS_WIN32 u_long argp; #endif union { struct sockaddr_in in; struct sockaddr_in6 in6; } native_address; struct sockaddr* addr; socklen_t addrlen; int result; int errcode; g_return_val_if_fail(INF_IS_TCP_CONNECTION(connection), FALSE); priv = INF_TCP_CONNECTION_PRIVATE(connection); g_return_val_if_fail(priv->io != NULL, FALSE); g_return_val_if_fail(priv->status == INF_TCP_CONNECTION_CLOSED, FALSE); g_return_val_if_fail(priv->remote_address != NULL, FALSE); g_return_val_if_fail(priv->remote_port != 0, FALSE); /* Close previous socket */ if(priv->socket != INVALID_SOCKET) closesocket(priv->socket); switch(inf_ip_address_get_family(priv->remote_address)) { case INF_IP_ADDRESS_IPV4: priv->socket = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP); addr = (struct sockaddr*)&native_address.in; addrlen = sizeof(struct sockaddr_in); memcpy( &native_address.in.sin_addr, inf_ip_address_get_raw(priv->remote_address), sizeof(struct in_addr) ); native_address.in.sin_family = AF_INET; native_address.in.sin_port = htons(priv->remote_port); break; case INF_IP_ADDRESS_IPV6: priv->socket = socket(PF_INET6, SOCK_STREAM, IPPROTO_TCP); addr = (struct sockaddr*)&native_address.in6; addrlen = sizeof(struct sockaddr_in6); memcpy( &native_address.in6.sin6_addr, inf_ip_address_get_raw(priv->remote_address), sizeof(struct in6_addr) ); native_address.in6.sin6_family = AF_INET6; native_address.in6.sin6_port = htons(priv->remote_port); native_address.in6.sin6_flowinfo = 0; native_address.in6.sin6_scope_id = priv->device_index; break; default: g_assert_not_reached(); break; } if(priv->socket == INVALID_SOCKET) { inf_tcp_connection_make_system_error( INF_TCP_CONNECTION_LAST_ERROR, error ); return FALSE; } /* Set socket non-blocking */ #ifndef G_OS_WIN32 result = fcntl(priv->socket, F_GETFL); if(result == INVALID_SOCKET) { errcode = INF_TCP_CONNECTION_LAST_ERROR; inf_tcp_connection_make_system_error(errcode, error); closesocket(priv->socket); priv->socket = INVALID_SOCKET; return FALSE; } if(fcntl(priv->socket, F_SETFL, result | O_NONBLOCK) == -1) { errcode = INF_TCP_CONNECTION_LAST_ERROR; inf_tcp_connection_make_system_error(errcode, error); closesocket(priv->socket); priv->socket = INVALID_SOCKET; return FALSE; } #else argp = 1; if(ioctlsocket(priv->socket, FIONBIO, &argp) != 0) { errcode = INF_TCP_CONNECTION_LAST_ERROR; inf_tcp_connection_make_system_error(errcode, error); closesocket(priv->socket); priv->socket = INVALID_SOCKET; return FALSE; } #endif /* Connect */ do { result = connect(priv->socket, addr, addrlen); errcode = INF_TCP_CONNECTION_LAST_ERROR; if(result == -1 && errcode != INF_TCP_CONNECTION_EINTR && errcode != INF_TCP_CONNECTION_EINPROGRESS) { inf_tcp_connection_make_system_error(errcode, error); closesocket(priv->socket); priv->socket = INVALID_SOCKET; return FALSE; } } while(result == -1 && errcode != INF_TCP_CONNECTION_EINPROGRESS); if(result == 0) { /* Connection fully established */ inf_tcp_connection_connected(connection); } else { g_assert(priv->watch == NULL); /* Connection establishment in progress */ priv->events = INF_IO_OUTGOING | INF_IO_ERROR; priv->watch = inf_io_add_watch( priv->io, &priv->socket, priv->events, inf_tcp_connection_io, connection, NULL ); priv->status = INF_TCP_CONNECTION_CONNECTING; g_object_notify(G_OBJECT(connection), "status"); } return TRUE; } /** * inf_tcp_connection_close: * @connection: A #InfTcpConnection. * * Closes a TCP connection that is either open or currently connecting. **/ void inf_tcp_connection_close(InfTcpConnection* connection) { InfTcpConnectionPrivate* priv; g_return_if_fail(INF_IS_TCP_CONNECTION(connection)); priv = INF_TCP_CONNECTION_PRIVATE(connection); g_return_if_fail(priv->status != INF_TCP_CONNECTION_CLOSED); priv->events = 0; g_assert(priv->watch != NULL); inf_io_remove_watch(priv->io, priv->watch); priv->watch = NULL; priv->front_pos = 0; priv->back_pos = 0; priv->status = INF_TCP_CONNECTION_CLOSED; g_object_notify(G_OBJECT(connection), "status"); } /** * inf_tcp_connection_send: * @connection: A #InfTcpConnection with status %INF_TCP_CONNECTION_CONNECTED. * @data: The data to send. * @len: Number of bytes to send. * * Sends data through the TCP connection. The data is not sent immediately, * but enqueued to a buffer and will be sent as soon as kernel space * becomes available. The "sent" signal will be emitted when data has * really been sent. **/ void inf_tcp_connection_send(InfTcpConnection* connection, gconstpointer data, guint len) { InfTcpConnectionPrivate* priv; gconstpointer sent_data; guint sent_len; g_return_if_fail(INF_IS_TCP_CONNECTION(connection)); g_return_if_fail(len == 0 || data != NULL); priv = INF_TCP_CONNECTION_PRIVATE(connection); g_return_if_fail(priv->status == INF_TCP_CONNECTION_CONNECTED); g_object_ref(connection); /* Check whether we have data currently queued. If we have, then we need * to wait until that data has been sent before sending the new data. */ if(priv->front_pos == priv->back_pos) { /* Must not be set, because otherwise we would need something to send, * but there is nothing in the queue. */ g_assert(~priv->events & INF_IO_OUTGOING); /* Nothing in queue, send data directly. */ sent_len = len; sent_data = data; if(inf_tcp_connection_send_real(connection, data, &sent_len) == TRUE) { data = (const char*)data + sent_len; len -= sent_len; } else { /* Sending failed. The error signal has been emitted. */ /* Set len to zero so that we don't enqueue data. */ len = 0; sent_len = 0; } } else { /* Nothing sent */ sent_len = 0; } /* If we couldn't send all the data... */ if(len > 0) { /* If we have not enough space for the new data, move queue data back * onto the beginning of the queue, if not already */ if(priv->alloc - priv->front_pos < len && priv->back_pos > 0) { memmove( priv->queue, priv->queue + priv->back_pos, priv->front_pos - priv->back_pos ); priv->front_pos -= priv->back_pos; priv->back_pos = 0; } /* Allocate more memory if there is still not enough space */ if(priv->alloc - priv->front_pos < len) { /* Make sure we allocate enough */ priv->alloc = priv->front_pos + len; /* Always allocate a multiple of 1024 */ if(priv->alloc % 1024 != 0) priv->alloc = priv->alloc + (1024 - priv->alloc % 1024); priv->queue = g_realloc(priv->queue, priv->alloc); } memcpy(priv->queue + priv->front_pos, data, len); priv->front_pos += len; if(~priv->events & INF_IO_OUTGOING) { priv->events |= INF_IO_OUTGOING; inf_io_update_watch(priv->io, priv->watch, priv->events); } } if(sent_len > 0) { g_signal_emit( G_OBJECT(connection), tcp_connection_signals[SENT], 0, sent_data, sent_len ); } g_object_unref(connection); } /** * inf_tcp_connection_get_remote_address: * @connection: A #InfTcpConnection. * * Returns the IP address of the remote site. * * Return Value: A #InfIpAddress owned by @connection. You do not need to * free it, but need to make your own copy if you want to keep it longer than * @connection's lifetime. **/ InfIpAddress* inf_tcp_connection_get_remote_address(InfTcpConnection* connection) { g_return_val_if_fail(INF_IS_TCP_CONNECTION(connection), NULL); return INF_TCP_CONNECTION_PRIVATE(connection)->remote_address; } /** * inf_tcp_connection_get_remote_port: * @connection: A #InfTcpConnection. * * Returns the port of the remote site to which @connection is (or was) * connected or connecting. * * Return Value: The port of the remote site. **/ guint inf_tcp_connection_get_remote_port(InfTcpConnection* connection) { g_return_val_if_fail(INF_IS_TCP_CONNECTION(connection), 0); return INF_TCP_CONNECTION_PRIVATE(connection)->remote_port; } /* Creates a new TCP connection from an accepted socket. This is only used * by InfdTcpServer and should not be considered regular API. Do not call * this function. Language bindings should not wrap it. */ InfTcpConnection* _inf_tcp_connection_accepted(InfIo* io, InfNativeSocket socket, InfIpAddress* address, guint port, GError** error) { InfTcpConnection* connection; InfTcpConnectionPrivate* priv; int errcode; #ifdef G_OS_WIN32 u_long argp; #else int result; #endif g_return_val_if_fail(INF_IS_IO(io), NULL); g_return_val_if_fail(socket != INVALID_SOCKET, NULL); #ifndef G_OS_WIN32 result = fcntl(socket, F_GETFL); if(result == -1) { errcode = INF_TCP_CONNECTION_LAST_ERROR; inf_tcp_connection_make_system_error(errcode, error); return NULL; } if(fcntl(socket, F_SETFL, result | O_NONBLOCK) == -1) { errcode = INF_TCP_CONNECTION_LAST_ERROR; inf_tcp_connection_make_system_error(errcode, error); return NULL; } #else argp = 1; if(ioctlsocket(socket, FIONBIO, &argp) != 0) { errcode = INF_TCP_CONNECTION_LAST_ERROR; inf_tcp_connection_make_system_error(errcode, error); return NULL; } #endif g_return_val_if_fail(address != NULL, NULL); g_return_val_if_fail(port != 0, NULL); connection = inf_tcp_connection_new(io, address, port); inf_ip_address_free(address); priv = INF_TCP_CONNECTION_PRIVATE(connection); priv->socket = socket; inf_tcp_connection_connected(connection); return connection; } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/common/inf-io.h0000644000175000017500000001502312264763732016141 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_IO_H__ #define __INF_IO_H__ #include #ifdef G_OS_WIN32 #include #endif G_BEGIN_DECLS #define INF_TYPE_IO (inf_io_get_type()) #define INF_IO(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INF_TYPE_IO, InfIo)) #define INF_IS_IO(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INF_TYPE_IO)) #define INF_IO_GET_IFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE((inst), INF_TYPE_IO, InfIoIface)) #define INF_TYPE_IO_EVENT (inf_io_event_get_type()) /** * InfIo: * * #InfIo is an opaque data type. You should only access it via the public * API functions. */ typedef struct _InfIo InfIo; typedef struct _InfIoIface InfIoIface; typedef struct _InfIoWatch InfIoWatch; typedef struct _InfIoTimeout InfIoTimeout; typedef struct _InfIoDispatch InfIoDispatch; /** * InfNativeSocket: * * Native socket type on the target platform. This typedef is a simple #int * on Unix and a #SOCKET on Windows. */ #ifdef G_OS_WIN32 typedef SOCKET InfNativeSocket; #else typedef int InfNativeSocket; #endif /** * InfIoEvent: * @INF_IO_INCOMING: Data can be read from the socket without blocking, or * the connection has been closed (which is the case when recv() returns 0). * @INF_IO_OUTGOING: Data can be sent without blocking. * @INF_IO_ERROR: An error with the socket occured, or the connection has * been closed. Use getsockopt() to read the %SO_ERROR option to find out what * the problem is. * * This enumeration specifies events that can be watched. */ typedef enum _InfIoEvent { INF_IO_INCOMING = 1 << 0, INF_IO_OUTGOING = 1 << 1, INF_IO_ERROR = 1 << 2 } InfIoEvent; /** * InfIoWatchFunc: * @socket: The socket on which an event occured. * @event: A bitmask of the events that occured. * @user_data: User-defined data specified in inf_io_add_watch(). * * Callback function that is called when an event occurs on a watched socket. */ typedef void(*InfIoWatchFunc)(InfNativeSocket* socket, InfIoEvent event, gpointer user_data); /** * InfIoTimeoutFunc: * @user_data: User-defined data specified in inf_io_add_timeout(). * * Callback function that is called when a timeout has elapsed. */ typedef void(*InfIoTimeoutFunc)(gpointer user_data); /** * InfIoDispatchFunc: * @user_data: User-defined data specified in inf_io_add_dispatch(). * * Callback function that is called when a dispatch is executed by the thread * that runs #InfIo. */ typedef void(*InfIoDispatchFunc)(gpointer user_data); /** * InfIoIface: * @add_watch: Watches a socket for events to occur in which case @func is * called. * @update_watch: Updates a watch on a socket so that a different set of * events is watched for. * @remove_watch: Removes a watch on a socket. * @add_timeout: Schedules @func to be called at least @msecs milliseconds * in the future. * @remove_timeout: Removes a scheduled timeout again. The timeout is * removed automatically when it has elapsed, so there is no need to call * this function in that case. * @add_dispatch: Schedules @func to be called by the thread the #InfIo * runs in. * @remove_dispatch: Removes a scheduled dispatch. This can be called as long * as the scheduled function has not yet been called. * * The virtual methods of #InfIo. These allow to set up socket watches, * timeouts and function dispatchers. All of these functions need to be * thread-safe. */ struct _InfIoIface { /*< private >*/ GTypeInterface parent; /*< public >*/ InfIoWatch* (*add_watch)(InfIo* io, InfNativeSocket* socket, InfIoEvent events, InfIoWatchFunc func, gpointer user_data, GDestroyNotify notify); void (*update_watch)(InfIo* io, InfIoWatch* watch, InfIoEvent events); void (*remove_watch)(InfIo* io, InfIoWatch* watch); InfIoTimeout* (*add_timeout)(InfIo* io, guint msecs, InfIoTimeoutFunc func, gpointer user_data, GDestroyNotify notify); void (*remove_timeout)(InfIo* io, InfIoTimeout* timeout); InfIoDispatch* (*add_dispatch)(InfIo* io, InfIoDispatchFunc func, gpointer user_data, GDestroyNotify notify); void (*remove_dispatch)(InfIo* io, InfIoDispatch* dispatch); }; GType inf_io_event_get_type(void) G_GNUC_CONST; GType inf_io_get_type(void) G_GNUC_CONST; InfIoWatch* inf_io_add_watch(InfIo* io, InfNativeSocket* socket, InfIoEvent events, InfIoWatchFunc func, gpointer user_data, GDestroyNotify notify); void inf_io_update_watch(InfIo* io, InfIoWatch* watch, InfIoEvent events); void inf_io_remove_watch(InfIo* io, InfIoWatch* watch); InfIoTimeout* inf_io_add_timeout(InfIo* io, guint msecs, InfIoTimeoutFunc func, gpointer user_data, GDestroyNotify notify); void inf_io_remove_timeout(InfIo* io, InfIoTimeout* timeout); InfIoDispatch* inf_io_add_dispatch(InfIo* io, InfIoDispatchFunc func, gpointer user_data, GDestroyNotify notify); void inf_io_remove_dispatch(InfIo* io, InfIoDispatch* dispatch); G_END_DECLS #endif /* __INF_IO_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/common/inf-session.h0000644000175000017500000003231012264763732017213 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_SESSION_H__ #define __INF_SESSION_H__ #include #include #include #include #include #include #include #include G_BEGIN_DECLS #define INF_TYPE_SESSION (inf_session_get_type()) #define INF_SESSION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INF_TYPE_SESSION, InfSession)) #define INF_SESSION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INF_TYPE_SESSION, InfSessionClass)) #define INF_IS_SESSION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INF_TYPE_SESSION)) #define INF_IS_SESSION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INF_TYPE_SESSION)) #define INF_SESSION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), INF_TYPE_SESSION, InfSessionClass)) #define INF_TYPE_SESSION_STATUS (inf_session_status_get_type()) typedef struct _InfSession InfSession; typedef struct _InfSessionClass InfSessionClass; /** * InfSessionStatus: * @INF_SESSION_PRESYNC: The session is scheduled to be synchronized from a * remote host. This can be useful if the session is needed to be present * before the actual synchronization begins. Use * inf_session_synchronize_from() to switch to * %INF_SESSION_SYNCHRONIZING. * @INF_SESSION_SYNCHRONIZING: The session is currently being synchronized * from a remote host. When done synchronizing, it will enter into * %INF_SESSION_RUNNING state. * @INF_SESSION_RUNNING: The session is running and ready to synchronize * other hosts. If a subscription group is set * (see inf_session_set_subscription_group()), then changes to the * underlying buffer are transmitted to all subscribed connections. * @INF_SESSION_CLOSED: The session is closed and can no longer be used. The * session enters this state if the synchronization fails in * %INF_SESSION_SYNCHRONIZING state or inf_session_close() is called. * * #InfSessionStatus defines in what state a session is in. */ typedef enum _InfSessionStatus { INF_SESSION_PRESYNC, INF_SESSION_SYNCHRONIZING, INF_SESSION_RUNNING, INF_SESSION_CLOSED } InfSessionStatus; /** * InfSessionSyncStatus: * @INF_SESSION_SYNC_NONE: No synchronization is ongoing. * @INF_SESSION_SYNC_IN_PROGRESS: Synchronization is currently in progress. * @INF_SESSION_SYNC_AWAITING_ACK: All synchronization data has been sent * (progress is 1.0), but we are still waiting for an acknowledgment from the * remote site. Synchronization can no longer be cancelled, but it can stiff * fail. * * #InfSessionSyncStatus represents the status of a synchronization. It is * used by inf_session_get_synchronization_status(). */ typedef enum _InfSessionSyncStatus { INF_SESSION_SYNC_NONE, INF_SESSION_SYNC_IN_PROGRESS, INF_SESSION_SYNC_AWAITING_ACK } InfSessionSyncStatus; /** * InfSessionSyncError: * @INF_SESSION_SYNC_ERROR_GOT_MESSAGE_IN_PRESYNC: Received a message * in state %INF_SESSION_PRESYNC. It is not processed because * inf_session_synchronize_from() was not yet called. * @INF_SESSION_SYNC_ERROR_UNEXPECTED_NODE: A message has been received that * was not understood. * @INF_SESSION_SYNC_ERROR_ID_NOT_PRESENT: An ID was not provided for a user * in the session. * @INF_SESSION_SYNC_ERROR_ID_IN_USE: The ID of a user is already in use by * another user. * @INF_SESSION_SYNC_ERROR_NAME_NOT_PRESENT: A name was not provided for a * user in the session. * @INF_SESSION_SYNC_ERROR_NAME_IN_USE: The name of a user is already in use * by another user. * @INF_SESSION_SYNC_ERROR_CONNECTION_CLOSED: The synchronization connection * has been closed. * @INF_SESSION_SYNC_ERROR_SENDER_CANCELLED: The sender has cancelled the * synchronization. * @INF_SESSION_SYNC_ERROR_RECEIVER_CANCELLED: The receiver has cancelled the * synchronization. * @INF_SESSION_SYNC_ERROR_UNEXPECTED_BEGIN_OF_SYNC: Received * <sync-begin/> * not a the beginning of the synchronization. * @INF_SESSION_SYNC_ERROR_NUM_MESSAGES_MISSING: The <sync-begin/> * message does not contain the number of synchronization messages to expect. * @INF_SESSION_SYNC_ERROR_UNEXPECTED_END_OF_SYNC: The <sync-end/> * message was not received at the end of the synchronization. * @INF_SESSION_SYNC_ERROR_EXPECTED_BEGIN_OF_SYNC: The <sync-begin/> * message was not received at the beginning of the synchronization. * @INF_SESSION_SYNC_ERROR_EXPECTED_END_OF_SYNC: The <sync-end/> message * was not received at the end of the synchronization. * @INF_SESSION_SYNC_ERROR_FAILED: Generic error code when no further reason * of failure is known. * * These are errors that can occur during a synchronization of a session. * Additional errors may occur depending on the session type. */ typedef enum _InfSessionSyncError { INF_SESSION_SYNC_ERROR_GOT_MESSAGE_IN_PRESYNC, INF_SESSION_SYNC_ERROR_UNEXPECTED_NODE, INF_SESSION_SYNC_ERROR_ID_NOT_PRESENT, INF_SESSION_SYNC_ERROR_ID_IN_USE, INF_SESSION_SYNC_ERROR_NAME_NOT_PRESENT, INF_SESSION_SYNC_ERROR_NAME_IN_USE, INF_SESSION_SYNC_ERROR_CONNECTION_CLOSED, INF_SESSION_SYNC_ERROR_SENDER_CANCELLED, INF_SESSION_SYNC_ERROR_RECEIVER_CANCELLED, INF_SESSION_SYNC_ERROR_UNEXPECTED_BEGIN_OF_SYNC, INF_SESSION_SYNC_ERROR_NUM_MESSAGES_MISSING, INF_SESSION_SYNC_ERROR_UNEXPECTED_END_OF_SYNC, INF_SESSION_SYNC_ERROR_EXPECTED_BEGIN_OF_SYNC, INF_SESSION_SYNC_ERROR_EXPECTED_END_OF_SYNC, INF_SESSION_SYNC_ERROR_FAILED } InfSessionSyncError; /** * InfSessionClass: * @to_xml_sync: Virtual function that saves the session within a XML * document. @parent is the root node of the document. It should create as * much nodes as possible within that root node and not in sub-nodes because * these are sent to a client and it is not allowed that other traffic is put * in between those nodes. This way, communication through the same connection * does not hang just because a large session is synchronized. * @process_xml_sync: Virtual function that is called for every node in the * XML document created by @to_xml_sync. It is supposed to reconstruct the * session content from the XML data. * @process_xml_run: Virtual function that is called for every received * message while the session is running. Return %INF_COMMUNICATION_SCOPE_GROUP * if the message is designated for all group members (see also * inf_communication_object_received() on this topic). * @get_xml_user_props: Virtual function that creates a list of * #GParameters for use with g_object_newv() from a XML node. * @set_xml_user_props: Virtual function that writes the passed user * properties into a XML node. * @validate_user_props: Virtual function that checks whether the given user * properties are valid for a user join. This prevents a user join if there is * already a user with the same name. If @exclude is not %NULL, then the * function does ignore it when validating. * @user_new: Virtual function that creates a new user object with the given * properties. * @close: Default signal handler for the #InfSession::close signal. This * cancels currently running synchronization in #InfSession. * @synchronization_begin: Default signal handler for the * #InfSession::synchronization-begin signal. The default handler queues the * synchronization messages. * @synchronization_progress: Default signal handler for the * #InfSession::synchronization-progress signal. * @synchronization_complete: Default signal handler for the * #InfSession::synchronization-complete signal. If the session itself got * synchronized (and did not synchronize another session), then the default * handler changes status to %INF_SESSION_RUNNING. * @synchronization_failed: Default signal handler for the * #InfSession::synchronization-failed signal. If the session itself got * synchronized (and did not synchronize another session), then the default * handler changes status to %INF_SESSION_CLOSED. * * This structure contains the virtual functions and default signal handlers * of #InfSession. */ struct _InfSessionClass { /*< private >*/ GObjectClass parent_class; /*< public >*/ /* Virtual table */ void(*to_xml_sync)(InfSession* session, xmlNodePtr parent); gboolean(*process_xml_sync)(InfSession* session, InfXmlConnection* connection, xmlNodePtr xml, GError** error); InfCommunicationScope(*process_xml_run)(InfSession* session, InfXmlConnection* connection, xmlNodePtr xml, GError** error); GArray*(*get_xml_user_props)(InfSession* session, InfXmlConnection* conn, xmlNodePtr xml); void (*set_xml_user_props)(InfSession* session, const GParameter* params, guint n_params, xmlNodePtr xml); gboolean(*validate_user_props)(InfSession* session, const GParameter* params, guint n_params, InfUser* exclude, GError** error); InfUser*(*user_new)(InfSession* session, GParameter* params, guint n_params); /* Signals */ void(*close)(InfSession* session); void(*synchronization_begin)(InfSession* session, InfCommunicationGroup* group, InfXmlConnection* connection); void(*synchronization_progress)(InfSession* session, InfXmlConnection* connection, gdouble percentage); void(*synchronization_complete)(InfSession* session, InfXmlConnection* connection); void(*synchronization_failed)(InfSession* session, InfXmlConnection* connection, const GError* error); }; /** * InfSession: * * #InfSession is an opaque data type. You should only access it via the * public API functions. */ struct _InfSession { /*< private >*/ GObject parent; }; const GParameter* inf_session_lookup_user_property(const GParameter* params, guint n_params, const gchar* name); GParameter* inf_session_get_user_property(GArray* array, const gchar* name); GType inf_session_status_get_type(void) G_GNUC_CONST; GType inf_session_get_type(void) G_GNUC_CONST; void inf_session_user_to_xml(InfSession* session, InfUser* user, xmlNodePtr xml); void inf_session_close(InfSession* session); InfCommunicationManager* inf_session_get_communication_manager(InfSession* session); InfBuffer* inf_session_get_buffer(InfSession* session); InfUserTable* inf_session_get_user_table(InfSession* session); InfSessionStatus inf_session_get_status(InfSession* session); InfUser* inf_session_add_user(InfSession* session, const GParameter* params, guint n_params, GError** error); void inf_session_set_user_status(InfSession* session, InfUser* user, InfUserStatus status); void inf_session_synchronize_from(InfSession* session); void inf_session_synchronize_to(InfSession* session, InfCommunicationGroup* group, InfXmlConnection* connection); InfSessionSyncStatus inf_session_get_synchronization_status(InfSession* session, InfXmlConnection* connection); gdouble inf_session_get_synchronization_progress(InfSession* session, InfXmlConnection* connection); gboolean inf_session_has_synchronizations(InfSession* session); InfCommunicationGroup* inf_session_get_subscription_group(InfSession* session); void inf_session_set_subscription_group(InfSession* session, InfCommunicationGroup* group); void inf_session_send_to_subscriptions(InfSession* session, xmlNodePtr xml); G_END_DECLS #endif /* __INF_SESSION_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/common/inf-user-table.h0000644000175000017500000001011512264763732017572 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_USER_TABLE_H__ #define __INF_USER_TABLE_H__ #include #include G_BEGIN_DECLS #define INF_TYPE_USER_TABLE (inf_user_table_get_type()) #define INF_USER_TABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INF_TYPE_USER_TABLE, InfUserTable)) #define INF_USER_TABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INF_TYPE_USER_TABLE, InfUserTableClass)) #define INF_IS_USER_TABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INF_TYPE_USER_TABLE)) #define INF_IS_USER_TABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INF_TYPE_USER_TABLE)) #define INF_USER_TABLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), INF_TYPE_USER_TABLE, InfUserTableClass)) typedef struct _InfUserTable InfUserTable; typedef struct _InfUserTableClass InfUserTableClass; /** * InfUserTableClass: * @add_user: Default signal handler for the #InfUserTable::add_user signal. * @remove_user: Default signal handler for the #InfUserTable::remove_user * signal. * @add_local_user: Default signal handler for the * #InfUserTable::add_local_user signal. * @remove_local_user: Default signal handler for the * #InfUserTable::remove_local_user signal. * * Signals for the #InfUserTable class. */ struct _InfUserTableClass { /*< private >*/ GObjectClass parent_class; /*< public >*/ void(*add_user)(InfUserTable* user_table, InfUser* user); void(*remove_user)(InfUserTable* user_table, InfUser* user); void(*add_local_user)(InfUserTable* user_table, InfUser* user); void(*remove_local_user)(InfUserTable* user_table, InfUser* user); }; /** * InfUserTable: * * #InfUserTable is an opaque data type. You should only access it via the * public API functions. */ struct _InfUserTable { /*< private >*/ GObject parent; }; /** * InfUserTableForeachUserFunc: * @user: The #InfUser for the current iteration. * @user_data: The user_data passed to inf_user_table_foreach_user() or * inf_user_table_foreach_local_user(). * * This callback is called for every user iterated by * inf_user_table_foreach_user() or inf_user_table_foreach_local_user(). */ typedef void(*InfUserTableForeachUserFunc)(InfUser* user, gpointer user_data); GType inf_user_table_get_type(void) G_GNUC_CONST; InfUserTable* inf_user_table_new(void); void inf_user_table_add_user(InfUserTable* user_table, InfUser* user); void inf_user_table_remove_user(InfUserTable* user_table, InfUser* user); InfUser* inf_user_table_lookup_user_by_id(InfUserTable* user_table, guint id); InfUser* inf_user_table_lookup_user_by_name(InfUserTable* user_table, const gchar* name); void inf_user_table_foreach_user(InfUserTable* user_table, InfUserTableForeachUserFunc func, gpointer user_data); void inf_user_table_foreach_local_user(InfUserTable* user_table, InfUserTableForeachUserFunc func, gpointer user_data); G_END_DECLS #endif /* __INF_USER_TABLE_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/common/inf-local-publisher.c0000644000175000017500000000776312264763732020626 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ /** * SECTION:inf-local-publisher * @short_description: Publish services on the local network * @include: libinfinity/common/inf-local-publisher.h * @see_also: #InfDiscoveryAvahi * * #InfLocalPublisher provides a common interface to publish services on the * local network. */ #include static void inf_local_publisher_base_init(gpointer g_class) { static gboolean initialized = FALSE; if(!initialized) { initialized = TRUE; } } GType inf_local_publisher_get_type(void) { static GType local_publisher_type = 0; if(!local_publisher_type) { static const GTypeInfo local_publisher_info = { sizeof(InfLocalPublisherIface), /* class_size */ inf_local_publisher_base_init, /* base_init */ NULL, /* base_finalize */ NULL, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ 0, /* instance_size */ 0, /* n_preallocs */ NULL, /* instance_init */ NULL /* value_table */ }; local_publisher_type = g_type_register_static( G_TYPE_INTERFACE, "InfLocalPublisher", &local_publisher_info, 0 ); g_type_interface_add_prerequisite(local_publisher_type, G_TYPE_OBJECT); } return local_publisher_type; } /** * inf_local_publisher_publish: * @publisher: A #InfLocalPublisher. * @type: The service type to publish, such as _http._tcp. * @name: The name of the service. * @port: The port the service is listening on. * * Publishes a service through @publisher so that it can be discovered with * an appropriate #InfDiscovery. * * Return Value: A #InfLocalPublisherItem that can be used to unpublish * the service again. **/ InfLocalPublisherItem* inf_local_publisher_publish(InfLocalPublisher* publisher, const gchar* type, const gchar* name, guint port) { InfLocalPublisherIface* iface; g_return_val_if_fail(INF_IS_LOCAL_PUBLISHER(publisher), NULL); g_return_val_if_fail(type != NULL, NULL); g_return_val_if_fail(name != NULL, NULL); g_return_val_if_fail(port != 0, NULL); iface = INF_LOCAL_PUBLISHER_GET_IFACE(publisher); g_return_val_if_fail(iface->publish != NULL, NULL); return iface->publish(publisher, type, name, port); } /** * inf_local_publisher_unpublish: * @publisher: A #InfLocalPublisher. * @item: A published item obtained from inf_local_publisher_publish(). * * Unpublishes @item so that it can no longer be found in the network. **/ void inf_local_publisher_unpublish(InfLocalPublisher* publisher, InfLocalPublisherItem* item) { InfLocalPublisherIface* iface; g_return_if_fail(INF_IS_LOCAL_PUBLISHER(publisher)); g_return_if_fail(item != NULL); iface = INF_LOCAL_PUBLISHER_GET_IFACE(publisher); g_return_if_fail(iface->unpublish != NULL); iface->unpublish(publisher, item); } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/common/inf-xml-util.h0000644000175000017500000001177212264763732017314 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_XML_UTIL_H__ #define __INF_XML_UTIL_H__ #include #include G_BEGIN_DECLS void inf_xml_util_add_child_text(xmlNodePtr xml, const gchar* text, gsize bytes); gchar* inf_xml_util_get_child_text(xmlNodePtr xml, gsize* bytes, guint* chars, GError** error); xmlChar* inf_xml_util_get_attribute(xmlNodePtr xml, const gchar* attribute); xmlChar* inf_xml_util_get_attribute_required(xmlNodePtr xml, const gchar* attribute, GError** error); gboolean inf_xml_util_get_attribute_int(xmlNodePtr xml, const gchar* attribute, gint* result, GError** error); gboolean inf_xml_util_get_attribute_int_required(xmlNodePtr xml, const gchar* attribute, gint* result, GError** error); gboolean inf_xml_util_get_attribute_long(xmlNodePtr xml, const gchar* attribute, glong* result, GError** error); gboolean inf_xml_util_get_attribute_long_required(xmlNodePtr xml, const gchar* attribute, glong* result, GError** error); gboolean inf_xml_util_get_attribute_uint(xmlNodePtr xml, const gchar* attribute, guint* result, GError** error); gboolean inf_xml_util_get_attribute_uint_required(xmlNodePtr xml, const gchar* attribute, guint* result, GError** error); gboolean inf_xml_util_get_attribute_ulong(xmlNodePtr xml, const gchar* attribute, gulong* result, GError** error); gboolean inf_xml_util_get_attribute_ulong_required(xmlNodePtr xml, const gchar* attribute, gulong* result, GError** error); gboolean inf_xml_util_get_attribute_double(xmlNodePtr xml, const gchar* attribute, gdouble* result, GError** error); gboolean inf_xml_util_get_attribute_double_required(xmlNodePtr xml, const gchar* attribute, gdouble* result, GError** error); void inf_xml_util_set_attribute(xmlNodePtr xml, const gchar* attribute, const gchar* value); void inf_xml_util_set_attribute_int(xmlNodePtr xml, const gchar* attribute, gint value); void inf_xml_util_set_attribute_long(xmlNodePtr xml, const gchar* attribute, glong value); void inf_xml_util_set_attribute_uint(xmlNodePtr xml, const gchar* attribute, guint value); void inf_xml_util_set_attribute_ulong(xmlNodePtr xml, const gchar* attribute, gulong value); void inf_xml_util_set_attribute_double(xmlNodePtr xml, const gchar* attribute, gdouble value); xmlNodePtr inf_xml_util_new_node_from_error(GError* error, xmlNsPtr name_space, const gchar* name); GError* inf_xml_util_new_error_from_node(xmlNodePtr xml); G_END_DECLS #endif /* __INF_XML_UTIL_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/common/inf-xmpp-connection.h0000644000175000017500000001730412264763732020657 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_XMPP_CONNECTION_H__ #define __INF_XMPP_CONNECTION_H__ #include #include #include #include #include /* Get ssize_t on MSVC, required by gnutls.h */ #include /*#include */ #include G_BEGIN_DECLS #define INF_TYPE_XMPP_CONNECTION (inf_xmpp_connection_get_type()) #define INF_XMPP_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INF_TYPE_XMPP_CONNECTION, InfXmppConnection)) #define INF_XMPP_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INF_TYPE_XMPP_CONNECTION, InfXmppConnectionClass)) #define INF_IS_XMPP_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INF_TYPE_XMPP_CONNECTION)) #define INF_IS_XMPP_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INF_TYPE_XMPP_CONNECTION)) #define INF_XMPP_CONNECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), INF_TYPE_XMPP_CONNECTION, InfXmppConnectionClass)) #define INF_TYPE_XMPP_CONNECTION_SITE (inf_xmpp_connection_site_get_type()) #define INF_TYPE_XMPP_CONNECTION_SECURITY_POLICY (inf_xmpp_connection_security_policy_get_type()) typedef struct _InfXmppConnection InfXmppConnection; typedef struct _InfXmppConnectionClass InfXmppConnectionClass; typedef enum _InfXmppConnectionSite { INF_XMPP_CONNECTION_SERVER, INF_XMPP_CONNECTION_CLIENT } InfXmppConnectionSite; typedef enum _InfXmppConnectionSecurityPolicy { /* Server: Do not offer TLS. * Client: Only connect if TLS is not required. */ INF_XMPP_CONNECTION_SECURITY_ONLY_UNSECURED, /* Server: Require TLS. * Client: Only connect if TLS is available. */ INF_XMPP_CONNECTION_SECURITY_ONLY_TLS, /* Server: Offer both. * Client: Use unsecured communication unless TLS is required */ INF_XMPP_CONNECTION_SECURITY_BOTH_PREFER_UNSECURED, /* Server: Offer both. * Client: Use TLS-secured communication unless TLS is not available. */ INF_XMPP_CONNECTION_SECURITY_BOTH_PREFER_TLS } InfXmppConnectionSecurityPolicy; typedef enum _InfXmppConnectionError { /* Server does not support TLS */ INF_XMPP_CONNECTION_ERROR_TLS_UNSUPPORTED, /* The server requires TLS, but we don't want TLS */ INF_XMPP_CONNECTION_ERROR_TLS_REQUIRED, /* Got as response to */ INF_XMPP_CONNECTION_ERROR_TLS_FAILURE, /* The server did not provide a certificate */ INF_XMPP_CONNECTION_ERROR_NO_CERTIFICATE_PROVIDED, /* The server certificate is not trusted */ INF_XMPP_CONNECTION_ERROR_CERTIFICATE_NOT_TRUSTED, /* Server does not provide authentication mechanisms */ INF_XMPP_CONNECTION_ERROR_AUTHENTICATION_UNSUPPORTED, /* Server does not offer a suitable machnism */ INF_XMPP_CONNECTION_ERROR_NO_SUITABLE_MECHANISM, INF_XMPP_CONNECTION_ERROR_FAILED } InfXmppConnectionError; /* As defined in RFC 3920, section 4.7.3 */ typedef enum _InfXmppConnectionStreamError { INF_XMPP_CONNECTION_STREAM_ERROR_BAD_FORMAT, INF_XMPP_CONNECTION_STREAM_ERROR_BAD_NAMESPACE_PREFIX, INF_XMPP_CONNECTION_STREAM_ERROR_CONFLICT, INF_XMPP_CONNECTION_STREAM_ERROR_CONNECTION_TIMEOUT, INF_XMPP_CONNECTION_STREAM_ERROR_HOST_GONE, INF_XMPP_CONNECTION_STREAM_ERROR_HOST_UNKNOWN, INF_XMPP_CONNECTION_STREAM_ERROR_IMPROPER_ADDRESSING, INF_XMPP_CONNECTION_STREAM_ERROR_INTERNAL_SERVER_ERROR, INF_XMPP_CONNECTION_STREAM_ERROR_INVALID_FROM, INF_XMPP_CONNECTION_STREAM_ERROR_INVALID_ID, INF_XMPP_CONNECTION_STREAM_ERROR_INVALID_NAMESPACE, INF_XMPP_CONNECTION_STREAM_ERROR_INVALID_XML, INF_XMPP_CONNECTION_STREAM_ERROR_NOT_AUTHORIZED, INF_XMPP_CONNECTION_STREAM_ERROR_POLICY_VIOLATION, INF_XMPP_CONNECTION_STREAM_ERROR_REMOTE_CONNECTION_FAILED, INF_XMPP_CONNECTION_STREAM_ERROR_RESOURCE_CONSTRAINT, INF_XMPP_CONNECTION_STREAM_ERROR_RESTRICTED_XML, INF_XMPP_CONNECTION_STREAM_ERROR_SEE_OTHER_HOST, INF_XMPP_CONNECTION_STREAM_ERROR_SYSTEM_SHUTDOWN, INF_XMPP_CONNECTION_STREAM_ERROR_UNDEFINED_CONDITION, INF_XMPP_CONNECTION_STREAM_ERROR_UNSUPPORTED_ENCODING, INF_XMPP_CONNECTION_STREAM_ERROR_UNSUPPORTED_STANZA_TYPE, INF_XMPP_CONNECTION_STREAM_ERROR_UNSUPPORTED_VERSION, INF_XMPP_CONNECTION_STREAM_ERROR_XML_NOT_WELL_FORMED, INF_XMPP_CONNECTION_STREAM_ERROR_FAILED } InfXmppConnectionStreamError; /* As defined in RFC 3920, section 6.4 */ typedef enum _InfXmppConnectionAuthError { INF_XMPP_CONNECTION_AUTH_ERROR_ABORTED, INF_XMPP_CONNECTION_AUTH_ERROR_INCORRECT_ENCODING, INF_XMPP_CONNECTION_AUTH_ERROR_INVALID_AUTHZID, INF_XMPP_CONNECTION_AUTH_ERROR_INVALID_MECHANISM, INF_XMPP_CONNECTION_AUTH_ERROR_MECHANISM_TOO_WEAK, INF_XMPP_CONNECTION_AUTH_ERROR_NOT_AUTHORIZED, INF_XMPP_CONNECTION_AUTH_ERROR_TEMPORARY_AUTH_FAILURE, INF_XMPP_CONNECTION_AUTH_ERROR_FAILED } InfXmppConnectionAuthError; struct _InfXmppConnectionClass { GObjectClass parent_class; }; struct _InfXmppConnection { GObject parent; }; typedef void(*InfXmppConnectionCrtCallback)(InfXmppConnection* xmpp, InfCertificateChain* chain, gpointer user_data); GType inf_xmpp_connection_security_policy_get_type(void) G_GNUC_CONST; GType inf_xmpp_connection_site_get_type(void) G_GNUC_CONST; GType inf_xmpp_connection_get_type(void) G_GNUC_CONST; InfXmppConnection* inf_xmpp_connection_new(InfTcpConnection* tcp, InfXmppConnectionSite site, const gchar* local_hostname, const gchar* remote_hostname, InfXmppConnectionSecurityPolicy security_policy, InfCertificateCredentials* creds, InfSaslContext* sasl_context, const gchar* sasl_mechanisms); gboolean inf_xmpp_connection_get_tls_enabled(InfXmppConnection* xmpp); void inf_xmpp_connection_set_certificate_callback(InfXmppConnection* xmpp, InfXmppConnectionCrtCallback cb, gpointer user_data); void inf_xmpp_connection_certificate_verify_continue(InfXmppConnection* xmpp); void inf_xmpp_connection_certificate_verify_cancel(InfXmppConnection* xmpp); void inf_xmpp_connection_reset_sasl_authentication(InfXmppConnection* xmpp, InfSaslContext* new_context, const gchar* new_mechanisms); gboolean inf_xmpp_connection_retry_sasl_authentication(InfXmppConnection* xmpp, GError** error); void inf_xmpp_connection_set_sasl_error(InfXmppConnection* xmpp, const GError* error); const GError* inf_xmpp_connection_get_sasl_error(InfXmppConnection* xmpp); G_END_DECLS #endif /* __INF_XMPP_CONNECTION_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/common/inf-buffer.c0000644000175000017500000001031212264763732016772 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ /** * SECTION:inf-buffer * @title: InfBuffer * @short_description: Abstract document interface * @include: libinfinity/common/inf-buffer.h * * #InfBuffer represents a document containing a session's content. It does * not cope with keeping its content in-sync with other participants but just * offers an interface to modify the document. * * The #InfBuffer interface itself is probably not too useful, but actual * documents implementing functionality (such as text editing or graphics * editing) need to implement this interface to be passed to #InfSession. **/ #include static void inf_buffer_base_init(gpointer g_class) { static gboolean initialized = FALSE; if(!initialized) { g_object_interface_install_property( g_class, g_param_spec_boolean( "modified", "Modified", "Whether the buffer was modified since it has been saved", FALSE, G_PARAM_READWRITE ) ); initialized = TRUE; } } GType inf_buffer_get_type(void) { static GType buffer_type = 0; if(!buffer_type) { static const GTypeInfo buffer_info = { sizeof(InfBufferIface), /* class_size */ inf_buffer_base_init, /* base_init */ NULL, /* base_finalize */ NULL, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ 0, /* instance_size */ 0, /* n_preallocs */ NULL, /* instance_init */ NULL /* value_table */ }; buffer_type = g_type_register_static( G_TYPE_INTERFACE, "InfBuffer", &buffer_info, 0 ); g_type_interface_add_prerequisite(buffer_type, G_TYPE_OBJECT); } return buffer_type; } /** * inf_buffer_get_modified: * @buffer: A #InfBuffer. * * Indicates whether the buffer has been modified since the last call to * inf_buffer_set_modified() set the modification flag to %FALSE. * * Returns: Whether the buffer has been modified. */ gboolean inf_buffer_get_modified(InfBuffer* buffer) { InfBufferIface* iface; gboolean modified; g_return_val_if_fail(INF_IS_BUFFER(buffer), FALSE); iface = INF_BUFFER_GET_IFACE(buffer); if(iface->get_modified != NULL) { return iface->get_modified(buffer); } else { g_object_get(G_OBJECT(buffer), "modified", &modified, NULL); return modified; } } /** * inf_buffer_set_modified: * @buffer: A #InfBuffer. * @modified: Whether the buffer is considered modified or not. * * Sets the modification flag of @buffer to @modified. You should normally set * the flag to %FALSE every time the document is saved onto disk. The buffer * itself will set it to %TRUE when it has been changed. * * To get notified when the modification flag changes, connect to * GObject::notify for the InfBuffer:modified property. */ void inf_buffer_set_modified(InfBuffer* buffer, gboolean modified) { InfBufferIface* iface; g_return_if_fail(INF_IS_BUFFER(buffer)); iface = INF_BUFFER_GET_IFACE(buffer); if(iface->set_modified != NULL) { iface->set_modified(buffer, modified); } else { g_object_set(G_OBJECT(buffer), "modified", modified, NULL); } } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/common/inf-chat-session.h0000644000175000017500000000736212264763732020141 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef __INF_CHAT_SESSION_H__ #define __INF_CHAT_SESSION_H__ #include #include #include #include G_BEGIN_DECLS #define INF_TYPE_CHAT_SESSION (inf_chat_session_get_type()) #define INF_CHAT_SESSION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INF_TYPE_CHAT_SESSION, InfChatSession)) #define INF_CHAT_SESSION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INF_TYPE_CHAT_SESSION, InfChatSessionClass)) #define INF_IS_CHAT_SESSION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INF_TYPE_CHAT_SESSION)) #define INF_IS_CHAT_SESSION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INF_TYPE_CHAT_SESSION)) #define INF_CHAT_SESSION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), INF_TYPE_CHAT_SESSION, InfChatSessionClass)) typedef struct _InfChatSession InfChatSession; typedef struct _InfChatSessionClass InfChatSessionClass; /** * InfChatSessionError: * @INF_CHAT_SESSION_ERROR_TYPE_INVALID: An invalid message type was sent. * @INF_CHAT_SESSION_ERROR_NO_SUCH_USER: A message referred to a nonexisting * user. * @INF_CHAT_SESSION_ERROR_FAILED: Generic error code when no further reason * of failure is known. * * Errors that can occur with a chat session, especially in the * process_xml_sync and process_xml_run vfunc implementations. */ typedef enum _InfChatSessionError { INF_CHAT_SESSION_ERROR_TYPE_INVALID, INF_CHAT_SESSION_ERROR_NO_SUCH_USER, INF_CHAT_SESSION_ERROR_FAILED } InfChatSessionError; /** * InfChatSessionClass: * @receive_message: Default signal handler for the * #InfChatSession::receive-message signal. * @send_message: Default signal handler for the * #InfChatSession::send-message signal. * * This structure contains default signal handlers for #InfChatSession. */ struct _InfChatSessionClass { /*< private >*/ InfSessionClass parent_class; /*< public >*/ void (*receive_message)(InfChatSession* session, const InfChatBufferMessage* message); void (*send_message)(InfChatSession* session, const InfChatBufferMessage* message); }; /** * InfChatSession: * * #InfChatSession is an opaque data type. You should only access it via the * public API functions. */ struct _InfChatSession { /*< private >*/ InfSession parent; }; GType inf_chat_session_get_type(void) G_GNUC_CONST; InfChatSession* inf_chat_session_new(InfCommunicationManager* manager, guint backlog_size, InfSessionStatus status, InfCommunicationGroup* sync_group, InfXmlConnection* sync_connection); gboolean inf_chat_session_set_log_file(InfChatSession* session, const gchar* log_file, GError** error); G_END_DECLS #endif /* __INF_CHAT_SESSION_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/common/inf-error.h0000644000175000017500000002210412264763732016661 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_ERROR_H__ #define __INF_ERROR_H__ #include G_BEGIN_DECLS /* These are error codes do not occur directly in common/, but that * may be reported and/or need to be understood by both client and server. */ /** * InfRequestError: * @INF_REQUEST_ERROR_UNKNOWN_DOMAIN: The server sent <request-failed/> * with an unknown error domain. * @INF_REQUEST_ERROR_REPLY_UNPROCESSED: An error occured while processing the * server reply for a request. * @INF_REQUEST_ERROR_INVALID_SEQ: The server sent an invalid sequence number * in a reply to a request. * @INF_REQUEST_ERROR_NO_SUCH_ATTRIBUTE: A request did not contain a XML * attribute that is required to complete the request. * @INF_REQUEST_ERROR_INVALID_NUMBER: A number in a request was invalid. * Either it was not numerical, or it produced an underflow or an overflow. * @INF_REQUEST_ERROR_FAILED: Generic error code when no further reason of * failure is known. * * These are general request errors that all #InfcRequests can * fail with. Specific requests may also fail with more errors, such as * #InfDirectoryError. */ typedef enum _InfRequestError { INF_REQUEST_ERROR_UNKNOWN_DOMAIN, INF_REQUEST_ERROR_REPLY_UNPROCESSED, INF_REQUEST_ERROR_INVALID_SEQ, INF_REQUEST_ERROR_NO_SUCH_ATTRIBUTE, INF_REQUEST_ERROR_INVALID_NUMBER, INF_REQUEST_ERROR_FAILED } InfRequestError; /** * InfUserError: * @INF_USER_ERROR_NAME_IN_USE: The requested name is already in use by * another user. * @INF_USER_ERROR_ID_PROVIDED: The client provided a user ID field in a * user join request, but it's the server's job to find an ID. * @INF_USER_ERROR_NO_SUCH_USER: A request referred to a user ID that no user * is associated with. * @INF_USER_ERROR_STATUS_UNAVAILABLE: The initial user status was given as * unavailable during user join or rejoin. * @INF_USER_ERROR_NOT_JOINED: The user did not join from the connection the * request comes from. For example, a user status change can only be requested * from the same connection that joined the user. * @INF_USER_ERROR_INVALID_STATUS: An invalid status was used in a XML * request. Allowed status values are "unavailable", "inactive" or "active". * @INF_USER_ERROR_FAILED: Generic error code when no further reason of * failure is known. * * These are errors related to users. They may occur during user join or * during processing a user-related message, such as a user status change * message in an #InfSession. */ typedef enum _InfUserError { INF_USER_ERROR_NAME_IN_USE, INF_USER_ERROR_ID_PROVIDED, INF_USER_ERROR_NO_SUCH_USER, INF_USER_ERROR_STATUS_UNAVAILABLE, INF_USER_ERROR_NOT_JOINED, INF_USER_ERROR_INVALID_STATUS, INF_USER_ERROR_FAILED } InfUserError; /** * InfDirectoryError: * @INF_DIRECTORY_ERROR_NO_WELCOME_MESSAGE: A client did not receive the * directory's initial welcome message. * @INF_DIRECTORY_ERROR_VERSION_MISMATCH: The server and client use * different versions of the protocol. * @INF_DIRECTORY_ERROR_NODE_EXISTS: A node with the given name exists * already in that subdirectory (in response to node creation requests). * @INF_DIRECTORY_ERROR_INVALID_NAME: A node with an invalid name was * attempted to be created. * @INF_DIRECTORY_ERROR_NO_SUCH_NODE: The node refered to in a request does * not exist in the directory (anymore). * @INF_DIRECTORY_ERROR_NO_SUCH_SUBSCRIPTION_REQUEST: A <subscribe-ack> * or <subscribe-nack> has been received without a previous request. * @INF_DIRECTORY_ERROR_CHAT_DISABLED: A client attempted to subscribe to a * server's chat, but the chat is disabled on the server side. * @INF_DIRECTORY_ERROR_NOT_A_SUBDIRECTORY: The node refered to in a request * is not a subdirectory node, but the requested operation requires one. * @INF_DIRECTORY_ERROR_NOT_A_NOTE: The node refered to in a request is not * a note (non-subdirectory) node, but the requested operations requires one. * @INF_DIRECTORY_ERROR_ROOT_NODE_REMOVE_ATTEMPT: A <remove-node> * request attempted to remove a directory's root node, which is not allowed. * @INF_DIRECTORY_ERROR_ALREADY_EXPLORED: The node given in an exploration * request has already been explored earlier. * @INF_DIRECTORY_ERROR_TOO_MUCH_CHILDREN: Exploration yields more children * than announced at the beginning of the exploration. * @INF_DIRECTORY_ERROR_TOO_FEW_CHILDREN: Exploration yields less children * than announced at the beginning of the exploration. * @INF_DIRECTORY_ERROR_TYPE_UNKNOWN: The type of a note is not known. * @INF_DIRECTORY_ERROR_ALREADY_SUBSCRIBED: The connection already subscribed * to the node refered to, but the requested operation requires it to be * unsubscribed. * @INF_DIRECTORY_ERROR_UNSUBSCRIBED: The connection is not subscribed to the * node refered to, but the requested operation requires it to be subscribed. * @INF_DIRECTORY_ERROR_NETWORK_UNSUPPORTED: The server does not support the * network of the incoming connection for the requested operation. For * example, subscribing to a session might require a network that has a * peer-to-peer communication method, but there is no implementation of that * method for the connection's network. * @INF_DIRECTORY_ERROR_METHOD_UNSUPPORTED: The server requested a * communaction method for subscription or synchronization that is not * supported by the client. * @INF_DIRECTORY_ERROR_UNEXPECTED_SYNC_IN: A client received a * <sync-in/> without having requested one. The client has no data to * sync to the server. * @INF_DIRECTORY_ERROR_UNEXPECTED_MESSAGE: A message that is not understood * was received. * @INF_DIRECTORY_ERROR_NO_STORAGE: A node cannot be stored permanently on the * server since it has no storage backend attached. * @INF_DIRECTORY_ERROR_FAILED: Generic error code when no further reason of * failure is known. * * These are errors related to the directory of documents. These errors can * be reason why requests created by #InfcBrowser fail. */ typedef enum _InfDirectoryError { INF_DIRECTORY_ERROR_NO_WELCOME_MESSAGE, INF_DIRECTORY_ERROR_VERSION_MISMATCH, INF_DIRECTORY_ERROR_NODE_EXISTS, INF_DIRECTORY_ERROR_INVALID_NAME, INF_DIRECTORY_ERROR_NO_SUCH_NODE, INF_DIRECTORY_ERROR_NO_SUCH_SUBSCRIPTION_REQUEST, INF_DIRECTORY_ERROR_CHAT_DISABLED, INF_DIRECTORY_ERROR_NOT_A_SUBDIRECTORY, INF_DIRECTORY_ERROR_NOT_A_NOTE, INF_DIRECTORY_ERROR_ROOT_NODE_REMOVE_ATTEMPT, INF_DIRECTORY_ERROR_ALREADY_EXPLORED, INF_DIRECTORY_ERROR_TOO_MUCH_CHILDREN, INF_DIRECTORY_ERROR_TOO_FEW_CHILDREN, INF_DIRECTORY_ERROR_TYPE_UNKNOWN, INF_DIRECTORY_ERROR_ALREADY_SUBSCRIBED, INF_DIRECTORY_ERROR_UNSUBSCRIBED, INF_DIRECTORY_ERROR_NETWORK_UNSUPPORTED, INF_DIRECTORY_ERROR_METHOD_UNSUPPORTED, INF_DIRECTORY_ERROR_UNEXPECTED_SYNC_IN, INF_DIRECTORY_ERROR_UNEXPECTED_MESSAGE, INF_DIRECTORY_ERROR_NO_STORAGE, INF_DIRECTORY_ERROR_FAILED } InfDirectoryError; /** * InfAuthenticationDetailError: * @INF_AUTHENTICATION_DETAIL_ERROR_AUTHENTICATION_FAILED: User did not provide * valid credentials. * @INF_AUTHENTICATION_DETAIL_ERROR_USER_NOT_AUTHORIZED: User is not permitted * to connect to this server. * @INF_AUTHENTICATION_DETAIL_ERROR_TRY_AGAIN: Authentication was temporarily * interrupted on the server side. * @INF_AUTHENTICATION_DETAIL_ERROR_SERVER_ERROR: An error occured while * checking user permissions. */ typedef enum _InfAuthenticationDetailError { INF_AUTHENTICATION_DETAIL_ERROR_AUTHENTICATION_FAILED, INF_AUTHENTICATION_DETAIL_ERROR_USER_NOT_AUTHORIZED, INF_AUTHENTICATION_DETAIL_ERROR_TRY_AGAIN, INF_AUTHENTICATION_DETAIL_ERROR_SERVER_ERROR } InfAuthenticationDetailError; GQuark inf_request_error_quark(void); const gchar* inf_request_strerror(InfRequestError code); GQuark inf_user_error_quark(void); const gchar* inf_user_strerror(InfUserError code); GQuark inf_directory_error_quark(void); const gchar* inf_directory_strerror(InfDirectoryError code); const gchar* inf_authentication_detail_strerror(InfAuthenticationDetailError code); GQuark inf_authentication_detail_error_quark(void); GQuark inf_gnutls_error_quark(void); void inf_gnutls_set_error(GError** error, int error_code); GQuark inf_gsasl_error_quark(void); void inf_gsasl_set_error(GError** error, int error_code); G_END_DECLS #endif /* __INF_ERROR_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/common/inf-xmpp-manager.c0000644000175000017500000004156612264763732020134 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include #include #include /** * SECTION:inf-xmpp-manager * @title: InfXmppManager * @short_description: Reuse existing connections * @include: libinfinity/common/inf-xmpp-manager.h * @stability: Unstable * * #InfXmppManager stores #InfXmppConnection objects and allows to look them * up by the IP address and port number of their underlaying * #InfTcpConnections. This can be used to reuse existing network * connections instead of creating new ones. * * Each object which needs to make connections should be passed a * #InfXmppManager. Then, when making a connection to a certain address/port * pair, it should first look in the XMPP manager whether there is already * an existing connection to the destination host, via * inf_xmpp_manager_lookup_connection_by_address(). If there is, it should * use it (maybe reopen it if it is closed). Otherwise, it should create a * new connection and it to the XMPP manager via * inf_xmpp_manager_add_connection() for others to use. */ typedef struct _InfXmppManagerKey InfXmppManagerKey; struct _InfXmppManagerKey { InfIpAddress* address; /* owned by connection */ guint port; }; typedef struct _InfXmppManagerKeyChangedForeachFuncData InfXmppManagerKeyChangedForeachFuncData; struct _InfXmppManagerKeyChangedForeachFuncData { InfTcpConnection* connection; InfXmppConnection* xmpp; const InfXmppManagerKey* key; }; typedef struct _InfXmppManagerPrivate InfXmppManagerPrivate; struct _InfXmppManagerPrivate { GTree* connections; }; enum { ADD_CONNECTION, REMOVE_CONNECTION, LAST_SIGNAL }; #define INF_XMPP_MANAGER_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), INF_TYPE_XMPP_MANAGER, InfXmppManagerPrivate)) static GObjectClass* parent_class; static guint xmpp_manager_signals[LAST_SIGNAL]; static InfXmppManagerKey* inf_xmpp_manager_key_new(InfXmppConnection* connection) { InfXmppManagerKey* key; InfTcpConnection* tcp; g_object_get(G_OBJECT(connection), "tcp-connection", &tcp, NULL); g_assert(tcp != NULL); key = g_slice_new(InfXmppManagerKey); key->address = inf_ip_address_copy(inf_tcp_connection_get_remote_address(tcp)); key->port = inf_tcp_connection_get_remote_port(tcp); g_object_unref(tcp); return key; } static void inf_xmpp_manager_key_free(gpointer key) { inf_ip_address_free( ((InfXmppManagerKey*)key)->address); g_slice_free(InfXmppManagerKey, key); } static int inf_xmpp_manager_key_cmp(gconstpointer first, gconstpointer second, G_GNUC_UNUSED gpointer data) { const InfXmppManagerKey* first_key; const InfXmppManagerKey* second_key; first_key = (const InfXmppManagerKey*)first; second_key = (const InfXmppManagerKey*)second; if(first_key->port < second_key->port) return -1; else if(first_key->port > second_key->port) return 1; else return inf_ip_address_collate(first_key->address, second_key->address); } static gboolean inf_xmpp_manager_key_changed_foreach_func(gpointer key, gpointer value, gpointer data) { InfXmppManagerKeyChangedForeachFuncData* func_data; InfTcpConnection* tcp; func_data = (InfXmppManagerKeyChangedForeachFuncData*)data; g_object_get(G_OBJECT(value), "tcp-connection", &tcp, NULL); if(func_data->connection == tcp) { g_assert(func_data->xmpp == NULL && func_data->key == NULL); func_data->xmpp = INF_XMPP_CONNECTION(value); func_data->key = key; g_object_unref(tcp); return TRUE; } g_object_unref(tcp); return FALSE; } static void inf_xmpp_manager_key_changed(InfXmppManager* manager, InfTcpConnection* connection) { InfXmppManagerPrivate* priv; InfXmppManagerKeyChangedForeachFuncData data; InfXmppConnection* xmpp; InfXmppManagerKey key; InfXmppManagerKey* new_key; priv = INF_XMPP_MANAGER_PRIVATE(manager); data.connection = connection; data.xmpp = NULL; data.key = NULL; g_tree_foreach( priv->connections, inf_xmpp_manager_key_changed_foreach_func, &data ); g_assert(data.xmpp != NULL); key.address = inf_tcp_connection_get_remote_address(connection); key.port = inf_tcp_connection_get_remote_port(connection); xmpp = g_tree_lookup(priv->connections, &key); if(xmpp != data.xmpp) { /* Remove old, now invalid entry */ g_tree_remove(priv->connections, data.key); if(xmpp != NULL) { /* Changed address causes conflict, so remove the * conflicting connection (data.xmpp). */ /* Make room for the old connection, so that when emitting the signal * the default signal handler removes the correct connection. */ g_object_ref(xmpp); g_tree_remove(priv->connections, &key); /* Insert the conflicting connection at the point of the previous one */ new_key = inf_xmpp_manager_key_new(data.xmpp); g_tree_insert(priv->connections, new_key, data.xmpp); /* Now remove it again, emitting a corresponding signal */ inf_xmpp_manager_remove_connection(manager, data.xmpp); /* Finally readd the previous connection. */ /* TODO: Handle the case when a signal handler did so already. */ new_key = inf_xmpp_manager_key_new(xmpp); g_tree_insert(priv->connections, new_key, xmpp); g_object_unref(xmpp); } else { /* Readd the connection to the tree with the new key */ new_key = inf_xmpp_manager_key_new(data.xmpp); g_tree_insert(priv->connections, new_key, data.xmpp); } } } static void inf_xmpp_manager_notify_remote_address_cb(GObject* object, GParamSpec* pspec, gpointer user_data) { inf_xmpp_manager_key_changed( INF_XMPP_MANAGER(user_data), INF_TCP_CONNECTION(object) ); } static void inf_xmpp_manager_notify_remote_port_cb(GObject* object, GParamSpec* pspec, gpointer user_data) { inf_xmpp_manager_key_changed( INF_XMPP_MANAGER(user_data), INF_TCP_CONNECTION(object) ); } static gboolean inf_xmpp_manager_dispose_destroy_func(gpointer key, gpointer value, gpointer data) { InfXmppManager* manager; InfXmppConnection* connection; InfTcpConnection* tcp; manager = INF_XMPP_MANAGER(data); connection = INF_XMPP_CONNECTION(value); g_object_get(G_OBJECT(connection), "tcp-connection", &tcp, NULL); g_assert(tcp != NULL); inf_signal_handlers_disconnect_by_func( tcp, G_CALLBACK(inf_xmpp_manager_notify_remote_address_cb), manager ); inf_signal_handlers_disconnect_by_func( tcp, G_CALLBACK(inf_xmpp_manager_notify_remote_port_cb), manager ); g_object_unref(tcp); g_object_unref(connection); return FALSE; } static void inf_xmpp_manager_init(GTypeInstance* instance, gpointer g_class) { InfXmppManager* manager; InfXmppManagerPrivate* priv; manager = INF_XMPP_MANAGER(instance); priv = INF_XMPP_MANAGER_PRIVATE(manager); /* destroy_funcs cannot have data associated, but we need the * manager to remove the signal connection. */ priv->connections = g_tree_new_full( inf_xmpp_manager_key_cmp, NULL, inf_xmpp_manager_key_free, NULL ); } static void inf_xmpp_manager_dispose(GObject* object) { InfXmppManager* manager; InfXmppManagerPrivate* priv; manager = INF_XMPP_MANAGER(object); priv = INF_XMPP_MANAGER_PRIVATE(object); g_tree_foreach( priv->connections, inf_xmpp_manager_dispose_destroy_func, manager ); g_tree_destroy(priv->connections); priv->connections = NULL; G_OBJECT_CLASS(parent_class)->dispose(object); } static void inf_xmpp_manager_add_connection_handler(InfXmppManager* xmpp_manager, InfXmppConnection* connection) { InfXmppManagerPrivate* priv; InfXmppManagerKey* key; InfTcpConnection* tcp; priv = INF_XMPP_MANAGER_PRIVATE(xmpp_manager); g_object_get(G_OBJECT(connection), "tcp-connection", &tcp, NULL); g_assert(tcp != NULL); g_signal_connect( tcp, "notify::remote-address", G_CALLBACK(inf_xmpp_manager_notify_remote_address_cb), xmpp_manager ); g_signal_connect( tcp, "notify::remote-port", G_CALLBACK(inf_xmpp_manager_notify_remote_port_cb), xmpp_manager ); key = inf_xmpp_manager_key_new(connection); g_tree_insert(priv->connections, key, connection); g_object_ref(connection); g_object_unref(tcp); } static void inf_xmpp_manager_remove_connection_handler(InfXmppManager* xmpp_manager, InfXmppConnection* connection) { InfXmppManagerPrivate* priv; InfTcpConnection* tcp; InfXmppManagerKey key; priv = INF_XMPP_MANAGER_PRIVATE(xmpp_manager); g_object_get(G_OBJECT(connection), "tcp-connection", &tcp, NULL); g_assert(tcp != NULL); inf_signal_handlers_disconnect_by_func( tcp, G_CALLBACK(inf_xmpp_manager_notify_remote_address_cb), xmpp_manager ); inf_signal_handlers_disconnect_by_func( tcp, G_CALLBACK(inf_xmpp_manager_notify_remote_port_cb), xmpp_manager ); key.address = inf_tcp_connection_get_remote_address(tcp); key.port = inf_tcp_connection_get_remote_port(tcp); g_tree_remove(priv->connections, &key); g_object_unref(tcp); g_object_unref(connection); } static void inf_xmpp_manager_class_init(gpointer g_class, gpointer class_data) { GObjectClass* object_class; InfXmppManagerClass* xmpp_manager_class; object_class = G_OBJECT_CLASS(g_class); xmpp_manager_class = INF_XMPP_MANAGER_CLASS(g_class); parent_class = G_OBJECT_CLASS(g_type_class_peek_parent(g_class)); g_type_class_add_private(g_class, sizeof(InfXmppManagerPrivate)); object_class->dispose = inf_xmpp_manager_dispose; xmpp_manager_class->add_connection = inf_xmpp_manager_add_connection_handler; xmpp_manager_class->remove_connection = inf_xmpp_manager_remove_connection_handler; /** * InfXmppManager::add-connection: * @xmpp_manager: The #InfXmppManager emitting the signal. * @connection: The #InfXmppConnection that was added to @xmpp_manager. * * This signal is emitted whenever a new connection has been added to the * #InfXmppManager, via inf_xmpp_manager_add_connection(). */ xmpp_manager_signals[ADD_CONNECTION] = g_signal_new( "add-connection", G_OBJECT_CLASS_TYPE(object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(InfXmppManagerClass, add_connection), NULL, NULL, inf_marshal_VOID__OBJECT, G_TYPE_NONE, 1, INF_TYPE_XMPP_CONNECTION ); /** * InfXmppManager::remove-connection: * @xmpp_manager: The #InfXmppManager emitting the signal. * @connection: The #InfXmppConnection that was removed from @xmpp_manager. * * This signal is emitted whenever a connection has been removed from the * #InfXmppManager, via inf_xmpp_manager_remove_connection(). */ xmpp_manager_signals[REMOVE_CONNECTION] = g_signal_new( "remove-connection", G_OBJECT_CLASS_TYPE(object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(InfXmppManagerClass, remove_connection), NULL, NULL, inf_marshal_VOID__OBJECT, G_TYPE_NONE, 1, INF_TYPE_XMPP_CONNECTION ); } GType inf_xmpp_manager_get_type(void) { static GType xmpp_manager_type = 0; if(!xmpp_manager_type) { static const GTypeInfo xmpp_manager_type_info = { sizeof(InfXmppManagerClass), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ inf_xmpp_manager_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InfXmppManager), /* instance_size */ 0, /* n_preallocs */ inf_xmpp_manager_init, /* instance_init */ NULL /* value_table */ }; xmpp_manager_type = g_type_register_static( G_TYPE_OBJECT, "InfXmppManager", &xmpp_manager_type_info, 0 ); } return xmpp_manager_type; } /** * inf_xmpp_manager_new: * * Creates a new xmpp manager. * * Returns: A new #InfXmppManager. **/ InfXmppManager* inf_xmpp_manager_new(void) { GObject* object; object = g_object_new(INF_TYPE_XMPP_MANAGER, NULL); return INF_XMPP_MANAGER(object); } /** * inf_xmpp_manager_lookup_connection_by_address: * @manager: A #InfXmppManager. * @address: The remote #InfIpAddress of the connection to look for. * @port: The remote port number of the connection to look for. * * Looks for a #InfXmppConnection contained in @manager whose underlaying * #InfTcpConnection has the given address and port set. Returns %NULL if * there is no such connection. * * This function may also return a closed connection. You can then attempt to * reopen it, or remove it from the manager using * inf_xmpp_manager_remove_connection() when that fails. * * Returns: A #InfXmppConnection with the given address and port, or %NULL on * error. **/ InfXmppConnection* inf_xmpp_manager_lookup_connection_by_address(InfXmppManager* manager, InfIpAddress* address, guint port) { InfXmppManagerPrivate* priv; InfXmppManagerKey key; g_return_val_if_fail(INF_IS_XMPP_MANAGER(manager), NULL); g_return_val_if_fail(address != NULL, NULL); priv = INF_XMPP_MANAGER_PRIVATE(manager); key.address = address; key.port = port; return INF_XMPP_CONNECTION(g_tree_lookup(priv->connections, &key)); } /** * inf_xmpp_manager_contains_connection: * @manager: A #InfXmppManager. * @connection: A #InfXmppConnection. * * Returns whether @connection is contained in @manager. * * Returns: %TRUE if @connection is contained in @manager, %FALSE * otherwise. */ gboolean inf_xmpp_manager_contains_connection(InfXmppManager* manager, InfXmppConnection* connection) { InfXmppManagerPrivate* priv; InfTcpConnection* tcp; InfXmppManagerKey key; g_return_val_if_fail(INF_IS_XMPP_MANAGER(manager), FALSE); g_return_val_if_fail(INF_IS_XMPP_CONNECTION(connection), FALSE); priv = INF_XMPP_MANAGER_PRIVATE(manager); g_object_get(G_OBJECT(connection), "tcp-connection", &tcp, NULL); g_assert(tcp != NULL); key.address = inf_tcp_connection_get_remote_address(tcp); key.port = inf_tcp_connection_get_remote_port(tcp); g_object_unref(G_OBJECT(tcp)); return INF_XMPP_CONNECTION(g_tree_lookup(priv->connections, &key)) != NULL; } /** * inf_xmpp_manager_add_connection: * @manager: A #InfXmppManager. * @connection: A #InfXmppConnection not yet contained in @manager. * * Adds the given connection to @manager so that it is found by * inf_xmpp_manager_lookup_connection_by_address() and * inf_xmpp_manager_contains_connection(). */ void inf_xmpp_manager_add_connection(InfXmppManager* manager, InfXmppConnection* connection) { g_return_if_fail(INF_IS_XMPP_MANAGER(manager)); g_return_if_fail(INF_IS_XMPP_CONNECTION(connection)); g_return_if_fail( inf_xmpp_manager_contains_connection(manager, connection) == FALSE ); g_signal_emit( G_OBJECT(manager), xmpp_manager_signals[ADD_CONNECTION], 0, connection ); } /** * inf_xmpp_manager_remove_connection: * @manager: A #InfXmppManager. * @connection: A #InfXmppConnection contained in @manager. * * Removes the given connection from @manager. */ void inf_xmpp_manager_remove_connection(InfXmppManager* manager, InfXmppConnection* connection) { g_return_if_fail(INF_IS_XMPP_MANAGER(manager)); g_return_if_fail(INF_IS_XMPP_CONNECTION(connection)); g_return_if_fail( inf_xmpp_manager_contains_connection(manager, connection) == TRUE ); g_signal_emit( G_OBJECT(manager), xmpp_manager_signals[REMOVE_CONNECTION], 0, connection ); } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/common/inf-ip-address.c0000644000175000017500000002361712264763732017570 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ /** * SECTION:inf-ip-address * @title: InfIpAddress * @short_description: IPv4 and IPv6 addresses * @see_also: #InfTcpConnection * @include: libinfinity/common/inf-ip-address.h * @stability: Unstable * * A #InfIpAddress represents an IPv4 or an IPv6 network address. Use * inf_ip_address_get_family() to find out the type of a specific address. **/ #include #ifdef G_OS_WIN32 # include # include #else # include # include # include # include # include #endif #include struct _InfIpAddress { InfIpAddressFamily family; union { struct in_addr addr4; struct in6_addr addr6; } shared; }; static InfIpAddress* inf_ip_address_new_common(InfIpAddressFamily family) { InfIpAddress* address; address = g_slice_new(InfIpAddress); address->family = family; return address; } GType inf_ip_address_family_get_type(void) { static GType ip_address_family_type = 0; if(!ip_address_family_type) { static const GEnumValue ip_address_family_values[] = { { INF_IP_ADDRESS_IPV4, "INF_IP_ADDRESS_IPV4", "IPv4" }, { INF_IP_ADDRESS_IPV6, "INF_IP_ADDRESS_IPV6", "IPv6" }, { 0, NULL, NULL } }; ip_address_family_type = g_enum_register_static( "InfIpAddressFamily", ip_address_family_values ); } return ip_address_family_type; } GType inf_ip_address_get_type(void) { static GType ip_address_type = 0; if(!ip_address_type) { ip_address_type = g_boxed_type_register_static( "InfIpAddress", (GBoxedCopyFunc)inf_ip_address_copy, (GBoxedFreeFunc)inf_ip_address_free ); } return ip_address_type; } /** * inf_ip_address_new_raw4: * @address: An IPv4 address in network byte order. * * Creates a new IPv4 address. * * Return Value: A new #InfIpAddress. **/ InfIpAddress* inf_ip_address_new_raw4(guint32 address) { InfIpAddress* addr; addr = inf_ip_address_new_common(INF_IP_ADDRESS_IPV4); addr->shared.addr4.s_addr = address; return addr; } /** * inf_ip_address_new_loopback4: * * Creates a new IPv4 address that contains the local host's IP address * ("127.0.0.1"). * * Return Value: A new #InfIpAddress. **/ InfIpAddress* inf_ip_address_new_loopback4(void) { return inf_ip_address_new_raw4(htonl(INADDR_LOOPBACK)); } /** * inf_ip_address_new_raw6: * @address: An IPv6 address in network bype order. * * Creates a new IPv6 address. * * Return Value: A new #InfIpAddress. **/ InfIpAddress* inf_ip_address_new_raw6(const guint8 address[16]) { InfIpAddress* addr; addr = inf_ip_address_new_common(INF_IP_ADDRESS_IPV6); memcpy(addr->shared.addr6.s6_addr, address, 16); return addr; } /** * inf_ip_address_new_loopback6: * * Creates a new IPv6 address that contains the local host's IP address * ("::1"). * * Return Value: A new #InfIpAddress. **/ InfIpAddress* inf_ip_address_new_loopback6(void) { return inf_ip_address_new_raw6(in6addr_loopback.s6_addr); } /** * inf_ip_address_new_from_string: * @str: A string containing an IPv4 or IPv6 address in standard dots * notation. * * Creates a new IP address (either IPv4 or IPv6) from the given string. * * Return Value: A new #InfIpAddress, or %NULL. **/ InfIpAddress* inf_ip_address_new_from_string(const gchar* str) { InfIpAddress* addr; #ifdef G_OS_WIN32 /* inet_pton only exists since Windows Vista, so we use * WSAStringToAddress */ union { struct sockaddr_in addr4; struct sockaddr_in6 addr6; } shared; int len; int ret; #endif addr = g_slice_new(InfIpAddress); #ifdef G_OS_WIN32 len = sizeof(struct sockaddr_in); ret = WSAStringToAddress( (char*)str, AF_INET, NULL, (struct sockaddr*)&shared.addr4, &len ); if(ret == 0) { addr->family = INF_IP_ADDRESS_IPV4; addr->shared.addr4.s_addr = shared.addr4.sin_addr.s_addr; } else { len = sizeof(struct sockaddr_in6); ret = WSAStringToAddress( (char*)str, AF_INET6, NULL, (struct sockaddr*)&shared.addr6, &len ); if(ret == 0) { addr->family = INF_IP_ADDRESS_IPV6; memcpy(addr->shared.addr6.s6_addr, shared.addr6.sin6_addr.s6_addr, 16); } else { g_slice_free(InfIpAddress, addr); addr = NULL; } } #else if(inet_pton(AF_INET, str, &addr->shared.addr4) > 0) { addr->family = INF_IP_ADDRESS_IPV4; } else if(inet_pton(AF_INET6, str, &addr->shared.addr6) > 0) { addr->family = INF_IP_ADDRESS_IPV6; } else { g_slice_free(InfIpAddress, addr); addr = NULL; } #endif return addr; } /** * inf_ip_address_copy: * @address: A #InfIpAddress. * * Creates a new #InfIpAddress that contains the same address as @address. * * Return Value: A new #InfIpAddress. **/ InfIpAddress* inf_ip_address_copy(const InfIpAddress* address) { switch(address->family) { case INF_IP_ADDRESS_IPV4: return inf_ip_address_new_raw4(address->shared.addr4.s_addr); case INF_IP_ADDRESS_IPV6: return inf_ip_address_new_raw6(address->shared.addr6.s6_addr); default: g_assert_not_reached(); return NULL; } } /** * inf_ip_address_free: * @address: A #InfIpAddress. * * Frees @address. **/ void inf_ip_address_free(InfIpAddress* address) { g_slice_free(InfIpAddress, address); } /** * inf_ip_address_get_family: * @address: A #InfIpAddress. * * Returns the address family of @address. * * Return Value: A #InfIpAddressFamily. **/ InfIpAddressFamily inf_ip_address_get_family(const InfIpAddress* address) { return address->family; } /** * inf_ip_address_get_raw: * @address: A #InfIpAddress. * * Returns either 32 bit (IPv4) or 128 bit (IPv6) raw address data in host * byte order of @address. * * Return Value: The raw address. **/ gconstpointer inf_ip_address_get_raw(const InfIpAddress* address) { switch(address->family) { case INF_IP_ADDRESS_IPV4: return &address->shared.addr4; case INF_IP_ADDRESS_IPV6: return address->shared.addr6.s6_addr; default: g_assert_not_reached(); return NULL; } } /** * inf_ip_address_to_string: * @address: A #InfIpAddress. * * Returns a string representation of @address in standard dots format (like * "192.168.0.1" or "::1"). * * Return Value: A newly-allocated string. Free with g_free(). **/ gchar* inf_ip_address_to_string(const InfIpAddress* address) { gchar* retval; #ifdef G_OS_WIN32 /* inet_ntop only exists since Windows Vista, so we use * WSAAddressToString */ union { struct sockaddr_in addr4; struct sockaddr_in6 addr6; } shared; struct sockaddr* inaddr; char dummy; DWORD addr_len; DWORD str_len; int res; #endif #ifdef G_OS_WIN32 switch(address->family) { case INF_IP_ADDRESS_IPV4: shared.addr4.sin_family = AF_INET; shared.addr4.sin_addr.s_addr = address->shared.addr4.s_addr; shared.addr4.sin_port = htons(0); inaddr = (struct sockaddr*)&shared.addr4; addr_len = sizeof(struct sockaddr_in); break; case INF_IP_ADDRESS_IPV6: shared.addr6.sin6_family = AF_INET6; memcpy(shared.addr6.sin6_addr.s6_addr, address->shared.addr6.s6_addr, 16); shared.addr6.sin6_port = htons(0); shared.addr6.sin6_flowinfo = 0; shared.addr6.sin6_scope_id = 0; inaddr = (struct sockaddr*)&shared.addr6; addr_len = sizeof(struct sockaddr_in6); break; default: g_assert_not_reached(); return NULL; } str_len = 0; res = WSAAddressToString(inaddr, addr_len, NULL, &dummy, &str_len); g_assert(res != 0); if(WSAGetLastError() != WSAEFAULT) return NULL; retval = g_malloc(str_len); res = WSAAddressToString(inaddr, addr_len, NULL, retval, &str_len); if(res < 0) { g_free(retval); return NULL; } return retval; #else switch(address->family) { case INF_IP_ADDRESS_IPV4: retval = g_malloc(INET_ADDRSTRLEN); inet_ntop(AF_INET, &address->shared.addr4, retval, INET_ADDRSTRLEN); return retval; case INF_IP_ADDRESS_IPV6: retval = g_malloc(INET6_ADDRSTRLEN); inet_ntop(AF_INET6, &address->shared.addr6, retval, INET6_ADDRSTRLEN); return retval; default: g_assert_not_reached(); return NULL; } #endif } /** * inf_ip_address_collate: * @address1: First address. * @address2: Second address. * * Compares the two addresses for sorting. * * Return Value: -1 if @address1 compares before, 0 if it compares equal or * 1 if it compares after @address. **/ int inf_ip_address_collate(const InfIpAddress* address1, const InfIpAddress* address2) { if(address1->family != address2->family) { /* IPv4 compares before IPv6 */ if(address1->family == INF_IP_ADDRESS_IPV4) return -1; else return 1; } else { if(address1->family == INF_IP_ADDRESS_IPV4) { return memcmp( &address1->shared.addr4, &address2->shared.addr4, sizeof(struct in_addr) ); } else { return memcmp( &address1->shared.addr6, &address2->shared.addr6, sizeof(struct in6_addr) ); } } } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/common/inf-cert-util.c0000644000175000017500000002416312264763732017442 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include #include #define X509_BEGIN_1 "-----BEGIN CERTIFICATE-----" #define X509_BEGIN_2 "-----BEGIN X509 CERTIFICATE-----" #define X509_END_1 "-----END CERTIFICATE-----" #define X509_END_2 "-----END X509 CERTIFICATE----" static gchar* inf_cert_util_format_time(time_t time) { struct tm* tm; gsize alloc; gchar* result; gchar* converted; size_t ret; tm = localtime(&time); alloc = 128; result = NULL; do { result = g_realloc(result, alloc); ret = strftime(result, alloc, "%c", tm); alloc *= 2; } while(ret == 0); converted = g_locale_to_utf8(result, -1, NULL, NULL, NULL); g_free(result); /* The conversion sequence should be always valid, otherwise strftime * is screwed!? */ g_assert(converted != NULL); return converted; } static gchar* inf_cert_util_format_hexadecimal(const guchar* data, gsize size) { gchar* formatted; gchar* cur; gsize i; formatted = g_malloc(3 * size); cur = formatted; for(i = 0; i < size; ++ i) { g_sprintf(cur, "%.2X", (unsigned int)data[i]); cur[2] = ':'; cur += 3; } cur[-1] = '\0'; return formatted; } static void inf_cert_util_free_array(GPtrArray* array, GPtrArray* current, guint current_len) { /* If current is given, then free all entries from current, keeping only * the first current_len entries. If not, free array completely. */ guint i; if(current != NULL) { for(i = current_len; i < current->len; ++ i) gnutls_x509_crt_deinit((gnutls_x509_crt_t)g_ptr_array_index(array, i)); } else { for(i = 0; i < array->len; ++ i) gnutls_x509_crt_deinit((gnutls_x509_crt_t)g_ptr_array_index(array, i)); g_ptr_array_free(array, TRUE); } } gboolean inf_cert_util_save_file(gnutls_x509_crt_t* certs, guint n_certs, const gchar* file, GError** error) { GIOChannel* channel; guint i; gnutls_x509_crt_t cert; int res; size_t size; gchar* buffer; GIOStatus status; channel = g_io_channel_new_file(file, "w", error); if(channel == NULL) return FALSE; status = g_io_channel_set_encoding(channel, NULL, error); if(status != G_IO_STATUS_NORMAL) { g_io_channel_unref(channel); return FALSE; } for(i = 0; i < n_certs; ++ i) { if(i > 0) { status = g_io_channel_write_chars(channel, "\n", 1, NULL, error); if(status != G_IO_STATUS_NORMAL) { g_io_channel_unref(channel); return FALSE; } } cert = (gnutls_x509_crt_t)certs[i]; size = 0; res = gnutls_x509_crt_export(cert, GNUTLS_X509_FMT_PEM, NULL, &size); if(res != GNUTLS_E_SHORT_MEMORY_BUFFER) { g_io_channel_unref(channel); inf_gnutls_set_error(error, res); return FALSE; } buffer = g_malloc(size); res = gnutls_x509_crt_export(cert, GNUTLS_X509_FMT_PEM, buffer, &size); if(res != GNUTLS_E_SUCCESS) { g_free(buffer); g_io_channel_unref(channel); inf_gnutls_set_error(error, res); return FALSE; } status = g_io_channel_write_chars(channel, buffer, size, NULL, error); g_free(buffer); if(status != G_IO_STATUS_NORMAL) { g_io_channel_unref(channel); return FALSE; } } g_io_channel_unref(channel); return TRUE; } GPtrArray* inf_cert_util_load_file(const gchar* filename, GPtrArray* current, GError** error) { gchar* contents; gsize length; GPtrArray* result; guint current_len; gchar* begin; gchar* end; int ret; gnutls_datum_t import_data; gnutls_x509_crt_t crt; if(!g_file_get_contents(filename, &contents, &length, error)) return NULL; if(current == NULL) { result = g_ptr_array_new(); } else { result = current; current_len = current->len; } end = contents; for(;;) { begin = g_strstr_len(end, length - (end - contents), X509_BEGIN_1); if(begin) { end = g_strstr_len(begin, length - (begin - contents), X509_END_1); if(!end) break; end += sizeof(X509_END_1); } else { begin = g_strstr_len(end, length - (end - contents), X509_BEGIN_2); if(!begin) break; end = g_strstr_len(begin, length - (begin - contents), X509_END_2); if(!end) break; end += sizeof(X509_END_2); } import_data.data = (unsigned char*)begin; import_data.size = end - begin; ret = gnutls_x509_crt_init(&crt); if(ret != GNUTLS_E_SUCCESS) { inf_cert_util_free_array(result, current, current_len); inf_gnutls_set_error(error, ret); return NULL; } ret = gnutls_x509_crt_import(crt, &import_data, GNUTLS_X509_FMT_PEM); if(ret != GNUTLS_E_SUCCESS) { gnutls_x509_crt_deinit(crt); inf_cert_util_free_array(result, current, current_len); inf_gnutls_set_error(error, ret); return NULL; } g_ptr_array_add(result, crt); } g_free(contents); return result; } int inf_cert_util_copy(gnutls_x509_crt_t* dest, gnutls_x509_crt_t src) { int ret; size_t der_size; gpointer data; gnutls_datum_t tmp; ret = gnutls_x509_crt_export(src, GNUTLS_X509_FMT_DER, NULL, &der_size); if (ret != GNUTLS_E_SHORT_MEMORY_BUFFER) return ret; data = g_malloc(der_size); ret = gnutls_x509_crt_export(src, GNUTLS_X509_FMT_DER, data, &der_size); if (ret < 0) { g_free(data); return ret; } gnutls_x509_crt_init(dest); tmp.data = data; tmp.size = der_size; ret = gnutls_x509_crt_import(*dest, &tmp, GNUTLS_X509_FMT_DER); g_free(data); if (ret < 0) { gnutls_x509_crt_deinit(*dest); return ret; } return 0; } gchar* inf_cert_util_get_dn_by_oid(gnutls_x509_crt_t cert, const char* oid, unsigned int index) { size_t size; gchar* buffer; int ret; buffer = NULL; size = 0; ret = gnutls_x509_crt_get_dn_by_oid(cert, oid, index, 0, buffer, &size); if(ret == GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE) return NULL; g_assert(ret == GNUTLS_E_SHORT_MEMORY_BUFFER); buffer = g_malloc(size); ret = gnutls_x509_crt_get_dn_by_oid(cert, oid, index, 0, buffer, &size); if(ret < 0) { g_free(buffer); buffer = NULL; } return buffer; } gchar* inf_cert_util_get_issuer_dn_by_oid(gnutls_x509_crt_t cert, const char* oid, unsigned int index) { size_t size; gchar* buffer; int ret; buffer = NULL; size = 0; ret = gnutls_x509_crt_get_issuer_dn_by_oid( cert, oid, index, 0, buffer, &size ); if(ret == GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE) return NULL; g_assert(ret == GNUTLS_E_SHORT_MEMORY_BUFFER); buffer = g_malloc(size); ret = gnutls_x509_crt_get_issuer_dn_by_oid( cert, oid, index, 0, buffer, &size ); if(ret < 0) { g_free(buffer); buffer = NULL; } return buffer; } gchar* inf_cert_util_get_hostname(gnutls_x509_crt_t cert) { guint i; int ret; size_t size; gchar* buffer; buffer = NULL; size = 0; for(i = 0; ; ++ i) { ret = gnutls_x509_crt_get_subject_alt_name(cert, i, buffer, &size, NULL); if(ret == GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE) break; if(ret == GNUTLS_E_SHORT_MEMORY_BUFFER) { buffer = g_realloc(buffer, size); ret = gnutls_x509_crt_get_subject_alt_name( cert, i, buffer, &size, NULL ); } if(ret == GNUTLS_SAN_DNSNAME || ret == GNUTLS_SAN_IPADDRESS) return buffer; } g_free(buffer); return inf_cert_util_get_dn_by_oid(cert, GNUTLS_OID_X520_COMMON_NAME, 0); } /* TODO: Error reporting for the following functions? */ gchar* inf_cert_util_get_serial_number(gnutls_x509_crt_t cert) { int ret; size_t size; guchar* value; gchar* formatted; size = 0; ret = gnutls_x509_crt_get_serial(cert, NULL, &size); if(ret != GNUTLS_E_SHORT_MEMORY_BUFFER) return NULL; value = g_malloc(size); ret = gnutls_x509_crt_get_serial(cert, value, &size); if(ret != GNUTLS_E_SUCCESS) return NULL; formatted = inf_cert_util_format_hexadecimal(value, size); g_free(value); return formatted; } gchar* inf_cert_util_get_fingerprint(gnutls_x509_crt_t cert, gnutls_digest_algorithm_t algo) { int ret; size_t size; guchar* value; gchar* formatted; size = 0; ret = gnutls_x509_crt_get_fingerprint(cert, algo, NULL, &size); if(ret != GNUTLS_E_SHORT_MEMORY_BUFFER) return NULL; value = g_malloc(size); ret = gnutls_x509_crt_get_fingerprint(cert, algo, value, &size); if(ret != GNUTLS_E_SUCCESS) return NULL; formatted = inf_cert_util_format_hexadecimal(value, size); g_free(value); return formatted; } gchar* inf_cert_util_get_activation_time(gnutls_x509_crt_t cert) { time_t time; time = gnutls_x509_crt_get_activation_time(cert); if(time == (time_t)(-1)) return NULL; return inf_cert_util_format_time(time); } gchar* inf_cert_util_get_expiration_time(gnutls_x509_crt_t cert) { time_t time; time = gnutls_x509_crt_get_expiration_time(cert); if(time == (time_t)(-1)) return NULL; return inf_cert_util_format_time(time); } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/common/inf-certificate-credentials.h0000644000175000017500000000355312264763732022314 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_CERTIFICATE_CREDENTIALS_H__ #define __INF_CERTIFICATE_CREDENTIALS_H__ #include /* Get ssize_t on MSVC, required by gnutls.h */ #include #include G_BEGIN_DECLS #define INF_TYPE_CERTIFICATE_CREDENTIALS (inf_certificate_credentials_get_type()) /** * InfCertificateCredentials: * * #InfCertificateCredentials is an opaque data type. You should only access * it via the public API functions. */ typedef struct _InfCertificateCredentials InfCertificateCredentials; GType inf_certificate_credentials_get_type(void) G_GNUC_CONST; InfCertificateCredentials* inf_certificate_credentials_new(void); InfCertificateCredentials* inf_certificate_credentials_ref(InfCertificateCredentials* creds); void inf_certificate_credentials_unref(InfCertificateCredentials* creds); gnutls_certificate_credentials_t inf_certificate_credentials_get(InfCertificateCredentials* creds); G_END_DECLS #endif /* __INF_CERTIFICATE_CREDENTIALS_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/common/inf-simulated-connection.c0000644000175000017500000004275412264763732021664 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include /** * SECTION:inf-simulated-connection * @title: InfSimulatedConnection * @short_description: Simulated network connection * @include: libinfinity/common/inf-simulated-connection.h * @stability: Unstable * * #InfSimulatedConnection simulates a connection and can be used everywhere * where a #InfXmlConnection is expected. Use * inf_simulated_connection_connect() to connect two such connections so that * data sent through one is received by the other. */ typedef struct _InfSimulatedConnectionPrivate InfSimulatedConnectionPrivate; struct _InfSimulatedConnectionPrivate { InfIo* io; InfIoDispatch* io_handler; InfSimulatedConnection* target; InfSimulatedConnectionMode mode; xmlNodePtr queue; xmlNodePtr queue_last_item; }; enum { PROP_0, PROP_IO, PROP_TARGET, PROP_MODE, /* From InfXmlConnection */ PROP_STATUS, PROP_NETWORK, PROP_LOCAL_ID, PROP_REMOTE_ID }; #define INF_SIMULATED_CONNECTION_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), INF_TYPE_SIMULATED_CONNECTION, InfSimulatedConnectionPrivate)) static GObjectClass* parent_class; static void inf_simulated_connection_clear_queue(InfSimulatedConnection* connection) { InfSimulatedConnectionPrivate* priv; xmlNodePtr next; priv = INF_SIMULATED_CONNECTION_PRIVATE(connection); if(priv->io_handler != NULL) { g_assert(priv->io != NULL); inf_io_remove_dispatch(priv->io, priv->io_handler); priv->io_handler = NULL; } while(priv->queue != NULL) { next = priv->queue->next; xmlFreeNode(priv->queue); priv->queue = next; } priv->queue_last_item = NULL; } static void inf_simulated_connection_unset_target(InfSimulatedConnection* connection) { InfSimulatedConnectionPrivate* priv; InfSimulatedConnection* target; InfSimulatedConnectionPrivate* target_priv; priv = INF_SIMULATED_CONNECTION_PRIVATE(connection); target = priv->target; if(target != NULL) { target_priv = INF_SIMULATED_CONNECTION_PRIVATE(priv->target); g_assert(target_priv->target == connection); priv->target = NULL; target_priv->target = NULL; inf_simulated_connection_clear_queue(connection); inf_simulated_connection_clear_queue(target); g_object_notify(G_OBJECT(connection), "target"); g_object_notify(G_OBJECT(connection), "status"); g_object_notify(G_OBJECT(target), "target"); g_object_notify(G_OBJECT(target), "status"); } } static void inf_simulated_connection_set_target(InfSimulatedConnection* connection, InfSimulatedConnection* target) { InfSimulatedConnectionPrivate* priv; inf_simulated_connection_unset_target(connection); if(target != NULL) inf_simulated_connection_unset_target(target); priv = INF_SIMULATED_CONNECTION_PRIVATE(connection); priv->target = target; if(target != NULL) { priv = INF_SIMULATED_CONNECTION_PRIVATE(target); priv->target = connection; } g_object_notify(G_OBJECT(connection), "target"); g_object_notify(G_OBJECT(connection), "status"); if(target != NULL) { g_object_notify(G_OBJECT(target), "target"); g_object_notify(G_OBJECT(target), "status"); } } /* * GObject overrides */ static void inf_simulated_connection_init(GTypeInstance* instance, gpointer g_class) { InfSimulatedConnection* connection; InfSimulatedConnectionPrivate* priv; connection = INF_SIMULATED_CONNECTION(instance); priv = INF_SIMULATED_CONNECTION_PRIVATE(connection); priv->io = NULL; priv->target = NULL; priv->mode = INF_SIMULATED_CONNECTION_IMMEDIATE; } static void inf_simulated_connection_dispose(GObject* object) { InfSimulatedConnection* connection; InfSimulatedConnectionPrivate* priv; connection = INF_SIMULATED_CONNECTION(object); priv = INF_SIMULATED_CONNECTION_PRIVATE(connection); inf_simulated_connection_unset_target(connection); g_assert(priv->io_handler == NULL); if(priv->io != NULL) { g_object_unref(priv->io); priv->io = NULL; } G_OBJECT_CLASS(parent_class)->dispose(object); } static void inf_simulated_connection_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec) { InfSimulatedConnection* sim; InfSimulatedConnectionPrivate* priv; sim = INF_SIMULATED_CONNECTION(object); priv = INF_SIMULATED_CONNECTION_PRIVATE(sim); switch(prop_id) { case PROP_IO: g_assert(priv->io == NULL); /* construct only */ priv->io = INF_IO(g_value_get_object(value)); g_object_ref(priv->io); break; case PROP_TARGET: inf_simulated_connection_set_target( sim, INF_SIMULATED_CONNECTION(g_value_get_object(value)) ); break; case PROP_MODE: inf_simulated_connection_set_mode(sim, g_value_get_enum(value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void inf_simulated_connection_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec) { InfSimulatedConnection* sim; InfSimulatedConnectionPrivate* priv; gchar* id; sim = INF_SIMULATED_CONNECTION(object); priv = INF_SIMULATED_CONNECTION_PRIVATE(sim); switch(prop_id) { case PROP_IO: g_value_set_object(value, G_OBJECT(priv->io)); break; case PROP_TARGET: g_value_set_object(value, G_OBJECT(priv->target)); break; case PROP_MODE: g_value_set_enum(value, priv->mode); break; case PROP_STATUS: if(priv->target != NULL) g_value_set_enum(value, INF_XML_CONNECTION_OPEN); else g_value_set_enum(value, INF_XML_CONNECTION_CLOSED); break; case PROP_NETWORK: g_value_set_static_string(value, "simulated"); break; case PROP_LOCAL_ID: id = g_strdup_printf("simulated-%p", (void*)sim); g_value_take_string(value, id); break; case PROP_REMOTE_ID: g_assert(priv->target != NULL); id = g_strdup_printf("simulated-%p", (void*)priv->target); g_value_take_string(value, id); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } /* * InfXmlConnection interface implementation */ static void inf_simulated_connection_xml_connection_close(InfXmlConnection* connection) { InfSimulatedConnectionPrivate* priv; priv = INF_SIMULATED_CONNECTION_PRIVATE(connection); g_assert(priv->target != NULL); inf_simulated_connection_unset_target(INF_SIMULATED_CONNECTION(connection)); } static void inf_simulated_connection_dispatch_func(gpointer user_data) { InfSimulatedConnection* connection; InfSimulatedConnectionPrivate* priv; connection = INF_SIMULATED_CONNECTION(user_data); priv = INF_SIMULATED_CONNECTION_PRIVATE(connection); priv->io_handler = NULL; inf_simulated_connection_flush(connection); } static void inf_simulated_connection_xml_connection_send(InfXmlConnection* connection, xmlNodePtr xml) { InfSimulatedConnectionPrivate* priv; priv = INF_SIMULATED_CONNECTION_PRIVATE(connection); g_assert(priv->target != NULL); switch(priv->mode) { case INF_SIMULATED_CONNECTION_IMMEDIATE: inf_xml_connection_sent(connection, xml); inf_xml_connection_received(INF_XML_CONNECTION(priv->target), xml); xmlFreeNode(xml); break; case INF_SIMULATED_CONNECTION_DELAYED: case INF_SIMULATED_CONNECTION_IO_CONTROLLED: xmlUnlinkNode(xml); if(priv->queue == NULL) { priv->queue = xml; priv->queue_last_item = xml; } else { priv->queue_last_item->next = xml; priv->queue_last_item = xml; } if(priv->mode == INF_SIMULATED_CONNECTION_IO_CONTROLLED) { if(priv->io_handler == NULL) { g_assert(priv->io != NULL); priv->io_handler = inf_io_add_dispatch( priv->io, inf_simulated_connection_dispatch_func, connection, NULL ); } } break; default: g_assert_not_reached(); break; } } /* * GObject type registration */ static void inf_simulated_connection_class_init(gpointer g_class, gpointer class_data) { GObjectClass* object_class; object_class = G_OBJECT_CLASS(g_class); parent_class = G_OBJECT_CLASS(g_type_class_peek_parent(g_class)); g_type_class_add_private(g_class, sizeof(InfSimulatedConnectionPrivate)); object_class->dispose = inf_simulated_connection_dispose; object_class->set_property = inf_simulated_connection_set_property; object_class->get_property = inf_simulated_connection_get_property; g_object_class_install_property( object_class, PROP_IO, g_param_spec_object( "io", "IO", "The main loop to be used for IO_CONTROLLED mode", INF_TYPE_IO, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); g_object_class_install_property( object_class, PROP_TARGET, g_param_spec_object( "target", "Target connection", "The simulated connection receiving data sent through this connection", INF_TYPE_SIMULATED_CONNECTION, G_PARAM_READWRITE ) ); g_object_class_install_property( object_class, PROP_MODE, g_param_spec_enum( "mode", "Mode", "The mode of the simulated connection", INF_TYPE_SIMULATED_CONNECTION_MODE, INF_SIMULATED_CONNECTION_IMMEDIATE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT ) ); g_object_class_override_property(object_class, PROP_STATUS, "status"); g_object_class_override_property(object_class, PROP_NETWORK, "network"); g_object_class_override_property(object_class, PROP_LOCAL_ID, "local-id"); g_object_class_override_property(object_class, PROP_REMOTE_ID, "remote-id"); } static void inf_simulated_connection_xml_connection_init(gpointer g_iface, gpointer iface_data) { InfXmlConnectionIface* iface; iface = (InfXmlConnectionIface*)g_iface; iface->close = inf_simulated_connection_xml_connection_close; iface->send = inf_simulated_connection_xml_connection_send; } GType inf_simulated_connection_mode_get_type(void) { static GType mode_type = 0; if(!mode_type) { static const GEnumValue mode_type_values[] = { { INF_SIMULATED_CONNECTION_IMMEDIATE, "INF_SIMULATED_CONNECTION_IMMEDIATE", "immediate" }, { INF_SIMULATED_CONNECTION_DELAYED, "INF_SIMULATED_CONNECTION_DELAYED", "delayed" }, { INF_SIMULATED_CONNECTION_IO_CONTROLLED, "INF_SIMULATED_CONNECTION_IO_CONTROLLED", "io-controlled" }, { 0, NULL, NULL } }; mode_type = g_enum_register_static( "InfSimulatedConnectionMode", mode_type_values ); } return mode_type; } GType inf_simulated_connection_get_type(void) { static GType simulated_connection_type = 0; if(!simulated_connection_type) { static const GTypeInfo simulated_connection_type_info = { sizeof(InfSimulatedConnectionClass), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ inf_simulated_connection_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InfSimulatedConnection), /* instance_size */ 0, /* n_preallocs */ inf_simulated_connection_init, /* instance_init */ NULL /* value_table */ }; static const GInterfaceInfo xml_connection_info = { inf_simulated_connection_xml_connection_init, NULL, NULL }; simulated_connection_type = g_type_register_static( G_TYPE_OBJECT, "InfSimulatedConnection", &simulated_connection_type_info, 0 ); g_type_add_interface_static( simulated_connection_type, INF_TYPE_XML_CONNECTION, &xml_connection_info ); } return simulated_connection_type; } /* * Public API */ /** * inf_simulated_connection_new: * * Creates a new #InfSimulatedConnection. A connection created this way cannot * be switched to %INF_SIMULATED_CONNECTION_IO_CONTROLLED mode. Use * inf_simulated_connection_new_with_io() instead if you intend to do that. * * Returns: A new #InfSimulatedConnection. **/ InfSimulatedConnection* inf_simulated_connection_new(void) { GObject* object; object = g_object_new(INF_TYPE_SIMULATED_CONNECTION, NULL); return INF_SIMULATED_CONNECTION(object); } /** * inf_simulated_connection_new_with_io: * @io: The main loop to be used for %INF_SIMULATED_CONNECTION_IO_CONTROLLED * mode. * * Creates a new #InfSimulatedConnection with the given #InfIo. This * connection can be used with %INF_SIMULATED_CONNECTION_IO_CONTROLLED mode. * If you don't intend to use that mode then using * inf_simulated_connection_new() is also good enough since the #InfIo object * is not required in that case. * * Returns: A new #InfSimulatedConnection. */ InfSimulatedConnection* inf_simulated_connection_new_with_io(InfIo* io) { GObject* object; g_return_val_if_fail(INF_IS_IO(io), NULL); object = g_object_new(INF_TYPE_SIMULATED_CONNECTION, "io", io, NULL); return INF_SIMULATED_CONNECTION(object); } /** * inf_simulated_connection_connect: * @connection: A #InfSimulatedConnection. * @to: The target connection. * * Connects two simulated connections, so that data sent through one of them * is received by the other one and vice versa. So one call to this function * connects both #InfSimulatedConnections to each other. There is no * need to call this function once for each connection. * * If one or both of the connections already have another target, then the * simulated connection between those is closed first. */ void inf_simulated_connection_connect(InfSimulatedConnection* connection, InfSimulatedConnection* to) { inf_simulated_connection_set_target(connection, to); } /** * inf_simulated_connection_set_mode: * @connection: A #InfSimulatedConnection. * @mode: The new mode to set. * * Sets the mode of the simulated connection. * * In %INF_SIMULATED_CONNECTION_IMMEDIATE mode, messages sent through the * connection are received by the target during the call to * inf_xml_connection_send(). * * In %INF_SIMULATED_CONNECTION_DELAYED mode, messages sent are queued and * received by the target when inf_simulated_connection_flush() is called. * * In %INF_SIMULATED_CONNECTION_IO_CONTROLLED mode, messages are queued and * received by the target as soon as a dispatch handler (see * inf_io_add_dispatch()) installed on the main loop is called. * * When changing the mode from %INF_SIMULATED_CONNECTION_DELAYED or * %INF_SIMULATED_CONNECTION_IO_CONTROLLED to * %INF_SIMULATED_CONNECTION_IMMEDIATE, then the queue is flushed, too. */ void inf_simulated_connection_set_mode(InfSimulatedConnection* connection, InfSimulatedConnectionMode mode) { InfSimulatedConnectionPrivate* priv; priv = INF_SIMULATED_CONNECTION_PRIVATE(connection); g_return_if_fail(priv->io != NULL || mode != INF_SIMULATED_CONNECTION_IO_CONTROLLED); if(priv->mode != mode) { if(mode == INF_SIMULATED_CONNECTION_IMMEDIATE) inf_simulated_connection_flush(connection); priv->mode = mode; g_object_notify(G_OBJECT(connection), "mode"); } } /** * inf_simulated_connection_flush: * @connection: A #InfSimulatedConnection. * * When @connection's mode is %INF_SIMULATED_CONNECTION_DELAYED or * %INF_SIMULATED_CONNECTION_IO_CONTROLLED, then calling this function makes * the target connection receive all the queued messages. */ void inf_simulated_connection_flush(InfSimulatedConnection* connection) { InfSimulatedConnectionPrivate* priv; xmlNodePtr next; priv = INF_SIMULATED_CONNECTION_PRIVATE(connection); g_return_if_fail(priv->target != NULL); if(priv->mode == INF_SIMULATED_CONNECTION_IO_CONTROLLED) { g_assert(priv->io != NULL); if(priv->io_handler != NULL) { inf_io_remove_dispatch(priv->io, priv->io_handler); priv->io_handler = NULL; } } while(priv->queue != NULL) { inf_xml_connection_sent( INF_XML_CONNECTION(connection), priv->queue ); inf_xml_connection_received( INF_XML_CONNECTION(priv->target), priv->queue ); next = priv->queue->next; xmlFreeNode(priv->queue); priv->queue = next; } priv->queue_last_item = NULL; } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/common/inf-xml-connection.c0000644000175000017500000002324512264763732020467 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include enum { SENT, RECEIVED, ERROR, LAST_SIGNAL }; static guint connection_signals[LAST_SIGNAL]; static void inf_xml_connection_base_init(gpointer g_class) { static gboolean initialized = FALSE; if(!initialized) { /** * InfXmlConnection::sent: * @connection: The #InfXmlConnection through which @node has been sent * @node: An #xmlNodePtr refering to the XML node that has been sent */ connection_signals[SENT] = g_signal_new( "sent", INF_TYPE_XML_CONNECTION, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(InfXmlConnectionIface, sent), NULL, NULL, inf_marshal_VOID__POINTER, G_TYPE_NONE, 1, G_TYPE_POINTER ); /** * InfXmlConnection::received: * @connection: The #InfXmlConnection through which @node has been received * @node: An #xmlNodePtr refering to the XML node that has been received */ connection_signals[RECEIVED] = g_signal_new( "received", INF_TYPE_XML_CONNECTION, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(InfXmlConnectionIface, received), NULL, NULL, inf_marshal_VOID__POINTER, G_TYPE_NONE, 1, G_TYPE_POINTER ); /** * InfXmlConnection::error: * @connection: The erroneous #InfXmlConnection * @error: A pointer to a #GError object with details on the error */ connection_signals[ERROR] = g_signal_new( "error", INF_TYPE_XML_CONNECTION, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(InfXmlConnectionIface, error), NULL, NULL, inf_marshal_VOID__POINTER, G_TYPE_NONE, 1, G_TYPE_POINTER /* actually a GError */ ); g_object_interface_install_property( g_class, g_param_spec_enum( "status", "XmlConnection Status", "The status of the connection.", INF_TYPE_XML_CONNECTION_STATUS, INF_XML_CONNECTION_CLOSED, G_PARAM_READABLE ) ); /* The network of a connection should not change through lifetime. All * users on a given network should be able to create direct connections * between each user. For example, 'jabber' might be such a network, * 'local' another one. All jabber user can have connections to other * jabber users, but not to those on a local network. */ g_object_interface_install_property( g_class, g_param_spec_string( "network", "Network", "An identifier for the type of network this connection is on", NULL, G_PARAM_READABLE ) ); g_object_interface_install_property( g_class, g_param_spec_string( "local-id", "Local ID", "A unique identification on the network for the local site", NULL, G_PARAM_READABLE ) ); g_object_interface_install_property( g_class, g_param_spec_string( "remote-id", "Remote ID", "A unique identification on the network for the remote site", NULL, G_PARAM_READABLE ) ); initialized = TRUE; } } GType inf_xml_connection_status_get_type(void) { static GType connection_status_type = 0; if(!connection_status_type) { static const GEnumValue connection_status_values[] = { { INF_XML_CONNECTION_CLOSED, "INF_XML_CONNECTION_CLOSED", "closed" }, { INF_XML_CONNECTION_CLOSING, "INF_XML_CONNECTION_CLOSING", "closing" }, { INF_XML_CONNECTION_OPEN, "INF_XML_CONNECTION_OPEN", "open" }, { INF_XML_CONNECTION_OPENING, "INF_XML_CONNECTION_OPENING", "opening" }, { 0, NULL, NULL } }; connection_status_type = g_enum_register_static( "InfXmlConnectionStatus", connection_status_values ); } return connection_status_type; } GType inf_xml_connection_get_type(void) { static GType xml_connection_type = 0; if(!xml_connection_type) { static const GTypeInfo xml_connection_info = { sizeof(InfXmlConnectionIface), /* class_size */ inf_xml_connection_base_init, /* base_init */ NULL, /* base_finalize */ NULL, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ 0, /* instance_size */ 0, /* n_preallocs */ NULL, /* instance_init */ NULL /* value_table */ }; xml_connection_type = g_type_register_static( G_TYPE_INTERFACE, "InfXmlConnection", &xml_connection_info, 0 ); g_type_interface_add_prerequisite(xml_connection_type, G_TYPE_OBJECT); } return xml_connection_type; } /** * inf_xml_connection_open: * @connection: A #infXmlConnection. * @error: Location to store error information, if any. * * Attempts to open the given XML connection. If the process fails, @error * will be set. The connection needs to be in status * %INF_XML_CONNECTION_CLOSED for this function to be called. Even if this * function succeeds, the connection process can fail later. In that case * the status of @connection will be reset to %INF_XML_CONNECTION_CLOSED * and the #InfXmlConnection::error signal will be emitted. * * Returns: %TRUE on succes, or %FALSE on error. */ gboolean inf_xml_connection_open(InfXmlConnection* connection, GError** error) { InfXmlConnectionIface* iface; g_return_val_if_fail(INF_IS_XML_CONNECTION(connection), FALSE); g_return_val_if_fail(error == NULL || *error == NULL, FALSE); iface = INF_XML_CONNECTION_GET_IFACE(connection); g_return_val_if_fail(iface->open != NULL, FALSE); return iface->open(connection, error); } /** * inf_xml_connection_close: * @connection: A #InfXmlConnection. * * Closes the given connection. **/ void inf_xml_connection_close(InfXmlConnection* connection) { InfXmlConnectionIface* iface; g_return_if_fail(INF_IS_XML_CONNECTION(connection)); iface = INF_XML_CONNECTION_GET_IFACE(connection); g_return_if_fail(iface->close != NULL); iface->close(connection); } /** * inf_xml_connection_send: * @connection: A #InfXmlConnection. * @xml: A XML message to send. The function takes ownership of the XML node. * * Sends the given XML message to the remote host. **/ void inf_xml_connection_send(InfXmlConnection* connection, xmlNodePtr xml) { InfXmlConnectionIface* iface; g_return_if_fail(INF_IS_XML_CONNECTION(connection)); g_return_if_fail(xml != NULL); iface = INF_XML_CONNECTION_GET_IFACE(connection); g_return_if_fail(iface->send != NULL); iface->send(connection, xml); } /** * inf_xml_connection_sent: * @connection: A #InfXmlConnection. * @xml: The XML message that has been sent. * * Emits the "sent" signal on @connection. This will most likely only be * useful to implementors. **/ void inf_xml_connection_sent(InfXmlConnection* connection, const xmlNodePtr xml) { g_return_if_fail(INF_IS_XML_CONNECTION(connection)); g_return_if_fail(xml != NULL); g_signal_emit( G_OBJECT(connection), connection_signals[SENT], 0, xml ); } /** * inf_xml_connection_received: * @connection: A #InfXmlConnection. * @xml: The XML message that has been received. * * Emits the "received" signal on @connection. This will most likely only * be useful to implementors. **/ void inf_xml_connection_received(InfXmlConnection* connection, const xmlNodePtr xml) { g_return_if_fail(INF_IS_XML_CONNECTION(connection)); g_return_if_fail(xml != NULL); g_signal_emit( G_OBJECT(connection), connection_signals[RECEIVED], 0, xml ); } /** * inf_xml_connection_error: * @connection: A #InfXmlConnection. * @error: The error that occured. * * Emits the "error" signal on @connection. This will most likely only * be useful to implementors. * * Note that the error may or may not be fatal for the connection. If it * is fatal, then a status notify to %INF_XML_CONNECTION_CLOSING or * %INF_XML_CONNECTION_CLOSED will follow. If you are implementing a custom * class implementing #InfXmlConnection, make sure to always emit the "error" * signal before doing the status notify because many users of the connection * will release their reference when the connection is no longer connected. **/ void inf_xml_connection_error(InfXmlConnection* connection, const GError* error) { g_return_if_fail(INF_IS_XML_CONNECTION(connection)); g_return_if_fail(error != NULL); g_signal_emit( G_OBJECT(connection), connection_signals[ERROR], 0, error ); } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/common/inf-discovery.h0000644000175000017500000001354012264763732017543 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_DISCOVERY_H__ #define __INF_DISCOVERY_H__ #include #include G_BEGIN_DECLS #define INF_TYPE_DISCOVERY (inf_discovery_get_type()) #define INF_DISCOVERY(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INF_TYPE_DISCOVERY, InfDiscovery)) #define INF_IS_DISCOVERY(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INF_TYPE_DISCOVERY)) #define INF_DISCOVERY_GET_IFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE((inst), INF_TYPE_DISCOVERY, InfDiscoveryIface)) /** * InfDiscovery: * * #InfDiscovery is an opaque data type. You should only access it * via the public API functions. */ typedef struct _InfDiscovery InfDiscovery; typedef struct _InfDiscoveryIface InfDiscoveryIface; /** * InfDiscoveryInfo: * * #InfDiscoveryInfo is an opaque data type. You should only access it * via the public API functions. */ typedef struct _InfDiscoveryInfo InfDiscoveryInfo; /** * InfDiscoveryResolvCompleteFunc: * @info: The resolved #InfDiscoveryInfo. * @connection: The resulting #InfXmlConnection. * @user_data: The user_data passed to inf_discovery_resolve(). * * This callback is called when a call to inf_discovery_resolve() finished * successfully. */ typedef void(*InfDiscoveryResolvCompleteFunc)(InfDiscoveryInfo* info, InfXmlConnection* connection, gpointer user_data); /** * InfDiscoveryResolvErrorFunc: * @info: The resolved #InfDiscoveryInfo. * @error: Reason for the failure. * @user_data: The user_data passed to inf_discovery_resolve(). * * This callback is called when a call to inf_discovery_resolve() failed. */ typedef void(*InfDiscoveryResolvErrorFunc)(InfDiscoveryInfo* info, const GError* error, gpointer user_data); /** * InfDiscoveryIface: * @discover: Virtual function to start discovery of services of the given * type. If the discovery was already started ealier, then this function does * nothing. * @get_discovered: Virtual function to retrieve a list of * #InfDiscoveryInfos that represent discovered services. * It needs to be freed by the caller via g_slist_free(). * @resolve: Virtual function that attempts to resolve the given discovery * info. It guarantees to either call @complete_func or @error_func when the * process has finished. * @info_get_service_name: Returns the service name of the given * #InfDiscoveryInfo as a new string, to be freed by the caller with g_free(). * @info_get_service_type: Returns the type of the discovered service of the * given #InfDiscoveryInfo as a static string. * @discovered: Default signal handler for the #InfDiscovery::discovered * signal. * @undiscovered: Default signal handler for the #InfDiscovery::undiscovered * signal. * * The virtual methods and default signal handlers of #InfDiscovery. * Implementing these allows discovering infinote servers. */ struct _InfDiscoveryIface { /*< private >*/ GTypeInterface parent; /*< public >*/ void (*discover)(InfDiscovery* discovery, const gchar* type); GSList* (*get_discovered)(InfDiscovery* discovery, const gchar* type); void (*resolve)(InfDiscovery* discovery, InfDiscoveryInfo* info, InfDiscoveryResolvCompleteFunc complete_func, InfDiscoveryResolvErrorFunc error_func, gpointer user_data); gchar*(*info_get_service_name)(InfDiscovery* discovery, InfDiscoveryInfo* info); const gchar*(*info_get_service_type)(InfDiscovery* discovery, InfDiscoveryInfo* info); /* Signals */ void (*discovered)(InfDiscovery* discovery, InfDiscoveryInfo* info); void (*undiscovered)(InfDiscovery* discovery, InfDiscoveryInfo* info); }; GType inf_discovery_get_type(void) G_GNUC_CONST; void inf_discovery_discover(InfDiscovery* discovery, const gchar* type); GSList* inf_discovery_get_discovered(InfDiscovery* discovery, const gchar* type); void inf_discovery_resolve(InfDiscovery* discovery, InfDiscoveryInfo* info, InfDiscoveryResolvCompleteFunc complete_func, InfDiscoveryResolvErrorFunc error_func, gpointer user_data); gchar* inf_discovery_info_get_service_name(InfDiscovery* discovery, InfDiscoveryInfo* info); const gchar* inf_discovery_info_get_service_type(InfDiscovery* discovery, InfDiscoveryInfo* info); void inf_discovery_discovered(InfDiscovery* discovery, InfDiscoveryInfo* info); void inf_discovery_undiscovered(InfDiscovery* discovery, InfDiscoveryInfo* info); G_END_DECLS #endif /* __INF_DISCOVERY_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/common/inf-xmpp-connection.c0000644000175000017500000041073212264763732020654 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include "config.h" /* This is set in inf_init() in inf-init.c based on the existance of the * environment variable LIBINFINITY_DEBUG_PRINT_TRAFFIC. */ gboolean INF_XMPP_CONNECTION_PRINT_TRAFFIC = FALSE; /* This is an implementation of the XMPP protocol as specified in RFC 3920. * Note that it is neither complete nor very standard-compliant at this time. */ typedef enum _InfXmppConnectionStatus { /* Underlaying TCP connection is being established */ INF_XMPP_CONNECTION_CONNECTING, /* Underlaying TCP connection is established */ INF_XMPP_CONNECTION_CONNECTED, /* Same as above, but the stream has already been authenticated */ INF_XMPP_CONNECTION_AUTH_CONNECTED, /* Initial has been sent */ INF_XMPP_CONNECTION_INITIATED, /* Same as above, but the stream has already been authenticated */ INF_XMPP_CONNECTION_AUTH_INITIATED, /* has been received, waiting for features (client only) */ INF_XMPP_CONNECTION_AWAITING_FEATURES, /* Same as above, but the stream has already been authenticated */ INF_XMPP_CONNECTION_AUTH_AWAITING_FEATURES, /* request has been sent (client only) */ INF_XMPP_CONNECTION_ENCRYPTION_REQUESTED, /* TLS handshake is being performed */ INF_XMPP_CONNECTION_HANDSHAKING, /* SASL authentication is in progress */ INF_XMPP_CONNECTION_AUTHENTICATING, /* Connection is ready to send XML */ INF_XMPP_CONNECTION_READY, /* Connection is being closed, but we did not yet get * from the other site */ INF_XMPP_CONNECTION_CLOSING_STREAM, /* Connection is being closed, we got but are still * waiting for any final data to be sent. */ /* TODO: Rename this. */ INF_XMPP_CONNECTION_CLOSING_GNUTLS, /* Connection is closed */ INF_XMPP_CONNECTION_CLOSED } InfXmppConnectionStatus; typedef void(*InfXmppConnectionSentFunc)(InfXmppConnection* xmpp, gpointer user_data); typedef void(*InfXmppConnectionFreeFunc)(InfXmppConnection* xmpp, gpointer user_data); typedef struct _InfXmppConnectionMessage InfXmppConnectionMessage; struct _InfXmppConnectionMessage { InfXmppConnectionMessage* next; guint position; gboolean sent; InfXmppConnectionSentFunc sent_func; InfXmppConnectionFreeFunc free_func; gpointer user_data; }; typedef struct _InfXmppConnectionPrivate InfXmppConnectionPrivate; struct _InfXmppConnectionPrivate { InfTcpConnection* tcp; InfXmppConnectionSite site; gchar* local_hostname; gchar* remote_hostname; InfXmppConnectionSecurityPolicy security_policy; InfXmppConnectionStatus status; InfXmppConnectionCrtCallback certificate_callback; gpointer certificate_callback_user_data; /* The number of chars given to the TCP connection * waiting for being sent. */ guint position; /* Message queue */ xmlDocPtr doc; xmlBufferPtr buf; InfXmppConnectionMessage* messages; InfXmppConnectionMessage* last_message; /* XML parsing */ guint parsing; /* Whether we are currently in an XML parser or GnuTLS callback */ xmlParserCtxtPtr parser; xmlNodePtr root; xmlNodePtr cur; /* Transport layer security */ gnutls_session_t session; InfCertificateCredentials* creds; /*InfCertificateCredentials* own_creds;*/ const gchar* pull_data; gsize pull_len; /* SASL */ InfSaslContext* sasl_context; InfSaslContext* sasl_own_context; InfSaslContextSession* sasl_session; gchar* sasl_local_mechanisms; gchar* sasl_remote_mechanisms; GError* sasl_error; }; enum { PROP_0, PROP_TCP, PROP_SITE, PROP_LOCAL_HOSTNAME, PROP_REMOTE_HOSTNAME, PROP_SECURITY_POLICY, PROP_TLS_ENABLED, PROP_CREDENTIALS, PROP_SASL_CONTEXT, PROP_SASL_MECHANISMS, /* From InfXmlConnection */ PROP_STATUS, PROP_NETWORK, PROP_LOCAL_ID, PROP_REMOTE_ID }; #define INF_XMPP_CONNECTION_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), INF_TYPE_XMPP_CONNECTION, InfXmppConnectionPrivate)) static GObjectClass* parent_class; static GQuark inf_xmpp_connection_error_quark; static GQuark inf_xmpp_connection_stream_error_quark; static GQuark inf_xmpp_connection_auth_error_quark; /* * XMPP error handling */ typedef struct _InfXmppConnectionErrorCondition { const gchar* condition; guint code; } InfXmppConnectionErrorCondition; static const InfXmppConnectionErrorCondition inf_xmpp_connection_stream_error_conditions[] = { { "bad-format", INF_XMPP_CONNECTION_STREAM_ERROR_BAD_FORMAT }, { "bad-namespace-prefix", INF_XMPP_CONNECTION_STREAM_ERROR_BAD_NAMESPACE_PREFIX }, { "conflict", INF_XMPP_CONNECTION_STREAM_ERROR_CONFLICT }, { "connection-timeout", INF_XMPP_CONNECTION_STREAM_ERROR_CONNECTION_TIMEOUT }, { "host-gone", INF_XMPP_CONNECTION_STREAM_ERROR_HOST_GONE }, { "host-unknown", INF_XMPP_CONNECTION_STREAM_ERROR_HOST_UNKNOWN }, { "improper-addressing", INF_XMPP_CONNECTION_STREAM_ERROR_IMPROPER_ADDRESSING }, { "internal-server-error", INF_XMPP_CONNECTION_STREAM_ERROR_INTERNAL_SERVER_ERROR }, { "invalid-from", INF_XMPP_CONNECTION_STREAM_ERROR_INVALID_FROM }, { "invalid-id", INF_XMPP_CONNECTION_STREAM_ERROR_INVALID_ID }, { "invalid-namespace", INF_XMPP_CONNECTION_STREAM_ERROR_INVALID_NAMESPACE }, { "invalid-xml", INF_XMPP_CONNECTION_STREAM_ERROR_INVALID_XML }, { "not-authorized", INF_XMPP_CONNECTION_STREAM_ERROR_NOT_AUTHORIZED }, { "policy-violation", INF_XMPP_CONNECTION_STREAM_ERROR_POLICY_VIOLATION }, { "remote-connection-failed", INF_XMPP_CONNECTION_STREAM_ERROR_REMOTE_CONNECTION_FAILED }, { "resource-constraint", INF_XMPP_CONNECTION_STREAM_ERROR_RESOURCE_CONSTRAINT }, { "restricted-xml", INF_XMPP_CONNECTION_STREAM_ERROR_RESTRICTED_XML }, { "see-other-host", INF_XMPP_CONNECTION_STREAM_ERROR_SEE_OTHER_HOST }, { "system-shutdown", INF_XMPP_CONNECTION_STREAM_ERROR_SYSTEM_SHUTDOWN }, { "undefined-condition", INF_XMPP_CONNECTION_STREAM_ERROR_UNDEFINED_CONDITION }, { /* Also map unknown failure to undefined-condition */ "undefined-condition", INF_XMPP_CONNECTION_STREAM_ERROR_FAILED }, { "unsupported-encoding", INF_XMPP_CONNECTION_STREAM_ERROR_UNSUPPORTED_ENCODING }, { "unsupported-stanza-type", INF_XMPP_CONNECTION_STREAM_ERROR_UNSUPPORTED_STANZA_TYPE }, { "unsupported-version", INF_XMPP_CONNECTION_STREAM_ERROR_UNSUPPORTED_VERSION }, { "xml-not-well-formed", INF_XMPP_CONNECTION_STREAM_ERROR_XML_NOT_WELL_FORMED }, { NULL, 0 } }; static const InfXmppConnectionErrorCondition inf_xmpp_connection_auth_error_conditions[] = { { "aborted", INF_XMPP_CONNECTION_AUTH_ERROR_ABORTED }, { "incorrect-encoding", INF_XMPP_CONNECTION_AUTH_ERROR_INCORRECT_ENCODING }, { "invalid-authzid", INF_XMPP_CONNECTION_AUTH_ERROR_INVALID_AUTHZID }, { "invalid-mechanism", INF_XMPP_CONNECTION_AUTH_ERROR_INVALID_MECHANISM }, { "mechanism-too-weak", INF_XMPP_CONNECTION_AUTH_ERROR_MECHANISM_TOO_WEAK }, { "not-authorized", INF_XMPP_CONNECTION_AUTH_ERROR_NOT_AUTHORIZED }, { "temporary-auth-failure", INF_XMPP_CONNECTION_AUTH_ERROR_TEMPORARY_AUTH_FAILURE }, { NULL, 0 } }; static InfXmppConnectionStreamError inf_xmpp_connection_stream_error_from_condition(const gchar* condition) { const InfXmppConnectionErrorCondition* cond; for(cond = inf_xmpp_connection_stream_error_conditions; cond->condition != NULL; ++ cond) { if(strcmp(condition, cond->condition) == 0) return cond->code; } return INF_XMPP_CONNECTION_STREAM_ERROR_FAILED; } static const gchar* inf_xmpp_connection_stream_error_to_condition(InfXmppConnectionStreamError code) { const InfXmppConnectionErrorCondition* cond; for(cond = inf_xmpp_connection_stream_error_conditions; cond->condition != NULL; ++ cond) { if(code == cond->code) return cond->condition; } g_assert_not_reached(); return NULL; } /* TODO: These are directly copied from RFC 3920, section 4.7.3, probably * they have to be adjusted to be more useful to the user. */ static const gchar* inf_xmpp_connection_stream_strerror(InfXmppConnectionStreamError code) { switch(code) { case INF_XMPP_CONNECTION_STREAM_ERROR_BAD_FORMAT: return _("The entity has sent XML that cannot be processed"); case INF_XMPP_CONNECTION_STREAM_ERROR_BAD_NAMESPACE_PREFIX: return _("The entity has sent a namespace prefix that is unsupported, or " "has sent no namespace prefix on an element that requires such " "a prefix"); case INF_XMPP_CONNECTION_STREAM_ERROR_CONFLICT: return _("The server is closing the active stream for this entity " "because a new stream has been initiated that conflicts with " "the existing stream"); case INF_XMPP_CONNECTION_STREAM_ERROR_CONNECTION_TIMEOUT: return _("The entity has not generated any traffic over the stream for " "some period of time"); case INF_XMPP_CONNECTION_STREAM_ERROR_HOST_GONE: return _("The value of the 'to' attribute provided by the initiating " "entity in the stream header corresponds to a hostname that is " "no longer hosted by the server"); case INF_XMPP_CONNECTION_STREAM_ERROR_HOST_UNKNOWN: return _("The value of the 'to' attribute provided by the initiating " "entity in the stream header does not correspond to a hostname " "that is hosted by the server"); case INF_XMPP_CONNECTION_STREAM_ERROR_IMPROPER_ADDRESSING: return _("A stanza sent between two servers lacks a 'to' or 'from'" "attribute"); case INF_XMPP_CONNECTION_STREAM_ERROR_INTERNAL_SERVER_ERROR: return _("The server has experienced a misconfiguration or an otherwise-" "undefined internal error that prevents it from servicing " "the stream"); case INF_XMPP_CONNECTION_STREAM_ERROR_INVALID_FROM: return _("The JID or hostname provided in a 'from' address does not " "match an authorized JID or validated domain negotiated between " "servers via SASL or dialback, or between a client and a " "server via authentication and resource binding"); case INF_XMPP_CONNECTION_STREAM_ERROR_INVALID_ID: return _("The stream ID or dialback ID is invalid or does not match an " "ID previously provided"); case INF_XMPP_CONNECTION_STREAM_ERROR_INVALID_NAMESPACE: return _("The streams namespace is something other than " "\"http://etherx.jabber.org/streams\" or the dialback namespace " "name is something other than \"jabber:server:dialback\""); case INF_XMPP_CONNECTION_STREAM_ERROR_INVALID_XML: return _("The entity has sent invalid XML over the stream to a server " "that performs validation"); case INF_XMPP_CONNECTION_STREAM_ERROR_NOT_AUTHORIZED: return _("The entity has attempted to send data before the stream has " "been authenticated, or otherwise is not authorized to perform " "an action related to stream negotiation"); case INF_XMPP_CONNECTION_STREAM_ERROR_POLICY_VIOLATION: return _("The entity has violated some local service policy"); case INF_XMPP_CONNECTION_STREAM_ERROR_REMOTE_CONNECTION_FAILED: return _("The server is unable to property connect to a remote entity " "that is required for authentication or authorization"); case INF_XMPP_CONNECTION_STREAM_ERROR_RESOURCE_CONSTRAINT: return _("The server lacks the system resources necessary to service the " "stream"); case INF_XMPP_CONNECTION_STREAM_ERROR_RESTRICTED_XML: return _("The entity has attempted to send restricted XML features"); case INF_XMPP_CONNECTION_STREAM_ERROR_SEE_OTHER_HOST: return _("The server will not provide service to the initiating " "entity but is redirecting traffic to another host"); case INF_XMPP_CONNECTION_STREAM_ERROR_SYSTEM_SHUTDOWN: return _("The server is being shut down and all active streams are being " "closed"); case INF_XMPP_CONNECTION_STREAM_ERROR_UNDEFINED_CONDITION: case INF_XMPP_CONNECTION_STREAM_ERROR_FAILED: return _("The error condition is not one of those defined by the other " "conditions"); case INF_XMPP_CONNECTION_STREAM_ERROR_UNSUPPORTED_ENCODING: return _("The initiating entity has encoded the stream in an encoding " "that is not supported by the server"); case INF_XMPP_CONNECTION_STREAM_ERROR_UNSUPPORTED_STANZA_TYPE: return _("The initiating entity has sent a first-level child of the " "stream that is not supported by the server."); case INF_XMPP_CONNECTION_STREAM_ERROR_UNSUPPORTED_VERSION: return _("The value of the 'version' attribute provided by the " "initiating entity in the stream header specifies a version of " "XMPP that is not supported by the server"); case INF_XMPP_CONNECTION_STREAM_ERROR_XML_NOT_WELL_FORMED: return _("The initiating entity has sent XML that is not well-formed"); default: g_assert_not_reached(); break; } } static InfXmppConnectionAuthError inf_xmpp_connection_auth_error_from_condition(const gchar* condition) { const InfXmppConnectionErrorCondition* cond; for(cond = inf_xmpp_connection_auth_error_conditions; cond->condition != NULL; ++ cond) { if(strcmp(condition, cond->condition) == 0) return cond->code; } return INF_XMPP_CONNECTION_AUTH_ERROR_FAILED; } static const gchar* inf_xmpp_connection_auth_error_to_condition(InfXmppConnectionAuthError code) { const InfXmppConnectionErrorCondition* cond; for(cond = inf_xmpp_connection_auth_error_conditions; cond->condition != NULL; ++ cond) { if(cond->code == code) return cond->condition; } g_assert_not_reached(); return NULL; } /* TODO: Again, this is only copied from RFC 3920, section 6.4 */ static const gchar* inf_xmpp_connection_auth_strerror(InfXmppConnectionAuthError code) { switch(code) { case INF_XMPP_CONNECTION_AUTH_ERROR_ABORTED: return _("The receiving entity acknowledged an element sent by " "the initiating entity"); case INF_XMPP_CONNECTION_AUTH_ERROR_INCORRECT_ENCODING: return _("The data provided by the initiating entity could not be " "processed because the Base64 encoding is incorrect"); case INF_XMPP_CONNECTION_AUTH_ERROR_INVALID_AUTHZID: return _("The authzid provided by the initiating entity is invalid, " "either because it is incorrectly formatted or because the " "initiating entity does not have permissions to authorize " "that ID"); case INF_XMPP_CONNECTION_AUTH_ERROR_INVALID_MECHANISM: return _("The initiating entity did not provide a mechanism or requested " "a mechanism that is not supported by the receiving entity"); case INF_XMPP_CONNECTION_AUTH_ERROR_MECHANISM_TOO_WEAK: return _("The mechanism requsted by the initiating entity is weaker than " "server policy permits for that initiating entity"); case INF_XMPP_CONNECTION_AUTH_ERROR_NOT_AUTHORIZED: return _("The authentication failed because the initiating entity did " "not provide valid credentials"); case INF_XMPP_CONNECTION_AUTH_ERROR_TEMPORARY_AUTH_FAILURE: return _("The authentication failed because of a temporary error condition " "within the receiving entity"); case INF_XMPP_CONNECTION_AUTH_ERROR_FAILED: return _("An unknown authentication error has occured"); default: g_assert_not_reached(); return NULL; } } /* * Message queue */ static void inf_xmpp_connection_push_message(InfXmppConnection* xmpp, InfXmppConnectionSentFunc sent_func, InfXmppConnectionFreeFunc free_func, gpointer user_data) { InfXmppConnectionPrivate* priv; InfXmppConnectionMessage* message; priv = INF_XMPP_CONNECTION_PRIVATE(xmpp); if(priv->position == 0) { if(sent_func != NULL) sent_func(xmpp, user_data); if(free_func != NULL) free_func(xmpp, user_data); } else { message = g_slice_new(InfXmppConnectionMessage); message->next = NULL; message->position = priv->position; message->sent = FALSE; message->sent_func = sent_func; message->free_func = free_func; message->user_data = user_data; if(priv->last_message == NULL) priv->messages = message; else priv->last_message->next = message; priv->last_message = message; } } static void inf_xmpp_connection_pop_message(InfXmppConnection* connection) { InfXmppConnectionPrivate* priv; InfXmppConnectionMessage* message; priv = INF_XMPP_CONNECTION_PRIVATE(connection); message = priv->messages; g_assert(message != NULL); priv->messages = message->next; if(priv->messages == NULL) priv->last_message = NULL; if(message->free_func != NULL) message->free_func(connection, message->user_data); g_slice_free(InfXmppConnectionMessage, message); } /* Note that this function does not change the state of xmpp, so it might * rest in a state where it expects to actually have the resources available * that are cleared here. Be sure to adjust state after having called * this function. */ static void inf_xmpp_connection_clear(InfXmppConnection* xmpp) { InfXmppConnectionPrivate* priv; priv = INF_XMPP_CONNECTION_PRIVATE(xmpp); g_object_freeze_notify(G_OBJECT(xmpp)); if(priv->sasl_session != NULL) { inf_sasl_context_stop_session(priv->sasl_context, priv->sasl_session); priv->sasl_session = NULL; } if(priv->sasl_remote_mechanisms != NULL) { g_free(priv->sasl_remote_mechanisms); priv->sasl_remote_mechanisms = NULL; } if(priv->session != NULL) { gnutls_deinit(priv->session); priv->session = NULL; g_object_notify(G_OBJECT(xmpp), "tls-enabled"); } if(priv->parser != NULL) { xmlFreeParserCtxt(priv->parser); priv->parser = NULL; if(priv->root != NULL) { xmlFreeNode(priv->root); priv->root = NULL; priv->cur = NULL; } } while(priv->messages != NULL) inf_xmpp_connection_pop_message(xmpp); if(priv->buf != NULL) { g_assert(priv->doc != NULL); xmlBufferFree(priv->buf); xmlFreeDoc(priv->doc); priv->buf = NULL; priv->doc = NULL; } priv->pull_data = NULL; priv->pull_len = 0; g_object_thaw_notify(G_OBJECT(xmpp)); } static void inf_xmpp_connection_send_chars(InfXmppConnection* xmpp, gconstpointer data, guint len) { InfXmppConnectionPrivate* priv; ssize_t cur_bytes; GError* error; priv = INF_XMPP_CONNECTION_PRIVATE(xmpp); g_assert(priv->status != INF_XMPP_CONNECTION_HANDSHAKING && priv->status != INF_XMPP_CONNECTION_CLOSED); if(INF_XMPP_CONNECTION_PRINT_TRAFFIC) printf("\033[00;34m%.*s\033[00;00m\n", (int)len, (const char*)data); /* From here on we go into a GnuTLS callback. Set this flag to prevent * premature cleanup -- make sure that if the connection is being brought * down from a GnuTLS callback then we keep the GnuTLS context around * until the gntuls_record_send() call finishes. */ ++priv->parsing; if(priv->session != NULL) { do { cur_bytes = gnutls_record_send(priv->session, data, len); if(cur_bytes < 0) { /* A GnuTLS error occured. It does not make sense to try to send * or a gnutls bye here, since this would again * have to go through GnuTLS, which would fail again, and so on. */ error = NULL; inf_gnutls_set_error(&error, cur_bytes); inf_xml_connection_error(INF_XML_CONNECTION(xmpp), error); g_error_free(error); inf_tcp_connection_close(priv->tcp); break; } else if(cur_bytes == 0) { /* TODO: I am not sure whether this can actually happen and what * it means. */ g_assert_not_reached(); /*inf_tcp_connection_close(priv->tcp);*/ } else { *((const char**)&data) += cur_bytes; len -= cur_bytes; } } while(len > 0); } else { priv->position += len; inf_tcp_connection_send(priv->tcp, data, len); } g_assert(priv->parsing > 0); if(--priv->parsing == 0) { if(priv->status == INF_XMPP_CONNECTION_CLOSED) { /* Status changed to CLOSED, so while attempting to send data we noticed * that the connection is down. Clear up. We didn't clean up in the * disconnection callback because we wanted to keep the gnutls context * alive until gnutls_record_send() returns. */ inf_xmpp_connection_clear(xmpp); } } } static void inf_xmpp_connection_send_xml(InfXmppConnection* xmpp, xmlNodePtr xml) { InfXmppConnectionPrivate* priv; priv = INF_XMPP_CONNECTION_PRIVATE(xmpp); g_return_if_fail(priv->doc != NULL); g_return_if_fail(priv->buf != NULL); xmlDocSetRootElement(priv->doc, xml); xmlNodeDump(priv->buf, priv->doc, xml, 0, 0); xmlUnlinkNode(xml); xmlSetListDoc(xml, NULL); /* Keep the object alive during the send_chars call, so that we can check * the buffer variable afterwards. */ g_object_ref(xmpp); inf_xmpp_connection_send_chars( xmpp, xmlBufferContent(priv->buf), xmlBufferLength(priv->buf) ); /* The connection might be closed & cleared as a result from * inf_xmpp_connection_send_chars(), so make sure the buffer still * exists before emptying it. */ if(priv->buf != NULL) xmlBufferEmpty(priv->buf); g_object_unref(xmpp); } /* * Helper functions */ static xmlNodePtr inf_xmpp_connection_node_new(const gchar* name, const gchar* xmlns) { xmlNodePtr ptr; ptr = xmlNewNode(NULL, (const xmlChar*)name); xmlNewProp(ptr, (const xmlChar*)"xmlns", (const xmlChar*)xmlns); return ptr; } static xmlNodePtr inf_xmpp_connection_node_new_streams(const gchar* name) { return inf_xmpp_connection_node_new( name, "urn:ietf:params:xml:ns:xmpp-streams" ); } static xmlNodePtr inf_xmpp_connection_node_new_tls(const gchar* name) { return inf_xmpp_connection_node_new( name, "urn:ietf:params:xml:ns:xmpp-tls" ); } static xmlNodePtr inf_xmpp_connection_node_new_sasl(const gchar* name) { return inf_xmpp_connection_node_new( name, "urn:ietf:params:xml:ns:xmpp-sasl" ); } /* * XMPP deinitialization */ /* Terminates the XMPP session and closes the connection. */ static void inf_xmpp_connection_terminate(InfXmppConnection* xmpp) { static const gchar xmpp_connection_deinit_request[] = ""; InfXmppConnectionPrivate* priv; xmlNodePtr abort; priv = INF_XMPP_CONNECTION_PRIVATE(xmpp); g_assert(priv->status != INF_XMPP_CONNECTION_CLOSED && priv->status != INF_XMPP_CONNECTION_CLOSING_GNUTLS && priv->status != INF_XMPP_CONNECTION_CONNECTING); /* We cannot send or a gnutls bye in these states * because it would interfere with the handshake. */ if(priv->status != INF_XMPP_CONNECTION_HANDSHAKING && priv->status != INF_XMPP_CONNECTION_ENCRYPTION_REQUESTED) { /* Session termination is not required in these states because the session * did not yet even begin or has already been sent, * respectively. */ if(priv->status != INF_XMPP_CONNECTION_CONNECTED && priv->status != INF_XMPP_CONNECTION_AUTH_CONNECTED && priv->status != INF_XMPP_CONNECTION_CLOSING_STREAM) { if(priv->status == INF_XMPP_CONNECTION_AUTHENTICATING) { /* Abort authentication before sending final */ abort = inf_xmpp_connection_node_new_sasl("abort"); inf_xmpp_connection_send_xml(xmpp, abort); xmlFreeNode(abort); } /* inf_xmpp_connection_send_xml() above might have caused * status update: */ if(priv->status != INF_XMPP_CONNECTION_CLOSED) { inf_xmpp_connection_send_chars( xmpp, xmpp_connection_deinit_request, sizeof(xmpp_connection_deinit_request) - 1 ); } } /* One of the send() calls above might have caused status update */ if(priv->status != INF_XMPP_CONNECTION_CLOSED && priv->session != NULL) gnutls_bye(priv->session, GNUTLS_SHUT_WR); } /* Clear resources such as GnuTLS session and XML parser */ if(priv->parsing == 0) inf_xmpp_connection_clear(xmpp); /* It can happen that the call to gnutls_bye() causes a send error because * the connection is already down. In that case the status is changed to * CLOSED, in which case we do not need further status updates at * this point. */ if(priv->status != INF_XMPP_CONNECTION_CLOSED) { /* The Change from CLOSING_STREAM to CLOSING_GNUTLS does not change * the XML status, so we need no notify in this case. */ if(priv->status != INF_XMPP_CONNECTION_CLOSING_STREAM) { priv->status = INF_XMPP_CONNECTION_CLOSING_GNUTLS; g_object_notify(G_OBJECT(xmpp), "status"); } else { priv->status = INF_XMPP_CONNECTION_CLOSING_GNUTLS; } } } /* This sends a with the given error code, but does not close * the stream for the client to retry authentication. */ static void inf_xmpp_connection_send_auth_error(InfXmppConnection* xmpp, InfXmppConnectionAuthError code) { InfXmppConnectionPrivate* priv; xmlNodePtr xml; xmlNodePtr child; priv = INF_XMPP_CONNECTION_PRIVATE(xmpp); /* SASL should be present, otherwise no auth error could have occured */ g_assert(priv->sasl_context != NULL); xml = inf_xmpp_connection_node_new_sasl("failure"); child = xmlNewChild( xml, NULL, (const xmlChar*)inf_xmpp_connection_auth_error_to_condition(code), NULL ); if(priv->sasl_error != NULL) { xmlAddChild( child, inf_xml_util_new_node_from_error(priv->sasl_error, NULL, "error")); } inf_xmpp_connection_send_xml(xmpp, xml); xmlFreeNode(xml); } /* Emits an error signal for the given auth error code. */ static void inf_xmpp_connection_emit_auth_error(InfXmppConnection* xmpp, InfXmppConnectionAuthError code) { GError* error; error = NULL; g_set_error( &error, inf_xmpp_connection_auth_error_quark, code, "%s", inf_xmpp_connection_auth_strerror(code) ); inf_xml_connection_error(INF_XML_CONNECTION(xmpp), error); g_error_free(error); } /* This sends a and then terminates the session using * the inf_xmpp_connection_terminate. message may be NULL. */ static void inf_xmpp_connection_terminate_error(InfXmppConnection* xmpp, InfXmppConnectionStreamError code, const gchar* message) { InfXmppConnectionPrivate* priv; xmlNodePtr node; xmlNodePtr child; GError* error; priv = INF_XMPP_CONNECTION_PRIVATE(xmpp); g_assert(priv->parser != NULL); g_assert(priv->status != INF_XMPP_CONNECTION_HANDSHAKING && priv->status != INF_XMPP_CONNECTION_ENCRYPTION_REQUESTED); error = NULL; g_set_error( &error, inf_xmpp_connection_stream_error_quark, code, "%s", message != NULL ? message : inf_xmpp_connection_stream_strerror(code) ); node = xmlNewNode(NULL, (const xmlChar*)"stream:error"); child = inf_xmpp_connection_node_new_streams( inf_xmpp_connection_stream_error_to_condition(code) ); xmlAddChild(node, child); if(message != NULL) { child = inf_xmpp_connection_node_new_streams("text"); xmlNodeAddContent(child, (const xmlChar*)message); /* TODO: Get real language code, probably from gettext */ xmlNodeSetLang(child, (const xmlChar*)"en"); } inf_xmpp_connection_send_xml(xmpp, node); xmlFreeNode(node); inf_xml_connection_error(INF_XML_CONNECTION(xmpp), error); g_error_free(error); inf_xmpp_connection_terminate(xmpp); } /* This attempts to deinitiate the stream by sending a final , * but it waits for the response of the other site. */ static void inf_xmpp_connection_deinitiate(InfXmppConnection* xmpp) { static const gchar xmpp_connection_deinitiate_request[] = ""; InfXmppConnectionPrivate* priv; xmlNodePtr abort; priv = INF_XMPP_CONNECTION_PRIVATE(xmpp); g_assert(priv->status != INF_XMPP_CONNECTION_CLOSING_GNUTLS && priv->status != INF_XMPP_CONNECTION_CLOSING_STREAM && priv->status != INF_XMPP_CONNECTION_CONNECTED && priv->status != INF_XMPP_CONNECTION_AUTH_CONNECTED); /* If we are in an authentication callback and we decide not to continue * the connection then remove the cached SASL server mechanisms as we don't * need them anymore. */ if(priv->site == INF_XMPP_CONNECTION_CLIENT && priv->sasl_remote_mechanisms != NULL) { g_free(priv->sasl_remote_mechanisms); priv->sasl_remote_mechanisms = NULL; } if(priv->status == INF_XMPP_CONNECTION_AUTHENTICATING) { /* If the SASL session is NULL then we have already aborted the * authentication but are still waiting for the server to acknowledge. */ if(priv->sasl_session != NULL) { /* Abort authentication before sending . */ /* TODO: Wait for response of the abort before sending */ abort = inf_xmpp_connection_node_new_sasl("abort"); inf_xmpp_connection_send_xml(xmpp, abort); } } inf_xmpp_connection_send_chars( xmpp, xmpp_connection_deinitiate_request, sizeof(xmpp_connection_deinitiate_request) - 1 ); priv->status = INF_XMPP_CONNECTION_CLOSING_STREAM; g_object_notify(G_OBJECT(xmpp), "status"); } /* * GnuTLS setup */ /* Required by inf_xmpp_connection_tls_handshake */ static void inf_xmpp_connection_initiate(InfXmppConnection* xmpp); static gboolean inf_xmpp_connection_prefers_tls(InfXmppConnection* xmpp) { InfXmppConnectionPrivate* priv; priv = INF_XMPP_CONNECTION_PRIVATE(xmpp); return priv->security_policy == INF_XMPP_CONNECTION_SECURITY_BOTH_PREFER_TLS || priv->security_policy == INF_XMPP_CONNECTION_SECURITY_ONLY_TLS; } static ssize_t inf_xmpp_connection_tls_push(gnutls_transport_ptr_t ptr, const void* data, size_t len) { InfXmppConnection* xmpp; InfXmppConnectionPrivate* priv; xmpp = INF_XMPP_CONNECTION(ptr); priv = INF_XMPP_CONNECTION_PRIVATE(xmpp); priv->position += len; inf_tcp_connection_send(priv->tcp, data, len); return len; } static ssize_t inf_xmpp_connection_tls_pull(gnutls_transport_ptr_t ptr, void* data, size_t len) { InfXmppConnection* xmpp; InfXmppConnectionPrivate* priv; size_t pull_len; xmpp = INF_XMPP_CONNECTION(ptr); priv = INF_XMPP_CONNECTION_PRIVATE(xmpp); /* The data to pull is set in inf_xmpp_connection_received_cb() which then * calls gnutls_record_recv, however, the pull function might also be * called during a call to gnutls_handshake when no data is available. * We return EAGAIN in this case to wait for more data from * inf_xmpp_connection_received_cb(). */ /* No data available */ if(priv->pull_len == 0) { gnutls_transport_set_errno(priv->session, EAGAIN); return -1; } else { pull_len = priv->pull_len; if(len < pull_len) pull_len = len; memcpy(data, priv->pull_data, pull_len); priv->pull_len -= pull_len; priv->pull_data += pull_len; return pull_len; } } static InfCertificateChain* inf_xmpp_connection_tls_import_server_certificate(InfXmppConnection* xmpp, GError** error) { InfXmppConnectionPrivate* priv; const gnutls_datum_t* server_certs_raw; unsigned int list_size; gnutls_x509_crt_t* certs; unsigned int i; int res; priv = INF_XMPP_CONNECTION_PRIVATE(xmpp); server_certs_raw = gnutls_certificate_get_peers(priv->session, &list_size); if(server_certs_raw == NULL) { g_set_error( error, inf_xmpp_connection_error_quark, INF_XMPP_CONNECTION_ERROR_NO_CERTIFICATE_PROVIDED, "%s", _("The server did not provide a certificate") ); return NULL; } certs = g_malloc(list_size * sizeof(gnutls_x509_crt_t)); for(i = 0; i < list_size; ++ i) { res = gnutls_x509_crt_init(&certs[i]); if(res == GNUTLS_E_SUCCESS) { res = gnutls_x509_crt_import( certs[i], server_certs_raw + i, GNUTLS_X509_FMT_DER ); if(res != GNUTLS_E_SUCCESS) gnutls_x509_crt_deinit(certs[i]); } if(res != GNUTLS_E_SUCCESS) { for(; i > 0; -- i) gnutls_x509_crt_deinit(certs[i - 1]); g_free(certs); inf_gnutls_set_error(error, res); return NULL; } } return inf_certificate_chain_new(certs, list_size); } static void inf_xmpp_connection_tls_handshake(InfXmppConnection* xmpp) { InfXmppConnectionPrivate* priv; int ret; InfCertificateChain* chain; GError* error; priv = INF_XMPP_CONNECTION_PRIVATE(xmpp); g_assert(priv->status == INF_XMPP_CONNECTION_HANDSHAKING); g_assert(priv->session != NULL); ret = gnutls_handshake(priv->session); switch(ret) { case GNUTLS_E_AGAIN: /* Wait for more data */ break; case 0: /* Handshake finished successfully */ priv->status = INF_XMPP_CONNECTION_CONNECTED; g_object_notify(G_OBJECT(xmpp), "tls-enabled"); if(priv->site == INF_XMPP_CONNECTION_SERVER || priv->certificate_callback == NULL) { /* Reinitiate stream */ inf_xmpp_connection_initiate(xmpp); } else { error = NULL; chain = inf_xmpp_connection_tls_import_server_certificate(xmpp, &error); if(chain == NULL) { inf_xml_connection_error(INF_XML_CONNECTION(xmpp), error); g_error_free(error); inf_xmpp_connection_terminate(xmpp); } else { priv->certificate_callback( xmpp, chain, priv->certificate_callback_user_data ); inf_certificate_chain_unref(chain); } } break; default: error = NULL; inf_gnutls_set_error(&error, ret); inf_xml_connection_error(INF_XML_CONNECTION(xmpp), error); g_error_free(error); gnutls_deinit(priv->session); priv->session = NULL; switch(priv->site) { case INF_XMPP_CONNECTION_CLIENT: /* Terminate connection when GnuTLS handshake fails. Don't wait for * as the server might not be aware of the problem. */ inf_xmpp_connection_terminate(xmpp); #if 0 /* Wait for terminating from server */ priv->status = INF_XMPP_CONNECTION_CLOSING_STREAM; g_object_notify(G_OBJECT(xmpp), "status"); #endif break; case INF_XMPP_CONNECTION_SERVER: /* TODO: Just close connection on error, without sending * , as in the client case? */ /* So that inf_xmpp_connection_terminate() doesn't get confused, it will * be overwritten to CLOSING_GNUTLS anyway. */ priv->status = INF_XMPP_CONNECTION_INITIATED; /* Send terminating , close XMPP session */ inf_xmpp_connection_terminate(xmpp); break; default: g_assert_not_reached(); break; } break; } } static void inf_xmpp_connection_tls_init(InfXmppConnection* xmpp) { static const guint xmpp_connection_dh_bits = 1024; #if 0 static const int xmpp_connection_protocol_priority[] = { GNUTLS_TLS1, GNUTLS_SSL3, 0 }; static const int xmpp_connection_kx_priority[] = { GNUTLS_KX_RSA, 0 }; static const int xmpp_connection_cipher_priority[] = { GNUTLS_CIPHER_3DES_CBC, GNUTLS_CIPHER_ARCFOUR, 0 }; static const int xmpp_connection_comp_priority[] = { GNUTLS_COMP_ZLIB, GNUTLS_COMP_NULL, 0 }; static const int xmpp_connection_mac_priority[] = { GNUTLS_MAC_SHA, GNUTLS_MAC_MD5, 0 }; #endif InfXmppConnectionPrivate* priv; priv = INF_XMPP_CONNECTION_PRIVATE(xmpp); g_assert(priv->session == NULL); /* Make sure credentials are present */ if(priv->creds == NULL) { /* We can create built-in credentials for the client side. However, the * server requires a certificate, and it doesn't make sense to generate * one here, so we require that credentials are given for a server-side * XMPP connection. */ g_assert(priv->site == INF_XMPP_CONNECTION_CLIENT); priv->creds = inf_certificate_credentials_new(); g_object_notify(G_OBJECT(xmpp), "credentials"); } switch(priv->site) { case INF_XMPP_CONNECTION_CLIENT: gnutls_init(&priv->session, GNUTLS_CLIENT); break; case INF_XMPP_CONNECTION_SERVER: gnutls_init(&priv->session, GNUTLS_SERVER); break; default: g_assert_not_reached(); break; } gnutls_set_default_priority(priv->session); #if 0 gnutls_protocol_set_priority( priv->session, xmpp_connection_protocol_priority ); gnutls_cipher_set_priority(priv->session, xmpp_connection_cipher_priority); gnutls_compression_set_priority( priv->session, xmpp_connection_comp_priority ); gnutls_kx_set_priority(priv->session, xmpp_connection_kx_priority); gnutls_mac_set_priority(priv->session, xmpp_connection_mac_priority); #endif gnutls_credentials_set( priv->session, GNUTLS_CRD_CERTIFICATE, inf_certificate_credentials_get(priv->creds) ); gnutls_dh_set_prime_bits(priv->session, xmpp_connection_dh_bits); gnutls_transport_set_ptr(priv->session, xmpp); gnutls_transport_set_push_function( priv->session, inf_xmpp_connection_tls_push ); gnutls_transport_set_pull_function( priv->session, inf_xmpp_connection_tls_pull ); priv->status = INF_XMPP_CONNECTION_HANDSHAKING; inf_xmpp_connection_tls_handshake(xmpp); } /* * Gsasl setup */ static gboolean inf_xmpp_connection_sasl_has_mechanism(const char* mechlist, const char* mechanism) { size_t len; const char* res; for(len = strlen(mechanism); mechlist != NULL; mechlist = strchr(res, ' ')) { res = strstr(mechlist, mechanism); if(res == NULL) return FALSE; if( (res == mechlist || isspace(res[ -1])) && (res[len] == '\0' || isspace(res[len]))) return TRUE; } return FALSE; } static void inf_xmpp_connection_sasl_finish(InfXmppConnection* xmpp, gboolean success) { InfXmppConnectionPrivate* priv; priv = INF_XMPP_CONNECTION_PRIVATE(xmpp); /* Can be NULL already if we have aborted the authentication before but were * still waiting for the server to acknowledge. */ if(priv->sasl_session != NULL) { inf_sasl_context_stop_session(priv->sasl_context, priv->sasl_session); priv->sasl_session = NULL; } if(success) { if(priv->sasl_error != NULL) { g_error_free(priv->sasl_error); priv->sasl_error = NULL; } /* Authentication done, switch to AUTH_CONNECTED */ priv->status = INF_XMPP_CONNECTION_AUTH_CONNECTED; if(priv->site == INF_XMPP_CONNECTION_CLIENT) { g_assert(priv->sasl_remote_mechanisms != NULL); g_free(priv->sasl_remote_mechanisms); priv->sasl_remote_mechanisms = NULL; } else { g_assert(priv->sasl_remote_mechanisms == NULL); } /* We might be in a XML callback here, so do not initiate the stream right * now because it replaces the XML parser. The stream is reinitiated in * received_cb(). */ if(priv->parsing == 0) inf_xmpp_connection_initiate(xmpp); } else { /* Authentication failed, switch to AWAITING_FEATURES/INITIATED * for possible retry */ if(priv->site == INF_XMPP_CONNECTION_CLIENT) priv->status = INF_XMPP_CONNECTION_AWAITING_FEATURES; else priv->status = INF_XMPP_CONNECTION_INITIATED; } } /* Emits the error signal for the given SASL error code and sends an * authentication failure to the other site. */ static void inf_xmpp_connection_sasl_error(InfXmppConnection* xmpp, const GError* error) { InfXmppConnectionPrivate* priv; InfXmppConnectionAuthError auth_code; priv = INF_XMPP_CONNECTION_PRIVATE(xmpp); inf_xml_connection_error(INF_XML_CONNECTION(xmpp), error); if(priv->site == INF_XMPP_CONNECTION_SERVER) { /* Find matching auth error code to send to client */ switch(error->code) { case GSASL_UNKNOWN_MECHANISM: case GSASL_MECHANISM_PARSE_ERROR: auth_code = INF_XMPP_CONNECTION_AUTH_ERROR_INVALID_MECHANISM; break; case GSASL_BASE64_ERROR: auth_code = INF_XMPP_CONNECTION_AUTH_ERROR_INCORRECT_ENCODING; break; case GSASL_AUTHENTICATION_ERROR: auth_code = INF_XMPP_CONNECTION_AUTH_ERROR_NOT_AUTHORIZED; break; default: auth_code = INF_XMPP_CONNECTION_AUTH_ERROR_TEMPORARY_AUTH_FAILURE; break; } inf_xmpp_connection_send_auth_error(xmpp, auth_code); /* Reset state to INITIATED so that the client can retry */ priv->status = INF_XMPP_CONNECTION_INITIATED; inf_xmpp_connection_sasl_finish(xmpp, FALSE); } else { inf_xmpp_connection_sasl_finish(xmpp, FALSE); /* Just terminate session on client site when a SASL error occurs */ /* TODO: Better deinitiate here? */ inf_xmpp_connection_terminate(xmpp); } } static void inf_xmpp_connection_sasl_cb(InfSaslContextSession* session, Gsasl_property property, gpointer session_data, gpointer user_data) { InfXmppConnection* xmpp; InfXmppConnectionPrivate* priv; xmpp = INF_XMPP_CONNECTION(user_data); priv = INF_XMPP_CONNECTION_PRIVATE(xmpp); switch(property) { case GSASL_ANONYMOUS_TOKEN: inf_sasl_context_session_set_property( session, GSASL_ANONYMOUS_TOKEN, g_get_user_name() ); inf_sasl_context_session_continue(session, GSASL_OK); break; case GSASL_VALIDATE_ANONYMOUS: /* Authentication always successful */ inf_sasl_context_session_continue(session, GSASL_OK); break; default: /* This callbackfunction is only used when using the built-in SASL * context, and this one only supports anonymous authentication. */ g_assert_not_reached(); inf_sasl_context_session_continue(session, GSASL_NO_CALLBACK); break; } } static gboolean inf_xmpp_connection_sasl_ensure(InfXmppConnection* xmpp) { InfXmppConnectionPrivate* priv; GError* error; priv = INF_XMPP_CONNECTION_PRIVATE(xmpp); if(priv->sasl_context == NULL) { g_assert(priv->sasl_own_context == NULL); error = NULL; priv->sasl_own_context = inf_sasl_context_new(&error); if(priv->sasl_own_context == NULL) { inf_xml_connection_error(INF_XML_CONNECTION(xmpp), error); g_error_free(error); inf_xmpp_connection_terminate(xmpp); return FALSE; } else { priv->sasl_context = priv->sasl_own_context; inf_sasl_context_ref(priv->sasl_context); inf_sasl_context_set_callback( priv->sasl_context, inf_xmpp_connection_sasl_cb, xmpp ); g_object_notify(G_OBJECT(xmpp), "sasl-context"); } } g_assert(priv->sasl_context != NULL); return TRUE; } static void inf_xmpp_connection_sasl_request_feed_func(InfSaslContextSession* session, const char* data, gboolean needs_more, const GError* error, gpointer user_data) { InfXmppConnection* xmpp; InfXmppConnectionPrivate* priv; xmlNodePtr reply; xmpp = INF_XMPP_CONNECTION(user_data); priv = INF_XMPP_CONNECTION_PRIVATE(xmpp); g_assert(priv->status == INF_XMPP_CONNECTION_AUTHENTICATING); g_assert(priv->sasl_session != NULL); if(error) { inf_xmpp_connection_sasl_error(xmpp, error); } else { /* We do not need to send a challenge when the authentication * has already been completed, but we need to response every * challenge. */ if(data != NULL) { reply = NULL; switch(priv->site) { case INF_XMPP_CONNECTION_SERVER: if(needs_more) reply = inf_xmpp_connection_node_new_sasl("challenge"); break; case INF_XMPP_CONNECTION_CLIENT: reply = inf_xmpp_connection_node_new_sasl("response"); break; default: g_assert_not_reached(); break; } if(reply != NULL) { xmlNodeAddContent(reply, (const xmlChar*)data); inf_xmpp_connection_send_xml(xmpp, reply); xmlFreeNode(reply); } } /* Send authentication success to client when done */ if(!needs_more) { if(priv->site == INF_XMPP_CONNECTION_SERVER) { reply = inf_xmpp_connection_node_new_sasl("success"); inf_xmpp_connection_send_xml(xmpp, reply); xmlFreeNode(reply); inf_xmpp_connection_sasl_finish(xmpp, TRUE); } /* Wait for from server before calling finish on * client side. */ } } } static void inf_xmpp_connection_sasl_request(InfXmppConnection* xmpp, const gchar* input) { InfXmppConnectionPrivate* priv; priv = INF_XMPP_CONNECTION_PRIVATE(xmpp); g_assert(priv->status == INF_XMPP_CONNECTION_AUTHENTICATING); g_assert(priv->sasl_session != NULL); inf_sasl_context_session_feed( priv->sasl_session, input, inf_xmpp_connection_sasl_request_feed_func, xmpp ); /* Wait for feed_func to be called */ } static void inf_xmpp_connection_sasl_init(InfXmppConnection* xmpp, const gchar* mechanism) { InfXmppConnectionPrivate* priv; InfIo* io; xmlNodePtr auth; GError* error; priv = INF_XMPP_CONNECTION_PRIVATE(xmpp); g_assert(priv->status != INF_XMPP_CONNECTION_AUTHENTICATING); g_assert(priv->sasl_context != NULL); g_assert(priv->sasl_session == NULL); g_assert(priv->tcp != NULL); if(priv->sasl_error != NULL) { g_error_free(priv->sasl_error); priv->sasl_error = NULL; } g_object_get(G_OBJECT(priv->tcp), "io", &io, NULL); g_assert(io != NULL); switch(priv->site) { case INF_XMPP_CONNECTION_CLIENT: auth = inf_xmpp_connection_node_new_sasl("auth"); xmlNewProp( auth, (const xmlChar*)"mechanism", (const xmlChar*)mechanism ); inf_xmpp_connection_send_xml(xmpp, auth); xmlFreeNode(auth); g_assert(priv->status == INF_XMPP_CONNECTION_AWAITING_FEATURES); error = NULL; priv->sasl_session = inf_sasl_context_client_start_session( priv->sasl_context, io, mechanism, xmpp, &error ); break; case INF_XMPP_CONNECTION_SERVER: g_assert(priv->status == INF_XMPP_CONNECTION_INITIATED); error = NULL; priv->sasl_session = inf_sasl_context_server_start_session( priv->sasl_context, io, mechanism, xmpp, &error ); break; default: g_assert_not_reached(); break; } g_object_unref(io); if(error != NULL) { inf_xmpp_connection_sasl_error(xmpp, error); g_error_free(error); } else { priv->status = INF_XMPP_CONNECTION_AUTHENTICATING; /* Begin on server site */ if(priv->site == INF_XMPP_CONNECTION_SERVER) inf_xmpp_connection_sasl_request(xmpp, NULL); } } /* * XMPP messaging */ /* This does actually process the start_element event after several * special cases have been handled in sax_start_element(). */ static void inf_xmpp_connection_process_start_element(InfXmppConnection* xmpp, const xmlChar* name, const xmlChar** attrs) { InfXmppConnectionPrivate* priv; xmlNodePtr node; const xmlChar** attr; const xmlChar* attr_name; const xmlChar* attr_value; priv = INF_XMPP_CONNECTION_PRIVATE(xmpp); node = xmlNewNode(NULL, name); if(attrs != NULL) { attr = attrs; while(*attr != NULL) { attr_name = *attr; ++ attr; attr_value = *attr; ++ attr; xmlNewProp(node, attr_name, attr_value); } } if(priv->root == NULL) { g_assert(priv->cur == NULL); priv->root = node; priv->cur = node; } else { g_assert(priv->cur != NULL); priv->cur = xmlAddChild(priv->cur, node); } } static void inf_xmpp_connection_process_connected(InfXmppConnection* xmpp, const xmlChar** attrs) { /* TODO: xml:lang and id field are missing here */ static const gchar xmpp_connection_initial_request[] = ""; InfXmppConnectionPrivate* priv; char* mech_list; char* begin; char* end; gchar* reply; xmlNodePtr features; xmlNodePtr starttls; xmlNodePtr mechanisms; xmlNodePtr mechanism; gchar* mechanism_dup; GError* error; priv = INF_XMPP_CONNECTION_PRIVATE(xmpp); g_assert(priv->site == INF_XMPP_CONNECTION_SERVER); g_assert(priv->parser != NULL); g_assert(priv->status == INF_XMPP_CONNECTION_CONNECTED || priv->status == INF_XMPP_CONNECTION_AUTH_CONNECTED); reply = g_strdup_printf( xmpp_connection_initial_request, priv->local_hostname ); inf_xmpp_connection_send_chars(xmpp, reply, strlen(reply)); g_free(reply); /* was sent, so change status to initiated */ switch(priv->status) { case INF_XMPP_CONNECTION_CONNECTED: priv->status = INF_XMPP_CONNECTION_INITIATED; break; case INF_XMPP_CONNECTION_AUTH_CONNECTED: priv->status = INF_XMPP_CONNECTION_AUTH_INITIATED; break; default: g_assert_not_reached(); break; } features = xmlNewNode(NULL, (const xmlChar*)"stream:features"); /* Don't offer TLS if we have already authenticated. It's pointless now. */ if(priv->session == NULL && priv->status != INF_XMPP_CONNECTION_AUTH_INITIATED) { if(priv->security_policy != INF_XMPP_CONNECTION_SECURITY_ONLY_UNSECURED) { starttls = inf_xmpp_connection_node_new_tls("starttls"); xmlAddChild(features, starttls); if(priv->security_policy == INF_XMPP_CONNECTION_SECURITY_ONLY_TLS) xmlNewChild(starttls, NULL, (const xmlChar*)"required", NULL); } } if(priv->status == INF_XMPP_CONNECTION_INITIATED) { /* Not yet authenticated, so give the client a list of authentication * mechanisms. */ mechanisms = inf_xmpp_connection_node_new_sasl("mechanisms"); xmlAddChild(features, mechanisms); /* Ensure that priv->sasl_context exists */ if(inf_xmpp_connection_sasl_ensure(xmpp) == FALSE) { /* Error occured during SASL initialization */ xmlFreeNode(features); return; } else if(priv->sasl_own_context != NULL) { /* Do only provide anonymous authentication when using own context */ xmlNewTextChild( mechanisms, NULL, (const xmlChar*)"mechanism", (const xmlChar*)"ANONYMOUS" ); } else { if(priv->sasl_local_mechanisms == NULL) { error = NULL; mech_list = inf_sasl_context_server_list_mechanisms( priv->sasl_context, &error ); if(error != NULL) { xmlFreeNode(features); inf_xml_connection_error(INF_XML_CONNECTION(xmpp), error); g_error_free(error); inf_xmpp_connection_terminate(xmpp); return; } } else { mech_list = priv->sasl_local_mechanisms; } begin = end = mech_list; while(*end != '\0') { end = strpbrk(begin, " \t\r\n"); if(end == NULL) end = begin + strlen(begin); mechanism_dup = g_strndup(begin, end - begin); if(inf_sasl_context_server_supports_mechanism(priv->sasl_context, mechanism_dup)) { mechanism = xmlNewChild( mechanisms, NULL, (const xmlChar*)"mechanism", NULL ); xmlNodeAddContentLen(mechanism, (const xmlChar*)begin, end - begin); } g_free(mechanism_dup); begin = end + 1; } if(priv->sasl_local_mechanisms == NULL) gsasl_free(mech_list); } } inf_xmpp_connection_send_xml(xmpp, features); xmlFreeNode(features); if(priv->status == INF_XMPP_CONNECTION_AUTH_INITIATED) { /* Authentication done, sent. Session is ready. */ priv->status = INF_XMPP_CONNECTION_READY; g_object_notify(G_OBJECT(xmpp), "status"); } } static void inf_xmpp_connection_process_initiated(InfXmppConnection* xmpp, xmlNodePtr xml) { InfXmppConnectionPrivate* priv; xmlNodePtr proceed; xmlChar* mech; gboolean has_mechanism; priv = INF_XMPP_CONNECTION_PRIVATE(xmpp); g_assert(priv->site == INF_XMPP_CONNECTION_SERVER); g_assert(priv->status == INF_XMPP_CONNECTION_INITIATED); /* TODO: Actually, RFC 3920 specifies in 5.1.3 that we MUST offer the * starttls attribute if the client's stream version is at least 1.0. We * don't do so if security_policy is * INF_XMPP_CONNECTION_SECURITY_ONLY_UNSECURED to allow ad-hoc unsecured * infinote sessions that don't need all this certificate stuff. */ /* I'm not totally sure how to do this in full compliance with the RFC. * Maybe we can ship with a simple self-signed ad-hoc certificate. */ if(priv->session == NULL && priv->security_policy != INF_XMPP_CONNECTION_SECURITY_ONLY_UNSECURED) { if(strcmp((const gchar*)xml->name, "starttls") == 0) { proceed = inf_xmpp_connection_node_new_tls("proceed"); inf_xmpp_connection_send_xml(xmpp, proceed); xmlFreeNode(proceed); inf_xmpp_connection_tls_init(xmpp); } else if(priv->security_policy == INF_XMPP_CONNECTION_SECURITY_ONLY_TLS) { inf_xmpp_connection_terminate_error( xmpp, INF_XMPP_CONNECTION_STREAM_ERROR_NOT_AUTHORIZED, _("Stream is not yet secured with TLS") ); } } /* If we handled one of the cases above, then we don't want to check for * authentication here. In that case, the status has already changed. */ if(priv->status == INF_XMPP_CONNECTION_INITIATED) { /* This should already have been allocated before having sent the list * of mechanisms to the client. */ g_assert(priv->sasl_context != NULL); if(strcmp((const gchar*)xml->name, "auth") == 0) { mech = xmlGetProp(xml, (const xmlChar*)"mechanism"); has_mechanism = TRUE; if(mech == NULL) { has_mechanism = FALSE; } else if(!inf_sasl_context_server_supports_mechanism(priv->sasl_context, (const char*)mech)) { has_mechanism = FALSE; } else if(priv->sasl_own_context == NULL && priv->sasl_local_mechanisms != NULL && !inf_xmpp_connection_sasl_has_mechanism( priv->sasl_local_mechanisms, (const char*)mech)) { has_mechanism = FALSE; } else if(priv->sasl_own_context != NULL && g_ascii_strcasecmp((const char*)mech, "ANONYMOUS") != 0) { has_mechanism = FALSE; } if(has_mechanism) { inf_xmpp_connection_sasl_init(xmpp, (const gchar*)mech); } else { /* Keep state for the client to retry */ inf_xmpp_connection_send_auth_error( xmpp, INF_XMPP_CONNECTION_AUTH_ERROR_INVALID_MECHANISM ); inf_xmpp_connection_emit_auth_error( xmpp, INF_XMPP_CONNECTION_AUTH_ERROR_INVALID_MECHANISM ); } if(mech != NULL) xmlFree(mech); } else { /* Got something else than */ inf_xmpp_connection_terminate_error( xmpp, INF_XMPP_CONNECTION_STREAM_ERROR_NOT_AUTHORIZED, _("Stream is not yet authorized") ); } } } static void inf_xmpp_connection_load_sasl_remote_mechanisms(InfXmppConnection* xmpp, xmlNodePtr xml) { InfXmppConnectionPrivate* priv; GString* mechanisms_string; xmlNodePtr child; priv = INF_XMPP_CONNECTION_PRIVATE(xmpp); g_assert(priv->sasl_remote_mechanisms == NULL); mechanisms_string = g_string_sized_new(128); for(child = xml->children; child != NULL; child = child->next) { if(strcmp((const gchar*)child->name, "mechanism") == 0 && child->children != NULL && child->children->content != NULL) { g_string_append( mechanisms_string, (const char*) child->children->content ); if(child->next != NULL) g_string_append_c(mechanisms_string, ' '); } } priv->sasl_remote_mechanisms = g_string_free(mechanisms_string, FALSE); } static const gchar* inf_xmpp_connection_sasl_suggest_mechanism(InfXmppConnection* xmpp, GError** error) { InfXmppConnectionPrivate* priv; GString* mechanisms_string; GString* mechanism_string; char* iter; char* end; const gchar* suggestion; gboolean has_mechanism; priv = INF_XMPP_CONNECTION_PRIVATE(xmpp); if(priv->sasl_own_context != NULL) { /* We only support ANONYMOUS authentication when using the built-in * SASL context. */ for(iter = priv->sasl_remote_mechanisms; *iter; iter = end + 1) { end = strchr(iter, ' '); if(end == NULL) { if(strcmp(iter, "ANONYMOUS") == 0) suggestion = "ANONYMOUS"; break; } if(strncmp(iter, "ANONYMOUS", MAX((size_t) (end - iter), sizeof("ANONYMOUS") - 1) == 0)) { suggestion = "ANONYMOUS"; break; } } } else { mechanisms_string = g_string_sized_new(128); mechanism_string = g_string_sized_new(16); /* should fit most names */ for(end = iter = priv->sasl_remote_mechanisms; end; iter = end + 1) { end = strchr(iter, ' '); if(end != NULL) { g_string_overwrite_len(mechanism_string, 0, iter, end - iter); g_string_truncate(mechanism_string, end - iter); iter = mechanism_string->str; } has_mechanism = inf_sasl_context_client_supports_mechanism(priv->sasl_context, iter); if(has_mechanism == TRUE && priv->sasl_local_mechanisms != NULL) { has_mechanism = inf_xmpp_connection_sasl_has_mechanism( priv->sasl_local_mechanisms, iter ); } if(has_mechanism == TRUE) { if(mechanisms_string->len > 0) g_string_append_c(mechanisms_string, ' '); g_string_append(mechanisms_string, iter); } } if(mechanisms_string->len > 0) { suggestion = inf_sasl_context_client_suggest_mechanism( priv->sasl_context, mechanisms_string->str ); } g_string_free(mechanisms_string, TRUE); } if(suggestion == NULL) { g_set_error( error, inf_xmpp_connection_error_quark, INF_XMPP_CONNECTION_ERROR_NO_SUITABLE_MECHANISM, "%s", _("The server does not offer a suitable authentication mechanism") ); } return suggestion; } static void inf_xmpp_connection_process_features(InfXmppConnection* xmpp, xmlNodePtr xml) { InfXmppConnectionPrivate* priv; xmlNodePtr child; xmlNodePtr req; xmlNodePtr starttls; const char* suggestion; GError* error; priv = INF_XMPP_CONNECTION_PRIVATE(xmpp); g_assert(priv->site == INF_XMPP_CONNECTION_CLIENT); g_assert(priv->status == INF_XMPP_CONNECTION_AWAITING_FEATURES || priv->status == INF_XMPP_CONNECTION_AUTH_AWAITING_FEATURES); if(strcmp((const gchar*)xml->name, "stream:features") != 0) { /* Server sent something else. Don't know what it is, so let us ignore it. * Perhaps the we are waiting for follows later. */ return; } /* Don't try TLS anymore if we are already authenticated. This can happen * if the server only offers TLS after authentication, but that's stupid. */ else if(priv->status == INF_XMPP_CONNECTION_AWAITING_FEATURES && priv->session == NULL) { for(child = xml->children; child != NULL; child = child->next) if(strcmp((const gchar*)child->name, "starttls") == 0) break; /* Server has no StartTLS feature. We don't like that. */ if(child == NULL && priv->security_policy == INF_XMPP_CONNECTION_SECURITY_ONLY_TLS) { error = g_error_new_literal( inf_xmpp_connection_error_quark, INF_XMPP_CONNECTION_ERROR_TLS_UNSUPPORTED, _("The server does not support transport layer security (TLS)") ); inf_xml_connection_error(INF_XML_CONNECTION(xmpp), error); g_error_free(error); inf_xmpp_connection_deinitiate(xmpp); } else if(child != NULL) { for(req = child->children; req != NULL; req = req->next) if(strcmp((const gchar*)req->name, "required") == 0) break; if(req != NULL && priv->security_policy == INF_XMPP_CONNECTION_SECURITY_ONLY_UNSECURED) { error = NULL; g_set_error( &error, inf_xmpp_connection_error_quark, INF_XMPP_CONNECTION_ERROR_TLS_REQUIRED, "%s", _("The server requires transport layer security (TLS)") ); inf_xml_connection_error(INF_XML_CONNECTION(xmpp), error); g_error_free(error); inf_xmpp_connection_deinitiate(xmpp); } /* The server supports TLS. Now, request TLS if it's required or if * we do prefer it. */ else if(req != NULL || inf_xmpp_connection_prefers_tls(xmpp)) { starttls = inf_xmpp_connection_node_new_tls("starttls"); inf_xmpp_connection_send_xml(xmpp, starttls); xmlFreeNode(starttls); priv->status = INF_XMPP_CONNECTION_ENCRYPTION_REQUESTED; } } } /* If we did not request TLS above, then go on with authentication */ if(priv->status == INF_XMPP_CONNECTION_AWAITING_FEATURES) { for(child = xml->children; child != NULL; child = child->next) if(strcmp((const gchar*)child->name, "mechanisms") == 0) break; /* Server does not provide authentication mechanisms */ if(child == NULL) { error = g_error_new_literal( inf_xmpp_connection_error_quark, INF_XMPP_CONNECTION_ERROR_AUTHENTICATION_UNSUPPORTED, _("The server does not provide any authentication mechanism") ); inf_xml_connection_error(INF_XML_CONNECTION(xmpp), error); g_error_free(error); inf_xmpp_connection_deinitiate(xmpp); } else if(inf_xmpp_connection_sasl_ensure(xmpp) == TRUE) { inf_xmpp_connection_load_sasl_remote_mechanisms(xmpp, child); error = NULL; suggestion = inf_xmpp_connection_sasl_suggest_mechanism(xmpp, &error); if(!suggestion) { inf_xml_connection_error(INF_XML_CONNECTION(xmpp), error); g_error_free(error); /* Deinitiate if error signal handler does not retry authentication */ if(priv->status == INF_XMPP_CONNECTION_AWAITING_FEATURES) inf_xmpp_connection_deinitiate(xmpp); } else { inf_xmpp_connection_sasl_init(xmpp, suggestion); } } } else if(priv->status == INF_XMPP_CONNECTION_AUTH_AWAITING_FEATURES) { priv->status = INF_XMPP_CONNECTION_READY; g_object_notify(G_OBJECT(xmpp), "status"); } } static void inf_xmpp_connection_process_encryption(InfXmppConnection* xmpp, xmlNodePtr xml) { InfXmppConnectionPrivate* priv; GError* error; priv = INF_XMPP_CONNECTION_PRIVATE(xmpp); g_assert(priv->site == INF_XMPP_CONNECTION_CLIENT); g_assert(priv->status == INF_XMPP_CONNECTION_ENCRYPTION_REQUESTED); g_assert(priv->session == NULL); if(strcmp((const gchar*)xml->name, "proceed") == 0) { inf_xmpp_connection_tls_init(xmpp); } else if(strcmp((const gchar*)xml->name, "failure") == 0) { error = g_error_new_literal( inf_xmpp_connection_error_quark, INF_XMPP_CONNECTION_ERROR_TLS_FAILURE, _("The server cannot perform the TLS handshake") ); inf_xml_connection_error(INF_XML_CONNECTION(xmpp), error); g_error_free(error); /* The server is required to close the stream after failure, so wait * for . */ priv->status = INF_XMPP_CONNECTION_CLOSING_STREAM; g_object_notify(G_OBJECT(xmpp), "status"); } else { /* We got neither 'proceed' nor 'failure'. Ignore and wait for either * of them. */ } } static void inf_xmpp_connection_process_authentication_error( InfXmppConnection* xmpp, InfXmppConnectionAuthError auth_code) { InfXmppConnectionPrivate* priv; priv = INF_XMPP_CONNECTION_PRIVATE(xmpp); g_assert(priv->site == INF_XMPP_CONNECTION_CLIENT); g_assert(priv->status == INF_XMPP_CONNECTION_AUTHENTICATING); inf_xmpp_connection_sasl_finish(xmpp, FALSE); inf_xmpp_connection_emit_auth_error(xmpp, auth_code); /* Deinitiate connection if the signal handler of the auth error did not * call inf_xmpp_connection_retry_sasl_authentication(). */ if(priv->status == INF_XMPP_CONNECTION_AWAITING_FEATURES) inf_xmpp_connection_deinitiate(xmpp); } static void inf_xmpp_connection_process_authentication(InfXmppConnection* xmpp, xmlNodePtr xml) { InfXmppConnectionPrivate* priv; InfXmppConnectionAuthError auth_code; xmlNodePtr child; xmlNodePtr error_node; xmlChar* content; GError* local_error; priv = INF_XMPP_CONNECTION_PRIVATE(xmpp); g_assert(priv->status == INF_XMPP_CONNECTION_AUTHENTICATING); switch(priv->site) { case INF_XMPP_CONNECTION_CLIENT: if(strcmp((const gchar*)xml->name, "challenge") == 0) { /* Ignore if authentication was aborted by * inf_xmpp_connection_reset_sasl_authentication() */ if(priv->sasl_session != NULL) { /* Process challenge from server */ content = xmlNodeGetContent(xml); inf_xmpp_connection_sasl_request(xmpp, (const gchar*)content); xmlFree(content); } } else if(strcmp((const gchar*)xml->name, "failure") == 0) { child = xml->children; auth_code = INF_XMPP_CONNECTION_AUTH_ERROR_FAILED; if(child != NULL) { error_node = child->children; if(error_node != NULL && strcmp((const char*)error_node->name, "error") == 0) { g_assert(priv->sasl_error == NULL); priv->sasl_error = inf_xml_util_new_error_from_node(error_node); } auth_code = inf_xmpp_connection_auth_error_from_condition( (const gchar*)child->name ); } inf_xmpp_connection_process_authentication_error(xmpp, auth_code); } else if(strcmp((const gchar*)xml->name, "success") == 0) { inf_xmpp_connection_sasl_finish(xmpp, TRUE); } else { /* Unknown request. Ignore. */ } break; case INF_XMPP_CONNECTION_SERVER: if(strcmp((const gchar*)xml->name, "response") == 0) { if(priv->sasl_session != NULL) { /* Process client reponse */ content = xmlNodeGetContent(xml); inf_xmpp_connection_sasl_request(xmpp, (const gchar*)content); xmlFree(content); } else { /* If priv->sasl_session is NULL then the authentication was aborted * via inf_xmpp_connection_reset_sasl_authentication(). */ inf_xmpp_connection_sasl_finish(xmpp, FALSE); /* Build and set detail error to send to client */ local_error = g_error_new_literal( inf_authentication_detail_error_quark(), INF_AUTHENTICATION_DETAIL_ERROR_TRY_AGAIN, inf_authentication_detail_strerror( INF_AUTHENTICATION_DETAIL_ERROR_TRY_AGAIN) ); inf_xmpp_connection_set_sasl_error(xmpp, local_error); g_error_free(local_error); /* Notify client that the authentication failed and ask it to try again */ inf_xmpp_connection_send_auth_error( xmpp, INF_XMPP_CONNECTION_AUTH_ERROR_TEMPORARY_AUTH_FAILURE ); inf_xmpp_connection_emit_auth_error( xmpp, INF_XMPP_CONNECTION_AUTH_ERROR_TEMPORARY_AUTH_FAILURE ); /* Can be reset if a signal handler retried or * reset the authentication. */ if(priv->sasl_error) { g_error_free(priv->sasl_error); priv->sasl_error = NULL; } } } else if(strcmp((const gchar*)xml->name, "abort") == 0) { /* Fall back to initiated state, wait for another auth request. */ inf_xmpp_connection_sasl_finish(xmpp, FALSE); inf_xmpp_connection_send_auth_error( xmpp, INF_XMPP_CONNECTION_AUTH_ERROR_ABORTED ); inf_xmpp_connection_emit_auth_error( xmpp, INF_XMPP_CONNECTION_AUTH_ERROR_ABORTED ); } break; default: g_assert_not_reached(); break; } } /* This actually processes the end element after having handled some * special cases in sax_end_element(). */ static void inf_xmpp_connection_process_end_element(InfXmppConnection* xmpp, const xmlChar* name) { InfXmppConnectionPrivate* priv; InfXmppConnectionStreamError stream_code; GError* error; priv = INF_XMPP_CONNECTION_PRIVATE(xmpp); g_assert(priv->cur != NULL); /* This should have raised a sax_error. */ g_assert(strcmp((const gchar*)priv->cur->name, (const gchar*)name) == 0); priv->cur = priv->cur->parent; if(priv->cur == NULL) { /* Got a complete XML message */ if(strcmp((const gchar*)name, "stream:error") == 0) { /* Just emit error signal in this case. If the stream is supposed to * be closed, a should follow. */ stream_code = INF_XMPP_CONNECTION_STREAM_ERROR_FAILED; if(priv->root->children != NULL) { stream_code = inf_xmpp_connection_stream_error_from_condition( (const gchar*)priv->root->children->name ); } error = NULL; g_set_error( &error, inf_xmpp_connection_stream_error_quark, stream_code, "%s", inf_xmpp_connection_stream_strerror(stream_code) ); /* TODO: Incorporate text child of the stream:error request, if any */ inf_xml_connection_error(INF_XML_CONNECTION(xmpp), error); g_error_free(error); } else { switch(priv->status) { case INF_XMPP_CONNECTION_INITIATED: /* The client should be waiting for from the server * in this state, and sax_end_element() should not have called this * function. */ g_assert(priv->site == INF_XMPP_CONNECTION_SERVER); inf_xmpp_connection_process_initiated(xmpp, priv->root); break; case INF_XMPP_CONNECTION_AWAITING_FEATURES: case INF_XMPP_CONNECTION_AUTH_AWAITING_FEATURES: /* This is a client-only state */ g_assert(priv->site == INF_XMPP_CONNECTION_CLIENT); inf_xmpp_connection_process_features(xmpp, priv->root); break; case INF_XMPP_CONNECTION_ENCRYPTION_REQUESTED: /* This is a client-only state */ g_assert(priv->site == INF_XMPP_CONNECTION_CLIENT); inf_xmpp_connection_process_encryption(xmpp, priv->root); break; case INF_XMPP_CONNECTION_AUTHENTICATING: inf_xmpp_connection_process_authentication(xmpp, priv->root); break; case INF_XMPP_CONNECTION_READY: inf_xml_connection_received(INF_XML_CONNECTION(xmpp), priv->root); break; case INF_XMPP_CONNECTION_AUTH_INITIATED: /* The client should be waiting for from the server * in this state, and sax_end_element should not have called this * function. Also, this is a client-only state (the server goes * directly to READY after having received ). */ case INF_XMPP_CONNECTION_CONNECTING: case INF_XMPP_CONNECTION_CONNECTED: case INF_XMPP_CONNECTION_AUTH_CONNECTED: case INF_XMPP_CONNECTION_HANDSHAKING: case INF_XMPP_CONNECTION_CLOSING_STREAM: case INF_XMPP_CONNECTION_CLOSING_GNUTLS: case INF_XMPP_CONNECTION_CLOSED: default: g_assert_not_reached(); break; } } xmlFreeNode(priv->root); priv->root = NULL; priv->cur = NULL; } } static void inf_xmpp_connection_sax_start_element(void* context, const xmlChar* name, const xmlChar** attrs) { InfXmppConnection* xmpp; InfXmppConnectionPrivate* priv; xmpp = INF_XMPP_CONNECTION(context); priv = INF_XMPP_CONNECTION_PRIVATE(xmpp); /* This can happen when both a chunk which causes the connection to * terminate and the start of an element happen in the same call to * xmlParseChunk */ if(priv->status == INF_XMPP_CONNECTION_CLOSING_GNUTLS) return; switch(priv->status) { case INF_XMPP_CONNECTION_CONNECTED: case INF_XMPP_CONNECTION_AUTH_CONNECTED: /* The first thing the client does in this state is sending * and switching to the initiated state. */ g_assert(priv->site == INF_XMPP_CONNECTION_SERVER); if(strcmp((const gchar*)name, "stream:stream") != 0) { /* Did not get , but something else. */ /* TODO: Produce an error here, so the user knows what happened */ inf_xmpp_connection_terminate(xmpp); } else { /* Got from client, send response */ inf_xmpp_connection_process_connected(xmpp, attrs); } break; case INF_XMPP_CONNECTION_INITIATED: case INF_XMPP_CONNECTION_AUTH_INITIATED: if(priv->site == INF_XMPP_CONNECTION_CLIENT) { /* We are waiting for from the server. */ if(strcmp((const gchar*)name, "stream:stream") != 0) { /* Did not get , but something else. */ inf_xmpp_connection_terminate(xmpp); } else { /* Got , wait for now so that * we can start TLS or authentication if the server supports it. */ /* TODO: Read server's JID, if a from field is given? However, the RFC * suggests we SHOULD silently ignore it. */ if(priv->status == INF_XMPP_CONNECTION_INITIATED) priv->status = INF_XMPP_CONNECTION_AWAITING_FEATURES; else priv->status = INF_XMPP_CONNECTION_AUTH_AWAITING_FEATURES; } } else { inf_xmpp_connection_process_start_element(xmpp, name, attrs); } break; case INF_XMPP_CONNECTION_CLOSING_STREAM: /* We are still processing messages if we are waiting for * , but are discarding them. */ case INF_XMPP_CONNECTION_AWAITING_FEATURES: case INF_XMPP_CONNECTION_AUTH_AWAITING_FEATURES: case INF_XMPP_CONNECTION_ENCRYPTION_REQUESTED: case INF_XMPP_CONNECTION_AUTHENTICATING: case INF_XMPP_CONNECTION_READY: inf_xmpp_connection_process_start_element(xmpp, name, attrs); break; case INF_XMPP_CONNECTION_CLOSING_GNUTLS: case INF_XMPP_CONNECTION_HANDSHAKING: /* received_cb should not call the XML parser in these states */ case INF_XMPP_CONNECTION_CLOSED: case INF_XMPP_CONNECTION_CONNECTING: /* We should not even receive something in these states */ default: g_assert_not_reached(); break; } } static void inf_xmpp_connection_sax_end_element(void* context, const xmlChar* name) { InfXmppConnection* xmpp; InfXmppConnectionPrivate* priv; xmpp = INF_XMPP_CONNECTION(context); priv = INF_XMPP_CONNECTION_PRIVATE(xmpp); g_assert(priv->status != INF_XMPP_CONNECTION_HANDSHAKING); /* This can happen when both a chunk which causes the connection to * terminate and the end of an element happen in the same call to * xmlParseChunk */ if(priv->status == INF_XMPP_CONNECTION_CLOSING_GNUTLS) return; /* If we are not in the toplevel (directly in ) but in some * child, process this normally because it belongs to a child. */ if(priv->root != NULL) { inf_xmpp_connection_process_end_element(xmpp, name); } else { /* Should have caused an error in the XML parser otherwise. The only case * where we get an end element for the top-level which is not * stream:stream is when the remote part sent a non-stream:stream opening * tag and the corresponding closing tag in one go so that we process both * in the same XML parser invocation. In that case * inf_xmpp_connection_sax_start_element resets the connection status * however so also check for that here. See also bug #546. */ g_assert(strcmp((const gchar*)name, "stream:stream") == 0 || priv->status == INF_XMPP_CONNECTION_CLOSING_GNUTLS || priv->status == INF_XMPP_CONNECTION_CLOSED); switch(priv->status) { case INF_XMPP_CONNECTION_CLOSING_STREAM: /* This is the we were waiting for. */ case INF_XMPP_CONNECTION_AUTHENTICATING: /* I think we should receive a failure first, but some evil server * might send directly. */ case INF_XMPP_CONNECTION_INITIATED: case INF_XMPP_CONNECTION_AUTH_INITIATED: case INF_XMPP_CONNECTION_AWAITING_FEATURES: case INF_XMPP_CONNECTION_AUTH_AWAITING_FEATURES: case INF_XMPP_CONNECTION_ENCRYPTION_REQUESTED: case INF_XMPP_CONNECTION_READY: /* Also terminate stream in these states */ inf_xmpp_connection_terminate(xmpp); break; case INF_XMPP_CONNECTION_CLOSED: case INF_XMPP_CONNECTION_CLOSING_GNUTLS: /* This can happen if the connection was terminated by start_element and * the XML parser processed the corresponding end tag in the same * xmlParseChunk() invocation. */ break; case INF_XMPP_CONNECTION_CONNECTED: case INF_XMPP_CONNECTION_AUTH_CONNECTED: /* We should not get before we got , * which would have caused us to change into the INITIATED state. The * XML parser should have reported an error in this case. */ case INF_XMPP_CONNECTION_HANDSHAKING: /* received_cb should not call the XML parser in these states */ case INF_XMPP_CONNECTION_CONNECTING: /* We should not even receive something in these states */ default: g_assert_not_reached(); break; } } } static void inf_xmpp_connection_sax_characters(void* context, const xmlChar* content, int len) { InfXmppConnection* xmpp; InfXmppConnectionPrivate* priv; xmpp = INF_XMPP_CONNECTION(context); priv = INF_XMPP_CONNECTION_PRIVATE(xmpp); g_assert(priv->status != INF_XMPP_CONNECTION_HANDSHAKING); if(priv->root == NULL) { /* Someone sent content of the node. Ignore. */ } else { g_assert(priv->cur != NULL); xmlNodeAddContentLen(priv->cur, content, len); } } static void inf_xmpp_connection_sax_warning(void* context, const char* msg, ...) { InfXmppConnection* xmpp; InfXmppConnectionPrivate* priv; InfIpAddress* address; gchar* addr_str; gchar* warn_str; va_list arglist; xmpp = INF_XMPP_CONNECTION(context); priv = INF_XMPP_CONNECTION_PRIVATE(xmpp); g_object_get(G_OBJECT(priv->tcp), "remote-address", &address, NULL); addr_str = inf_ip_address_to_string(address); inf_ip_address_free(address); va_start(arglist, msg); warn_str = g_strdup_vprintf(msg, arglist); va_end(arglist); /* XML Warning from : */ g_warning(_("XML warning from %s: %s\n"), addr_str, warn_str); g_free(addr_str); g_free(warn_str); } static void inf_xmpp_connection_sax_error(void* context, const char* msg, ...) { InfXmppConnection* xmpp; InfXmppConnectionPrivate* priv; InfXmppConnectionStreamError stream_code; xmlErrorPtr error_xml; const gchar* message; xmpp = INF_XMPP_CONNECTION(context); priv = INF_XMPP_CONNECTION_PRIVATE(xmpp); error_xml = xmlCtxtGetLastError(priv->parser); g_assert(error_xml != NULL); /* The XML parser should not be called in this state */ g_assert(priv->status != INF_XMPP_CONNECTION_HANDSHAKING); /* This can happen when both a chunk which causes the connection to * terminate and an error happens in the same call to xmlParseChunk */ if(priv->status == INF_XMPP_CONNECTION_CLOSING_GNUTLS) return; /* If we are in this state, the server waits already on a GnuTLS * handshake, so we cannot send arbitrary XML here. Also cannot * send without having sent . */ if(priv->status != INF_XMPP_CONNECTION_ENCRYPTION_REQUESTED && priv->status != INF_XMPP_CONNECTION_CONNECTED && priv->status != INF_XMPP_CONNECTION_AUTH_CONNECTED) { /* TODO: Get more accurate error information from stream error */ stream_code = INF_XMPP_CONNECTION_STREAM_ERROR_BAD_FORMAT; if(error_xml->domain == XML_FROM_PARSER && error_xml->code == XML_ERR_DOCUMENT_EMPTY) { /* The server sent something which is not XML */ message = _("Remote site is not an XMPP server"); } else { /* TODO: Strip leading and trailing whitespace from message */ message = error_xml->message; } inf_xmpp_connection_terminate_error(xmpp, stream_code, message); } else { /* Just terminate connection without sending stream:error */ inf_xmpp_connection_terminate(xmpp); } } static xmlSAXHandler inf_xmpp_connection_handler = { NULL, /* internalSubset */ NULL, /* isStandalone */ NULL, /* hasInternalSubset */ NULL, /* hasExternalSubset */ NULL, /* resolveEntity */ NULL, /* getEntity */ NULL, /* entityDecl */ NULL, /* notationDecl */ NULL, /* attributeDecl */ NULL, /* elementDecl */ NULL, /* unparsedEntityDecl */ NULL, /* setDocumentLocator */ NULL, /* startDocument */ NULL, /* endDocument */ inf_xmpp_connection_sax_start_element, /* startElement */ inf_xmpp_connection_sax_end_element, /* endElement */ NULL, /* reference */ inf_xmpp_connection_sax_characters, /* characters */ NULL, /* ignorableWhitespace */ NULL, /* processingInstruction */ NULL, /* comment */ inf_xmpp_connection_sax_warning, /* warning */ /* We treat error and fatal error the same */ inf_xmpp_connection_sax_error, /* error */ inf_xmpp_connection_sax_error, /* fatalError */ NULL, /* getParameterEntity */ NULL, /* cdataBlock */ NULL, /* externalSubset */ 0, /* initialized */ NULL, /* _private */ NULL, /* startElementNs */ NULL, /* endElementNs */ NULL /* serror */ }; static void inf_xmpp_connection_initiate(InfXmppConnection* xmpp) { static const gchar xmpp_connection_initial_request[] = ""; InfXmppConnectionPrivate* priv; gchar* request; priv = INF_XMPP_CONNECTION_PRIVATE(xmpp); g_assert(priv->status == INF_XMPP_CONNECTION_CONNECTED || priv->status == INF_XMPP_CONNECTION_AUTH_CONNECTED); /* Create XML parser for incoming data */ if(priv->parser != NULL) xmlFreeParserCtxt(priv->parser); priv->parser = xmlCreatePushParserCtxt( &inf_xmpp_connection_handler, xmpp, NULL, 0, NULL ); /* Create XML buffer for outgoing data */ if(priv->buf == NULL) { priv->buf = xmlBufferCreate(); priv->doc = xmlNewDoc((const xmlChar*)"1.0"); } if(priv->site == INF_XMPP_CONNECTION_CLIENT) { request = g_strdup_printf( xmpp_connection_initial_request, priv->remote_hostname ); inf_xmpp_connection_send_chars(xmpp, request, strlen(request)); g_free(request); switch(priv->status) { case INF_XMPP_CONNECTION_CONNECTED: priv->status = INF_XMPP_CONNECTION_INITIATED; break; case INF_XMPP_CONNECTION_AUTH_CONNECTED: priv->status = INF_XMPP_CONNECTION_AUTH_INITIATED; break; default: g_assert_not_reached(); break; } } } /* * Signal handlers. */ static void inf_xmpp_connection_received_cb_sent_func(InfXmppConnection* xmpp, gpointer user_data) { InfXmppConnectionPrivate* priv; priv = INF_XMPP_CONNECTION_PRIVATE(xmpp); /* Terminating and GnuTLS bye have been sent, so * close underlaying TCP connection. This will trigger a TCP status * notify. */ inf_tcp_connection_close(priv->tcp); } static void inf_xmpp_connection_sent_cb(InfTcpConnection* tcp, gconstpointer data, guint len, gpointer user_data) { InfXmppConnection* xmpp; InfXmppConnectionPrivate* priv; InfXmppConnectionMessage* message; gboolean have_sent; xmpp = INF_XMPP_CONNECTION(user_data); priv = INF_XMPP_CONNECTION_PRIVATE(xmpp); g_assert(priv->position >= len); g_object_ref(G_OBJECT(xmpp)); priv->position -= len; if(priv->messages != NULL) { have_sent = priv->messages->sent; /* Flag all messages that have been sent by this call */ for(message = priv->messages; message != NULL; message = message->next) { if(!message->sent) { if(message->position <= len) message->sent = TRUE; else message->position -= len; } } /* Note that a complete execution of this function doesn't keep messages * with sent flag set to TRUE in the queue. So if the sent flag was FALSE, * the method has been called recursively by a sent callback. In that * case, don't do anything here but let the parent call do all other sent * callbacks. */ if(have_sent == FALSE) { /* Now call sent func on all flagged messages */ while(priv->messages != NULL && priv->messages->sent) { if(priv->messages->sent_func != NULL) priv->messages->sent_func(xmpp, priv->messages->user_data); /* Note that the sent func might have called _clear() in which case all * messages have already been removed. */ if(priv->messages != NULL) inf_xmpp_connection_pop_message(xmpp); } } } g_object_unref(G_OBJECT(xmpp)); } static void inf_xmpp_connection_received_cb(InfTcpConnection* tcp, gconstpointer data, guint len, gpointer user_data) { InfXmppConnection* xmpp; InfXmppConnectionPrivate* priv; gchar buffer[2048]; ssize_t res; GError* error; gboolean receiving; xmpp = INF_XMPP_CONNECTION(user_data); priv = INF_XMPP_CONNECTION_PRIVATE(xmpp); /* We just keep the connection open to send a final gnutls bye and * in this state, any input gets discarded. */ if(priv->status == INF_XMPP_CONNECTION_CLOSING_GNUTLS) return; g_object_ref(xmpp); g_assert(priv->parsing == 0); g_assert(priv->parser != NULL); /* Let callbacks know that we start XML parsing. In case of deinitialization * this tells them to keep the XML parser alive. We clean up after parsing * in that case. */ ++priv->parsing; /* If we have a GnuTLS session, prepare data to be read by * gnutls_record_recv(). */ if(priv->session != NULL) { g_assert(priv->pull_len == 0); priv->pull_data = data; priv->pull_len = len; } if(priv->status == INF_XMPP_CONNECTION_HANDSHAKING) { g_assert(priv->session != NULL); inf_xmpp_connection_tls_handshake(xmpp); } /* Note that this is not an else branch, since if the XMPP handshake * finishes, the status will change and then we process initial data * here, if any. */ if(priv->status != INF_XMPP_CONNECTION_HANDSHAKING && priv->status != INF_XMPP_CONNECTION_CLOSING_GNUTLS) { if(priv->session != NULL) { receiving = TRUE; while(receiving && (priv->pull_len > 0 || gnutls_record_check_pending(priv->session) > 0)) { res = gnutls_record_recv(priv->session, buffer, 2048); if(res < 0) { /* Just try again if we were interrupted */ if(res != GNUTLS_E_INTERRUPTED && res != GNUTLS_E_AGAIN) { /* A TLS error occured. */ error = NULL; inf_gnutls_set_error(&error, res); inf_xml_connection_error(INF_XML_CONNECTION(xmpp), error); g_error_free(error); /* We cannot assume that GnuTLS is working enough to send a * final or something, so just close the * underlaying TCP connection. */ inf_tcp_connection_close(priv->tcp); receiving = FALSE; } } else if(res == 0) { /* Remote site sent gnutls_bye. This involves session closure. */ inf_tcp_connection_close(priv->tcp); receiving = FALSE; } else { /* Feed decoded data into XML parser */ if(INF_XMPP_CONNECTION_PRINT_TRAFFIC) printf("\033[00;32m%.*s\033[00;00m\n", (int)res, buffer); xmlParseChunk(priv->parser, buffer, res, 0); /* If the callback changed made us disconnect then don't try * to read more data. */ if(priv->status == INF_XMPP_CONNECTION_CLOSING_GNUTLS || priv->status == INF_XMPP_CONNECTION_CLOSED) { receiving = FALSE; } } } } else { /* Feed input directly into XML parser */ if(INF_XMPP_CONNECTION_PRINT_TRAFFIC) printf("\033[00;31m%.*s\033[00;00m\n", (int)len, (const char*)data); xmlParseChunk(priv->parser, data, len, 0); } } g_assert(priv->parsing > 0); if(--priv->parsing == 0) { if(priv->status == INF_XMPP_CONNECTION_CLOSING_GNUTLS || priv->status == INF_XMPP_CONNECTION_CLOSED) { /* Status changed to CLOSING_GNUTLS, this means that someone called * _terminate(). Clean up any resources in use (XML parser, GnuTLS * session etc. */ inf_xmpp_connection_clear(xmpp); if(priv->status != INF_XMPP_CONNECTION_CLOSED) { /* Close the TCP connection after remaining stuff has been sent out * in case it is not closed already. */ inf_xmpp_connection_push_message( xmpp, inf_xmpp_connection_received_cb_sent_func, NULL, NULL ); } } else if(priv->status == INF_XMPP_CONNECTION_AUTH_CONNECTED) { /* Reinitiate connection after successful authentication */ /* TODO: Only do this if status at the beginning of this call was * AUTHENTICATING */ inf_xmpp_connection_initiate(xmpp); } } g_object_unref(xmpp); } static void inf_xmpp_connection_error_cb(InfTcpConnection* tcp, GError* error, gpointer user_data) { /* Do not modify status because we get a status change notify from the * TCP connection little later anyway. */ inf_xml_connection_error(INF_XML_CONNECTION(user_data), error); } static void inf_xmpp_connection_notify_status_cb(InfTcpConnection* tcp, GParamSpec* pspec, gpointer user_data) { InfXmppConnection* xmpp; InfXmppConnectionPrivate* priv; InfTcpConnectionStatus tcp_status; xmpp = INF_XMPP_CONNECTION(user_data); priv = INF_XMPP_CONNECTION_PRIVATE(xmpp); g_object_get(G_OBJECT(tcp), "status", &tcp_status, NULL); switch(tcp_status) { case INF_TCP_CONNECTION_CLOSED: if(priv->status != INF_XMPP_CONNECTION_CLOSED) { /* If we are currently parsing XML (because this was called from a * signal handler) then we can't delete the XML parser here (otherwise * libxml2 crashes, understandably). Instead, just set the status to * closed and clean up after XML parsing in _received_cb(). */ if(priv->parsing == 0) inf_xmpp_connection_clear(xmpp); priv->status = INF_XMPP_CONNECTION_CLOSED; priv->position = 0; g_object_notify(G_OBJECT(xmpp), "status"); } else { g_assert(priv->session == NULL); g_assert(priv->messages == NULL); g_assert(priv->parser == NULL); g_assert(priv->doc == NULL); g_assert(priv->position == 0); g_assert(priv->sasl_session == NULL); } break; case INF_TCP_CONNECTION_CONNECTING: g_assert(priv->status == INF_XMPP_CONNECTION_CLOSED); if(priv->status != INF_XMPP_CONNECTION_CONNECTING) { priv->status = INF_XMPP_CONNECTION_CONNECTING; g_object_notify(G_OBJECT(xmpp), "status"); } break; case INF_TCP_CONNECTION_CONNECTED: g_assert(priv->status == INF_XMPP_CONNECTION_CONNECTING); /* No notify required, because it does not change the xml status */ priv->status = INF_XMPP_CONNECTION_CONNECTED; inf_xmpp_connection_initiate(xmpp); break; default: g_assert_not_reached(); break; } } /* * Utility functions. */ static void inf_xmpp_connection_set_tcp(InfXmppConnection* xmpp, InfTcpConnection* tcp) { InfXmppConnectionPrivate* priv; InfTcpConnectionStatus tcp_status; priv = INF_XMPP_CONNECTION_PRIVATE(xmpp); g_object_freeze_notify(G_OBJECT(xmpp)); if(priv->tcp != NULL) { g_object_get(G_OBJECT(priv->tcp), "status", &tcp_status, NULL); /* This will cause a status notify which will actually delete * GnuTLS session (if any) and the message queue. */ if(tcp_status != INF_TCP_CONNECTION_CLOSED) inf_tcp_connection_close(priv->tcp); /* Make sure there is no SASL session running anymore... it's not a big * deal if there was but it should be aborted by the above call to * inf_tcp_connection_close(). */ g_assert(priv->sasl_session == NULL); inf_signal_handlers_disconnect_by_func( G_OBJECT(priv->tcp), G_CALLBACK(inf_xmpp_connection_sent_cb), xmpp ); inf_signal_handlers_disconnect_by_func( G_OBJECT(priv->tcp), G_CALLBACK(inf_xmpp_connection_received_cb), xmpp ); inf_signal_handlers_disconnect_by_func( G_OBJECT(priv->tcp), G_CALLBACK(inf_xmpp_connection_error_cb), xmpp ); inf_signal_handlers_disconnect_by_func( G_OBJECT(priv->tcp), G_CALLBACK(inf_xmpp_connection_notify_status_cb), xmpp ); g_object_unref(G_OBJECT(priv->tcp)); } priv->tcp = tcp; if(tcp != NULL) { g_object_ref(G_OBJECT(tcp)); g_signal_connect( G_OBJECT(tcp), "sent", G_CALLBACK(inf_xmpp_connection_sent_cb), xmpp ); g_signal_connect( G_OBJECT(tcp), "received", G_CALLBACK(inf_xmpp_connection_received_cb), xmpp ); g_signal_connect( G_OBJECT(tcp), "error", G_CALLBACK(inf_xmpp_connection_error_cb), xmpp ); g_signal_connect( G_OBJECT(tcp), "notify::status", G_CALLBACK(inf_xmpp_connection_notify_status_cb), xmpp ); g_object_get(G_OBJECT(tcp), "status", &tcp_status, NULL); switch(tcp_status) { case INF_TCP_CONNECTION_CLOSED: g_assert(priv->status == INF_XMPP_CONNECTION_CLOSED); break; case INF_TCP_CONNECTION_CONNECTING: priv->status = INF_XMPP_CONNECTION_CONNECTING; g_object_notify(G_OBJECT(xmpp), "status"); break; case INF_TCP_CONNECTION_CONNECTED: /* Do not call initiate, this will be done in constructor little * time later. */ priv->status = INF_XMPP_CONNECTION_CONNECTED; g_object_notify(G_OBJECT(xmpp), "status"); break; default: g_assert_not_reached(); break; } } g_object_thaw_notify(G_OBJECT(xmpp)); } static InfXmlConnectionStatus inf_xmpp_connection_get_xml_status(InfXmppConnection* xmpp) { InfXmppConnectionPrivate* priv; priv = INF_XMPP_CONNECTION_PRIVATE(xmpp); switch(priv->status) { case INF_XMPP_CONNECTION_CONNECTING: case INF_XMPP_CONNECTION_CONNECTED: case INF_XMPP_CONNECTION_AUTH_CONNECTED: case INF_XMPP_CONNECTION_INITIATED: case INF_XMPP_CONNECTION_AUTH_INITIATED: case INF_XMPP_CONNECTION_AWAITING_FEATURES: case INF_XMPP_CONNECTION_AUTH_AWAITING_FEATURES: case INF_XMPP_CONNECTION_ENCRYPTION_REQUESTED: case INF_XMPP_CONNECTION_HANDSHAKING: case INF_XMPP_CONNECTION_AUTHENTICATING: return INF_XML_CONNECTION_OPENING; case INF_XMPP_CONNECTION_READY: return INF_XML_CONNECTION_OPEN; case INF_XMPP_CONNECTION_CLOSING_STREAM: case INF_XMPP_CONNECTION_CLOSING_GNUTLS: return INF_XML_CONNECTION_CLOSING; case INF_XMPP_CONNECTION_CLOSED: return INF_XML_CONNECTION_CLOSED; default: g_assert_not_reached(); return INF_XML_CONNECTION_CLOSED; } } static gchar* inf_xmpp_connection_get_address_id(InfIpAddress* addr, guint port) { gchar* addr_str; gchar* addr_id; addr_str = inf_ip_address_to_string(addr); switch(inf_ip_address_get_family(addr)) { case INF_IP_ADDRESS_IPV4: addr_id = g_strdup_printf("%s:%u", addr_str, port); break; case INF_IP_ADDRESS_IPV6: addr_id = g_strdup_printf("[%s]:%u", addr_str, port); break; default: g_assert_not_reached(); break; } g_free(addr_str); return addr_id; } /* * GObject overrides */ static void inf_xmpp_connection_init(GTypeInstance* instance, gpointer g_class) { InfXmppConnection* io; InfXmppConnectionPrivate* priv; io = INF_XMPP_CONNECTION(instance); priv = INF_XMPP_CONNECTION_PRIVATE(io); priv->tcp = NULL; priv->site = INF_XMPP_CONNECTION_CLIENT; priv->status = INF_XMPP_CONNECTION_CLOSED; priv->local_hostname = NULL; priv->remote_hostname = NULL; priv->security_policy = INF_XMPP_CONNECTION_SECURITY_BOTH_PREFER_TLS; priv->certificate_callback = NULL; priv->certificate_callback_user_data = NULL; priv->position = 0; priv->messages = NULL; priv->last_message = NULL; priv->parsing = 0; priv->parser = NULL; priv->root = NULL; priv->cur = NULL; priv->doc = NULL; priv->buf = NULL; priv->session = NULL; priv->creds = NULL; priv->pull_data = NULL; priv->pull_len = 0; priv->sasl_context = NULL; priv->sasl_own_context = NULL; priv->sasl_session = NULL; priv->sasl_local_mechanisms = NULL; priv->sasl_remote_mechanisms = NULL; priv->sasl_error = NULL; } static GObject* inf_xmpp_connection_constructor(GType type, guint n_construct_properties, GObjectConstructParam* construct_properties) { InfXmppConnectionPrivate* priv; InfTcpConnectionStatus status; GObject* obj; obj = G_OBJECT_CLASS(parent_class)->constructor( type, n_construct_properties, construct_properties ); priv = INF_XMPP_CONNECTION_PRIVATE(obj); g_assert(priv->tcp != NULL); if(priv->local_hostname == NULL) priv->local_hostname = g_strdup(g_get_host_name()); g_object_get(G_OBJECT(priv->tcp), "status", &status, NULL); /* Initiate stream if connection is already established */ if(status == INF_TCP_CONNECTION_CONNECTED) inf_xmpp_connection_initiate(INF_XMPP_CONNECTION(obj)); /* If we are an the server and allow TLS, then we do need credentials for * this. We can't create them ourselves, because it requires * a certificate. */ g_assert( priv->security_policy == INF_XMPP_CONNECTION_SECURITY_ONLY_UNSECURED || priv->site == INF_XMPP_CONNECTION_CLIENT || priv->creds != NULL ); return obj; } static void inf_xmpp_connection_dispose(GObject* object) { InfXmppConnection* xmpp; InfXmppConnectionPrivate* priv; xmpp = INF_XMPP_CONNECTION(object); priv = INF_XMPP_CONNECTION_PRIVATE(xmpp); inf_xmpp_connection_set_tcp(xmpp, NULL); if(priv->sasl_own_context != NULL) { inf_sasl_context_unref(priv->sasl_own_context); priv->sasl_own_context = NULL; } if(priv->sasl_context != NULL) { inf_sasl_context_unref(priv->sasl_context); priv->sasl_context = NULL; } if(priv->creds != NULL) { inf_certificate_credentials_unref(priv->creds); priv->creds = NULL; } G_OBJECT_CLASS(parent_class)->dispose(object); } static void inf_xmpp_connection_finalize(GObject* object) { InfXmppConnection* xmpp; InfXmppConnectionPrivate* priv; xmpp = INF_XMPP_CONNECTION(object); priv = INF_XMPP_CONNECTION_PRIVATE(xmpp); g_free(priv->local_hostname); g_free(priv->remote_hostname); g_free(priv->sasl_local_mechanisms); g_free(priv->sasl_remote_mechanisms); if(priv->sasl_error) g_error_free(priv->sasl_error); G_OBJECT_CLASS(parent_class)->finalize(object); } static void inf_xmpp_connection_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec) { InfXmppConnection* xmpp; InfXmppConnectionPrivate* priv; xmpp = INF_XMPP_CONNECTION(object); priv = INF_XMPP_CONNECTION_PRIVATE(xmpp); switch(prop_id) { case PROP_TCP: inf_xmpp_connection_set_tcp( xmpp, INF_TCP_CONNECTION(g_value_get_object(value)) ); break; case PROP_SITE: /* Site can only been changed if the initial has not * yet been sent. */ g_assert(priv->status == INF_XMPP_CONNECTION_CONNECTING || priv->status == INF_XMPP_CONNECTION_CONNECTED || priv->status == INF_XMPP_CONNECTION_CLOSED); priv->site = g_value_get_enum(value); break; case PROP_LOCAL_HOSTNAME: /* Can only change this if the initial has not * yet been sent. */ g_assert(priv->status == INF_XMPP_CONNECTION_CONNECTING || priv->status == INF_XMPP_CONNECTION_CONNECTED || priv->status == INF_XMPP_CONNECTION_CLOSED); g_free(priv->local_hostname); priv->local_hostname = g_value_dup_string(value); if(priv->local_hostname == NULL) priv->local_hostname = g_strdup(g_get_host_name()); break; case PROP_REMOTE_HOSTNAME: /* Can only change this if the initial has not * yet been sent. */ g_assert(priv->status == INF_XMPP_CONNECTION_CONNECTING || priv->status == INF_XMPP_CONNECTION_CONNECTED || priv->status == INF_XMPP_CONNECTION_CLOSED); g_free(priv->remote_hostname); priv->remote_hostname = g_value_dup_string(value); break; case PROP_SECURITY_POLICY: priv->security_policy = g_value_get_enum(value); break; case PROP_CREDENTIALS: /* Cannot change credentials when currently in use */ g_assert(priv->session == NULL); if(priv->creds != NULL) inf_certificate_credentials_unref(priv->creds); priv->creds = g_value_dup_boxed(value); break; case PROP_SASL_CONTEXT: /* Cannot change context when currently in use */ /* Use inf_xmpp_connection_reset_sasl_authentication() * to change it any time. */ g_assert(priv->sasl_session == NULL); if(priv->sasl_own_context != NULL) { inf_sasl_context_unref(priv->sasl_own_context); priv->sasl_own_context = NULL; } if(priv->sasl_context != NULL) inf_sasl_context_unref(priv->sasl_context); priv->sasl_context = g_value_dup_boxed(value); break; case PROP_SASL_MECHANISMS: /* Cannot change context when currently in use */ /* Use inf_xmpp_connection_reset_sasl_authentication() * to change it any time. */ g_assert(priv->sasl_session == NULL); g_free(priv->sasl_local_mechanisms); priv->sasl_local_mechanisms = g_value_dup_string(value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void inf_xmpp_connection_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec) { InfXmppConnection* xmpp; InfXmppConnectionPrivate* priv; InfIpAddress* addr; guint port; gchar* id; xmpp = INF_XMPP_CONNECTION(object); priv = INF_XMPP_CONNECTION_PRIVATE(xmpp); switch(prop_id) { case PROP_TCP: g_value_set_object(value, G_OBJECT(priv->tcp)); break; case PROP_SITE: g_value_set_enum(value, priv->site); break; case PROP_LOCAL_HOSTNAME: g_value_set_string(value, priv->local_hostname); break; case PROP_REMOTE_HOSTNAME: g_value_set_string(value, priv->remote_hostname); break; case PROP_SECURITY_POLICY: g_value_set_enum(value, priv->security_policy); break; case PROP_TLS_ENABLED: g_value_set_boolean(value, inf_xmpp_connection_get_tls_enabled(xmpp)); break; case PROP_CREDENTIALS: g_value_set_boxed(value, priv->creds); break; case PROP_SASL_CONTEXT: g_value_set_boxed(value, priv->sasl_context); break; case PROP_SASL_MECHANISMS: g_value_set_string(value, priv->sasl_local_mechanisms); break; case PROP_STATUS: g_value_set_enum(value, inf_xmpp_connection_get_xml_status(xmpp)); break; case PROP_NETWORK: g_value_set_static_string(value, "tcp/ip"); break; case PROP_LOCAL_ID: /* TODO: Perhaps we could also use JIDs here, but we have to make sure * then that they are unique within the whole network, which is * not so easy, and address/port serves the purpose equally well. */ g_object_get( G_OBJECT(priv->tcp), "local-address", &addr, "local-port", &port, NULL ); id = inf_xmpp_connection_get_address_id(addr, port); inf_ip_address_free(addr); g_value_take_string(value, id); break; case PROP_REMOTE_ID: addr = inf_tcp_connection_get_remote_address(priv->tcp); port = inf_tcp_connection_get_remote_port(priv->tcp); id = inf_xmpp_connection_get_address_id(addr, port); g_value_take_string(value, id); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } /* * InfXmlConnection interface implementation */ static void inf_xmpp_connection_xml_connection_send_sent(InfXmppConnection* xmpp, gpointer xml) { inf_xml_connection_sent(INF_XML_CONNECTION(xmpp), (xmlNodePtr)xml); } static void inf_xmpp_connection_xml_connection_send_free(InfXmppConnection* xmpp, gpointer xml) { xmlFreeNode((xmlNodePtr)xml); } static gboolean inf_xmpp_connection_xml_connection_open(InfXmlConnection* connection, GError** error) { InfXmppConnectionPrivate* priv; InfTcpConnectionStatus status; priv = INF_XMPP_CONNECTION_PRIVATE(connection); g_assert(priv->status == INF_XMPP_CONNECTION_CLOSED); g_assert(priv->tcp != NULL); /* TODO: If we are in CLOSING state, we could go to a state such as * INF_XMPP_CONNECTION_CLOSING_RECONNECT which reconnects after the * closing has finished. */ g_object_get(G_OBJECT(priv->tcp), "status", &status, NULL); g_assert(status == INF_TCP_CONNECTION_CLOSED); return inf_tcp_connection_open(priv->tcp, error); } static void inf_xmpp_connection_xml_connection_close(InfXmlConnection* connection) { InfXmppConnectionPrivate* priv; priv = INF_XMPP_CONNECTION_PRIVATE(connection); /* Connection is already being closed */ g_assert(priv->status != INF_XMPP_CONNECTION_CLOSING_STREAM && priv->status != INF_XMPP_CONNECTION_CLOSING_GNUTLS && priv->status != INF_XMPP_CONNECTION_CLOSED); switch(priv->status) { case INF_XMPP_CONNECTION_CONNECTING: inf_tcp_connection_close(priv->tcp); break; case INF_XMPP_CONNECTION_CONNECTED: case INF_XMPP_CONNECTION_AUTH_CONNECTED: g_assert(priv->parsing == 0); inf_xmpp_connection_terminate(INF_XMPP_CONNECTION(connection)); /* TODO: Shouldn't we close the TCP connection here, as in * inf_xmpp_connection_received_cb()? */ break; case INF_XMPP_CONNECTION_HANDSHAKING: case INF_XMPP_CONNECTION_ENCRYPTION_REQUESTED: /* TODO: Perhaps we should wait for the TLS handshake being finished * and then close the connection regularly. */ /* I don't think we can do more here to make the closure more * explicit */ g_assert(priv->session != NULL); gnutls_deinit(priv->session); priv->session = NULL; /* This will cause a status property notify which will actually set * the xmpp status */ inf_tcp_connection_close(priv->tcp); break; case INF_XMPP_CONNECTION_AUTHENTICATING: /* TODO: I think we should send an request here and then * wait on either successful or unsuccessful authentication result, * and then close the connection normally. Actually, this is what * inf_xmpp_connection_deinitiate is supposed to do. */ g_assert(priv->parsing == 0); inf_xmpp_connection_terminate(INF_XMPP_CONNECTION(connection)); /* TODO: Shouldn't we close the TCP connection here, as in * inf_xmpp_connection_received_cb()? */ break; case INF_XMPP_CONNECTION_INITIATED: case INF_XMPP_CONNECTION_AUTH_INITIATED: case INF_XMPP_CONNECTION_AWAITING_FEATURES: case INF_XMPP_CONNECTION_AUTH_AWAITING_FEATURES: case INF_XMPP_CONNECTION_READY: inf_xmpp_connection_deinitiate(INF_XMPP_CONNECTION(connection)); break; default: g_assert_not_reached(); break; } } static void inf_xmpp_connection_xml_connection_send(InfXmlConnection* connection, xmlNodePtr xml) { InfXmppConnectionPrivate* priv; priv = INF_XMPP_CONNECTION_PRIVATE(connection); g_assert(priv->status == INF_XMPP_CONNECTION_READY); inf_xmpp_connection_send_xml(INF_XMPP_CONNECTION(connection), xml); /* It can happen that while calling inf_xmpp_connection_send_xml we * notice that the connection is down. Only proceed with sent notification * if the connection is still up and we could actually send the thing. */ if(priv->status == INF_XMPP_CONNECTION_READY) { inf_xmpp_connection_push_message( INF_XMPP_CONNECTION(connection), inf_xmpp_connection_xml_connection_send_sent, inf_xmpp_connection_xml_connection_send_free, xml ); } else { xmlFreeNode(xml); } } /* * GObject type registration */ static void inf_xmpp_connection_class_init(gpointer g_class, gpointer class_data) { GObjectClass* object_class; InfXmppConnectionClass* xmpp_class; object_class = G_OBJECT_CLASS(g_class); xmpp_class = INF_XMPP_CONNECTION_CLASS(g_class); parent_class = G_OBJECT_CLASS(g_type_class_peek_parent(g_class)); g_type_class_add_private(g_class, sizeof(InfXmppConnectionPrivate)); object_class->constructor = inf_xmpp_connection_constructor; object_class->dispose = inf_xmpp_connection_dispose; object_class->finalize = inf_xmpp_connection_finalize; object_class->set_property = inf_xmpp_connection_set_property; object_class->get_property = inf_xmpp_connection_get_property; inf_xmpp_connection_error_quark = g_quark_from_static_string( "INF_XMPP_CONNECTION_ERROR" ); inf_xmpp_connection_stream_error_quark = g_quark_from_static_string( "INF_XMPP_CONNECTION_STREAM_ERROR" ); inf_xmpp_connection_auth_error_quark = g_quark_from_static_string( "INF_XMPP_CONNECTION_AUTH_ERROR" ); g_object_class_install_property( object_class, PROP_TCP, g_param_spec_object( "tcp-connection", "TCP connection", "Underlaying TCP connection", INF_TYPE_TCP_CONNECTION, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); g_object_class_install_property( object_class, PROP_SITE, g_param_spec_enum( "site", "Site", "Site of the connection (client or server)", INF_TYPE_XMPP_CONNECTION_SITE, INF_XMPP_CONNECTION_CLIENT, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); g_object_class_install_property( object_class, PROP_LOCAL_HOSTNAME, g_param_spec_string( "local-hostname", "Local hostname", "The hostname of the local host", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); g_object_class_install_property( object_class, PROP_REMOTE_HOSTNAME, g_param_spec_string( "remote-hostname", "Remote hostname", "The hostname of the remote host", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); g_object_class_install_property( object_class, PROP_SECURITY_POLICY, g_param_spec_enum( "security-policy", "Security policy", "How to choose whether to use (or offer, as a server) TLS", INF_TYPE_XMPP_CONNECTION_SECURITY_POLICY, INF_XMPP_CONNECTION_SECURITY_BOTH_PREFER_TLS, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); g_object_class_install_property( object_class, PROP_TLS_ENABLED, g_param_spec_boolean( "tls-enabled", "TLS enabled", "Whether TLS is enabled for the connection or not", FALSE, G_PARAM_READABLE ) ); g_object_class_install_property( object_class, PROP_CREDENTIALS, g_param_spec_boxed( "credentials", "Credentials", "The certificate credentials for GnuTLS", INF_TYPE_CERTIFICATE_CREDENTIALS, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); g_object_class_install_property( object_class, PROP_SASL_CONTEXT, g_param_spec_boxed( "sasl-context", "SASL context", "The SASL context used for authentication", INF_TYPE_SASL_CONTEXT, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); g_object_class_install_property( object_class, PROP_SASL_MECHANISMS, g_param_spec_string( "sasl-mechanisms", "SASL Mechanisms", "Whitespace separated list of SASL mechanisms to accept/offer", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); g_object_class_override_property(object_class, PROP_STATUS, "status"); g_object_class_override_property(object_class, PROP_NETWORK, "network"); g_object_class_override_property(object_class, PROP_LOCAL_ID, "local-id"); g_object_class_override_property(object_class, PROP_REMOTE_ID, "remote-id"); } static void inf_xmpp_connection_xml_connection_init(gpointer g_iface, gpointer iface_data) { InfXmlConnectionIface* iface; iface = (InfXmlConnectionIface*)g_iface; iface->open = inf_xmpp_connection_xml_connection_open; iface->close = inf_xmpp_connection_xml_connection_close; iface->send = inf_xmpp_connection_xml_connection_send; } GType inf_xmpp_connection_site_get_type(void) { static GType xmpp_connection_site_type = 0; if(!xmpp_connection_site_type) { static const GEnumValue xmpp_connection_site_values[] = { { INF_XMPP_CONNECTION_CLIENT, "INF_XMPP_CONNECTION_CLIENT", "client" }, { INF_XMPP_CONNECTION_SERVER, "INF_XMPP_CONNECTION_SERVER", "server" }, { 0, NULL, NULL } }; xmpp_connection_site_type = g_enum_register_static( "InfXmppConnectionSite", xmpp_connection_site_values ); } return xmpp_connection_site_type; } GType inf_xmpp_connection_security_policy_get_type(void) { static GType xmpp_connection_security_policy_type = 0; if(!xmpp_connection_security_policy_type) { static const GEnumValue xmpp_connection_security_policy_values[] = { { INF_XMPP_CONNECTION_SECURITY_ONLY_UNSECURED, "INF_XMPP_CONNECTION_SECURITY_ONLY_UNSECURED", "only-unsecured" }, { INF_XMPP_CONNECTION_SECURITY_ONLY_TLS, "INF_XMPP_CONNECTION_SECURITY_ONLY_TLS", "only-tls" }, { INF_XMPP_CONNECTION_SECURITY_BOTH_PREFER_UNSECURED, "INF_XMPP_CONNECTION_SECURITY_BOTH_PREFER_UNSECURED", "both-prefer-unsecured" }, { INF_XMPP_CONNECTION_SECURITY_BOTH_PREFER_TLS, "INF_XMPP_CONNECTION_SECURITY_BOTH_PREFER_TLS", "both-prefer-tls" }, { 0, NULL, NULL } }; xmpp_connection_security_policy_type = g_enum_register_static( "InfXmppConnectionSecurityPolicy", xmpp_connection_security_policy_values ); } return xmpp_connection_security_policy_type; } GType inf_xmpp_connection_get_type(void) { static GType xmpp_connection_type = 0; if(!xmpp_connection_type) { static const GTypeInfo xmpp_connection_type_info = { sizeof(InfXmppConnectionClass), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ inf_xmpp_connection_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InfXmppConnection), /* instance_size */ 0, /* n_preallocs */ inf_xmpp_connection_init, /* instance_init */ NULL /* value_table */ }; static const GInterfaceInfo xml_connection_info = { inf_xmpp_connection_xml_connection_init, NULL, NULL }; xmpp_connection_type = g_type_register_static( G_TYPE_OBJECT, "InfXmppConnection", &xmpp_connection_type_info, 0 ); g_type_add_interface_static( xmpp_connection_type, INF_TYPE_XML_CONNECTION, &xml_connection_info ); } return xmpp_connection_type; } /* * Public API */ /** * inf_xmpp_connection_new: * @tcp: The underlaying TCP connection to use. * @site: Whether this is a XMPP client or server. * @local_hostname: The hostname of the local host, or %NULL. * @remote_hostname: The hostname of the remote host. * @security_policy: Whether to use (or offer, as a server) TLS. See * #InfXmppConnectionSecurityPolicy for the meaning of this parameter. * @creds: Certificate credentials used to secure the communication. * @sasl_context: A SASL context used for authentication. * @sasl_mechanisms: A whitespace-separated list of SASL mechanisms to * accept/offer, or %NULL. * * Creates a new #InfXmppConnection with @tcp as communication channel. No * attempt is being made to open @tcp, if it is not already open. However, * communication is initiated as soon as @tcp gets into * %INF_TCP_CONNECTION_CONNECTED state, so you might still open it * lateron yourself. * * @local_hostname specifies the hostname of the local host, and * @remote_hostname specifies the hostname of the remote host, as known to * the caller. These can be a string representation of the IP address of * @tcp, or a DNS name such as "example.com". @local_hostname can be %NULL * in which case the host name as reported by g_get_host_name() is used. * * @creds may be %NULL in which case the connection creates the credentials * as soon as they are required. However, this only works if * @site is %INF_XMPP_CONNECTION_CLIENT or @security_policy is * %INF_XMPP_CONNECTION_SECURITY_ONLY_UNSECURED (or both, of course). For * server connections @creds must contain a valid server certificate in case * @security_policy is not %INF_XMPP_CONNECTION_SECURITY_ONLY_UNSECURED. * * If @sasl_context is %NULL, #InfXmppConnection uses a built-in context * that only supports ANONYMOUS authentication. In @sasl_context's * callback function, the #InfXmppConnection for which the authentication * shall be performed can be accessed via the @session_data parameter of * #InfSaslContextCallbackFunc. * * If @sasl_context is not %NULL, then the @sasl_mechanisms parameter defines * what SASL mechanisms are used. On the server side, these are the mechanisms * offered to the client, and on the client side, these are the accepted * mechanisms (meaning that if a server does not offer any of these, the * connection will be closed). If @sasl_context is %NULL, then this parameter * is ignored. @sasl_mechanisms can be %NULL in which case all available * mechanisms are accepted or offered, respectively. * * Return Value: A new #InfXmppConnection. **/ InfXmppConnection* inf_xmpp_connection_new(InfTcpConnection* tcp, InfXmppConnectionSite site, const gchar* local_hostname, const gchar* remote_hostname, InfXmppConnectionSecurityPolicy security_policy, InfCertificateCredentials* creds, InfSaslContext* sasl_context, const gchar* sasl_mechanisms) { GObject* object; g_return_val_if_fail(INF_IS_TCP_CONNECTION(tcp), NULL); g_return_val_if_fail( security_policy == INF_XMPP_CONNECTION_SECURITY_ONLY_UNSECURED || site == INF_XMPP_CONNECTION_CLIENT || creds != NULL, NULL ); object = g_object_new( INF_TYPE_XMPP_CONNECTION, "tcp-connection", tcp, "site", site, "local-hostname", local_hostname, "remote-hostname", remote_hostname, "security-policy", security_policy, "credentials", creds, "sasl-context", sasl_context, "sasl-mechanisms", sasl_mechanisms, NULL ); return INF_XMPP_CONNECTION(object); } /** * inf_xmpp_connection_get_tls_enabled: * @xmpp: A #InfXmppConnection. * * Returns whether TLS encryption is enabled for @xmpp. This returns %TRUE * as soon as the TLS handshake is completed but before the server certificate * was verified (see inf_xmpp_connection_set_certificate_callback()). * * Returns: %TRUE if TLS is enabled and %FALSE otherwise. */ gboolean inf_xmpp_connection_get_tls_enabled(InfXmppConnection* xmpp) { InfXmppConnectionPrivate* priv; g_return_val_if_fail(INF_IS_XMPP_CONNECTION(xmpp), FALSE); priv = INF_XMPP_CONNECTION_PRIVATE(xmpp); if(priv->status == INF_XMPP_CONNECTION_HANDSHAKING) return FALSE; if(priv->session == NULL) return FALSE; return TRUE; } /** * inf_xmpp_connection_set_certificate_callback: * @xmpp: A #InfXmppConnection. * @cb: Function to be called to verify the server certificate, or %NULL. * @user_data: Additional data to pass to the callback function. * * This function sets a callback that is called when the connection needs to * verify the server's certificate. It does not need to respond immediately, * but can, for example, show a dialog to a user and continue when the user * finished with it. * * When the certificate is trusted, then call * inf_xmpp_connection_certificate_verify_continue(), * otherwise inf_xmpp_connection_certificate_verify_cancel(). This can happen * in the callback or some time later. The connection process is stopped until * either of these functions is called. * * If @cb is %NULL, or this function has not been called before a certificate * needs to be verified, then the certificate is always trusted. */ void inf_xmpp_connection_set_certificate_callback(InfXmppConnection* xmpp, InfXmppConnectionCrtCallback cb, gpointer user_data) { InfXmppConnectionPrivate* priv; g_return_if_fail(INF_IS_XMPP_CONNECTION(xmpp)); priv = INF_XMPP_CONNECTION_PRIVATE(xmpp); priv->certificate_callback = cb; priv->certificate_callback_user_data = user_data; } /** * inf_xmpp_connection_certificate_verify_continue: * @xmpp: A #InfXmppConnection. * * Call this function when your callback set in * inf_xmpp_connection_set_certificate_callback() was called and you do trust * the server's certificate. The connection process will then continue. */ void inf_xmpp_connection_certificate_verify_continue(InfXmppConnection* xmpp) { InfXmppConnectionPrivate* priv; g_return_if_fail(INF_IS_XMPP_CONNECTION(xmpp)); priv = INF_XMPP_CONNECTION_PRIVATE(xmpp); g_return_if_fail(priv->status == INF_XMPP_CONNECTION_CONNECTED); g_return_if_fail(priv->session != NULL); inf_xmpp_connection_initiate(xmpp); } /** * inf_xmpp_connection_certificate_verify_cancel: * @xmpp: A #InfXmppConnection. * * Call this function when your callback set in * inf_xmpp_connection_set_certificate_callback() was called and you do not * trust the server's certificate. The connection will then be closed with a * corresponding error. */ void inf_xmpp_connection_certificate_verify_cancel(InfXmppConnection* xmpp) { InfXmppConnectionPrivate* priv; GError* error; g_return_if_fail(INF_IS_XMPP_CONNECTION(xmpp)); priv = INF_XMPP_CONNECTION_PRIVATE(xmpp); g_return_if_fail(priv->status == INF_XMPP_CONNECTION_CONNECTED); g_return_if_fail(priv->session != NULL); error = g_error_new_literal( inf_xmpp_connection_error_quark, INF_XMPP_CONNECTION_ERROR_CERTIFICATE_NOT_TRUSTED, _("The server certificate is not trusted") ); inf_xml_connection_error(INF_XML_CONNECTION(xmpp), error); g_error_free(error); inf_xmpp_connection_terminate(xmpp); } /** * inf_xmpp_connection_reset_sasl_authentication: * @xmpp: A #InfXmppConnection. * @new_context: The new sasl context to set, or %NULL. * @new_mechanisms: Allowed SASL mechanisms to use. Ignored if @new_context * is %NULL. * * Sets a new SASL context and mechanisms to use for authentication. This does * not have any effect if authentication has already been performed. This can * be useful if a server decides to use a stricter authentication policy and * gets away with its previous SASL context. If @new_context is %NULL, then a * built-in SASL context is used which only accepts anonymous authentication. * * If the authentication is currently in progress then it is aborted. The * server sends an %INF_XMPP_CONNECTION_AUTH_ERROR_TEMPORARY_AUTH_FAILURE * error to the client with %INF_AUTHENTICATION_DETAIL_ERROR_TRY_AGAIN detail * (see inf_xmpp_connection_get_sasl_error()). * * On the client side, if authentication is in progress, a request to abort * the authentication is sent to the server. The server will then reply with * an %INF_XMPP_CONNECTION_AUTH_ERROR_ABORTED error. In the signal handler of * the #InfXmlConnection::error signal you should reinitiate the authentication * with inf_xmpp_connection_retry_sasl_authentication() or the connection will * be closed. It is also possible that the final authentication request has * already been sent, and the server replies with successful authentication * instead. In that case calling this function will have no effect apart from * closing and reopening the connection will use the new context and * mechanisms. */ void inf_xmpp_connection_reset_sasl_authentication(InfXmppConnection* xmpp, InfSaslContext* new_context, const gchar* new_mechanisms) { InfXmppConnectionPrivate* priv; xmlNodePtr xml; g_return_if_fail(INF_IS_XMPP_CONNECTION(xmpp)); priv = INF_XMPP_CONNECTION_PRIVATE(xmpp); if(priv->status == INF_XMPP_CONNECTION_AUTHENTICATING) { switch(priv->site) { case INF_XMPP_CONNECTION_CLIENT: /* Send abort, wait for server reply (finish or failure), ignoring * challenges while doing so. Reset sasl_session to NULL to notify that * we are done with this session, but keep status while we are waiting * for server acknowledgement. The server might also be done with * authentication already. */ if(priv->sasl_session != NULL) { xml = inf_xmpp_connection_node_new_sasl("abort"); inf_xmpp_connection_send_xml(xmpp, xml); inf_sasl_context_stop_session(priv->sasl_context, priv->sasl_session); priv->sasl_session = NULL; } break; case INF_XMPP_CONNECTION_SERVER: /* Reset current SASL negotiation. Wait for client reply to current * challenge until we tell it to avoid race conditions. */ if(priv->sasl_session != NULL) { inf_sasl_context_stop_session(priv->sasl_context, priv->sasl_session); priv->sasl_session = NULL; } break; default: g_assert_not_reached(); break; } } if(priv->sasl_own_context != NULL) { inf_sasl_context_unref(priv->sasl_own_context); priv->sasl_own_context = NULL; } if(priv->sasl_context != NULL) inf_sasl_context_unref(priv->sasl_context); priv->sasl_context = new_context; if(new_context != NULL) inf_sasl_context_ref(new_context); g_free(priv->sasl_local_mechanisms); priv->sasl_local_mechanisms = g_strdup(new_mechanisms); g_object_freeze_notify(G_OBJECT(xmpp)); /* sasl_ensure also notifies */ if(new_context == NULL) { if(!inf_xmpp_connection_sasl_ensure(xmpp)) { /* OK, that's quite tough, but it should happen only rarely anyway, * and I don't think there is much we can do about it. This happens * when gsasl initialization of the built-in context fails. */ inf_xmpp_connection_deinitiate(xmpp); } } g_object_notify(G_OBJECT(xmpp), "sasl-context"); g_object_notify(G_OBJECT(xmpp), "sasl-mechanisms"); g_object_thaw_notify(G_OBJECT(xmpp)); } /** * inf_xmpp_connection_retry_sasl_authentication: * @xmpp: A #InfXmppConnection. * @error: Location to store error information, if any. * * When SASL authentication failed then the #InfXmlConnection::error signal * is emitted with an error from the INF_XMPP_CONNECTION_AUTH_ERROR domain. * If the signal handler wants to retry authentication then it should call * this function, possibly modifying the #InfXmppConnection:sasl-mechanisms * property before. If this function is not called then the connection will * terminate. * * The function can fail if the server does not support any of the available * mechanisms given in #InfXmppConnection:sasl-mechanisms. If so, the function * returns %FALSE and @error is set. * * Returns: %TRUE if auth retry is being performed, %FALSE otherwise. */ gboolean inf_xmpp_connection_retry_sasl_authentication(InfXmppConnection* xmpp, GError** error) { InfXmppConnectionPrivate* priv; const gchar* suggestion; priv = INF_XMPP_CONNECTION_PRIVATE(xmpp); g_return_val_if_fail( priv->status == INF_XMPP_CONNECTION_AWAITING_FEATURES, FALSE ); suggestion = inf_xmpp_connection_sasl_suggest_mechanism(xmpp, error); if(suggestion == NULL) return FALSE; inf_xmpp_connection_sasl_init(xmpp, suggestion); return TRUE; } /** * inf_xmpp_connection_set_sasl_error: * @xmpp: A #InfXmppConnection. * @error: The SASL error to set. * * Sets the SASL error of @xmpp. The SASL error is an additional hint of what * went wrong during authentication. It should be set on the server side * in the gsasl callback checking the user authentication. If on the * client side #InfXmlConnection::error is emitted with an error from the * INF_XMPP_CONNECTION_AUTH_ERROR domain then * inf_xmpp_connection_get_sasl_error() can be used to obtain more detailed * error information. */ void inf_xmpp_connection_set_sasl_error(InfXmppConnection* xmpp, const GError* error) { InfXmppConnectionPrivate* priv; priv = INF_XMPP_CONNECTION_PRIVATE(xmpp); g_return_if_fail(priv->sasl_context != NULL); g_return_if_fail(priv->sasl_error == NULL); priv->sasl_error = g_error_copy(error); } /** * inf_xmpp_connection_get_sasl_error: * @xmpp: A #InfXmppConnection. * * Gets the SASL error of @xmpp. See inf_xmpp_connection_set_sasl_error(). * * Returns: A pointer to a #GError object owned by @xmpp. */ const GError* inf_xmpp_connection_get_sasl_error(InfXmppConnection* xmpp) { InfXmppConnectionPrivate* priv; priv = INF_XMPP_CONNECTION_PRIVATE(xmpp); g_return_val_if_fail(priv->sasl_context != NULL, NULL); return priv->sasl_error; } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/common/inf-tcp-connection-private.h0000644000175000017500000000247212264763742022132 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_TCP_CONNECTION_PRIVATE_H__ #define __INF_TCP_CONNECTION_PRIVATE_H__ #include #include G_BEGIN_DECLS InfTcpConnection* _inf_tcp_connection_accepted(InfIo* io, InfNativeSocket socket, InfIpAddress* address, guint port, GError** error); G_END_DECLS #endif /* __INF_TCP_CONNECTION_PRIVATE_H__ */ libinfinity-0.5.5/libinfinity/common/inf-xml-connection.h0000644000175000017500000000617412264763732020476 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_XML_CONNECTION_H__ #define __INF_XML_CONNECTION_H__ #include #include G_BEGIN_DECLS #define INF_TYPE_XML_CONNECTION (inf_xml_connection_get_type()) #define INF_XML_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INF_TYPE_XML_CONNECTION, InfXmlConnection)) #define INF_IS_XML_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INF_TYPE_XML_CONNECTION)) #define INF_XML_CONNECTION_GET_IFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE((inst), INF_TYPE_XML_CONNECTION, InfXmlConnectionIface)) #define INF_TYPE_XML_CONNECTION_STATUS (inf_xml_connection_status_get_type()) typedef struct _InfXmlConnection InfXmlConnection; typedef struct _InfXmlConnectionIface InfXmlConnectionIface; typedef enum _InfXmlConnectionStatus { INF_XML_CONNECTION_CLOSED, INF_XML_CONNECTION_CLOSING, INF_XML_CONNECTION_OPEN, INF_XML_CONNECTION_OPENING } InfXmlConnectionStatus; struct _InfXmlConnectionIface { GTypeInterface parent; /* Virtual table */ gboolean (*open)(InfXmlConnection* connection, GError** error); void (*close)(InfXmlConnection* connection); void (*send)(InfXmlConnection* connection, xmlNodePtr xml); /* Signals */ void (*sent)(InfXmlConnection* connection, const xmlNodePtr xml); void (*received)(InfXmlConnection* connection, const xmlNodePtr xml); void (*error)(InfXmlConnection* connection, const GError* error); }; GType inf_xml_connection_status_get_type(void) G_GNUC_CONST; GType inf_xml_connection_get_type(void) G_GNUC_CONST; gboolean inf_xml_connection_open(InfXmlConnection* connection, GError** error); void inf_xml_connection_close(InfXmlConnection* connection); void inf_xml_connection_send(InfXmlConnection* connection, xmlNodePtr xml); void inf_xml_connection_sent(InfXmlConnection* connection, const xmlNodePtr xml); void inf_xml_connection_received(InfXmlConnection* connection, const xmlNodePtr xml); void inf_xml_connection_error(InfXmlConnection* connection, const GError* error); G_END_DECLS #endif /* __INF_XML_CONNECTION_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/common/inf-io.c0000644000175000017500000002036712264763732016143 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ /** * SECTION:inf-io * @title: InfIo * @short_description: Event loop abstraction * @include: libinfinity/common/inf-io.h * @see_also: #InfStandaloneIo * @stability: Unstable * * The #InfIo interface is used to schedule timeouts and to watch sockets for * events to occur. An actual implementation usually integrates this into the * application main loop, such as #GMainLoop. There is also a standalone * implementation, #InfStandaloneIo, that can directly be used as the * application's main loop. * * Every object in Libinfinity that needs to schedule timeouts or watches * sockets uses a InfIo to do so. This allows to use libinfinity with * different main event loops, not only Glib's one. * * #InfIo is guaranteed to be thread-safe. All functions can be called from * any thread at any time. However, all callback functions are always called * from the same thread (normally the one running the main loop). **/ #include GType inf_io_event_get_type(void) { static GType io_event_type = 0; if(!io_event_type) { static const GFlagsValue io_event_values[] = { { INF_IO_INCOMING, "INF_IO_INCOMING", "incoming" }, { INF_IO_OUTGOING, "INF_IO_OUTGOING", "outgoing" }, { INF_IO_ERROR, "INF_IO_ERROR", "error" }, { 0, NULL, NULL } }; io_event_type = g_flags_register_static( "InfIoEvent", io_event_values ); } return io_event_type; } GType inf_io_get_type(void) { static GType io_type = 0; if(!io_type) { static const GTypeInfo io_info = { sizeof(InfIoIface), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ NULL, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ 0, /* instance_size */ 0, /* n_preallocs */ NULL, /* instance_init */ NULL /* value_table */ }; io_type = g_type_register_static( G_TYPE_INTERFACE, "InfIo", &io_info, 0 ); g_type_interface_add_prerequisite(io_type, G_TYPE_OBJECT); } return io_type; } /** * inf_io_add_watch: * @io: A #InfIo. * @socket: The socket to watch. * @events: Events to watch for. * @func: Function to be called when one of the events occurs. * @user_data: Extra data to pass to @func. * @notify: A #GDestroyNotify that is called when @user_data is no longer * needed, or %NULL. * * Monitors the given socket for activity and calls @func if one of the * events specified in @events occurs. * * Returns: A #InfIoWatch that can be used to update or remove the watch. **/ InfIoWatch* inf_io_add_watch(InfIo* io, InfNativeSocket* socket, InfIoEvent events, InfIoWatchFunc func, gpointer user_data, GDestroyNotify notify) { InfIoIface* iface; g_return_val_if_fail(INF_IS_IO(io), NULL); g_return_val_if_fail(socket != NULL, NULL); g_return_val_if_fail(func != NULL, NULL); iface = INF_IO_GET_IFACE(io); g_return_val_if_fail(iface->add_watch != NULL, NULL); return iface->add_watch(io, socket, events, func, user_data, notify); } /** * inf_io_update_watch: * @io: A #InfIo. * @watch: The watch to update, as returned by inf_io_add_watch(). * @events: The new events to watch for. * * Changes the events that the socket bound to @watch is being watched for. * The callback of @watch will only be called if one of the newly watched for * events occurs. */ void inf_io_update_watch(InfIo* io, InfIoWatch* watch, InfIoEvent events) { InfIoIface* iface; g_return_if_fail(INF_IS_IO(io)); g_return_if_fail(watch != NULL); iface = INF_IO_GET_IFACE(io); g_return_if_fail(iface->update_watch != NULL); iface->update_watch(io, watch, events); } /** * inf_io_remove_watch: * @io: A #InfIo. * @watch: The watch to remove, as returned by inf_io_add_watch(). * * Removes @watch from @io and releases all resources allocated for the watch. * Events are no longer looked for on the socket. */ void inf_io_remove_watch(InfIo* io, InfIoWatch* watch) { InfIoIface* iface; g_return_if_fail(INF_IS_IO(io)); g_return_if_fail(watch != NULL); iface = INF_IO_GET_IFACE(io); g_return_if_fail(iface->remove_watch != NULL); iface->remove_watch(io, watch); } /** * inf_io_add_timeout: * @io: A #InfIo. * @msecs: Number of milliseconds after which the timeout should be elapsed. * @func: Function to be called when the timeout elapsed. * @user_data: Extra data to pass to @func. * @notify: A #GDestroyNotify that is called when @user_data is no longer * needed, or %NULL. * * Calls @func after at least @msecs milliseconds have elapsed. The timeout * is removed after it has elapsed. * * Returns: A timeout handle that can be used to remove the timeout. **/ InfIoTimeout* inf_io_add_timeout(InfIo* io, guint msecs, InfIoTimeoutFunc func, gpointer user_data, GDestroyNotify notify) { InfIoIface* iface; g_return_val_if_fail(INF_IS_IO(io), NULL); g_return_val_if_fail(func != NULL, NULL); iface = INF_IO_GET_IFACE(io); g_return_val_if_fail(iface->add_timeout != NULL, NULL); return iface->add_timeout(io, msecs, func, user_data, notify); } /** * inf_io_remove_timeout: * @io: A #InfIo. * @timeout: A timeout handle obtained from inf_io_add_timeout(). * * Removes the given timeout. **/ void inf_io_remove_timeout(InfIo* io, InfIoTimeout* timeout) { InfIoIface* iface; g_return_if_fail(INF_IS_IO(io)); g_return_if_fail(timeout != NULL); iface = INF_IO_GET_IFACE(io); g_return_if_fail(iface->remove_timeout != NULL); iface->remove_timeout(io, timeout); } /** * inf_io_add_dispatch: * @io: A #InfIo. * @func: Function to be called when the function is dispatched. * @user_data: Extra data to pass to @func. * @notify: A #GDestroyNotify that is called when @user_data is no longer * needed, or %NULL. * * Schedules @func to be called by the thread @io runs in. This function can * be used from a different thread to communicate to @io's thread. * * Returns: A dispatch handle that can be used to stop the dispatched function * from being called as long as it has not yet been called. **/ InfIoDispatch* inf_io_add_dispatch(InfIo* io, InfIoDispatchFunc func, gpointer user_data, GDestroyNotify notify) { InfIoIface* iface; g_return_val_if_fail(INF_IS_IO(io), NULL); g_return_val_if_fail(func != NULL, NULL); iface = INF_IO_GET_IFACE(io); g_return_val_if_fail(iface->add_dispatch != NULL, NULL); return iface->add_dispatch(io, func, user_data, notify); } /** * inf_io_remove_dispatch: * @io: A #InfIo. * @dispatch: A dispatch handle obtained from inf_io_add_dispatch(). * * Removes the given dispatch from @io so that it is not called. **/ void inf_io_remove_dispatch(InfIo* io, InfIoDispatch* dispatch) { InfIoIface* iface; g_return_if_fail(INF_IS_IO(io)); g_return_if_fail(dispatch != NULL); iface = INF_IO_GET_IFACE(io); g_return_if_fail(iface->remove_dispatch != NULL); iface->remove_dispatch(io, dispatch); } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/common/inf-ip-address.h0000644000175000017500000000471712264763732017575 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_IP_ADDRESS_H__ #define __INF_IP_ADDRESS_H__ #include G_BEGIN_DECLS #define INF_TYPE_IP_ADDRESS (inf_ip_address_get_type()) #define INF_TYPE_IP_ADDRESS_FAMILY (inf_ip_address_family_get_type()) /** * InfIpAddress: * * #InfIpAddress is an opaque data type. You should only access it * via the public API functions. */ typedef struct _InfIpAddress InfIpAddress; /** * InfIpAddressFamily: * @INF_IP_ADDRESS_IPV4: This specifies an IPv4 address. * @INF_IP_ADDRESS_IPV6: This specifies an IPv6 address. * * This enumeration specifies different types of IP addresses. */ typedef enum _InfIpAddressFamily { INF_IP_ADDRESS_IPV4, INF_IP_ADDRESS_IPV6 } InfIpAddressFamily; GType inf_ip_address_family_get_type(void) G_GNUC_CONST; GType inf_ip_address_get_type(void) G_GNUC_CONST; InfIpAddress* inf_ip_address_new_raw4(guint32 address); InfIpAddress* inf_ip_address_new_loopback4(void); InfIpAddress* inf_ip_address_new_raw6(const guint8 address[16]); InfIpAddress* inf_ip_address_new_loopback6(void); InfIpAddress* inf_ip_address_new_from_string(const gchar* str); InfIpAddress* inf_ip_address_copy(const InfIpAddress* address); void inf_ip_address_free(InfIpAddress* address); InfIpAddressFamily inf_ip_address_get_family(const InfIpAddress* address); gconstpointer inf_ip_address_get_raw(const InfIpAddress* address); gchar* inf_ip_address_to_string(const InfIpAddress* address); int inf_ip_address_collate(const InfIpAddress* address1, const InfIpAddress* address2); G_END_DECLS #endif /* __INF_IP_ADDRESS_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/common/inf-certificate-credentials.c0000644000175000017500000000722012264763732022302 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ /** * SECTION:inf-certificate-credentials * @title: InfCertificateCredentials * @short_description: Reference-counted wrapper for * #gnutls_certificate_credentials_t * @include: libinfinity/common/inf-certificate-credentials.h * @stability: Unstable * * This is a thin wrapper class for #gnutls_certificate_credentials_t. It * provides reference counting and a boxed GType for it. **/ #include struct _InfCertificateCredentials { guint ref_count; gnutls_certificate_credentials_t creds; }; GType inf_certificate_credentials_get_type(void) { static GType certificate_credentials_type = 0; if(!certificate_credentials_type) { certificate_credentials_type = g_boxed_type_register_static( "InfCertificateCredentials", (GBoxedCopyFunc)inf_certificate_credentials_ref, (GBoxedFreeFunc)inf_certificate_credentials_unref ); } return certificate_credentials_type; } /** * inf_certificate_credentials_new: * * Creates a new #InfCertificateCredentials with an initial reference count * of 1. Use inf_certificate_credentials_get() to access the underlying * #gnutls_certificate_credentials_t. * * Returns: A new #InfCertificateCredentials. Free with * inf_certificate_credentials_unref() when no longer needed. */ InfCertificateCredentials* inf_certificate_credentials_new(void) { InfCertificateCredentials* creds; creds = g_slice_new(InfCertificateCredentials); creds->ref_count = 1; gnutls_certificate_allocate_credentials(&creds->creds); return creds; } /** * inf_certificate_credentials_ref: * @creds: A #InfCertificateCredentials. * * Increases the reference count of @creds by 1. * * Returns: The passed #InfCertificateCredentials, @creds. */ InfCertificateCredentials* inf_certificate_credentials_ref(InfCertificateCredentials* creds) { g_return_val_if_fail(creds != NULL, NULL); ++creds->ref_count; return creds; } /** * inf_certificate_credentials_unref: * @creds: A #InfCertificateCredentials. * * Decreases the reference count of @creds by 1. If its reference count * reaches 0, then the #InfCertificateCredentials will be freed. */ void inf_certificate_credentials_unref(InfCertificateCredentials* creds) { g_return_if_fail(creds != NULL); if(!--creds->ref_count) { gnutls_certificate_free_credentials(creds->creds); g_slice_free(InfCertificateCredentials, creds); } } /** * inf_certificate_credentials_get: * @creds: A #InfCertificateCredentials. * * Provides access to the @creds' underlying * #gnutls_certificate_credentials_t. * * Returns: @creds' #gnutls_certificate_credentials_t. */ gnutls_certificate_credentials_t inf_certificate_credentials_get(InfCertificateCredentials* creds) { g_return_val_if_fail(creds != NULL, NULL); return creds->creds; } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/common/inf-discovery.c0000644000175000017500000002240112264763732017532 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ /** * SECTION:inf-discovery * @short_description: Discovery of remote services * @include: libinfinity/common/inf-discovery.h * @see_also: #InfDiscoveryAvahi * * #InfDiscovery provides a common interface for the discovery of services. * Discovered services are represented by #InfDiscoveryInfo objects * and can be used to query the name of the discovered service. * * To create a connection to the host providing a discovered service, use * inf_discovery_resolve(). */ #include #include enum { DISCOVERED, UNDISCOVERED, LAST_SIGNAL }; static guint discovery_signals[LAST_SIGNAL]; static void inf_discovery_base_init(gpointer g_class) { static gboolean initialized = FALSE; if(!initialized) { /** * InfDiscovery::discovered: * @discoverer: The #InfDiscovery object discovering something * @info: The #InfDiscoveryInfo describing the discovered service * * This signal is detailed. The detail is the name of the service that has * been discovered, so you can connect to * "discovered::my-service-name" if you are * only interested in a particular service. */ discovery_signals[DISCOVERED] = g_signal_new( "discovered", INF_TYPE_DISCOVERY, G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, G_STRUCT_OFFSET(InfDiscoveryIface, discovered), NULL, NULL, inf_marshal_VOID__POINTER, G_TYPE_NONE, 1, G_TYPE_POINTER /* InfDiscoveryInfo* */ ); /** * InfDiscovery::undiscovered: * @discoverer: The #InfDiscovery object undiscovering something * @info: The #InfDiscoveryInfo describing the undiscovered service * * This signal is emitted if a previously discovered service is no longer * available. * * This signal is detailed. The detail is the name of the service that has * been undiscovered, so you can connect to * "undiscovered::my-service-name" if you * are only interested in a particular service. */ discovery_signals[UNDISCOVERED] = g_signal_new( "undiscovered", INF_TYPE_DISCOVERY, G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, G_STRUCT_OFFSET(InfDiscoveryIface, undiscovered), NULL, NULL, inf_marshal_VOID__POINTER, G_TYPE_NONE, 1, G_TYPE_POINTER ); initialized = TRUE; } } GType inf_discovery_get_type(void) { static GType discovery_type = 0; if(!discovery_type) { static const GTypeInfo discovery_info = { sizeof(InfDiscoveryIface), /* class_size */ inf_discovery_base_init, /* base_init */ NULL, /* base_finalize */ NULL, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ 0, /* instance_size */ 0, /* n_preallocs */ NULL, /* instance_init */ NULL /* value_table */ }; discovery_type = g_type_register_static( G_TYPE_INTERFACE, "InfDiscovery", &discovery_info, 0 ); g_type_interface_add_prerequisite(discovery_type, G_TYPE_OBJECT); } return discovery_type; } /** * inf_discovery_discover: * @discovery: A #InfDiscovery. * @type: The service type to discover. * * Starts the discovery of the given service type. Whenever a service of * this type is discovered, the "discovered" signal is emitted. If the * service disappears, the "undiscovered" signal is emitted. This can be * called more than once for the same type, but only the first call has * an effect. * * Note also that implementations of #InfDiscovery might restrict the * service types that can be discovered. **/ void inf_discovery_discover(InfDiscovery* discovery, const gchar* type) { InfDiscoveryIface* iface; g_return_if_fail(INF_IS_DISCOVERY(discovery)); g_return_if_fail(type != NULL); iface = INF_DISCOVERY_GET_IFACE(discovery); g_return_if_fail(iface->discover != NULL); iface->discover(discovery, type); } /** * inf_discovery_get_discovered: * @discovery: A #InfDiscovery. * @type: The service type of which to get discovered infos for. * * Returns a list of discovered #InfDiscoveryInfo for the given type. * * Return Value: A newly allocated list that needs to be freed with * g_slist_free(). **/ GSList* inf_discovery_get_discovered(InfDiscovery* discovery, const gchar* type) { InfDiscoveryIface* iface; g_return_val_if_fail(INF_IS_DISCOVERY(discovery), NULL); g_return_val_if_fail(type != NULL, NULL); iface = INF_DISCOVERY_GET_IFACE(discovery); g_return_val_if_fail(iface->get_discovered != NULL, NULL); return iface->get_discovered(discovery, type); } /** * inf_discovery_resolve: * @discovery: A #InfDiscovery. * @info: A #InfDiscoveryInfo discovered by @discovery. * @complete_func: A callback that will be called when the resolving process * has completed. * @error_func: A callback that will be called when an error has occured. * @user_data: Extra data to pass to @complete_func and @error_func. * * Attempts to resolve @info. Resolving a #InfDiscoveryInfo means creating * a #InfXmlConnection to the publisher. The connection might not be * open when @complete_func runs. This will call either @complete_func * or @error_func, but not both. **/ void inf_discovery_resolve(InfDiscovery* discovery, InfDiscoveryInfo* info, InfDiscoveryResolvCompleteFunc complete_func, InfDiscoveryResolvErrorFunc error_func, gpointer user_data) { InfDiscoveryIface* iface; g_return_if_fail(INF_IS_DISCOVERY(discovery)); g_return_if_fail(info != NULL); iface = INF_DISCOVERY_GET_IFACE(discovery); g_return_if_fail(iface->resolve != NULL); iface->resolve(discovery, info, complete_func, error_func, user_data); } /** * inf_discovery_info_get_service_name: * @discovery: A #InfDiscovery. * @info: A #InfDiscoveryInfo discovered by @discovery. * * Returns the service name of the discovered @info. * * Return Value: A string owned by @discovery. **/ gchar* inf_discovery_info_get_service_name(InfDiscovery* discovery, InfDiscoveryInfo* info) { InfDiscoveryIface* iface; g_return_val_if_fail(INF_IS_DISCOVERY(discovery), NULL); g_return_val_if_fail(info != NULL, NULL); iface = INF_DISCOVERY_GET_IFACE(discovery); g_return_val_if_fail(iface->info_get_service_name != NULL, NULL); return iface->info_get_service_name(discovery, info); } /** * inf_discovery_info_get_service_type: * @discovery: A #InfDiscovery. * @info: A #InfDiscoveryInfo discovered by @discovery. * * Returns the service type of the discovered @info. * * Return Value: A string owned by @discovery. **/ const gchar* inf_discovery_info_get_service_type(InfDiscovery* discovery, InfDiscoveryInfo* info) { InfDiscoveryIface* iface; g_return_val_if_fail(INF_IS_DISCOVERY(discovery), NULL); g_return_val_if_fail(info != NULL, NULL); iface = INF_DISCOVERY_GET_IFACE(discovery); g_return_val_if_fail(iface->info_get_service_type != NULL, NULL); return iface->info_get_service_type(discovery, info); } /** * inf_discovery_discovered: * @discovery: A #InfDiscovery. * @info: The discovered #InfDiscoveryInfo. * * Emits the "discovered" signal on @discovery. **/ void inf_discovery_discovered(InfDiscovery* discovery, InfDiscoveryInfo* info) { g_return_if_fail(INF_IS_DISCOVERY(discovery)); g_return_if_fail(info != NULL); g_signal_emit( G_OBJECT(discovery), discovery_signals[DISCOVERED], g_quark_from_string(inf_discovery_info_get_service_type(discovery, info)), info ); } /** * inf_discovery_undiscovered: * @discovery: A #InfDiscovery. * @info: The undiscovered @InfDiscoveryInfo. * * Emits the "undiscovered" signal on @discovery. **/ void inf_discovery_undiscovered(InfDiscovery* discovery, InfDiscoveryInfo* info) { g_return_if_fail(INF_IS_DISCOVERY(discovery)); g_return_if_fail(info != NULL); g_signal_emit( G_OBJECT(discovery), discovery_signals[UNDISCOVERED], g_quark_from_string(inf_discovery_info_get_service_type(discovery, info)), info ); } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/inf-config.h0000664000175000017500000000245512262034752015505 00000000000000/* libinfinity/inf-config.h. Generated from inf-config.h.in by configure. */ /* infinote - Collaborative notetaking application * Copyright (C) 2007 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ /* Defines representing support for what features has been compiled into * libinfinity. All these defines are prefixed, so it is safe to be installed * and used by other packages. */ /* Whether avahi support is enabled */ #define LIBINFINITY_HAVE_AVAHI 1 /* Whether libdaemon support is enabled */ #define LIBINFINITY_HAVE_LIBDAEMON 1 /* Whether pam support is enabled */ /* #undef LIBINFINITY_HAVE_PAM */ libinfinity-0.5.5/libinfinity/inf-config.h.in0000644000175000017500000000232212204652337016102 00000000000000/* infinote - Collaborative notetaking application * Copyright (C) 2007 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ /* Defines representing support for what features has been compiled into * libinfinity. All these defines are prefixed, so it is safe to be installed * and used by other packages. */ /* Whether avahi support is enabled */ #undef LIBINFINITY_HAVE_AVAHI /* Whether libdaemon support is enabled */ #undef LIBINFINITY_HAVE_LIBDAEMON /* Whether pam support is enabled */ #undef LIBINFINITY_HAVE_PAM libinfinity-0.5.5/libinfinity/inf-i18n.h0000644000175000017500000000227212264763732015023 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_I18N_H__ #define __INF_I18N_H__ #include #define _(String) _inf_gettext(String) #ifdef gettext_noop # define N_(String) gettext_noop(String) #else # define N_(String) (String) #endif void _inf_gettext_init(void); const char* _inf_gettext(const char* msgid); #endif /* __INF_I18N_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/inf-marshal.in0000644000175000017500000000062612264763732016053 00000000000000VOID:VOID VOID:BOXED VOID:BOXED,DOUBLE,DOUBLE VOID:OBJECT VOID:POINTER VOID:OBJECT,DOUBLE VOID:OBJECT,POINTER VOID:POINTER,UINT VOID:UINT VOID:UINT,UINT VOID:OBJECT,BOOLEAN VOID:UINT,BOXED,OBJECT VOID:UINT,INT,BOOLEAN VOID:OBJECT,OBJECT VOID:BOXED,OBJECT VOID:BOXED,BOXED,OBJECT VOID:OBJECT,OBJECT,BOOLEAN VOID:DOUBLE VOID:ENUM BOOLEAN:OBJECT,OBJECT VOID:OBJECT,UINT POINTER:POINTER POINTER:OBJECT,POINTER libinfinity-0.5.5/libinfinity/server/0000755000175000017500000000000012264766267014712 500000000000000libinfinity-0.5.5/libinfinity/server/infd-note-plugin.h0000644000175000017500000000544512264763732020164 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INFD_NOTE_PLUGIN_H__ #define __INFD_NOTE_PLUGIN_H__ #include #include #include #include #include #include G_BEGIN_DECLS /* TODO: GTypeModule stuff? */ typedef InfSession*(*InfdNotePluginSessionNew)(InfIo*, InfCommunicationManager*, InfSessionStatus, InfCommunicationHostedGroup*, InfXmlConnection*, gpointer); typedef InfSession*(*InfdNotePluginSessionRead)(InfdStorage*, InfIo*, InfCommunicationManager*, const gchar*, gpointer, GError**); typedef gboolean(*InfdNotePluginSessionWrite)(InfdStorage*, InfSession*, const gchar*, gpointer, GError**); typedef struct _InfdNotePlugin InfdNotePlugin; struct _InfdNotePlugin { gpointer user_data; /* The typename of the storage backend this plugin can be used with, such * as InfdFilesystemStorage. */ const gchar* storage_type; /* The note type this plugin handles, such as InfText */ const gchar* note_type; InfdNotePluginSessionNew session_new; InfdNotePluginSessionRead session_read; InfdNotePluginSessionWrite session_write; }; G_END_DECLS #endif /* __INFD_NOTE_PLUGIN_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/server/infd-xml-server.h0000644000175000017500000000452712264763732020027 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INFD_XML_SERVER_H__ #define __INFD_XML_SERVER_H__ #include #include G_BEGIN_DECLS #define INFD_TYPE_XML_SERVER (infd_xml_server_get_type()) #define INFD_XML_SERVER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INFD_TYPE_XML_SERVER, InfdXmlServer)) #define INFD_IS_XML_SERVER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INFD_TYPE_XML_SERVER)) #define INFD_XML_SERVER_GET_IFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE((inst), INFD_TYPE_XML_SERVER, InfdXmlServerIface)) #define INFD_TYPE_XML_SERVER_STATUS (infd_xml_server_status_get_type()) typedef struct _InfdXmlServer InfdXmlServer; typedef struct _InfdXmlServerIface InfdXmlServerIface; typedef enum _InfdXmlServerStatus { INFD_XML_SERVER_CLOSED, INFD_XML_SERVER_CLOSING, INFD_XML_SERVER_OPEN, INFD_XML_SERVER_OPENING } InfdXmlServerStatus; struct _InfdXmlServerIface { GTypeInterface parent; /* Virtual Table */ void (*close)(InfdXmlServer* server); /* Signals */ void (*new_connection)(InfdXmlServer* server, InfXmlConnection* connection); }; GType infd_xml_server_status_get_type(void) G_GNUC_CONST; GType infd_xml_server_get_type(void) G_GNUC_CONST; void infd_xml_server_close(InfdXmlServer* server); void infd_xml_server_new_connection(InfdXmlServer* server, InfXmlConnection* connection); G_END_DECLS #endif /* __INFD_XML_SERVER_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/server/Makefile.am0000644000175000017500000000122712264763732016662 00000000000000noinst_LTLIBRARIES = libinfinity_server.la libinfinity_server_la_CPPFLAGS = \ -I$(top_srcdir) \ $(infinity_CFLAGS) libinfinity_server_ladir = \ $(includedir)/libinfinity-$(LIBINFINITY_API_VERSION)/libinfinity/server libinfinity_server_la_SOURCES = \ infd-directory.c \ infd-filesystem-storage.c \ infd-server-pool.c \ infd-session-proxy.c \ infd-storage.c \ infd-tcp-server.c \ infd-xml-server.c \ infd-xmpp-server.c libinfinity_server_la_HEADERS = \ infd-directory.h \ infd-filesystem-storage.h \ infd-note-plugin.h \ infd-server-pool.h \ infd-session-proxy.h \ infd-storage.h \ infd-tcp-server.h \ infd-xml-server.h \ infd-xmpp-server.h libinfinity-0.5.5/libinfinity/server/infd-session-proxy.h0000644000175000017500000000606112264763732020560 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INFD_SESSION_PROXY_H__ #define __INFD_SESSION_PROXY_H__ #include #include G_BEGIN_DECLS #define INFD_TYPE_SESSION_PROXY (infd_session_proxy_get_type()) #define INFD_SESSION_PROXY(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INFD_TYPE_SESSION_PROXY, InfdSessionProxy)) #define INFD_SESSION_PROXY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INFD_TYPE_SESSION_PROXY, InfdSessionProxyClass)) #define INFD_IS_SESSION_PROXY(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INFD_TYPE_SESSION_PROXY)) #define INFD_IS_SESSION_PROXY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INFD_TYPE_SESSION_PROXY)) #define INFD_SESSION_PROXY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), INFD_TYPE_SESSION_PROXY, InfdSessionProxyClass)) typedef struct _InfdSessionProxy InfdSessionProxy; typedef struct _InfdSessionProxyClass InfdSessionProxyClass; struct _InfdSessionProxyClass { GObjectClass parent_class; /* Signals */ void (*add_subscription)(InfdSessionProxy* proxy, InfXmlConnection* connection, guint seq_id); void (*remove_subscription)(InfdSessionProxy* proxy, InfXmlConnection* connection); }; struct _InfdSessionProxy { GObject parent; }; GType infd_session_proxy_get_type(void) G_GNUC_CONST; InfSession* infd_session_proxy_get_session(InfdSessionProxy* proxy); InfUser* infd_session_proxy_add_user(InfdSessionProxy* proxy, const GParameter* params, guint n_params, GError** error); void infd_session_proxy_subscribe_to(InfdSessionProxy* proxy, InfXmlConnection* connection, guint seq_id, gboolean synchronize); gboolean infd_session_proxy_has_subscriptions(InfdSessionProxy* proxy); gboolean infd_session_proxy_is_subscribed(InfdSessionProxy* proxy, InfXmlConnection* connection); gboolean infd_session_proxy_is_idle(InfdSessionProxy* proxy); G_END_DECLS #endif /* __INFD_SESSION_PROXY_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/server/infd-directory.c0000644000175000017500000041335212264763732017722 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ /** * SECTION:infd-directory * @short_description: Directory of published documents * @see_also: #InfcBrowser, #InfdStorage * @include: libinfinity/server/infd-directory.h * @stability: Unstable * * The #InfdDirectory manages a directory of documents. An item in the * directory is also called "node". A node may either be a * subdirectory or a document (also called "note"). Notes may be of * different type - there may be plain text notes, rich text notes, * graphics notes, etc. * * #InfdStorage defines where the directory structure and the notes are read * from and how there are permanently stored. **/ #include #include #include #include #include #include #include #include #include #include #include typedef struct _InfdDirectoryNode InfdDirectoryNode; struct _InfdDirectoryNode { InfdDirectoryNode* parent; InfdDirectoryNode* prev; InfdDirectoryNode* next; InfdStorageNodeType type; guint id; gchar* name; union { struct { /* Running session, or NULL */ InfdSessionProxy* session; /* Session type */ const InfdNotePlugin* plugin; /* Timeout to save the session when inactive for some time */ InfIoTimeout* save_timeout; } note; struct { /* List of connections that have this folder open and have to be * notified if something happens with it. */ GSList* connections; /* First child node */ InfdDirectoryNode* child; /* Whether we requested the node already from the background storage. * This is required because the nodes field may be NULL due to an empty * subdirectory or due to an unexplored subdirectory. */ gboolean explored; } subdir; } shared; }; typedef struct _InfdDirectorySessionSaveTimeoutData InfdDirectorySessionSaveTimeoutData; struct _InfdDirectorySessionSaveTimeoutData { InfdDirectory* directory; InfdDirectoryNode* node; }; typedef struct _InfdDirectorySyncIn InfdDirectorySyncIn; struct _InfdDirectorySyncIn { InfdDirectory* directory; InfdDirectoryNode* parent; guint node_id; gchar* name; const InfdNotePlugin* plugin; InfdSessionProxy* proxy; }; typedef enum _InfdDirectorySubreqType { INFD_DIRECTORY_SUBREQ_CHAT, INFD_DIRECTORY_SUBREQ_SESSION, INFD_DIRECTORY_SUBREQ_ADD_NODE, INFD_DIRECTORY_SUBREQ_SYNC_IN, INFD_DIRECTORY_SUBREQ_SYNC_IN_SUBSCRIBE } InfdDirectorySubreqType; /* Subscription request */ typedef struct _InfdDirectorySubreq InfdDirectorySubreq; struct _InfdDirectorySubreq { InfdDirectorySubreqType type; InfXmlConnection* connection; /* TODO: Should maybe go to shared as CHAT is not using this: */ guint node_id; union { struct { InfdSessionProxy* session; } session; struct { InfdDirectoryNode* parent; InfCommunicationHostedGroup* group; const InfdNotePlugin* plugin; gchar* name; /* TODO: Isn't group already present in proxy? */ InfdSessionProxy* proxy; } add_node; struct { InfdDirectoryNode* parent; InfCommunicationHostedGroup* synchronization_group; InfCommunicationHostedGroup* subscription_group; const InfdNotePlugin* plugin; gchar* name; /* TODO: Aren't the groups already present in proxy? */ InfdSessionProxy* proxy; } sync_in; } shared; }; typedef struct _InfdDirectoryConnectionInfo InfdDirectoryConnectionInfo; struct _InfdDirectoryConnectionInfo { guint seq_id; }; typedef struct _InfdDirectoryPrivate InfdDirectoryPrivate; struct _InfdDirectoryPrivate { InfIo* io; InfdStorage* storage; InfCommunicationManager* communication_manager; InfCommunicationHostedGroup* group; GHashTable* plugins; /* Registered plugins */ GHashTable* connections; /* Connection infos */ guint node_counter; GHashTable* nodes; /* Mapping from id to node */ InfdDirectoryNode* root; GSList* sync_ins; GSList* subscription_requests; InfdSessionProxy* chat_session; }; enum { PROP_0, PROP_IO, PROP_STORAGE, PROP_COMMUNICATION_MANAGER, /* read only */ PROP_CHAT_SESSION }; enum { NODE_ADDED, NODE_REMOVED, ADD_SESSION, REMOVE_SESSION, LAST_SIGNAL }; #define INFD_DIRECTORY_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), INFD_TYPE_DIRECTORY, InfdDirectoryPrivate)) /* These make sure that the node iter points to is contained in directory */ #define infd_directory_return_if_iter_fail(directory, iter) \ g_return_if_fail( \ g_hash_table_lookup( \ INFD_DIRECTORY_PRIVATE(INFD_DIRECTORY(directory))->nodes, \ GUINT_TO_POINTER((iter)->node_id) \ ) == (iter)->node \ ) #define infd_directory_return_val_if_iter_fail(directory, iter, val) \ g_return_val_if_fail( \ g_hash_table_lookup( \ INFD_DIRECTORY_PRIVATE(INFD_DIRECTORY(directory))->nodes, \ GUINT_TO_POINTER((iter)->node_id) \ ) == (iter)->node, \ val \ ) /* These make sure that node is a subdirectory node */ #define infd_directory_return_if_subdir_fail(node) \ g_return_if_fail( \ ((InfdDirectoryNode*)node)->type == INFD_STORAGE_NODE_SUBDIRECTORY \ ) #define infd_directory_return_val_if_subdir_fail(node, val) \ g_return_val_if_fail( \ ((InfdDirectoryNode*)node)->type == INFD_STORAGE_NODE_SUBDIRECTORY, \ val \ ) static GObjectClass* parent_class; static guint directory_signals[LAST_SIGNAL]; static GQuark infd_directory_node_id_quark; /* Time a session needs to be idle before it is unloaded from RAM */ /* TODO: This should be a property: */ static const guint INFD_DIRECTORY_SAVE_TIMEOUT = 60000; /* * Path handling. */ /* Returns the complete path to this node in the given GString */ static void infd_directory_node_get_path_string(InfdDirectoryNode* node, GString* string) { g_return_if_fail(node != NULL); g_return_if_fail(string != NULL); if(node->parent != NULL) { /* Each node except the root node has a name */ g_assert(node->name != NULL); /* Make sure to not recurse if our parent is the root node because * this would add an additional slash */ if(node->parent->parent != NULL) infd_directory_node_get_path_string(node->parent, string); g_string_append_c(string, '/'); g_string_append(string, node->name); } else { /* This node has no parent, so it is the root node */ g_assert(node->name == NULL); g_string_append_c(string, '/'); } } static void infd_directory_node_get_path(InfdDirectoryNode* node, gchar** path, gsize* len) { GString* str; g_return_if_fail(node != NULL); g_return_if_fail(path != NULL); str = g_string_sized_new(128); infd_directory_node_get_path_string(node, str); *path = str->str; if(len != NULL) *len = str->len; g_string_free(str, FALSE); } static void infd_directory_node_make_path(InfdDirectoryNode* node, const gchar* name, gchar** path, gsize* len) { GString* str; g_return_if_fail(node != NULL); g_return_if_fail(name != NULL); g_return_if_fail(path != NULL); str = g_string_sized_new(128); infd_directory_node_get_path_string(node, str); if(node->parent != NULL) g_string_append_c(str, '/'); g_string_append(str, name); *path = str->str; if(len != NULL) *len = str->len; g_string_free(str, FALSE); } /* * Save timeout */ /* Required by infd_directory_session_save_timeout_func() */ static void infd_directory_node_unlink_session(InfdDirectory* directory, InfdDirectoryNode* node); static void infd_directory_session_save_timeout_data_free(gpointer data) { g_slice_free(InfdDirectorySessionSaveTimeoutData, data); } static void infd_directory_session_save_timeout_func(gpointer user_data) { InfdDirectorySessionSaveTimeoutData* timeout_data; InfdDirectoryPrivate* priv; GError* error; gchar* path; gboolean result; timeout_data = (InfdDirectorySessionSaveTimeoutData*)user_data; g_assert(timeout_data->node->type == INFD_STORAGE_NODE_NOTE); g_assert(timeout_data->node->shared.note.save_timeout != NULL); priv = INFD_DIRECTORY_PRIVATE(timeout_data->directory); error = NULL; infd_directory_node_get_path(timeout_data->node, &path, NULL); result = timeout_data->node->shared.note.plugin->session_write( priv->storage, infd_session_proxy_get_session(timeout_data->node->shared.note.session), path, timeout_data->node->shared.note.plugin->user_data, &error ); /* TODO: Unset modified flag of buffer if result == TRUE */ /* The timeout is removed automatically after it has elapsed */ timeout_data->node->shared.note.save_timeout = NULL; if(result == FALSE) { g_warning( _("Failed to save note \"%s\": %s\n\nKeeping it in memory. Another " "save attempt will be made when the server is shut down."), path, error->message ); g_error_free(error); } else { infd_directory_node_unlink_session( timeout_data->directory, timeout_data->node ); } g_free(path); } static void infd_directory_start_session_save_timeout(InfdDirectory* directory, InfdDirectoryNode* node) { InfdDirectoryPrivate* priv; InfdDirectorySessionSaveTimeoutData* timeout_data; priv = INFD_DIRECTORY_PRIVATE(directory); timeout_data = g_slice_new(InfdDirectorySessionSaveTimeoutData); timeout_data->directory = directory; timeout_data->node = node; if(priv->storage != NULL) { node->shared.note.save_timeout = inf_io_add_timeout( priv->io, INFD_DIRECTORY_SAVE_TIMEOUT, infd_directory_session_save_timeout_func, timeout_data, infd_directory_session_save_timeout_data_free ); } } static void infd_directory_session_idle_notify_cb(GObject* object, GParamSpec* pspec, gpointer user_data) { InfdDirectory* directory; InfdDirectoryPrivate* priv; gpointer node_id; InfdDirectoryNode* node; directory = INFD_DIRECTORY(user_data); priv = INFD_DIRECTORY_PRIVATE(directory); node_id = g_object_get_qdata(object, infd_directory_node_id_quark); node = g_hash_table_lookup(priv->nodes, node_id); g_assert(node != NULL); /* Drop session from memory if it remains idle */ if(infd_session_proxy_is_idle(INFD_SESSION_PROXY(object))) { if(node->shared.note.save_timeout == NULL) { infd_directory_start_session_save_timeout(directory, node); } } else { if(node->shared.note.save_timeout != NULL) { inf_io_remove_timeout(priv->io, node->shared.note.save_timeout); node->shared.note.save_timeout = NULL; } } } /* * Node construction and removal */ /* Creates the subscription group for a node, named "InfSession_%u", %u being * the node id (which should be unique). */ static InfCommunicationHostedGroup* infd_directory_create_subscription_group(InfdDirectory* directory, guint node_id) { InfdDirectoryPrivate* priv; InfCommunicationHostedGroup* group; gchar* group_name; /* TODO: For the moment, there only exist central methods anyway. In the * long term, this should probably be a property, though. */ static const gchar* const methods[] = { "central", NULL }; priv = INFD_DIRECTORY_PRIVATE(directory); group_name = g_strdup_printf("InfSession_%u", node_id); group = inf_communication_manager_open_group( priv->communication_manager, group_name, methods ); g_free(group_name); return group; } static InfdSessionProxy* infd_directory_create_session_proxy_with_group(InfdDirectory* directory, InfSession* session, InfCommunicationHostedGroup* g) { InfdSessionProxy* proxy; g_assert( inf_communication_group_get_target(INF_COMMUNICATION_GROUP(g)) == NULL ); proxy = INFD_SESSION_PROXY( g_object_new( INFD_TYPE_SESSION_PROXY, "session", session, "subscription-group", g, NULL ) ); inf_communication_group_set_target( INF_COMMUNICATION_GROUP(g), INF_COMMUNICATION_OBJECT(proxy) ); return proxy; } static InfdSessionProxy* infd_directory_create_session_proxy_for_node(InfdDirectory* directory, guint node_id, InfSession* session) { InfdDirectoryPrivate* priv; InfCommunicationHostedGroup* group; InfdSessionProxy* proxy; priv = INFD_DIRECTORY_PRIVATE(directory); group = infd_directory_create_subscription_group(directory, node_id); proxy = infd_directory_create_session_proxy_with_group( directory, session, group ); g_object_unref(group); return proxy; } static InfdSessionProxy* infd_directory_create_session_proxy(InfdDirectory* directory, const InfdNotePlugin* plugin, InfSessionStatus status, InfCommunicationHostedGroup* sync_g, InfXmlConnection* sync_conn, InfCommunicationHostedGroup* sub_g) { InfdDirectoryPrivate* priv; InfSession* session; InfdSessionProxy* proxy; g_assert(sub_g != NULL); priv = INFD_DIRECTORY_PRIVATE(directory); session = plugin->session_new( priv->io, priv->communication_manager, status, sync_g, sync_conn, plugin->user_data ); proxy = infd_directory_create_session_proxy_with_group( directory, session, sub_g ); g_object_unref(session); if(sync_g != NULL && sync_g != sub_g) { inf_communication_group_set_target( INF_COMMUNICATION_GROUP(sync_g), INF_COMMUNICATION_OBJECT(proxy) ); } return proxy; } static InfdSessionProxy* infd_directory_create_session_proxy_for_storage( InfdDirectory* directory, InfdDirectoryNode* parent, InfCommunicationHostedGroup* sub_group, const gchar* name, const InfdNotePlugin* plugin, InfSessionStatus status, InfCommunicationHostedGroup* sync_group, InfXmlConnection* sync_conn, GError** error) { InfdDirectoryPrivate* priv; gchar* path; gboolean ret; InfSession* session; InfdSessionProxy* proxy; priv = INFD_DIRECTORY_PRIVATE(directory); proxy = infd_directory_create_session_proxy( directory, plugin, status, sync_group, sync_conn, sub_group); session = infd_session_proxy_get_session(proxy); /* Save session initially */ infd_directory_node_make_path(parent, name, &path, NULL); if(priv->storage != NULL) { ret = plugin->session_write( priv->storage, session, path, plugin->user_data, error ); } else { ret = TRUE; } g_free(path); if(ret == FALSE) { /* Reset communication groups for the proxy, to avoid a warning at * final unref. Due do this failing the groups are very likely going to be * unrefed as well any time soon. */ inf_communication_group_set_target( INF_COMMUNICATION_GROUP(sub_group), NULL ); if(sync_group != NULL && sync_group != sub_group) { inf_communication_group_set_target( INF_COMMUNICATION_GROUP(sync_group), NULL ); } g_object_unref(proxy); return NULL; } return proxy; } /* Links a InfdSessionProxy with a InfdDirectoryNode */ static void infd_directory_node_link_session(InfdDirectory* directory, InfdDirectoryNode* node, InfdSessionProxy* proxy) { InfdDirectoryPrivate* priv; InfdDirectoryIter iter; priv = INFD_DIRECTORY_PRIVATE(directory); g_assert(node->type == INFD_STORAGE_NODE_NOTE); g_assert(node->shared.note.session == NULL); iter.node = node; iter.node_id = node->id; g_signal_emit( G_OBJECT(directory), directory_signals[ADD_SESSION], 0, &iter, proxy ); } static void infd_directory_node_unlink_session(InfdDirectory* directory, InfdDirectoryNode* node) { InfdDirectoryPrivate* priv; InfdDirectoryIter iter; priv = INFD_DIRECTORY_PRIVATE(directory); g_assert(node->type == INFD_STORAGE_NODE_NOTE); g_assert(node->shared.note.session != NULL); iter.node = node; iter.node_id = node->id; /* TODO: We could still weakref the session, to continue using it if * others need it anyway. We just need to strongref it again if it becomes * non-idle. */ g_signal_emit( G_OBJECT(directory), directory_signals[REMOVE_SESSION], 0, &iter, node->shared.note.session ); } static void infd_directory_node_unlink_child_sessions(InfdDirectory* directory, InfdDirectoryNode* node, gboolean save_notes) { InfdDirectoryPrivate* priv; InfdDirectoryNode* child; gchar* path; GError* error; priv = INFD_DIRECTORY_PRIVATE(directory); switch(node->type) { case INFD_STORAGE_NODE_SUBDIRECTORY: if(node->shared.subdir.explored == TRUE) { for(child = node->shared.subdir.child; child != NULL; child = child->next) { infd_directory_node_unlink_child_sessions( directory, child, save_notes ); } } break; case INFD_STORAGE_NODE_NOTE: if(node->shared.note.session != NULL) { if(save_notes) { infd_directory_node_get_path(node, &path, NULL); error = NULL; if(priv->storage != NULL) { node->shared.note.plugin->session_write( priv->storage, infd_session_proxy_get_session(node->shared.note.session), path, node->shared.note.plugin->user_data, &error ); } /* TODO: Unset modified flag of buffer if result == TRUE */ if(error != NULL) { /* There is not really anything we could do about it here. Of * course, any application should save the sessions explicitely * before shutting the directory down, so that it has the chance to * cancel the shutdown if the session could not be saved. */ /* TODO: We could try saving the session somewhere in /tmp, for * example via to_xml_sync. */ g_warning( _("Could not write session \"%s\" to storage: %s\n\nAll changes " "since the document das been saved are lost."), path, error->message ); g_error_free(error); } g_free(path); } infd_directory_node_unlink_session(directory, node); } break; default: g_assert_not_reached(); break; } } static void infd_directory_node_link(InfdDirectoryNode* node, InfdDirectoryNode* parent) { g_return_if_fail(node != NULL); g_return_if_fail(parent != NULL); infd_directory_return_if_subdir_fail(parent); node->prev = NULL; if(parent->shared.subdir.child != NULL) { parent->shared.subdir.child->prev = node; node->next = parent->shared.subdir.child; } else { node->next = NULL; } parent->shared.subdir.child = node; } static void infd_directory_node_unlink(InfdDirectoryNode* node) { g_return_if_fail(node != NULL); g_return_if_fail(node->parent != NULL); if(node->prev != NULL) { node->prev->next = node->next; } else { g_assert(node->parent->type == INFD_STORAGE_NODE_SUBDIRECTORY); node->parent->shared.subdir.child = node->next; } if(node->next != NULL) node->next->prev = node->prev; } /* This function takes ownership of name */ static InfdDirectoryNode* infd_directory_node_new_common(InfdDirectory* directory, InfdDirectoryNode* parent, InfdStorageNodeType type, guint node_id, gchar* name) { InfdDirectoryPrivate* priv; InfdDirectoryNode* node; priv = INFD_DIRECTORY_PRIVATE(directory); g_assert( g_hash_table_lookup(priv->nodes, GUINT_TO_POINTER(node_id)) == NULL ); node = g_slice_new(InfdDirectoryNode); node->parent = parent; node->type = type; node->id = node_id; node->name = name; if(parent != NULL) { infd_directory_node_link(node, parent); } else { node->prev = NULL; node->next = NULL; } g_hash_table_insert(priv->nodes, GUINT_TO_POINTER(node->id), node); return node; } static InfdDirectoryNode* infd_directory_node_new_subdirectory(InfdDirectory* directory, InfdDirectoryNode* parent, guint node_id, gchar* name) { InfdDirectoryNode* node; node = infd_directory_node_new_common( directory, parent, INFD_STORAGE_NODE_SUBDIRECTORY, node_id, name ); node->shared.subdir.connections = NULL; node->shared.subdir.child = NULL; node->shared.subdir.explored = FALSE; return node; } static InfdDirectoryNode* infd_directory_node_new_note(InfdDirectory* directory, InfdDirectoryNode* parent, guint node_id, gchar* name, const InfdNotePlugin* plugin) { InfdDirectoryNode* node; node = infd_directory_node_new_common( directory, parent, INFD_STORAGE_NODE_NOTE, node_id, name ); node->shared.note.session = NULL; node->shared.note.plugin = plugin; node->shared.note.save_timeout = NULL; return node; } /* Required by infd_directory_node_free() */ static void infd_directory_remove_sync_in(InfdDirectory* directory, InfdDirectorySyncIn* sync_in); static void infd_directory_remove_subreq(InfdDirectory* directory, InfdDirectorySubreq* request); /* Notes are saved into the storage when save_notes is TRUE. */ static void infd_directory_node_free(InfdDirectory* directory, InfdDirectoryNode* node) { InfdDirectoryPrivate* priv; gboolean removed; GSList* item; GSList* next; InfdDirectorySyncIn* sync_in; InfdDirectorySubreq* request; g_return_if_fail(INFD_IS_DIRECTORY(directory)); g_return_if_fail(node != NULL); priv = INFD_DIRECTORY_PRIVATE(directory); switch(node->type) { case INFD_STORAGE_NODE_SUBDIRECTORY: g_slist_free(node->shared.subdir.connections); /* Free child nodes */ if(node->shared.subdir.explored == TRUE) { while(node->shared.subdir.child != NULL) { infd_directory_node_free(directory, node->shared.subdir.child); } } break; case INFD_STORAGE_NODE_NOTE: /* Sessions must have been explicitely unlinked before, so that the * remove-session signal was emitted before any children already have been * removed. */ g_assert(node->shared.note.session == NULL); break; default: g_assert_not_reached(); break; } if(node->parent != NULL) infd_directory_node_unlink(node); /* Remove sync-ins whose parent is gone */ for(item = priv->sync_ins; item != NULL; item = next) { next = item->next; sync_in = (InfdDirectorySyncIn*)item->data; if(sync_in->parent == node) infd_directory_remove_sync_in(directory, sync_in); } for(item = priv->subscription_requests; item != NULL; item = next) { next = item->next; request = (InfdDirectorySubreq*)item->data; switch(request->type) { case INFD_DIRECTORY_SUBREQ_CHAT: break; case INFD_DIRECTORY_SUBREQ_SESSION: /* Keep subscription requests whose parent is gone. They will be * released upon client reply. */ /*if(request->node_id == node->id) infd_directory_remove_subreq(directory, request);*/ break; case INFD_DIRECTORY_SUBREQ_ADD_NODE: if(request->shared.add_node.parent->id == node->id) request->shared.add_node.parent = NULL; break; case INFD_DIRECTORY_SUBREQ_SYNC_IN: case INFD_DIRECTORY_SUBREQ_SYNC_IN_SUBSCRIBE: if(request->shared.sync_in.parent->id == node->id) request->shared.sync_in.parent = NULL; break; default: g_assert_not_reached(); break; } } removed = g_hash_table_remove(priv->nodes, GUINT_TO_POINTER(node->id)); g_assert(removed == TRUE); g_free(node->name); g_slice_free(InfdDirectoryNode, node); } static void infd_directory_node_remove_connection(InfdDirectoryNode* node, InfXmlConnection* connection) { InfdDirectoryNode* child; GSList* item; g_assert(node->type == INFD_STORAGE_NODE_SUBDIRECTORY); g_assert(node->shared.subdir.explored == TRUE); item = g_slist_find(node->shared.subdir.connections, connection); /* Note that if the connection is not in this node's connection list, * then it cannot be in a child's list either. */ if(item != NULL) { node->shared.subdir.connections = g_slist_delete_link( node->shared.subdir.connections, item ); if(node->shared.subdir.explored == TRUE) { for(child = node->shared.subdir.child; child != NULL; child = child->next) { if(child->type == INFD_STORAGE_NODE_SUBDIRECTORY && child->shared.subdir.explored == TRUE) { infd_directory_node_remove_connection(child, connection); } } } else { g_assert(node->shared.subdir.connections == NULL); } } } /* * Node synchronization. */ static xmlNodePtr infd_directory_node_desc_register_to_xml(guint node_id, InfdDirectoryNode* parent, const InfdNotePlugin* plugin, const gchar* name) { xmlNodePtr xml; xml = xmlNewNode(NULL, (const xmlChar*)"add-node"); inf_xml_util_set_attribute_uint(xml, "id", node_id); inf_xml_util_set_attribute_uint(xml, "parent", parent->id); inf_xml_util_set_attribute(xml, "name", name); if(plugin != NULL) inf_xml_util_set_attribute(xml, "type", plugin->note_type); else inf_xml_util_set_attribute(xml, "type", "InfSubdirectory"); return xml; } /* Creates XML request to tell someone about a new node */ static xmlNodePtr infd_directory_node_register_to_xml(InfdDirectoryNode* node) { const InfdNotePlugin* plugin; g_assert(node->parent != NULL); switch(node->type) { case INFD_STORAGE_NODE_SUBDIRECTORY: plugin = NULL; break; case INFD_STORAGE_NODE_NOTE: plugin = node->shared.note.plugin; break; default: g_assert_not_reached(); break; } return infd_directory_node_desc_register_to_xml( node->id, node->parent, plugin, node->name ); } /* Creates XML request to tell someone about a removed node */ static xmlNodePtr infd_directory_node_unregister_to_xml(InfdDirectoryNode* node) { xmlNodePtr xml; gchar id_buf[16]; sprintf(id_buf, "%u", node->id); xml = xmlNewNode(NULL, (const xmlChar*)"remove-node"); xmlNewProp(xml, (const xmlChar*)"id", (const xmlChar*)id_buf); return xml; } static gboolean infd_directory_make_seq(InfdDirectory* directory, InfXmlConnection* connection, xmlNodePtr xml, gchar** seq, GError** error) { InfdDirectoryPrivate* priv; InfdDirectoryConnectionInfo* info; GError* local_error; guint seq_num; priv = INFD_DIRECTORY_PRIVATE(directory); local_error = NULL; if(!inf_xml_util_get_attribute_uint(xml, "seq", &seq_num, &local_error)) { if(local_error) { g_propagate_error(error, local_error); return FALSE; } *seq = NULL; return TRUE; } info = g_hash_table_lookup(priv->connections, connection); g_assert(info != NULL); *seq = g_strdup_printf("%u/%u", info->seq_id, seq_num); return TRUE; } /* Sends a message to the given connections. We cannot always send to all * group members because some messages are only supposed to be sent to * clients that explored a certain subdirectory. */ static void infd_directory_send(InfdDirectory* directory, GSList* connections, InfXmlConnection* exclude, xmlNodePtr xml) { InfdDirectoryPrivate* priv; GSList* item; priv = INFD_DIRECTORY_PRIVATE(directory); if(connections == NULL || (connections->data == exclude && connections->next == NULL)) { xmlFreeNode(xml); } else { for(item = connections; item != NULL; item = g_slist_next(item)) { if(item->data == exclude) continue; /* Do not copy this item if it is the last item to be sent because the * connection manager takes ownership */ if(item->next != NULL && (item->next->data != exclude || item->next->next != NULL)) { inf_communication_group_send_message( INF_COMMUNICATION_GROUP(priv->group), INF_XML_CONNECTION(item->data), xmlCopyNode(xml, 1) ); } else { inf_communication_group_send_message( INF_COMMUNICATION_GROUP(priv->group), INF_XML_CONNECTION(item->data), xml ); } } } } /* Announces the presence of a new node. This is not done in * infd_directory_node_new because we do not want to do this for all * nodes we create (namely not for the root node). */ static void infd_directory_node_register(InfdDirectory* directory, InfdDirectoryNode* node, InfXmlConnection* except, const gchar* seq) { InfdDirectoryPrivate* priv; InfdDirectoryIter iter; xmlNodePtr xml; priv = INFD_DIRECTORY_PRIVATE(directory); iter.node_id = node->id; iter.node = node; g_signal_emit( G_OBJECT(directory), directory_signals[NODE_ADDED], 0, &iter ); if(node->parent->shared.subdir.connections != NULL) { xml = infd_directory_node_register_to_xml(node); if(seq != NULL) inf_xml_util_set_attribute(xml, "seq", seq); infd_directory_send( directory, node->parent->shared.subdir.connections, except, xml ); } } /* Announces that a node is removed. Again, this is not done in * infd_directory_node_free because we do not want to do this for * every subnode if a subdirectory is freed. */ static void infd_directory_node_unregister(InfdDirectory* directory, InfdDirectoryNode* node, const gchar* seq) { InfdDirectoryPrivate* priv; InfdDirectoryIter iter; xmlNodePtr xml; priv = INFD_DIRECTORY_PRIVATE(directory); iter.node_id = node->id; iter.node = node; g_signal_emit( G_OBJECT(directory), directory_signals[NODE_REMOVED], 0, &iter ); xml = infd_directory_node_unregister_to_xml(node); if(seq != NULL) inf_xml_util_set_attribute(xml, "seq", seq); infd_directory_send( directory, node->parent->shared.subdir.connections, NULL, xml ); } static gboolean infd_directory_node_name_equal(const gchar* name1, const gchar* name2) { gchar* f1 = g_utf8_casefold(name1, -1); gchar* f2 = g_utf8_casefold(name2, -1); gboolean result = (g_utf8_collate(f1, f2) == 0); g_free(f2); g_free(f1); return result; } /* * Sync-In */ static void infd_directory_sync_in_synchronization_failed_cb(InfSession* session, InfXmlConnection* connection, const GError* error, gpointer user_data) { /* Synchronization failed. We simple remove the sync-in. There is no further * notification required since the synchronization failed on the remote site * as well. */ InfdDirectorySyncIn* sync_in; sync_in = (InfdDirectorySyncIn*)user_data; infd_directory_remove_sync_in(sync_in->directory, sync_in); } static void infd_directory_sync_in_synchronization_complete_cb(InfSession* session, InfXmlConnection* conn, gpointer user_data) { /* Synchronization done. We can now safely create the node in the directory * tree. */ InfdDirectorySyncIn* sync_in; InfdDirectory* directory; InfdDirectoryPrivate* priv; InfdDirectoryNode* node; gchar* path; gboolean ret; GError* error; sync_in = (InfdDirectorySyncIn*)user_data; directory = sync_in->directory; priv = INFD_DIRECTORY_PRIVATE(directory); node = infd_directory_node_new_note( directory, sync_in->parent, sync_in->node_id, sync_in->name, sync_in->plugin ); infd_directory_node_link_session(directory, node, sync_in->proxy); /* Save session initially */ infd_directory_node_get_path(node, &path, NULL); error = NULL; if(priv->storage != NULL) { ret = sync_in->plugin->session_write( priv->storage, session, path, sync_in->plugin->user_data, &error ); } else { ret = TRUE; } if(ret == FALSE) { /* Note that while indeed this may fail in theory we have already * (successfully) written the session before we started the sync-in, so * the name of the node is accepted by the storage backend. */ g_warning( _("Session \"%s\" could not be saved: %s\nAnother attempt will " "be made when the session is unused for a while or the server is " "shut down."), path, error->message ); g_error_free(error); } g_free(path); sync_in->name = NULL; /* Don't free, we passed ownership */ infd_directory_remove_sync_in(directory, sync_in); /* Don't send to conn since the completed synchronization already lets the * remote site know that the node was inserted. */ infd_directory_node_register(directory, node, conn, NULL); } static InfdDirectorySyncIn* infd_directory_add_sync_in(InfdDirectory* directory, InfdDirectoryNode* parent, guint node_id, const gchar* name, const InfdNotePlugin* plugin, InfdSessionProxy* proxy) { InfdDirectoryPrivate* priv; InfdDirectorySyncIn* sync_in; priv = INFD_DIRECTORY_PRIVATE(directory); sync_in = g_slice_new(InfdDirectorySyncIn); sync_in->directory = directory; sync_in->parent = parent; sync_in->node_id = node_id; sync_in->name = g_strdup(name); sync_in->plugin = plugin; sync_in->proxy = proxy; g_object_ref(sync_in->proxy); g_signal_connect( G_OBJECT(infd_session_proxy_get_session(sync_in->proxy)), "synchronization-failed", G_CALLBACK(infd_directory_sync_in_synchronization_failed_cb), sync_in ); g_signal_connect( G_OBJECT(infd_session_proxy_get_session(sync_in->proxy)), "synchronization-complete", G_CALLBACK(infd_directory_sync_in_synchronization_complete_cb), sync_in ); priv->sync_ins = g_slist_prepend(priv->sync_ins, sync_in); return sync_in; } static void infd_directory_remove_sync_in(InfdDirectory* directory, InfdDirectorySyncIn* sync_in) { InfdDirectoryPrivate* priv; priv = INFD_DIRECTORY_PRIVATE(directory); inf_signal_handlers_disconnect_by_func( G_OBJECT(infd_session_proxy_get_session(sync_in->proxy)), G_CALLBACK(infd_directory_sync_in_synchronization_failed_cb), sync_in ); inf_signal_handlers_disconnect_by_func( G_OBJECT(infd_session_proxy_get_session(sync_in->proxy)), G_CALLBACK(infd_directory_sync_in_synchronization_complete_cb), sync_in ); /* This cancels the synchronization: */ g_object_unref(sync_in->proxy); g_free(sync_in->name); g_slice_free(InfdDirectorySyncIn, sync_in); priv->sync_ins = g_slist_remove(priv->sync_ins, sync_in); } static InfdDirectorySyncIn* infd_directory_find_sync_in_by_name(InfdDirectory* directory, InfdDirectoryNode* parent, const gchar* name) { InfdDirectoryPrivate* priv; GSList* item; InfdDirectorySyncIn* sync_in; priv = INFD_DIRECTORY_PRIVATE(directory); for(item = priv->sync_ins; item != NULL; item = item->next) { sync_in = (InfdDirectorySyncIn*)item->data; if(sync_in->parent == parent && infd_directory_node_name_equal(sync_in->name, name) == TRUE) { return sync_in; } } return NULL; } /* * Subscription requests. */ static InfdDirectorySubreq* infd_directory_add_subreq_common(InfdDirectory* directory, InfdDirectorySubreqType type, InfXmlConnection* connection, guint node_id) { InfdDirectoryPrivate* priv; InfdDirectorySubreq* request; priv = INFD_DIRECTORY_PRIVATE(directory); request = g_slice_new(InfdDirectorySubreq); request->type = type; request->connection = connection; request->node_id = node_id; priv->subscription_requests = g_slist_prepend(priv->subscription_requests, request); return request; } static InfdDirectorySubreq* infd_directory_add_subreq_chat(InfdDirectory* directory, InfXmlConnection* connection) { InfdDirectorySubreq* request; request = infd_directory_add_subreq_common( directory, INFD_DIRECTORY_SUBREQ_CHAT, connection, 0 ); return request; } static InfdDirectorySubreq* infd_directory_add_subreq_session(InfdDirectory* directory, InfXmlConnection* connection, guint node_id, InfdSessionProxy* proxy) { InfdDirectorySubreq* request; request = infd_directory_add_subreq_common( directory, INFD_DIRECTORY_SUBREQ_SESSION, connection, node_id ); request->shared.session.session = proxy; /* take ownership */ return request; } static InfdDirectorySubreq* infd_directory_add_subreq_add_node(InfdDirectory* directory, InfXmlConnection* connection, guint node_id, InfdDirectoryNode* parent, InfCommunicationHostedGroup* group, const InfdNotePlugin* plugin, const gchar* name, GError** error) { InfdDirectorySubreq* request; InfdSessionProxy* proxy; proxy = infd_directory_create_session_proxy_for_storage( directory, parent, group, name, plugin, INF_SESSION_RUNNING, NULL, NULL, error ); if(proxy == NULL) return NULL; request = infd_directory_add_subreq_common( directory, INFD_DIRECTORY_SUBREQ_ADD_NODE, connection, node_id ); request->shared.add_node.parent = parent; request->shared.add_node.group = group; request->shared.add_node.plugin = plugin; request->shared.add_node.name = g_strdup(name); request->shared.add_node.proxy = proxy; g_object_ref(group); return request; } static InfdDirectorySubreq* infd_directory_add_subreq_sync_in(InfdDirectory* directory, InfXmlConnection* connection, guint node_id, InfdDirectoryNode* parent, InfCommunicationHostedGroup* sync_group, InfCommunicationHostedGroup* sub_group, const InfdNotePlugin* plugin, const gchar* name, GError** error) { InfdDirectorySubreq* request; InfdSessionProxy* proxy; /* Keep proxy in PRESYNC state, until we have the confirmation from the * remote site that the chosen method is OK and we can go on. */ proxy = infd_directory_create_session_proxy_for_storage( directory, parent, sub_group, name, plugin, INF_SESSION_PRESYNC, sync_group, connection, error ); if(proxy == NULL) return NULL; request = infd_directory_add_subreq_common( directory, sync_group == sub_group ? INFD_DIRECTORY_SUBREQ_SYNC_IN_SUBSCRIBE : INFD_DIRECTORY_SUBREQ_SYNC_IN, connection, node_id ); request->shared.sync_in.parent = parent; request->shared.sync_in.synchronization_group = sync_group; request->shared.sync_in.subscription_group = sub_group; request->shared.sync_in.plugin = plugin; request->shared.sync_in.name = g_strdup(name); request->shared.sync_in.proxy = proxy; g_object_ref(sync_group); g_object_ref(sub_group); return request; } static void infd_directory_free_subreq(InfdDirectorySubreq* request) { switch(request->type) { case INFD_DIRECTORY_SUBREQ_CHAT: break; case INFD_DIRECTORY_SUBREQ_SESSION: g_object_unref(request->shared.session.session); break; case INFD_DIRECTORY_SUBREQ_ADD_NODE: g_free(request->shared.add_node.name); g_object_unref(request->shared.add_node.group); g_object_unref(request->shared.add_node.proxy); break; case INFD_DIRECTORY_SUBREQ_SYNC_IN: case INFD_DIRECTORY_SUBREQ_SYNC_IN_SUBSCRIBE: g_free(request->shared.sync_in.name); g_object_unref(request->shared.sync_in.synchronization_group); g_object_unref(request->shared.sync_in.subscription_group); g_object_unref(request->shared.sync_in.proxy); break; default: g_assert_not_reached(); break; } g_slice_free(InfdDirectorySubreq, request); } static void infd_directory_unlink_subreq(InfdDirectory* directory, InfdDirectorySubreq* request) { InfdDirectoryPrivate* priv; priv = INFD_DIRECTORY_PRIVATE(directory); priv->subscription_requests = g_slist_remove(priv->subscription_requests, request); } static void infd_directory_remove_subreq(InfdDirectory* directory, InfdDirectorySubreq* request) { infd_directory_unlink_subreq(directory, request); infd_directory_free_subreq(request); } static InfdDirectorySubreq* infd_directory_find_subreq_by_name(InfdDirectory* directory, InfdDirectoryNode* parent, const gchar* name) { InfdDirectoryPrivate* priv; GSList* item; InfdDirectorySubreq* request; priv = INFD_DIRECTORY_PRIVATE(directory); for(item = priv->subscription_requests; item != NULL; item = item->next) { request = (InfdDirectorySubreq*)item->data; switch(request->type) { case INFD_DIRECTORY_SUBREQ_CHAT: case INFD_DIRECTORY_SUBREQ_SESSION: /* These don't occupy names */ break; case INFD_DIRECTORY_SUBREQ_ADD_NODE: if(request->shared.add_node.parent == parent && infd_directory_node_name_equal(request->shared.add_node.name, name)) { return request; } break; case INFD_DIRECTORY_SUBREQ_SYNC_IN: case INFD_DIRECTORY_SUBREQ_SYNC_IN_SUBSCRIBE: if(request->shared.sync_in.parent == parent && infd_directory_node_name_equal(request->shared.sync_in.name, name)) { return request; } break; default: g_assert_not_reached(); break; } } return NULL; } /* * Directory tree operations. */ static InfdDirectoryNode* infd_directory_node_find_child_by_name(InfdDirectoryNode* parent, const gchar* name) { InfdDirectoryNode* node; infd_directory_return_val_if_subdir_fail(parent, NULL); for(node = parent->shared.subdir.child; node != NULL; node = node->next) if(infd_directory_node_name_equal(node->name, name)) return node; return NULL; } /* Checks whether a node with the given name can be created in the given * parent directory. */ static gboolean infd_directory_node_is_name_available(InfdDirectory* directory, InfdDirectoryNode* parent, const gchar* name, GError** error) { gboolean has_sensible_character = FALSE; const gchar* p; for (p = name; *p != '\0'; p = g_utf8_next_char(p)) { if(!g_unichar_isprint(*p)) { g_set_error( error, inf_directory_error_quark(), INF_DIRECTORY_ERROR_INVALID_NAME, _("Name \"%s\" is an invalid name: contains non-printable characters"), name ); return FALSE; } else if(!g_unichar_isspace(*p)) { has_sensible_character = TRUE; } } if(!has_sensible_character) { g_set_error( error, inf_directory_error_quark(), INF_DIRECTORY_ERROR_INVALID_NAME, _("Name \"%s\" is an invalid name: contains only space characters"), name ); return FALSE; } if(strchr(name, '/') != NULL) { g_set_error( error, inf_directory_error_quark(), INF_DIRECTORY_ERROR_INVALID_NAME, _("Name \"%s\" is an invalid name: contains \"/\""), name ); return FALSE; } if(infd_directory_node_find_child_by_name(parent, name) != NULL || infd_directory_find_sync_in_by_name(directory, parent, name) != NULL || infd_directory_find_subreq_by_name(directory, parent, name) != NULL) { g_set_error( error, inf_directory_error_quark(), INF_DIRECTORY_ERROR_NODE_EXISTS, _("A node with name \"%s\" exists already"), name ); return FALSE; } return TRUE; } static gboolean infd_directory_node_explore(InfdDirectory* directory, InfdDirectoryNode* node, GError** error) { InfdDirectoryPrivate* priv; InfdStorageNode* storage_node; InfdDirectoryNode* new_node; InfdNotePlugin* plugin; GError* local_error; GSList* list; GSList* item; gchar* path; gsize len; priv = INFD_DIRECTORY_PRIVATE(directory); g_assert(priv->storage != NULL); g_assert(node->type == INFD_STORAGE_NODE_SUBDIRECTORY); g_assert(node->shared.subdir.explored == FALSE); local_error = NULL; infd_directory_node_get_path(node, &path, &len); list = infd_storage_read_subdirectory(priv->storage, path, &local_error); g_free(path); if(local_error != NULL) { g_propagate_error(error, local_error); return FALSE; } for(item = list; item != NULL; item = g_slist_next(item)) { storage_node = (InfdStorageNode*)item->data; new_node = NULL; /* TODO: Transfer ownership of storade_node->name to * infd_directory_new_*? */ switch(storage_node->type) { case INFD_STORAGE_NODE_SUBDIRECTORY: new_node = infd_directory_node_new_subdirectory( directory, node, priv->node_counter ++, g_strdup(storage_node->name) ); break; case INFD_STORAGE_NODE_NOTE: /* TODO: Currently we ignore notes of unknown type. Perhaps we should * report some error. */ plugin = g_hash_table_lookup(priv->plugins, storage_node->identifier); if(plugin != NULL) { new_node = infd_directory_node_new_note( directory, node, priv->node_counter ++, g_strdup(storage_node->name), plugin ); } break; default: g_assert_not_reached(); break; } if(new_node != NULL) { /* Announce the new node. In most cases, this does nothing on the * network because there are no connections that have this node open * (otherwise, we would already have explored the node earlier). * However, if the background storage is replaced by a new one, the root * folder of the new storage will be explored immediately (see below in * infd_directory_set_storage()) and there might still be connections * interesting in root folder changes (because they opened the root * folder from the old storage). Also, local users might be interested * in the new node. */ infd_directory_node_register(directory, new_node, NULL, NULL); } } infd_storage_node_list_free(list); node->shared.subdir.explored = TRUE; return TRUE; } static InfdDirectoryNode* infd_directory_node_add_subdirectory(InfdDirectory* directory, InfdDirectoryNode* parent, const gchar* name, InfXmlConnection* connection, const gchar* seq, GError** error) { InfdDirectoryPrivate* priv; InfdDirectoryNode* node; gboolean result; gchar* path; infd_directory_return_val_if_subdir_fail(parent, NULL); g_return_val_if_fail(parent->shared.subdir.explored == TRUE, NULL); priv = INFD_DIRECTORY_PRIVATE(directory); if(!infd_directory_node_is_name_available(directory, parent, name, error)) { return NULL; } else { infd_directory_node_make_path(parent, name, &path, NULL); if(priv->storage != NULL) result = infd_storage_create_subdirectory(priv->storage, path, error); else result = TRUE; g_free(path); if(result == FALSE) return NULL; node = infd_directory_node_new_subdirectory( directory, parent, priv->node_counter ++, g_strdup(name) ); node->shared.subdir.explored = TRUE; infd_directory_node_register(directory, node, NULL, seq); return node; } } static InfdDirectoryNode* infd_directory_node_create_new_note(InfdDirectory* directory, InfdDirectoryNode* parent, InfCommunicationHostedGroup* group, guint node_id, const gchar* name, const InfdNotePlugin* plugin, GError** error) { InfdSessionProxy* proxy; InfdDirectoryNode* node; proxy = infd_directory_create_session_proxy_for_storage( directory, parent, group, name, plugin, INF_SESSION_RUNNING, NULL, NULL, error ); if(proxy == NULL) return NULL; node = infd_directory_node_new_note( directory, parent, node_id, g_strdup(name), plugin ); infd_directory_node_link_session(directory, node, proxy); g_object_unref(proxy); return node; } static gboolean infd_directory_node_add_note(InfdDirectory* directory, InfdDirectoryNode* parent, const gchar* name, const InfdNotePlugin* plugin, InfXmlConnection* connection, gboolean subscribe_connection, const char* seq, GError** error) { InfdDirectoryPrivate* priv; InfdDirectoryNode* node; guint node_id; InfCommunicationHostedGroup* group; xmlNodePtr xml; xmlNodePtr child; const gchar* method; InfdDirectorySubreq* subreq; gboolean result; priv = INFD_DIRECTORY_PRIVATE(directory); infd_directory_return_val_if_subdir_fail(parent, FALSE); g_return_val_if_fail(parent->shared.subdir.explored == TRUE, FALSE); if(!infd_directory_node_is_name_available(directory, parent, name, error)) { return FALSE; } else { node_id = priv->node_counter++; group = infd_directory_create_subscription_group(directory, node_id); if(subscribe_connection == TRUE) { subreq = infd_directory_add_subreq_add_node( directory, connection, node_id, parent, group, plugin, name, error ); if(subreq != NULL) { xml = infd_directory_node_desc_register_to_xml( node_id, parent, plugin, name ); inf_xml_util_set_attribute(xml, "seq", seq); child = xmlNewChild(xml, NULL, (const xmlChar*)"subscribe", NULL); inf_xml_util_set_attribute( child, "group", inf_communication_group_get_name(INF_COMMUNICATION_GROUP(group)) ); method = inf_communication_group_get_method_for_connection( INF_COMMUNICATION_GROUP(group), connection ); /* "central" method should always be available */ g_assert(method != NULL); inf_xml_util_set_attribute(child, "method", method); inf_communication_group_send_message( INF_COMMUNICATION_GROUP(priv->group), connection, xml ); result = TRUE; } } else { node = infd_directory_node_create_new_note( directory, parent, group, node_id, name, plugin, error ); if(node != NULL) { infd_directory_node_register(directory, node, NULL, seq); result = TRUE; } else { result = FALSE; } } g_object_unref(group); return result; } } static gboolean infd_directory_node_add_sync_in(InfdDirectory* directory, InfdDirectoryNode* parent, const gchar* name, const InfdNotePlugin* plugin, InfXmlConnection* sync_conn, gboolean subscribe_sync_conn, const gchar *seq, GError** error) { InfdDirectoryPrivate* priv; InfCommunicationHostedGroup* subscription_group; InfCommunicationHostedGroup* synchronization_group; guint node_id; gchar* sync_group_name; const gchar* method; InfdDirectorySubreq* subreq; xmlNodePtr xml; xmlNodePtr child; /* Synchronization is always between only two peers, so central method * is enough. */ static const gchar* const sync_methods[] = { "central", NULL }; priv = INFD_DIRECTORY_PRIVATE(directory); if(!infd_directory_node_is_name_available(directory, parent, name, error)) return FALSE; node_id = priv->node_counter++; subscription_group = infd_directory_create_subscription_group(directory, node_id); if(subscribe_sync_conn == TRUE) { synchronization_group = subscription_group; g_object_ref(synchronization_group); } else { sync_group_name = g_strdup_printf("InfSession_SyncIn_%u", node_id); synchronization_group = inf_communication_manager_open_group( priv->communication_manager, sync_group_name, sync_methods ); g_free(sync_group_name); } method = inf_communication_group_get_method_for_connection( INF_COMMUNICATION_GROUP(synchronization_group), sync_conn ); /* "central" should always be available */ g_assert(method != NULL); subreq = infd_directory_add_subreq_sync_in( directory, sync_conn, node_id, parent, synchronization_group, subscription_group, plugin, name, error ); if(subreq == NULL) { g_object_unref(synchronization_group); g_object_unref(subscription_group); return FALSE; } xml = xmlNewNode(NULL, (const xmlChar*)"sync-in"); inf_xml_util_set_attribute_uint(xml, "id", node_id); inf_xml_util_set_attribute_uint(xml, "parent", parent->id); inf_xml_util_set_attribute( xml, "group", inf_communication_group_get_name( INF_COMMUNICATION_GROUP(synchronization_group) ) ); inf_xml_util_set_attribute(xml, "method", method); if(seq != NULL) inf_xml_util_set_attribute(xml, "seq", seq); inf_xml_util_set_attribute(xml, "name", name); inf_xml_util_set_attribute(xml, "type", plugin->note_type); if(subscribe_sync_conn == TRUE) { /* Note that if subscribe_sync_conn is set, then sync_group is the same * as the subscription group, so we don't need to query the subscription * group here. */ child = xmlNewChild(xml, NULL, (const xmlChar*)"subscribe", NULL); inf_xml_util_set_attribute(child, "method", method); inf_xml_util_set_attribute( child, "group", inf_communication_group_get_name( INF_COMMUNICATION_GROUP(subscription_group) ) ); } g_object_unref(synchronization_group); g_object_unref(subscription_group); inf_communication_group_send_message( INF_COMMUNICATION_GROUP(priv->group), sync_conn, xml ); return TRUE; } static gboolean infd_directory_node_remove(InfdDirectory* directory, InfdDirectoryNode* node, const gchar* seq, GError** error) { InfdDirectoryPrivate* priv; gboolean result; gchar* path; priv = INFD_DIRECTORY_PRIVATE(directory); /* Cannot remove the root node */ g_assert(node->parent != NULL); infd_directory_node_get_path(node, &path, NULL); if(priv->storage != NULL) { result = infd_storage_remove_node( priv->storage, node->type == INFD_STORAGE_NODE_NOTE ? node->shared.note.plugin->note_type : NULL, path, error ); } else { result = TRUE; } g_free(path); if(result == FALSE) return FALSE; /* Need to unlink child sessions explicitely before unregistering, so * remove-session is emitted before node-removed. Don't save changes since * we just removed the note anyway. */ infd_directory_node_unlink_child_sessions(directory, node, FALSE); infd_directory_node_unregister(directory, node, seq); infd_directory_node_free(directory, node); return TRUE; } /* Returns the session for the given node. This does not link the session * (if it isn't already). This means that the next time this function is * called, the session will be created again if you don't link it yourself, * or if you don't create a subscription request for it. Unref the result. * See infd_directory_node_get_and_link_session() to get a linked session. */ static InfdSessionProxy* infd_directory_node_get_session(InfdDirectory* directory, InfdDirectoryNode* node, GError** error) { InfdDirectoryPrivate* priv; InfSession* session; GSList* item; InfdDirectorySubreq* request; InfdSessionProxy* proxy; gchar* path; g_assert(node->type == INFD_STORAGE_NODE_NOTE); priv = INFD_DIRECTORY_PRIVATE(directory); if(node->shared.note.session != NULL) { proxy = node->shared.note.session; g_object_ref(proxy); return proxy; } /* If we don't have a background storage then all nodes are in memory */ g_assert(priv->storage != NULL); /* The session could already exist in a subscribe-session subreq */ proxy = NULL; for(item = priv->subscription_requests; item != NULL; item = item->next) { request = (InfdDirectorySubreq*)item->data; if(request->type == INFD_DIRECTORY_SUBREQ_SESSION) { if(request->node_id == node->id) { proxy = request->shared.session.session; break; } } } if(proxy != NULL) { g_object_ref(proxy); return proxy; } infd_directory_node_get_path(node, &path, NULL); session = node->shared.note.plugin->session_read( priv->storage, priv->io, priv->communication_manager, path, node->shared.note.plugin->user_data, error ); g_free(path); if(session == NULL) return NULL; /* Buffer might have been marked as modified while reading the session, but * as we just read it from the storage, we don't consider it modified. */ inf_buffer_set_modified(inf_session_get_buffer(session), FALSE); proxy = infd_directory_create_session_proxy_for_node( directory, node->id, session ); g_object_unref(session); return proxy; } static InfdSessionProxy* infd_directory_node_get_and_link_session(InfdDirectory* directory, InfdDirectoryNode* node, GError** error) { InfdSessionProxy* proxy; g_assert(node->type == INFD_STORAGE_NODE_NOTE); proxy = infd_directory_node_get_session(directory, node, error); if(!proxy) return NULL; if(node->shared.note.session == NULL) infd_directory_node_link_session(directory, node, proxy); g_object_unref(proxy); return node->shared.note.session; } /* * Network command handling. */ static void infd_directory_send_welcome_message(InfdDirectory* directory, InfXmlConnection* connection) { InfdDirectoryPrivate* priv; xmlNodePtr xml; xmlNodePtr plugins; xmlNodePtr child; GHashTableIter iter; gpointer value; const InfdNotePlugin* plugin; InfdDirectoryConnectionInfo* info; priv = INFD_DIRECTORY_PRIVATE(directory); xml = xmlNewNode(NULL, (const xmlChar*) "welcome"); inf_xml_util_set_attribute( xml, "protocol-version", inf_protocol_get_version()); info = g_hash_table_lookup(priv->connections, connection); g_assert(info != NULL); inf_xml_util_set_attribute_uint(xml, "sequence-id", info->seq_id); plugins = xmlNewChild(xml, NULL, (const xmlChar*) "note-plugins", NULL); g_hash_table_iter_init(&iter, priv->plugins); while(g_hash_table_iter_next(&iter, NULL, &value)) { plugin = (const InfdNotePlugin*)value; child = xmlNewChild(plugins, NULL, (const xmlChar*) "note-plugin", NULL); inf_xml_util_set_attribute(child, "type", plugin->note_type); } inf_communication_group_send_message( INF_COMMUNICATION_GROUP(priv->group), connection, xml); } static InfdDirectorySubreq* infd_directory_get_subreq_from_xml(InfdDirectory* directory, InfXmlConnection* connection, xmlNodePtr xml, GError** error) { InfdDirectoryPrivate* priv; guint node_id; gboolean has_node; GSList* item; InfdDirectorySubreq* request; priv = INFD_DIRECTORY_PRIVATE(directory); has_node = inf_xml_util_get_attribute_uint( xml, "id", &node_id, error ); if(has_node == FALSE) { /* subscription requests without node ID are for server chat */ for(item = priv->subscription_requests; item != NULL; item = item->next) { request = (InfdDirectorySubreq*)item->data; if(request->type == INFD_DIRECTORY_SUBREQ_CHAT) return request; } g_set_error( error, inf_directory_error_quark(), INF_DIRECTORY_ERROR_NO_SUCH_SUBSCRIPTION_REQUEST, "%s", _("No subscription request for the server chat") ); } else { for(item = priv->subscription_requests; item != NULL; item = item->next) { request = (InfdDirectorySubreq*)item->data; if(request->type != INFD_DIRECTORY_SUBREQ_CHAT && request->connection == connection && request->node_id == node_id) { return request; } } g_set_error( error, inf_directory_error_quark(), INF_DIRECTORY_ERROR_NO_SUCH_SUBSCRIPTION_REQUEST, _("No subscription request with ID %u"), node_id ); } return NULL; } static InfdDirectoryNode* infd_directory_get_node_from_xml(InfdDirectory* directory, xmlNodePtr xml, const gchar* attrib, GError** error) { InfdDirectoryPrivate* priv; InfdDirectoryNode* node; guint node_id; gboolean has_node; priv = INFD_DIRECTORY_PRIVATE(directory); has_node = inf_xml_util_get_attribute_uint_required( xml, attrib, &node_id, error ); if(has_node == FALSE) return NULL; node = g_hash_table_lookup(priv->nodes, GUINT_TO_POINTER(node_id)); if(node == NULL) { g_set_error( error, inf_directory_error_quark(), INF_DIRECTORY_ERROR_NO_SUCH_NODE, "%s", inf_directory_strerror(INF_DIRECTORY_ERROR_NO_SUCH_NODE) ); return NULL; } return node; } static InfdDirectoryNode* infd_directory_get_node_from_xml_typed(InfdDirectory* directory, xmlNodePtr xml, const gchar* attrib, InfdStorageNodeType type, GError** error) { InfdDirectoryNode* node; node = infd_directory_get_node_from_xml(directory, xml, attrib, error); if(node != NULL && node->type != type) { switch(type) { case INFD_STORAGE_NODE_SUBDIRECTORY: g_set_error( error, inf_directory_error_quark(), INF_DIRECTORY_ERROR_NOT_A_SUBDIRECTORY, "%s", inf_directory_strerror(INF_DIRECTORY_ERROR_NOT_A_SUBDIRECTORY) ); return NULL; case INFD_STORAGE_NODE_NOTE: g_set_error( error, inf_directory_error_quark(), INF_DIRECTORY_ERROR_NOT_A_NOTE, "%s", inf_directory_strerror(INF_DIRECTORY_ERROR_NOT_A_NOTE) ); return NULL; default: g_assert_not_reached(); return NULL; } } return node; } static gboolean infd_directory_handle_explore_node(InfdDirectory* directory, InfXmlConnection* connection, const xmlNodePtr xml, GError** error) { InfdDirectoryPrivate* priv; InfdDirectoryNode* node; InfdDirectoryNode* child; xmlNodePtr reply_xml; gchar* seq; guint total; priv = INFD_DIRECTORY_PRIVATE(directory); node = infd_directory_get_node_from_xml_typed( directory, xml, "id", INFD_STORAGE_NODE_SUBDIRECTORY, error ); if(node->shared.subdir.explored == FALSE) if(infd_directory_node_explore(directory, node, error) == FALSE) return FALSE; if(g_slist_find(node->shared.subdir.connections, connection) != NULL) { g_set_error( error, inf_directory_error_quark(), INF_DIRECTORY_ERROR_ALREADY_EXPLORED, "%s", inf_directory_strerror(INF_DIRECTORY_ERROR_ALREADY_EXPLORED) ); return FALSE; } if(!infd_directory_make_seq(directory, connection, xml, &seq, error)) return FALSE; total = 0; for(child = node->shared.subdir.child; child != NULL; child = child->next) ++ total; reply_xml = xmlNewNode(NULL, (const xmlChar*)"explore-begin"); inf_xml_util_set_attribute_uint(reply_xml, "total", total); if(seq != NULL) inf_xml_util_set_attribute(reply_xml, "seq", seq); inf_communication_group_send_message( INF_COMMUNICATION_GROUP(priv->group), connection, reply_xml ); for(child = node->shared.subdir.child; child != NULL; child = child->next) { reply_xml = infd_directory_node_register_to_xml(child); if(seq != NULL) inf_xml_util_set_attribute(reply_xml, "seq", seq); inf_communication_group_send_message( INF_COMMUNICATION_GROUP(priv->group), connection, reply_xml ); } reply_xml = xmlNewNode(NULL, (const xmlChar*)"explore-end"); if(seq != NULL) inf_xml_util_set_attribute(reply_xml, "seq", seq); inf_communication_group_send_message( INF_COMMUNICATION_GROUP(priv->group), connection, reply_xml ); /* Remember that this connection explored that node so that it gets * notified when changes occur. */ node->shared.subdir.connections = g_slist_prepend( node->shared.subdir.connections, connection ); g_free(seq); return TRUE; } static gboolean infd_directory_handle_add_node(InfdDirectory* directory, InfXmlConnection* connection, const xmlNodePtr xml, GError** error) { InfdDirectoryPrivate* priv; InfdDirectoryNode* parent; InfdDirectoryNode* node; InfdNotePlugin* plugin; xmlChar* name; xmlChar* type; gchar* seq; xmlNodePtr child; gboolean perform_sync_in; gboolean subscribe_sync_conn; gboolean node_added; priv = INFD_DIRECTORY_PRIVATE(directory); parent = infd_directory_get_node_from_xml_typed( directory, xml, "parent", INFD_STORAGE_NODE_SUBDIRECTORY, error ); if(parent == NULL) return FALSE; type = inf_xml_util_get_attribute_required(xml, "type", error); if(type == NULL) return FALSE; if(strcmp((const gchar*)type, "InfSubdirectory") == 0) { /* No plugin because we want to create a directory */ plugin = NULL; xmlFree(type); } else { plugin = g_hash_table_lookup(priv->plugins, (const gchar*)type); xmlFree(type); if(plugin == NULL) { g_set_error( error, inf_directory_error_quark(), INF_DIRECTORY_ERROR_TYPE_UNKNOWN, "%s", inf_directory_strerror(INF_DIRECTORY_ERROR_TYPE_UNKNOWN) ); return FALSE; } } if(!infd_directory_make_seq(directory, connection, xml, &seq, error)) return FALSE; name = inf_xml_util_get_attribute_required(xml, "name", error); if(name == NULL) { g_free(seq); return FALSE; } if(plugin == NULL) { node = infd_directory_node_add_subdirectory( directory, parent, (const gchar*)name, connection, seq, error ); if(node == NULL) node_added = FALSE; else node_added = TRUE; } else { /* Check for sync-in/subscribe flags */ perform_sync_in = subscribe_sync_conn = FALSE; for(child = xml->children; child != NULL; child = child->next) { if(strcmp((const char*)child->name, "sync-in") == 0) perform_sync_in = TRUE; else if(strcmp((const char*)child->name, "subscribe") == 0) subscribe_sync_conn = TRUE; } if(perform_sync_in == FALSE) { node_added = infd_directory_node_add_note( directory, parent, (const gchar*)name, plugin, connection, subscribe_sync_conn, seq, error ); } else { node_added = infd_directory_node_add_sync_in( directory, parent, (const char*)name, plugin, connection, subscribe_sync_conn, seq, error ); /* Note: The sync-in can still fail for various reasons. Maybe the * client doesn't support the communication method, the synchronization * fails or the parent folder is removed. */ } } xmlFree(name); g_free(seq); return node_added; } static gboolean infd_directory_handle_remove_node(InfdDirectory* directory, InfXmlConnection* connection, const xmlNodePtr xml, GError** error) { InfdDirectoryNode* node; gchar* seq; gboolean result; node = infd_directory_get_node_from_xml(directory, xml, "id", error); if(node == NULL) return FALSE; if(node->parent == NULL) { g_set_error( error, inf_directory_error_quark(), INF_DIRECTORY_ERROR_ROOT_NODE_REMOVE_ATTEMPT, "%s", _("The root node cannot be removed") ); return FALSE; } else { if(!infd_directory_make_seq(directory, connection, xml, &seq, error)) return FALSE; result = infd_directory_node_remove(directory, node, seq, error); return result; } } static gboolean infd_directory_handle_subscribe_session(InfdDirectory* directory, InfXmlConnection* connection, xmlNodePtr xml, GError** error) { InfdDirectoryPrivate* priv; InfdDirectoryNode* node; InfdSessionProxy* proxy; InfCommunicationGroup* group; const gchar* method; gchar* seq; xmlNodePtr reply_xml; priv = INFD_DIRECTORY_PRIVATE(directory); node = infd_directory_get_node_from_xml_typed( directory, xml, "id", INFD_STORAGE_NODE_NOTE, error ); if(node == NULL) return FALSE; /* TODO: Bail if this connection is either currently being synchronized to * or is already subscribed */ /* TODO: Bail if a subscription request for this connection is pending. */ proxy = infd_directory_node_get_session(directory, node, error); if(proxy == NULL) return FALSE; if(!infd_directory_make_seq(directory, connection, xml, &seq, error)) return FALSE; g_object_get(G_OBJECT(proxy), "subscription-group", &group, NULL); method = inf_communication_group_get_method_for_connection( group, connection ); /* We should always be able to fallback to "central" */ g_assert(method != NULL); /* Reply that subscription was successful (so far, synchronization may * still fail) and tell identifier. */ reply_xml = xmlNewNode(NULL, (const xmlChar*)"subscribe-session"); xmlNewProp( reply_xml, (const xmlChar*)"group", (const xmlChar*)inf_communication_group_get_name(group) ); xmlNewProp( reply_xml, (const xmlChar*)"method", (const xmlChar*)method ); g_object_unref(group); inf_xml_util_set_attribute_uint(reply_xml, "id", node->id); if(seq != NULL) inf_xml_util_set_attribute(reply_xml, "seq", seq); /* This gives ownership of proxy to the subscription request */ infd_directory_add_subreq_session(directory, connection, node->id, proxy); inf_communication_group_send_message( INF_COMMUNICATION_GROUP(priv->group), connection, reply_xml ); g_free(seq); return TRUE; } static gboolean infd_directory_handle_save_session(InfdDirectory* directory, InfXmlConnection* connection, const xmlNodePtr xml, GError** error) { InfdDirectoryPrivate* priv; InfdDirectoryNode* node; xmlNodePtr reply_xml; gchar* path; gchar* seq; gboolean result; priv = INFD_DIRECTORY_PRIVATE(directory); if(priv->storage == NULL) { g_set_error( error, inf_directory_error_quark(), INF_DIRECTORY_ERROR_NO_STORAGE, "%s", _("No background storage available") ); return FALSE; } /* TODO: Don't do anything if buffer is not modified */ /* TODO: Authentication, we could also allow specific connections to save * without being subscribed. */ node = infd_directory_get_node_from_xml_typed( directory, xml, "id", INFD_STORAGE_NODE_NOTE, error ); if(node->shared.note.session == NULL || !infd_session_proxy_is_subscribed(node->shared.note.session, connection)) { g_set_error( error, inf_directory_error_quark(), INF_DIRECTORY_ERROR_UNSUBSCRIBED, "%s", _("The requesting connection is not subscribed to the session") ); return FALSE; } /* We only need this if we are saving asynchronously: */ /* TODO: Which we should do, of course. */ #if 0 reply_xml = xmlNewNode(NULL, (const xmlChar*)"session-save-in-progress"); seq_attr = xmlGetProp(xml, (const xmlChar*)"seq"); if(seq_attr != NULL) { xmlNewProp(reply_xml, (const xmlChar*)"seq", seq_attr); xmlFree(seq_attr); } inf_connection_manager_group_send_to_connection( priv->group, connection, reply_xml ); #endif infd_directory_node_get_path(node, &path, NULL); result = node->shared.note.plugin->session_write( priv->storage, infd_session_proxy_get_session(node->shared.note.session), path, node->shared.note.plugin->user_data, error ); /* TODO: unset modified flag of buffer if result == TRUE */ /* The timeout should only be set when there aren't any connections * subscribed, however we just made sure that the connection the request * comes from is subscribed. */ g_assert(node->shared.note.save_timeout == NULL); g_free(path); if(result == FALSE) return FALSE; if(!infd_directory_make_seq(directory, connection, xml, &seq, error)) return FALSE; reply_xml = xmlNewNode(NULL, (const xmlChar*)"session-saved"); if(seq != NULL) inf_xml_util_set_attribute(reply_xml, "seq", seq); inf_communication_group_send_message( INF_COMMUNICATION_GROUP(priv->group), connection, reply_xml ); g_free(seq); return TRUE; } static gboolean infd_directory_handle_subscribe_chat(InfdDirectory* directory, InfXmlConnection* connection, xmlNodePtr xml, GError** error) { InfdDirectoryPrivate* priv; InfCommunicationGroup* group; const gchar* method; gchar* seq; xmlNodePtr reply_xml; priv = INFD_DIRECTORY_PRIVATE(directory); /* TODO: Bail if this connection is either currently being synchronized to * or is already subscribed */ /* TODO: Bail if a subscription request for this connection is pending. */ if(priv->chat_session == NULL) { g_set_error( error, inf_directory_error_quark(), INF_DIRECTORY_ERROR_CHAT_DISABLED, "%s", _("The chat is disabled") ); return FALSE; } if(!infd_directory_make_seq(directory, connection, xml, &seq, error)) return FALSE; g_object_get( G_OBJECT(priv->chat_session), "subscription-group", &group, NULL ); method = inf_communication_group_get_method_for_connection( group, connection ); /* We should always be able to fallback to "central" */ g_assert(method != NULL); /* Reply that subscription was successful (so far, synchronization may * still fail) and tell identifier. */ reply_xml = xmlNewNode(NULL, (const xmlChar*)"subscribe-chat"); xmlNewProp( reply_xml, (const xmlChar*)"group", (const xmlChar*)inf_communication_group_get_name(group) ); xmlNewProp( reply_xml, (const xmlChar*)"method", (const xmlChar*)method ); g_object_unref(group); if(seq) inf_xml_util_set_attribute(reply_xml, "seq", seq); infd_directory_add_subreq_chat(directory, connection); inf_communication_group_send_message( INF_COMMUNICATION_GROUP(priv->group), connection, reply_xml ); g_free(seq); return TRUE; } static gboolean infd_directory_handle_subscribe_ack(InfdDirectory* directory, InfXmlConnection* connection, const xmlNodePtr xml, GError** error) { InfdDirectoryPrivate* priv; InfdDirectorySubreq* request; InfdDirectoryNode* node; InfdDirectorySyncIn* sync_in; InfdSessionProxy* proxy; InfdDirectoryConnectionInfo* info; priv = INFD_DIRECTORY_PRIVATE(directory); request = infd_directory_get_subreq_from_xml( directory, connection, xml, error ); if(request == NULL) return FALSE; /* Unlink, so that the subreq itself does not cause the is_name_available * assertions below to fail. */ infd_directory_unlink_subreq(directory, request); info = g_hash_table_lookup(priv->connections, connection); g_assert(info != NULL); switch(request->type) { case INFD_DIRECTORY_SUBREQ_CHAT: /* Note that it doesn't matter whether the chat was disabled+enabled * between subreq generation and handling - the group * is always called InfChat so the client joins the correct group in * all cases. */ if(priv->chat_session != NULL) { infd_session_proxy_subscribe_to( priv->chat_session, connection, info->seq_id, TRUE ); } else { /* The chat does not exist anymore - just create a temporary chat, * subscribe the client and then close the chat right aftewards, to * notify the client about the chat not existing anymore. */ /* TODO: Make a helper function creating the chat proxy but not * setting the member var / doing the property notify */ g_object_freeze_notify(G_OBJECT(directory)); infd_directory_enable_chat(directory, TRUE); infd_session_proxy_subscribe_to( priv->chat_session, connection, info->seq_id, TRUE ); infd_directory_enable_chat(directory, FALSE); g_object_thaw_notify(G_OBJECT(directory)); } break; case INFD_DIRECTORY_SUBREQ_SESSION: node = g_hash_table_lookup( priv->nodes, GUINT_TO_POINTER(request->node_id) ); /* The node this client wants to subscribe might have been removed in the * meanwhile. */ if(node != NULL) { g_assert(node->type == INFD_STORAGE_NODE_NOTE); g_assert(node->shared.note.session == NULL || node->shared.note.session == request->shared.session.session); if(node->shared.note.session == NULL) { infd_directory_node_link_session( directory, node, request->shared.session.session ); } } infd_session_proxy_subscribe_to( request->shared.session.session, connection, info->seq_id, TRUE ); break; case INFD_DIRECTORY_SUBREQ_ADD_NODE: if(request->shared.add_node.parent != NULL) { g_assert( infd_directory_node_is_name_available( directory, request->shared.add_node.parent, request->shared.add_node.name, NULL ) == TRUE ); proxy = request->shared.add_node.proxy; g_object_ref(proxy); node = infd_directory_node_new_note( directory, request->shared.add_node.parent, request->node_id, g_strdup(request->shared.add_node.name), request->shared.add_node.plugin ); infd_directory_node_link_session(directory, node, proxy); /* register to all but conn. conn already added the node after * having sent subscribe-ack. */ infd_directory_node_register(directory, node, connection, NULL); } else { /* The add-node request can't be performed properly because the parent * node has been removed. Still create a session proxy and subscribe to * connection before unrefing it again, so that the remote host gets * notified that this session is no longer active. */ proxy = request->shared.add_node.proxy; g_object_ref(proxy); } /* Don't sync session to client if the client added this node, since the * node is empty anyway. */ infd_session_proxy_subscribe_to(proxy, connection, info->seq_id, FALSE); g_object_unref(proxy); break; case INFD_DIRECTORY_SUBREQ_SYNC_IN: case INFD_DIRECTORY_SUBREQ_SYNC_IN_SUBSCRIBE: /* Group and method are OK for the client, so start synchronization */ inf_session_synchronize_from( infd_session_proxy_get_session(request->shared.sync_in.proxy) ); if(request->shared.sync_in.parent != NULL) { g_assert( infd_directory_node_is_name_available( directory, request->shared.sync_in.parent, request->shared.sync_in.name, NULL ) == TRUE ); proxy = request->shared.sync_in.proxy; g_object_ref(proxy); sync_in = infd_directory_add_sync_in( directory, request->shared.sync_in.parent, request->node_id, request->shared.sync_in.name, request->shared.sync_in.plugin, proxy ); } else { /* The sync-in can't be performed properly because the parent node of * the node to sync-in has been removed. Still create the corresponding * session and close it immediately (cancelling the synchronization, to * tell the client). */ proxy = request->shared.sync_in.proxy; g_object_ref(proxy); } if(request->type == INFD_DIRECTORY_SUBREQ_SYNC_IN) { /* No subscription, so add connection to synchronization group * explicitely. */ inf_communication_hosted_group_add_member( request->shared.sync_in.synchronization_group, connection ); } else { /* subscribe_to adds connection to subscription group which is the * same as the synchronization group. */ infd_session_proxy_subscribe_to(proxy, connection, info->seq_id, FALSE); } g_object_unref(proxy); break; default: g_assert_not_reached(); break; } infd_directory_free_subreq(request); return TRUE; } static gboolean infd_directory_handle_subscribe_nack(InfdDirectory* directory, InfXmlConnection* connection, const xmlNodePtr xml, GError** error) { InfdDirectoryPrivate* priv; InfdDirectorySubreq* request; gchar* path; gboolean result; priv = INFD_DIRECTORY_PRIVATE(directory); request = infd_directory_get_subreq_from_xml( directory, connection, xml, error ); if(request == NULL) return FALSE; result = TRUE; if(priv->storage != NULL && request->type == INFD_DIRECTORY_SUBREQ_ADD_NODE) { infd_directory_node_make_path( request->shared.add_node.parent, request->shared.add_node.name, &path, NULL); result = infd_storage_remove_node( priv->storage, request->shared.add_node.plugin->note_type, path, error ); g_free(path); } infd_directory_remove_subreq(directory, request); return result; } /* * Signal handlers. */ static void infd_directory_connection_notify_status_cb(GObject* object, GParamSpec* pspec, gpointer user_data) { InfXmlConnectionStatus status; g_object_get(object, "status", &status, NULL); if(status == INF_XML_CONNECTION_OPEN) { infd_directory_send_welcome_message( INFD_DIRECTORY(user_data), INF_XML_CONNECTION(object) ); } } static void infd_directory_member_removed_cb(InfCommunicationGroup* group, InfXmlConnection* connection, gpointer user_data) { InfdDirectory* directory; InfdDirectoryPrivate* priv; GSList* item; InfdDirectorySubreq* request; InfdDirectoryConnectionInfo* info; directory = INFD_DIRECTORY(user_data); priv = INFD_DIRECTORY_PRIVATE(directory); if(priv->root != NULL && priv->root->shared.subdir.explored) { infd_directory_node_remove_connection(priv->root, connection); } /* Remove all subscription requests for this connection */ item = priv->subscription_requests; while(item != NULL) { request = (InfdDirectorySubreq*)item->data; item = item->next; if(request->connection == connection) infd_directory_remove_subreq(directory, request); } info = g_hash_table_lookup(priv->connections, connection); g_slice_free(InfdDirectoryConnectionInfo, info); inf_signal_handlers_disconnect_by_func(G_OBJECT(connection), G_CALLBACK(infd_directory_connection_notify_status_cb), directory); g_hash_table_remove(priv->connections, connection); g_object_unref(G_OBJECT(connection)); } /* * Property modification. */ static void infd_directory_set_storage(InfdDirectory* directory, InfdStorage* storage) { InfdDirectoryPrivate* priv; InfdDirectoryNode* child; priv = INFD_DIRECTORY_PRIVATE(directory); if(priv->storage != NULL) { /* priv->root may be NULL if this is called from dispose. */ if(priv->root != NULL && priv->root->shared.subdir.explored == TRUE) { /* Clear directory tree. This will cause all sessions to be saved in * storage. Note that sessions are not closed, but further * modifications to the sessions will not be stored in storage. */ while((child = priv->root->shared.subdir.child) != NULL) { infd_directory_node_unlink_child_sessions(directory, child, TRUE); infd_directory_node_unregister(directory, child, NULL); infd_directory_node_free(directory, child); } } g_object_unref(G_OBJECT(priv->storage)); } priv->storage = storage; if(storage != NULL) { /* root folder was explored before storage change, so keep it * explored. */ if(priv->root->shared.subdir.explored == TRUE) { /* Need to set explored flag to FALSE to meet preconditions of * infd_directory_node_explore(). */ priv->root->shared.subdir.explored = FALSE; /* TODO: Error handling? */ infd_directory_node_explore(directory, priv->root, NULL); } g_object_ref(G_OBJECT(storage)); } } static void infd_directory_set_communication_manager(InfdDirectory* directory, InfCommunicationManager* manager) { InfdDirectoryPrivate* priv; priv = INFD_DIRECTORY_PRIVATE(directory); /* construct/only */ g_assert(priv->communication_manager == NULL); priv->communication_manager = manager; g_object_ref(manager); } /* * GObject overrides. */ static void infd_directory_init(GTypeInstance* instance, gpointer g_class) { InfdDirectory* directory; InfdDirectoryPrivate* priv; directory = INFD_DIRECTORY(instance); priv = INFD_DIRECTORY_PRIVATE(directory); priv->io = NULL; priv->storage = NULL; priv->communication_manager = NULL; priv->plugins = g_hash_table_new(g_str_hash, g_str_equal); priv->connections = g_hash_table_new(NULL, NULL); priv->node_counter = 1; priv->nodes = g_hash_table_new(NULL, NULL); /* The root node has no name. */ priv->root = infd_directory_node_new_subdirectory(directory, NULL, 0, NULL); priv->sync_ins = NULL; priv->subscription_requests = NULL; priv->chat_session = NULL; } static GObject* infd_directory_constructor(GType type, guint n_construct_properties, GObjectConstructParam* construct_properties) { GObject* object; InfdDirectory* directory; InfdDirectoryPrivate* priv; /* We only use central method for directory handling */ static const gchar* const methods[] = { "centrol", NULL }; object = G_OBJECT_CLASS(parent_class)->constructor( type, n_construct_properties, construct_properties ); directory = INFD_DIRECTORY(object); priv = INFD_DIRECTORY_PRIVATE(directory); /* TODO: Use default communication manager in case none is set */ g_assert(priv->communication_manager != NULL); priv->group = inf_communication_manager_open_group( priv->communication_manager, "InfDirectory", methods ); g_signal_connect( G_OBJECT(priv->group), "member-removed", G_CALLBACK(infd_directory_member_removed_cb), directory ); inf_communication_group_set_target( INF_COMMUNICATION_GROUP(priv->group), INF_COMMUNICATION_OBJECT(directory) ); /* If we don't have a background storage then the root node has been * explored (there is simply no content yet, it has to be added via * infd_directory_add_note). */ if(priv->storage == NULL) priv->root->shared.subdir.explored = TRUE; g_assert(g_hash_table_size(priv->connections) == 0); return object; } static void infd_directory_dispose(GObject* object) { InfdDirectory* directory; InfdDirectoryPrivate* priv; GHashTableIter iter; gpointer key; directory = INFD_DIRECTORY(object); priv = INFD_DIRECTORY_PRIVATE(directory); /* Disable chat if any */ if(priv->chat_session != NULL) infd_directory_enable_chat(directory, FALSE); /* Cancel sync-ins */ while(priv->sync_ins != NULL) infd_directory_remove_sync_in(directory, priv->sync_ins->data); /* This frees the complete directory tree and saves sessions into the * storage. */ infd_directory_node_unlink_child_sessions(directory, priv->root, TRUE); infd_directory_node_free(directory, priv->root); priv->root = NULL; g_hash_table_destroy(priv->nodes); priv->nodes = NULL; for(g_hash_table_iter_init(&iter, priv->connections); g_hash_table_iter_next(&iter, &key, NULL); g_hash_table_iter_init(&iter, priv->connections)) { inf_communication_hosted_group_remove_member( priv->group, INF_XML_CONNECTION(key) ); } g_assert(g_hash_table_size(priv->connections) == 0); /* Should have been cleared by removing all connections */ g_assert(priv->subscription_requests == NULL); /* We have dropped all references to connections now, so these do not try * to tell anyone that the directory tree has gone or whatever. */ inf_signal_handlers_disconnect_by_func( G_OBJECT(priv->group), G_CALLBACK(infd_directory_member_removed_cb), directory ); g_object_unref(priv->group); g_object_unref(priv->communication_manager); infd_directory_set_storage(directory, NULL); g_hash_table_destroy(priv->connections); priv->connections = NULL; g_hash_table_destroy(priv->plugins); priv->plugins = NULL; if(priv->io != NULL) { g_object_unref(G_OBJECT(priv->io)); priv->io = NULL; } G_OBJECT_CLASS(parent_class)->dispose(object); } static void infd_directory_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec) { InfdDirectory* directory; InfdDirectoryPrivate* priv; directory = INFD_DIRECTORY(object); priv = INFD_DIRECTORY_PRIVATE(directory); switch(prop_id) { case PROP_IO: g_assert(priv->io == NULL); /* construct only */ priv->io = INF_IO(g_value_dup_object(value)); break; case PROP_STORAGE: infd_directory_set_storage( directory, INFD_STORAGE(g_value_get_object(value)) ); break; case PROP_COMMUNICATION_MANAGER: infd_directory_set_communication_manager( directory, INF_COMMUNICATION_MANAGER(g_value_get_object(value)) ); break; case PROP_CHAT_SESSION: /* read only */ default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void infd_directory_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec) { InfdDirectory* directory; InfdDirectoryPrivate* priv; directory = INFD_DIRECTORY(object); priv = INFD_DIRECTORY_PRIVATE(directory); switch(prop_id) { case PROP_IO: g_value_set_object(value, G_OBJECT(priv->io)); break; case PROP_STORAGE: g_value_set_object(value, G_OBJECT(priv->storage)); break; case PROP_COMMUNICATION_MANAGER: g_value_set_object(value, G_OBJECT(priv->communication_manager)); break; case PROP_CHAT_SESSION: g_value_set_object(value, G_OBJECT(priv->chat_session)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } /* * Default signal handler implementation. */ static void infd_directory_add_session(InfdDirectory* directory, InfdDirectoryIter* iter, InfdSessionProxy* session) { InfdDirectoryNode* node; infd_directory_return_if_iter_fail(directory, iter); node = (InfdDirectoryNode*)iter->node; g_assert(node->type == INFD_STORAGE_NODE_NOTE); g_assert(node->shared.note.session == NULL); node->shared.note.session = session; g_object_ref(session); g_object_set_qdata( G_OBJECT(session), infd_directory_node_id_quark, GUINT_TO_POINTER(node->id) ); g_signal_connect( G_OBJECT(session), "notify::idle", G_CALLBACK(infd_directory_session_idle_notify_cb), directory ); if(infd_session_proxy_is_idle(node->shared.note.session)) { infd_directory_start_session_save_timeout(directory, node); } } static void infd_directory_remove_session(InfdDirectory* directory, InfdDirectoryIter* iter, InfdSessionProxy* session) { InfdDirectoryNode* node; InfdDirectoryPrivate* priv; priv = INFD_DIRECTORY_PRIVATE(directory); infd_directory_return_if_iter_fail(directory, iter); node = (InfdDirectoryNode*)iter->node; g_assert(node->type == INFD_STORAGE_NODE_NOTE); g_assert(node->shared.note.session == session); if(node->shared.note.save_timeout != NULL) { inf_io_remove_timeout(priv->io, node->shared.note.save_timeout); node->shared.note.save_timeout = NULL; } inf_signal_handlers_disconnect_by_func( G_OBJECT(session), G_CALLBACK(infd_directory_session_idle_notify_cb), directory ); g_object_set_qdata( G_OBJECT(session), infd_directory_node_id_quark, NULL ); g_object_unref(session); node->shared.note.session = NULL; } /* * InfCommunicationObject implementation. */ static InfCommunicationScope infd_directory_communication_object_received(InfCommunicationObject* object, InfXmlConnection* connection, const xmlNodePtr node, GError** error) { InfdDirectory* directory; InfdDirectoryPrivate* priv; GError* local_error; xmlNodePtr reply_xml; gchar* seq; directory = INFD_DIRECTORY(object); priv = INFD_DIRECTORY_PRIVATE(directory); local_error = NULL; if(strcmp((const char*)node->name, "explore-node") == 0) { infd_directory_handle_explore_node( directory, connection, node, &local_error ); } else if(strcmp((const char*)node->name, "add-node") == 0) { infd_directory_handle_add_node( directory, connection, node, &local_error ); } else if(strcmp((const char*)node->name, "remove-node") == 0) { infd_directory_handle_remove_node( directory, connection, node, &local_error ); } else if(strcmp((const char*)node->name, "subscribe-session") == 0) { infd_directory_handle_subscribe_session( directory, connection, node, &local_error ); } else if(strcmp((const char*)node->name, "save-session") == 0) { infd_directory_handle_save_session( directory, connection, node, &local_error ); } else if(strcmp((const char*)node->name, "subscribe-chat") == 0) { infd_directory_handle_subscribe_chat( directory, connection, node, &local_error ); } else if(strcmp((const char*)node->name, "subscribe-ack") == 0) { /* Don't reply to subscribe-ack. */ infd_directory_handle_subscribe_ack( directory, connection, node, &local_error ); } else if(strcmp((const char*)node->name, "subscribe-nack") == 0) { /* Don't reply to subscribe-nack. */ infd_directory_handle_subscribe_nack( directory, connection, node, &local_error ); } else { g_set_error( &local_error, inf_directory_error_quark(), INF_DIRECTORY_ERROR_UNEXPECTED_MESSAGE, "%s", inf_directory_strerror(INF_DIRECTORY_ERROR_UNEXPECTED_MESSAGE) ); } if(local_error != NULL) { /* TODO: If error is not from the InfDirectoryError error domain, the * client cannot reconstruct the error because he possibly does not know * the error domain (it might even come from a storage plugin). */ if(!infd_directory_make_seq(directory, connection, node, &seq, error)) seq = NULL; /* An error happened, so tell the client that the request failed and * what has gone wrong. */ reply_xml = inf_xml_util_new_node_from_error(local_error, NULL, "request-failed"); if(seq != NULL) inf_xml_util_set_attribute(reply_xml, "seq", seq); g_free(seq); inf_communication_group_send_message( INF_COMMUNICATION_GROUP(priv->group), connection, reply_xml ); g_error_free(local_error); } /* Never forward directory messages */ return INF_COMMUNICATION_SCOPE_PTP; } /* * GType registration. */ static void infd_directory_class_init(gpointer g_class, gpointer class_data) { GObjectClass* object_class; InfdDirectoryClass* directory_class; object_class = G_OBJECT_CLASS(g_class); directory_class = INFD_DIRECTORY_CLASS(g_class); parent_class = G_OBJECT_CLASS(g_type_class_peek_parent(g_class)); g_type_class_add_private(g_class, sizeof(InfdDirectoryPrivate)); object_class->constructor = infd_directory_constructor; object_class->dispose = infd_directory_dispose; object_class->set_property = infd_directory_set_property; object_class->get_property = infd_directory_get_property; directory_class->node_added = NULL; directory_class->node_removed = NULL; directory_class->add_session = infd_directory_add_session; directory_class->remove_session = infd_directory_remove_session; infd_directory_node_id_quark = g_quark_from_static_string("INFD_DIRECTORY_NODE_ID"); g_object_class_install_property( object_class, PROP_IO, g_param_spec_object( "io", "IO", "IO object to watch sockets and schedule timeouts", INF_TYPE_IO, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); g_object_class_install_property( object_class, PROP_STORAGE, g_param_spec_object( "storage", "Storage backend", "The storage backend to use", INFD_TYPE_STORAGE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT ) ); g_object_class_install_property( object_class, PROP_COMMUNICATION_MANAGER, g_param_spec_object( "communication-manager", "Communication manager", "The communication manager for the directory", INF_COMMUNICATION_TYPE_MANAGER, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); g_object_class_install_property( object_class, PROP_CHAT_SESSION, g_param_spec_object( "chat-session", "Chat session", "The server's chat session", INFD_TYPE_SESSION_PROXY, G_PARAM_READABLE ) ); /** * InfdDirectory::node-added: * @directory: The #InfdDirectory emitting the signal. * @iter: A #InfdDirectoryIter pointing to the added node. * * This signal is emitted when a new node has been created. It can either * be created by API calls such as infd_directory_add_note() and * infd_directory_add_subdirectory() or by a client making a corresponding * request. **/ directory_signals[NODE_ADDED] = g_signal_new( "node-added", G_OBJECT_CLASS_TYPE(object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(InfdDirectoryClass, node_added), NULL, NULL, inf_marshal_VOID__BOXED, G_TYPE_NONE, 1, INFD_TYPE_DIRECTORY_ITER | G_SIGNAL_TYPE_STATIC_SCOPE ); /** * InfdDirectory::node-removed: * @directory: The #InfdDirectory emitting the signal. * @iter: A #InfdDirectoryIter pointing to the removed node. * * This signal is emitted when a node has been removed. If a subdirectory * node is removed, all contained nodes are removed as well. Node removal * can either happen through a call to infd_directory_remove_node(), or by * a client making a corresponding request. **/ directory_signals[NODE_REMOVED] = g_signal_new( "node-removed", G_OBJECT_CLASS_TYPE(object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(InfdDirectoryClass, node_removed), NULL, NULL, inf_marshal_VOID__BOXED, G_TYPE_NONE, 1, INFD_TYPE_DIRECTORY_ITER | G_SIGNAL_TYPE_STATIC_SCOPE ); /** * InfdDirectory::add-session: * @directory: The #InfdDirectory emitting the signal. * @iter: A #InfdDirectoryIter pointing to the affected node. * @session: The #InfdSessionProxy proxying the added session. * * This signal is emitted, when a session has been associated with a node. * This happens when infd_directory_iter_get_session() is called on a node, * when a remote client subscribes to a session or a new node was created. * * When a session has been created for a node, the session is kept until it * is idle for some time. Then, it is removed again after having been stored * into the background storage. */ directory_signals[ADD_SESSION] = g_signal_new( "add-session", G_OBJECT_CLASS_TYPE(object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(InfdDirectoryClass, add_session), NULL, NULL, inf_marshal_VOID__BOXED_OBJECT, G_TYPE_NONE, 2, INFD_TYPE_DIRECTORY_ITER | G_SIGNAL_TYPE_STATIC_SCOPE, INFD_TYPE_SESSION_PROXY ); /** * InfdDirectory::remove-session: * @directory: The #InfdDirectory emitting the signal. * @iter: A #InfdDirectoryIter pointing to the affected node. * @session: The #InfdSessionProxy proxying the removed session. * * This signal is emitted when a previously added session was removed. This * happens when a session is idle for some time, or when the corresponding * node has been removed. */ directory_signals[REMOVE_SESSION] = g_signal_new( "remove-session", G_OBJECT_CLASS_TYPE(object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(InfdDirectoryClass, remove_session), NULL, NULL, inf_marshal_VOID__BOXED_OBJECT, G_TYPE_NONE, 2, INFD_TYPE_DIRECTORY_ITER | G_SIGNAL_TYPE_STATIC_SCOPE, INFD_TYPE_SESSION_PROXY ); } static void infd_directory_communication_object_init(gpointer g_iface, gpointer iface_data) { InfCommunicationObjectIface* iface; iface = (InfCommunicationObjectIface*)g_iface; iface->received = infd_directory_communication_object_received; } GType infd_directory_iter_get_type(void) { static GType directory_iter_type = 0; if(!directory_iter_type) { directory_iter_type = g_boxed_type_register_static( "InfdDirectoryIter", (GBoxedCopyFunc)infd_directory_iter_copy, (GBoxedFreeFunc)infd_directory_iter_free ); } return directory_iter_type; } GType infd_directory_get_type(void) { static GType directory_type = 0; if(!directory_type) { static const GTypeInfo directory_type_info = { sizeof(InfdDirectoryClass), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ infd_directory_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InfdDirectory), /* instance_size */ 0, /* n_preallocs */ infd_directory_init, /* instance_init */ NULL /* value_table */ }; static const GInterfaceInfo communication_object_info = { infd_directory_communication_object_init, NULL, NULL }; directory_type = g_type_register_static( G_TYPE_OBJECT, "InfdDirectory", &directory_type_info, 0 ); g_type_add_interface_static( directory_type, INF_COMMUNICATION_TYPE_OBJECT, &communication_object_info ); } return directory_type; } /* * Public API. */ /** * infd_directory_iter_copy: * @iter: A #InfdDirectoryIter. * * Makes a dynamically-allocated copy of @iter. This should not be used by * applications because you can copy the structs by value. * * Return Value: A newly-allocated copy of @iter. **/ InfdDirectoryIter* infd_directory_iter_copy(InfdDirectoryIter* iter) { InfdDirectoryIter* new_iter; g_return_val_if_fail(iter != NULL, NULL); new_iter = g_slice_new(InfdDirectoryIter); *new_iter = *iter; return new_iter; } /** * infd_directory_iter_free: * @iter: A #InfdDirectoryIter. * * Frees a #InfdDirectoryIter allocated with infd_directory_iter_copy(). **/ void infd_directory_iter_free(InfdDirectoryIter* iter) { g_return_if_fail(iter != NULL); g_slice_free(InfdDirectoryIter, iter); } /** * infd_directory_new: * @io: IO object to watch connections and schedule timeouts. * @storage: Storage backend that is used to read/write notes from * permanent memory into #InfBuffer objects, or %NULL. * @comm_manager: A #InfCommunicationManager to register added * connections to and which forwards incoming data to the directory * or running sessions. * * Creates a new #InfdDirectory. If @storage is %NULL then the directory * keeps all content in memory. This can make sense for ad-hoc sessions where * no central document storage is required. * * Return Value: A new #InfdDirectory. **/ InfdDirectory* infd_directory_new(InfIo* io, InfdStorage* storage, InfCommunicationManager* comm_manager) { GObject* object; g_return_val_if_fail(INF_IS_IO(io), NULL); g_return_val_if_fail(storage == NULL || INFD_IS_STORAGE(storage), NULL); g_return_val_if_fail(INF_COMMUNICATION_IS_MANAGER(comm_manager), NULL); object = g_object_new( INFD_TYPE_DIRECTORY, "io", io, "storage", storage, "communication-manager", comm_manager, NULL ); return INFD_DIRECTORY(object); } /** * infd_directory_get_io: * @directory: A #InfdDirectory. * * Returns the IO object in use by the directory. * * Return Value: A #InfIo. **/ InfIo* infd_directory_get_io(InfdDirectory* directory) { g_return_val_if_fail(INFD_IS_DIRECTORY(directory), NULL); return INFD_DIRECTORY_PRIVATE(directory)->io; } /** * infd_directory_get_storage: * @directory: A #InfdDirectory: * * Returns the storage backend in use by the directory. * * Return Value: An #InfdStorage. **/ InfdStorage* infd_directory_get_storage(InfdDirectory* directory) { g_return_val_if_fail(INFD_IS_DIRECTORY(directory), NULL); return INFD_DIRECTORY_PRIVATE(directory)->storage; } /** * infd_directory_get_communication_manager: * @directory: A #InfdDirectory. * * Returns the connection manager of the directory. * * Return Value: An #InfCommunicationManager. **/ InfCommunicationManager* infd_directory_get_communication_manager(InfdDirectory* directory) { g_return_val_if_fail(INFD_IS_DIRECTORY(directory), NULL); return INFD_DIRECTORY_PRIVATE(directory)->communication_manager; } /** * infd_directory_add_plugin: * @directory: A #InfdDirectory. * @plugin: A #InfdNotePlugin. * * Adds @plugin to @directory. This allows the directory to create sessions * of the plugin's type. Only one plugin of each type can be added to the * directory. The plugin's storage_type must match the storage of @directory. * If the directory's storage is %NULL, then the plugin's storage type does * not matter, and the plugin's @session_read and @session_write functions * will not be used (and can therefore be %NULL). * * Return Value: Whether the plugin was added successfully. **/ gboolean infd_directory_add_plugin(InfdDirectory* directory, const InfdNotePlugin* plugin) { InfdDirectoryPrivate* priv; g_return_val_if_fail(INFD_IS_DIRECTORY(directory), FALSE); g_return_val_if_fail(plugin != NULL, FALSE); priv = INFD_DIRECTORY_PRIVATE(directory); g_return_val_if_fail( priv->storage == NULL || strcmp( plugin->storage_type, g_type_name(G_TYPE_FROM_INSTANCE(priv->storage)) ) == 0, FALSE ); if(g_hash_table_lookup(priv->plugins, plugin->note_type) != NULL) return FALSE; g_hash_table_insert( priv->plugins, /* cast const away without warning */ /* take addr -> char const * const * * cast -> void const * * cast -> void * const * * deref -> void * const */ *(const gpointer*)(gconstpointer)&plugin->note_type, *(gpointer*)(gpointer)&plugin ); return TRUE; } /** * infd_directory_lookup_plugin: * @directory: A #InfdDirectory. * @note_type: A note type for which to lookup the plugin. * * Returns the #InfdNotePlugin that handles the given note type, or %NULL * in case no corresponding plugin was added. * * Return Value: A #InfdNotePlugin, or %NULL. **/ const InfdNotePlugin* infd_directory_lookup_plugin(InfdDirectory* directory, const gchar* note_type) { InfdDirectoryPrivate* priv; g_return_val_if_fail(INFD_IS_DIRECTORY(directory), NULL); g_return_val_if_fail(note_type != NULL, NULL); priv = INFD_DIRECTORY_PRIVATE(directory); return (const InfdNotePlugin*)g_hash_table_lookup(priv->plugins, note_type); } /** * infd_directory_add_connection: * @directory: A #InfdDirectory. * @connection: A #InfConnection. * * Adds @connection to the connections of @directory. The directory will then * receive requests from @connection. If the directory's method manager does * not contain a "central" method for connection's network, then the * connection will not be added and the function returns %FALSE. * * The connection is removed again automatically if it is closed. * * Returns: Whether the connection was added to the directory. **/ gboolean infd_directory_add_connection(InfdDirectory* directory, InfXmlConnection* connection) { InfdDirectoryPrivate* priv; InfdDirectoryConnectionInfo* info; InfXmlConnectionStatus status; GHashTableIter iter; gpointer value; guint seq_id; g_return_val_if_fail(INFD_IS_DIRECTORY(directory), FALSE); g_return_val_if_fail(INF_IS_XML_CONNECTION(connection), FALSE); priv = INFD_DIRECTORY_PRIVATE(directory); g_return_val_if_fail(priv->communication_manager != NULL, FALSE); g_return_val_if_fail( g_hash_table_lookup(priv->connections, connection) == NULL, FALSE ); inf_communication_hosted_group_add_member(priv->group, connection); /* Find a free seq id */ seq_id = 1; g_hash_table_iter_init(&iter, priv->connections); while(g_hash_table_iter_next(&iter, NULL, &value)) { info = (InfdDirectoryConnectionInfo*)value; if(info->seq_id >= seq_id) seq_id = info->seq_id + 1; g_assert(seq_id > info->seq_id); /* check for overflow */ } info = g_slice_new(InfdDirectoryConnectionInfo); info->seq_id = seq_id; g_hash_table_insert(priv->connections, connection, info); g_object_ref(connection); g_signal_connect( G_OBJECT(connection), "notify::status", G_CALLBACK(infd_directory_connection_notify_status_cb), directory ); g_object_get(G_OBJECT(connection), "status", &status, NULL); if(status == INF_XML_CONNECTION_OPEN) infd_directory_send_welcome_message(directory, connection); return TRUE; } /** * infd_directory_foreach_connection: * @directory: A #InfdDirectory. * @func: The function to call for each connection in @directory. * @user_data: Additional data to pass to the callback function. * * Calls @func for each connection in @directory that has previously been * added to the directory. */ void infd_directory_foreach_connection(InfdDirectory* directory, InfdDirectoryForeachConnectionFunc func, gpointer userdata) { InfdDirectoryPrivate* priv; GHashTableIter iter; gpointer key; g_return_if_fail(INFD_IS_DIRECTORY(directory)); g_return_if_fail(func != NULL); priv = INFD_DIRECTORY_PRIVATE(directory); g_hash_table_iter_init(&iter, priv->connections); while (g_hash_table_iter_next(&iter, &key, NULL)) { func(INF_XML_CONNECTION(key), userdata); } } /** * infd_directory_iter_get_name: * @directory: A #InfdDirectory. * @iter: A #InfdDirectoryIter pointing to a node in @directory. * * Returns the name of the node @iter points to. * * Returns: The node's name. The returned string must not be freed. */ const gchar* infd_directory_iter_get_name(InfdDirectory* directory, InfdDirectoryIter* iter) { InfdDirectoryPrivate* priv; InfdDirectoryNode* node; g_return_val_if_fail(INFD_IS_DIRECTORY(directory), NULL); g_return_val_if_fail(iter != NULL, NULL); infd_directory_return_val_if_iter_fail(directory, iter, NULL); priv = INFD_DIRECTORY_PRIVATE(directory); node = (InfdDirectoryNode*)iter->node; return node->name; } /** * infd_directory_iter_get_path: * @directory: A #InfdDirectory. * @iter: A #InfdDirectoryIter pointing to a node in @directory. * * Returns the complete path to the node @iter points to. The path to a node * is the name of the node and the name of all parent nodes separated by '/', * as a filesystem path on Unix. * * Returns: The node's path. Free with g_free() when no longer in use. */ gchar* infd_directory_iter_get_path(InfdDirectory* directory, InfdDirectoryIter* iter) { InfdDirectoryPrivate* priv; InfdDirectoryNode* node; gchar* path; g_return_val_if_fail(INFD_IS_DIRECTORY(directory), NULL); g_return_val_if_fail(iter != NULL, NULL); infd_directory_return_val_if_iter_fail(directory, iter, NULL); priv = INFD_DIRECTORY_PRIVATE(directory); node = (InfdDirectoryNode*)iter->node; infd_directory_node_get_path(node, &path, NULL); return path; } /** * infd_directory_iter_get_root: * @directory: A #InfdDirectory * @iter: An uninitalized #InfdDirectoryIter. * * Sets @iter to point to the root node of the directory. **/ void infd_directory_iter_get_root(InfdDirectory* directory, InfdDirectoryIter* iter) { InfdDirectoryPrivate* priv; g_return_if_fail(INFD_IS_DIRECTORY(directory)); g_return_if_fail(iter != NULL); priv = INFD_DIRECTORY_PRIVATE(directory); g_assert(priv->root != NULL); iter->node_id = priv->root->id; iter->node = priv->root; } /** * infd_directory_iter_get_next: * @directory: A #InfdDirectory. * @iter: A #InfdDirectoryIter pointing to some node in @directory. * * Sets @iter to point to the next node within the same subdirectory. If there * is no next node, @iter is left untouched and the function returns %FALSE. * * Return Value: %TRUE, if @iter was set. **/ gboolean infd_directory_iter_get_next(InfdDirectory* directory, InfdDirectoryIter* iter) { InfdDirectoryPrivate* priv; InfdDirectoryNode* node; g_return_val_if_fail(INFD_IS_DIRECTORY(directory), FALSE); g_return_val_if_fail(iter != NULL, FALSE); infd_directory_return_val_if_iter_fail(directory, iter, FALSE); priv = INFD_DIRECTORY_PRIVATE(directory); node = (InfdDirectoryNode*)iter->node; if(node->next != NULL) { iter->node_id = node->next->id; iter->node = node->next; return TRUE; } else { return FALSE; } } /** * infd_directory_iter_get_prev: * @directory: A #InfdDirectory. * @iter: A #InfdDirectoryIter pointing to some node in @directory. * * Sets @iter to point to the previous node within the same subdirectory. If * there is no such node, @iter is left untouched and the function returns * %FALSE. * * Return Value: %TRUE, if @iter was set. **/ gboolean infd_directory_iter_get_prev(InfdDirectory* directory, InfdDirectoryIter* iter) { InfdDirectoryPrivate* priv; InfdDirectoryNode* node; g_return_val_if_fail(INFD_IS_DIRECTORY(directory), FALSE); g_return_val_if_fail(iter != NULL, FALSE); infd_directory_return_val_if_iter_fail(directory, iter, FALSE); priv = INFD_DIRECTORY_PRIVATE(directory); node = (InfdDirectoryNode*)iter->node; if(node->prev != NULL) { iter->node_id = node->prev->id; iter->node = node->prev; return TRUE; } else { return FALSE; } } /** * infd_directory_iter_get_parent: * @directory: A #InfdDirectory. * @iter: A #InfdDirectoryIter pointing to some node in @directory. * * Sets @iter to point to the parent node of @iter. This node is guaranteed * to be a subdirectory node. If there is no such node (i.e. @iter points * to the root node), @iter is left untouched and the function returns %FALSE. * * Return Value: %TRUE, if @iter was set. **/ gboolean infd_directory_iter_get_parent(InfdDirectory* directory, InfdDirectoryIter* iter) { InfdDirectoryPrivate* priv; InfdDirectoryNode* node; g_return_val_if_fail(INFD_IS_DIRECTORY(directory), FALSE); g_return_val_if_fail(iter != NULL, FALSE); infd_directory_return_val_if_iter_fail(directory, iter, FALSE); priv = INFD_DIRECTORY_PRIVATE(directory); node = (InfdDirectoryNode*)iter->node; if(node->parent != NULL) { iter->node_id = node->parent->id; iter->node = node->parent; return TRUE; } else { return FALSE; } } /** * infd_directory_iter_get_child: * @directory: A #InfdDirectory. * @iter: A #InfdDirectoryIter pointing to a subdirectory node in @directory. * @error: Location to store error information. * * Sets @iter to point to first child node of @iter. This requires that @iter * points to a subdirectory node. If the subdirectory @iter points to has * no children, the function returns %FALSE and @iter is left untouched. * * The function might fail if this node's children have not yet been read * from the background storage and an error occurs while reading them. In * this case, %FALSE is returned and @error is set. * * The function guarantees not to set @error if the node is already explored, * i.e. infd_directory_iter_get_explored() returns %TRUE for @directory and * @iter. * * Return Value: %TRUE, if @iter was set. **/ gboolean infd_directory_iter_get_child(InfdDirectory* directory, InfdDirectoryIter* iter, GError** error) { InfdDirectoryPrivate* priv; InfdDirectoryNode* node; g_return_val_if_fail(INFD_IS_DIRECTORY(directory), FALSE); g_return_val_if_fail(iter != NULL, FALSE); infd_directory_return_val_if_iter_fail(directory, iter, FALSE); infd_directory_return_val_if_subdir_fail(iter->node, FALSE); priv = INFD_DIRECTORY_PRIVATE(directory); node = (InfdDirectoryNode*)iter->node; if(node->shared.subdir.explored == FALSE) { if(infd_directory_node_explore(directory, node, error) == FALSE) return FALSE; g_assert(node->shared.subdir.explored == TRUE); } if(node->shared.subdir.child != NULL) { iter->node_id = node->shared.subdir.child->id; iter->node = node->shared.subdir.child; return TRUE; } else { return FALSE; } } /** * infd_directory_iter_get_explored: * @directory: A #InfdDirectory. * @iter: A #InfdDirectoryIter pointing to a subdirectory node in @directory. * * Returns whether the subdirectory node pointed to by @iter has already * been read from the background storage. If not, then no connections can * be subscribed to any child nodes. * * Returns: Whether the node @iter points to has been explored. */ gboolean infd_directory_iter_get_explored(InfdDirectory* directory, InfdDirectoryIter* iter) { InfdDirectoryPrivate* priv; InfdDirectoryNode* node; g_return_val_if_fail(INFD_IS_DIRECTORY(directory), FALSE); g_return_val_if_fail(iter != NULL, FALSE); infd_directory_return_val_if_iter_fail(directory, iter, FALSE); infd_directory_return_val_if_subdir_fail(iter->node, FALSE); priv = INFD_DIRECTORY_PRIVATE(directory); node = (InfdDirectoryNode*)iter->node; return node->shared.subdir.explored; } /** * infd_directory_add_subdirectory: * @directory: A #InfdDirectory. * @parent: A #InfdDirectoryIter pointing to a subdirectory node * in @directory. * @name: The name of the new node. * @iter: An uninitalized #InfdDirectoryIter. * @error: Location to store error information. * * Adds a subdirectory to the directory tree. The new subdirectory will be * a child the subdirectory @parent points to. @iter is modified to point to * the new subdirectory. If creation fails, the function returns FALSE and * @error is set. * * Return Value: %TRUE if the subdirectory was created successfully. **/ gboolean infd_directory_add_subdirectory(InfdDirectory* directory, InfdDirectoryIter* parent, const gchar* name, InfdDirectoryIter* iter, GError** error) { InfdDirectoryPrivate* priv; InfdDirectoryNode* node; g_return_val_if_fail(INFD_IS_DIRECTORY(directory), FALSE); g_return_val_if_fail(parent != NULL, FALSE); g_return_val_if_fail(name != NULL, FALSE); infd_directory_return_val_if_iter_fail(directory, parent, FALSE); infd_directory_return_val_if_subdir_fail(parent->node, FALSE); priv = INFD_DIRECTORY_PRIVATE(directory); if( ((InfdDirectoryNode*)parent->node)->shared.subdir.explored == FALSE) if(infd_directory_node_explore(directory, parent->node, error) == FALSE) return FALSE; node = infd_directory_node_add_subdirectory( directory, parent->node, name, NULL, NULL, error ); if(node == NULL) return FALSE; if(iter != NULL) { iter->node_id = node->id; iter->node = node; } return TRUE; } /** * infd_directory_add_note: * @directory: A #InfdDirectory. * @parent: A #InfdDirectoryIter pointing to a subdirectory node * in @directory. * @name: The name of the new node. * @plugin: The plugin to use for the node. Must have been added with * infd_directory_add_plugin(). * @iter: An uninitialized #InfdDirectoryIter. * @error: Location to store error information. * * Creates a new note in @directory. It will be child of the subdirectory * node @parent points to. @iter is set to point to the new node. If an * error occurs, the function returns %FALSE and @error is set. * * Return Value: %TRUE on success. **/ gboolean infd_directory_add_note(InfdDirectory* directory, InfdDirectoryIter* parent, const gchar* name, const InfdNotePlugin* plugin, InfdDirectoryIter* iter, GError** error) { InfdDirectoryPrivate* priv; guint node_id; InfCommunicationHostedGroup* group; InfdDirectoryNode* node; g_return_val_if_fail(INFD_IS_DIRECTORY(directory), FALSE); g_return_val_if_fail(parent != NULL, FALSE); g_return_val_if_fail(name != NULL, FALSE); g_return_val_if_fail(plugin != NULL, FALSE); infd_directory_return_val_if_iter_fail(directory, parent, FALSE); infd_directory_return_val_if_subdir_fail(parent->node, FALSE); priv = INFD_DIRECTORY_PRIVATE(directory); if( ((InfdDirectoryNode*)parent->node)->shared.subdir.explored == FALSE) if(infd_directory_node_explore(directory, parent->node, error) == FALSE) return FALSE; node_id = priv->node_counter++; group = infd_directory_create_subscription_group(directory, node_id); node = infd_directory_node_create_new_note( directory, parent->node, group, node_id, name, plugin, error ); g_object_unref(group); if(node == NULL) return FALSE; infd_directory_node_register(directory, node, NULL, NULL); if(iter != NULL) { iter->node = node; iter->node_id = node->id; } return TRUE; } /** * infd_directory_remove_node: * @directory: A #InfdDirectory * @iter: A #InfdDirectoryIter pointing to some node in @directory. * @error: Location to store error information. * * Removes the node @iter points to. If it is a subdirectory node, every * node it contains will also be removed. If the function fails, %FALSE is * returned and @error is set. * * Return Value: %TRUE on success. **/ gboolean infd_directory_remove_node(InfdDirectory* directory, InfdDirectoryIter* iter, GError** error) { InfdDirectoryNode* node; g_return_val_if_fail(INFD_IS_DIRECTORY(directory), FALSE); g_return_val_if_fail(iter != NULL, FALSE); infd_directory_return_val_if_iter_fail(directory, iter, FALSE); node = iter->node; g_return_val_if_fail(node->parent != NULL, FALSE); return infd_directory_node_remove(directory, node, NULL, error); } /** * infd_directory_iter_get_node_type: * @directory: A #InfdDirectory. * @iter: A #InfdDirectoryIter pointing to some node in @directory. * * Returns the type of the node @iter points to. * * Returns: A #InfdStorageNodeType. **/ InfdStorageNodeType infd_directory_iter_get_node_type(InfdDirectory* directory, InfdDirectoryIter* iter) { g_return_val_if_fail(INFD_IS_DIRECTORY(directory), INFD_STORAGE_NODE_NOTE); infd_directory_return_val_if_iter_fail( directory, iter, INFD_STORAGE_NODE_NOTE ); return ((InfdDirectoryNode*)iter->node)->type; } /** * infd_directory_iter_get_plugin: * @directory: A #InfdDirectory. * @iter: a #InfdDirectoryIter pointing to a note in @directory. * * Returns the plugin that is used to create a session for the note @iter * points to. * * Return Value: The plugin for the note @iter points to. **/ const InfdNotePlugin* infd_directory_iter_get_plugin(InfdDirectory* directory, InfdDirectoryIter* iter) { InfdDirectoryNode* node; g_return_val_if_fail(INFD_IS_DIRECTORY(directory), NULL); infd_directory_return_val_if_iter_fail(directory, iter, NULL); node = (InfdDirectoryNode*)iter->node; g_return_val_if_fail(node->type != INFD_STORAGE_NODE_NOTE, NULL); return node->shared.note.plugin; } /** * infd_directory_iter_get_session: * @directory: A #InfdDirectory. * @iter: A #InfdDirectoryIter pointing to a note in @directory. * @error: Location to store error information. * * Returns the running session in which the note @iter points to is currently * edited. If the session does not exist, it is created. However, this might * fail if the loading from the background storage fails. In this case, %NULL * is returned and @error is set. * * Return Value: A #InfdSessionProxy for the note @iter points to. **/ InfdSessionProxy* infd_directory_iter_get_session(InfdDirectory* directory, InfdDirectoryIter* iter, GError** error) { InfdDirectoryNode* node; g_return_val_if_fail(INFD_IS_DIRECTORY(directory), NULL); infd_directory_return_val_if_iter_fail(directory, iter, NULL); node = (InfdDirectoryNode*)iter->node; g_return_val_if_fail(node->type == INFD_STORAGE_NODE_NOTE, NULL); return infd_directory_node_get_and_link_session(directory, node, error); } /** * infd_directory_iter_peek_session: * @directory: A #InfdDirectory. * @iter: A #InfdDirectoryIter pointing to a note in @directory. * * Returns the running session in which the note @iter points to is currently * edited. If the session does not exist because nobody is editing it at the * moment, the function returns %NULL. * * Return Value: A #InfdSessionProxy for the note @iter points to, or %NULL. */ InfdSessionProxy* infd_directory_iter_peek_session(InfdDirectory* directory, InfdDirectoryIter* iter) { InfdDirectoryNode* node; g_return_val_if_fail(INFD_IS_DIRECTORY(directory), NULL); infd_directory_return_val_if_iter_fail(directory, iter, NULL); node = (InfdDirectoryNode*)iter->node; g_return_val_if_fail(node->type == INFD_STORAGE_NODE_NOTE, NULL); return node->shared.note.session; } /** * infd_directory_iter_save_session: * @directory: A #InfdDirectory. * @iter: A #InfdDirectoryIter pointing to a note in @directory. * @error: Location to store error information. * * Attempts to store the session the node @iter points to represents into the * background storage. * * Return Value: %TRUE if the operation succeeded, %FALSE otherwise. */ gboolean infd_directory_iter_save_session(InfdDirectory* directory, InfdDirectoryIter* iter, GError** error) { InfdDirectoryPrivate* priv; InfdDirectoryNode* node; gchar* path; gboolean result; g_return_val_if_fail(INFD_IS_DIRECTORY(directory), FALSE); infd_directory_return_val_if_iter_fail(directory, iter, FALSE); priv = INFD_DIRECTORY_PRIVATE(directory); node = (InfdDirectoryNode*)iter->node; g_return_val_if_fail(node->type == INFD_STORAGE_NODE_NOTE, FALSE); if(priv->storage == NULL) { g_set_error( error, inf_directory_error_quark(), INF_DIRECTORY_ERROR_NO_STORAGE, "%s", _("No background storage available") ); return FALSE; } infd_directory_node_get_path(node, &path, NULL); result = node->shared.note.plugin->session_write( priv->storage, infd_session_proxy_get_session(node->shared.note.session), path, node->shared.note.plugin->user_data, error ); /* TODO: Unset modified flag of buffer if result == TRUE */ g_free(path); return result; } /** * infd_directory_enable_chat: * @directory: A #InfdDirectory. * @enable: Whether to enable or disable the chat. * * If @enable is %TRUE, this enables the chat on the server. This allows * clients subscribing to the chat via infc_browser_subscribe_chat(). If * @enable is %FALSE the chat is disabled which means closing an existing * chat session if any and no longer allowing subscription to the chat. * The chat is initially disabled. */ void infd_directory_enable_chat(InfdDirectory* directory, gboolean enable) { InfdDirectoryPrivate* priv; InfCommunicationHostedGroup* group; InfChatSession* session; /* TODO: For the moment, there only exist central methods anyway. In the * long term, this should probably be a property, though. */ static const gchar* const methods[] = { "central", NULL }; g_return_if_fail(INFD_IS_DIRECTORY(directory)); priv = INFD_DIRECTORY_PRIVATE(directory); if(enable) { if(priv->chat_session == NULL) { group = inf_communication_manager_open_group( priv->communication_manager, "InfChat", methods ); session = inf_chat_session_new( priv->communication_manager, 256, INF_SESSION_RUNNING, NULL, NULL ); priv->chat_session = INFD_SESSION_PROXY( g_object_new( INFD_TYPE_SESSION_PROXY, "session", session, "subscription-group", group, NULL ) ); inf_communication_group_set_target( INF_COMMUNICATION_GROUP(group), INF_COMMUNICATION_OBJECT(priv->chat_session) ); g_object_unref(session); g_object_unref(group); g_object_notify(G_OBJECT(directory), "chat-session"); } } else { if(priv->chat_session != NULL) { inf_session_close(infd_session_proxy_get_session(priv->chat_session)); g_object_unref(priv->chat_session); priv->chat_session = NULL; g_object_notify(G_OBJECT(directory), "chat-session"); } } } /** * infd_directory_get_chat_session: * @directory: A #InfdDirectory. * * Returns a #InfdSessionProxy for the chat session, if any. If the chat is * enabled (see infd_directory_enable_chat()) this returns a #InfdSessionProxy * that can be used to join local users to the chat, or to get chat contents * (by getting the #InfChatBuffer from the proxy's #InfChatSession). If the * chat is disabled the function returns %NULL. * * Returns: A #InfdSessionProxy, or %NULL if the chat is disabled. */ InfdSessionProxy* infd_directory_get_chat_session(InfdDirectory* directory) { g_return_val_if_fail(INFD_IS_DIRECTORY(directory), NULL); return INFD_DIRECTORY_PRIVATE(directory)->chat_session; } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/server/infd-tcp-server.h0000644000175000017500000000521612264763732020011 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INFD_TCP_SERVER_H__ #define __INFD_TCP_SERVER_H__ #include #include G_BEGIN_DECLS #define INFD_TYPE_TCP_SERVER (infd_tcp_server_get_type()) #define INFD_TCP_SERVER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INFD_TYPE_TCP_SERVER, InfdTcpServer)) #define INFD_TCP_SERVER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INFD_TYPE_TCP_SERVER, InfdTcpServerClass)) #define INFD_IS_TCP_SERVER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INFD_TYPE_TCP_SERVER)) #define INFD_IS_TCP_SERVER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INFD_TYPE_TCP_SERVER)) #define INFD_TCP_SERVER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), INFD_TYPE_TCP_SERVER, InfdTcpServerClass)) #define INFD_TYPE_TCP_SERVER_STATUS (infd_tcp_server_status_get_type()) typedef struct _InfdTcpServer InfdTcpServer; typedef struct _InfdTcpServerClass InfdTcpServerClass; typedef enum _InfdTcpServerStatus { INFD_TCP_SERVER_CLOSED, INFD_TCP_SERVER_BOUND, INFD_TCP_SERVER_OPEN } InfdTcpServerStatus; struct _InfdTcpServerClass { GObjectClass parent_class; /* Signals */ void (*new_connection)(InfdTcpServer* server, InfTcpConnection* connection); void (*error)(InfdTcpServer* server, GError* error); }; struct _InfdTcpServer { GObject parent; }; GType infd_tcp_server_status_get_type(void) G_GNUC_CONST; GType infd_tcp_server_get_type(void) G_GNUC_CONST; gboolean infd_tcp_server_bind(InfdTcpServer* server, GError** error); gboolean infd_tcp_server_open(InfdTcpServer* server, GError** error); void infd_tcp_server_close(InfdTcpServer* server); G_END_DECLS #endif /* __INFD_TCP_SERVER_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/server/Makefile.in0000644000175000017500000010113212264766066016672 00000000000000# Makefile.in generated by automake 1.13.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = libinfinity/server DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/mkinstalldirs $(top_srcdir)/depcomp \ $(libinfinity_server_la_HEADERS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/libinfinity/inf-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libinfinity_server_la_LIBADD = am_libinfinity_server_la_OBJECTS = \ libinfinity_server_la-infd-directory.lo \ libinfinity_server_la-infd-filesystem-storage.lo \ libinfinity_server_la-infd-server-pool.lo \ libinfinity_server_la-infd-session-proxy.lo \ libinfinity_server_la-infd-storage.lo \ libinfinity_server_la-infd-tcp-server.lo \ libinfinity_server_la-infd-xml-server.lo \ libinfinity_server_la-infd-xmpp-server.lo libinfinity_server_la_OBJECTS = $(am_libinfinity_server_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -I$(top_builddir)/libinfinity 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) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libinfinity_server_la_SOURCES) DIST_SOURCES = $(libinfinity_server_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libinfinity_server_ladir)" HEADERS = $(libinfinity_server_la_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBINFINITY_API_VERSION = @LIBINFINITY_API_VERSION@ LIBINFINITY_LIBTOOL_VERSION = @LIBINFINITY_LIBTOOL_VERSION@ LIBINFINITY_VERSION = @LIBINFINITY_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ avahi_CFLAGS = @avahi_CFLAGS@ avahi_LIBS = @avahi_LIBS@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gtk_requirement = @gtk_requirement@ gtk_version = @gtk_version@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infgtk_CFLAGS = @infgtk_CFLAGS@ infgtk_LIBS = @infgtk_LIBS@ infinity_CFLAGS = @infinity_CFLAGS@ infinity_LIBS = @infinity_LIBS@ infinoted_CFLAGS = @infinoted_CFLAGS@ infinoted_LIBS = @infinoted_LIBS@ infodir = @infodir@ inftext_CFLAGS = @inftext_CFLAGS@ inftext_LIBS = @inftext_LIBS@ inftextgtk_CFLAGS = @inftextgtk_CFLAGS@ inftextgtk_LIBS = @inftextgtk_LIBS@ install_sh = @install_sh@ libdaemon_CFLAGS = @libdaemon_CFLAGS@ libdaemon_LIBS = @libdaemon_LIBS@ 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@ noinst_LTLIBRARIES = libinfinity_server.la libinfinity_server_la_CPPFLAGS = \ -I$(top_srcdir) \ $(infinity_CFLAGS) libinfinity_server_ladir = \ $(includedir)/libinfinity-$(LIBINFINITY_API_VERSION)/libinfinity/server libinfinity_server_la_SOURCES = \ infd-directory.c \ infd-filesystem-storage.c \ infd-server-pool.c \ infd-session-proxy.c \ infd-storage.c \ infd-tcp-server.c \ infd-xml-server.c \ infd-xmpp-server.c libinfinity_server_la_HEADERS = \ infd-directory.h \ infd-filesystem-storage.h \ infd-note-plugin.h \ infd-server-pool.h \ infd-session-proxy.h \ infd-storage.h \ infd-tcp-server.h \ infd-xml-server.h \ infd-xmpp-server.h all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libinfinity/server/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu libinfinity/server/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libinfinity_server.la: $(libinfinity_server_la_OBJECTS) $(libinfinity_server_la_DEPENDENCIES) $(EXTRA_libinfinity_server_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libinfinity_server_la_OBJECTS) $(libinfinity_server_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_server_la-infd-directory.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_server_la-infd-filesystem-storage.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_server_la-infd-server-pool.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_server_la-infd-session-proxy.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_server_la-infd-storage.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_server_la-infd-tcp-server.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_server_la-infd-xml-server.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinfinity_server_la-infd-xmpp-server.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< libinfinity_server_la-infd-directory.lo: infd-directory.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_server_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_server_la-infd-directory.lo -MD -MP -MF $(DEPDIR)/libinfinity_server_la-infd-directory.Tpo -c -o libinfinity_server_la-infd-directory.lo `test -f 'infd-directory.c' || echo '$(srcdir)/'`infd-directory.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_server_la-infd-directory.Tpo $(DEPDIR)/libinfinity_server_la-infd-directory.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='infd-directory.c' object='libinfinity_server_la-infd-directory.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_server_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_server_la-infd-directory.lo `test -f 'infd-directory.c' || echo '$(srcdir)/'`infd-directory.c libinfinity_server_la-infd-filesystem-storage.lo: infd-filesystem-storage.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_server_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_server_la-infd-filesystem-storage.lo -MD -MP -MF $(DEPDIR)/libinfinity_server_la-infd-filesystem-storage.Tpo -c -o libinfinity_server_la-infd-filesystem-storage.lo `test -f 'infd-filesystem-storage.c' || echo '$(srcdir)/'`infd-filesystem-storage.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_server_la-infd-filesystem-storage.Tpo $(DEPDIR)/libinfinity_server_la-infd-filesystem-storage.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='infd-filesystem-storage.c' object='libinfinity_server_la-infd-filesystem-storage.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_server_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_server_la-infd-filesystem-storage.lo `test -f 'infd-filesystem-storage.c' || echo '$(srcdir)/'`infd-filesystem-storage.c libinfinity_server_la-infd-server-pool.lo: infd-server-pool.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_server_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_server_la-infd-server-pool.lo -MD -MP -MF $(DEPDIR)/libinfinity_server_la-infd-server-pool.Tpo -c -o libinfinity_server_la-infd-server-pool.lo `test -f 'infd-server-pool.c' || echo '$(srcdir)/'`infd-server-pool.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_server_la-infd-server-pool.Tpo $(DEPDIR)/libinfinity_server_la-infd-server-pool.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='infd-server-pool.c' object='libinfinity_server_la-infd-server-pool.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_server_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_server_la-infd-server-pool.lo `test -f 'infd-server-pool.c' || echo '$(srcdir)/'`infd-server-pool.c libinfinity_server_la-infd-session-proxy.lo: infd-session-proxy.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_server_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_server_la-infd-session-proxy.lo -MD -MP -MF $(DEPDIR)/libinfinity_server_la-infd-session-proxy.Tpo -c -o libinfinity_server_la-infd-session-proxy.lo `test -f 'infd-session-proxy.c' || echo '$(srcdir)/'`infd-session-proxy.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_server_la-infd-session-proxy.Tpo $(DEPDIR)/libinfinity_server_la-infd-session-proxy.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='infd-session-proxy.c' object='libinfinity_server_la-infd-session-proxy.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_server_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_server_la-infd-session-proxy.lo `test -f 'infd-session-proxy.c' || echo '$(srcdir)/'`infd-session-proxy.c libinfinity_server_la-infd-storage.lo: infd-storage.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_server_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_server_la-infd-storage.lo -MD -MP -MF $(DEPDIR)/libinfinity_server_la-infd-storage.Tpo -c -o libinfinity_server_la-infd-storage.lo `test -f 'infd-storage.c' || echo '$(srcdir)/'`infd-storage.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_server_la-infd-storage.Tpo $(DEPDIR)/libinfinity_server_la-infd-storage.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='infd-storage.c' object='libinfinity_server_la-infd-storage.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_server_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_server_la-infd-storage.lo `test -f 'infd-storage.c' || echo '$(srcdir)/'`infd-storage.c libinfinity_server_la-infd-tcp-server.lo: infd-tcp-server.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_server_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_server_la-infd-tcp-server.lo -MD -MP -MF $(DEPDIR)/libinfinity_server_la-infd-tcp-server.Tpo -c -o libinfinity_server_la-infd-tcp-server.lo `test -f 'infd-tcp-server.c' || echo '$(srcdir)/'`infd-tcp-server.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_server_la-infd-tcp-server.Tpo $(DEPDIR)/libinfinity_server_la-infd-tcp-server.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='infd-tcp-server.c' object='libinfinity_server_la-infd-tcp-server.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_server_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_server_la-infd-tcp-server.lo `test -f 'infd-tcp-server.c' || echo '$(srcdir)/'`infd-tcp-server.c libinfinity_server_la-infd-xml-server.lo: infd-xml-server.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_server_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_server_la-infd-xml-server.lo -MD -MP -MF $(DEPDIR)/libinfinity_server_la-infd-xml-server.Tpo -c -o libinfinity_server_la-infd-xml-server.lo `test -f 'infd-xml-server.c' || echo '$(srcdir)/'`infd-xml-server.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_server_la-infd-xml-server.Tpo $(DEPDIR)/libinfinity_server_la-infd-xml-server.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='infd-xml-server.c' object='libinfinity_server_la-infd-xml-server.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_server_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_server_la-infd-xml-server.lo `test -f 'infd-xml-server.c' || echo '$(srcdir)/'`infd-xml-server.c libinfinity_server_la-infd-xmpp-server.lo: infd-xmpp-server.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_server_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinfinity_server_la-infd-xmpp-server.lo -MD -MP -MF $(DEPDIR)/libinfinity_server_la-infd-xmpp-server.Tpo -c -o libinfinity_server_la-infd-xmpp-server.lo `test -f 'infd-xmpp-server.c' || echo '$(srcdir)/'`infd-xmpp-server.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinfinity_server_la-infd-xmpp-server.Tpo $(DEPDIR)/libinfinity_server_la-infd-xmpp-server.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='infd-xmpp-server.c' object='libinfinity_server_la-infd-xmpp-server.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinfinity_server_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinfinity_server_la-infd-xmpp-server.lo `test -f 'infd-xmpp-server.c' || echo '$(srcdir)/'`infd-xmpp-server.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-libinfinity_server_laHEADERS: $(libinfinity_server_la_HEADERS) @$(NORMAL_INSTALL) @list='$(libinfinity_server_la_HEADERS)'; test -n "$(libinfinity_server_ladir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(libinfinity_server_ladir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libinfinity_server_ladir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libinfinity_server_ladir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(libinfinity_server_ladir)" || exit $$?; \ done uninstall-libinfinity_server_laHEADERS: @$(NORMAL_UNINSTALL) @list='$(libinfinity_server_la_HEADERS)'; test -n "$(libinfinity_server_ladir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(libinfinity_server_ladir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libinfinity_server_ladir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-libinfinity_server_laHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libinfinity_server_laHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-libinfinity_server_laHEADERS \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-libinfinity_server_laHEADERS # 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: libinfinity-0.5.5/libinfinity/server/infd-filesystem-storage.h0000644000175000017500000000552412264763732021547 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INFD_FILESYSTEM_STORAGE_H__ #define __INFD_FILESYSTEM_STORAGE_H__ #include #include G_BEGIN_DECLS #define INFD_TYPE_FILESYSTEM_STORAGE (infd_filesystem_storage_get_type()) #define INFD_FILESYSTEM_STORAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INFD_TYPE_FILESYSTEM_STORAGE, InfdFilesystemStorage)) #define INFD_FILESYSTEM_STORAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INFD_TYPE_FILESYSTEM_STORAGE, InfdFilesystemStorageClass)) #define INFD_IS_FILESYSTEM_STORAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INFD_TYPE_FILESYSTEM_STORAGE)) #define INFD_IS_FILESYSTEM_STORAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INFD_TYPE_FILESYSTEM_STORAGE)) #define INFD_FILESYSTEM_STORAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), INFD_TYPE_FILESYSTEM_STORAGE, InfdFilesystemStorageClass)) #define INFD_TYPE_FILESYSTEM_STORAGE_ITER (infd_filesystem_storage_iter_get_type()) typedef struct _InfdFilesystemStorage InfdFilesystemStorage; typedef struct _InfdFilesystemStorageClass InfdFilesystemStorageClass; typedef enum _InfdFilesystemStorageError { /* The path contains invalid characters */ INFD_FILESYSTEM_STORAGE_ERROR_INVALID_PATH, /* Failed to remove files from disk */ INFD_FILESYSTEM_STORAGE_ERROR_REMOVE_FILES, INFD_FILESYSTEM_STORAGE_ERROR_FAILED } InfdFilesystemStorageError; struct _InfdFilesystemStorageClass { GObjectClass parent_class; }; struct _InfdFilesystemStorage { GObject parent; }; GType infd_filesystem_storage_get_type(void) G_GNUC_CONST; InfdFilesystemStorage* infd_filesystem_storage_new(const gchar* root_directory); FILE* infd_filesystem_storage_open(InfdFilesystemStorage* storage, const gchar* identifier, const gchar* path, const gchar* mode, GError** error); G_END_DECLS #endif /* __INFD_FILESYSTEM_STORAGE_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/server/infd-session-proxy.c0000644000175000017500000013012112264763732020546 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include #include #include #include #include typedef struct _InfdSessionProxySubscription InfdSessionProxySubscription; struct _InfdSessionProxySubscription { InfXmlConnection* connection; guint seq_id; GSList* users; /* Available users joined via this connection */ }; typedef struct _InfdSessionProxyPrivate InfdSessionProxyPrivate; struct _InfdSessionProxyPrivate { InfSession* session; InfCommunicationHostedGroup* subscription_group; GSList* subscriptions; guint user_id_counter; /* Local users that do not belong to a particular connection */ GSList* local_users; /* Whether there are any subscriptions / synchronizations */ gboolean idle; }; enum { PROP_0, /* construct/only */ PROP_SESSION, PROP_SUBSCRIPTION_GROUP, /* read/only */ PROP_IDLE }; enum { ADD_SUBSCRIPTION, REMOVE_SUBSCRIPTION, LAST_SIGNAL }; #define INFD_SESSION_PROXY_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), INFD_TYPE_SESSION_PROXY, InfdSessionProxyPrivate)) static GObjectClass* parent_class; static guint session_proxy_signals[LAST_SIGNAL]; /* * SessionProxy subscriptions. */ static InfdSessionProxySubscription* infd_session_proxy_subscription_new(InfXmlConnection* connection, guint seq_id) { InfdSessionProxySubscription* subscription; subscription = g_slice_new(InfdSessionProxySubscription); subscription->connection = connection; subscription->seq_id = seq_id; subscription->users = NULL; g_object_ref(G_OBJECT(connection)); return subscription; } static void infd_session_proxy_subscription_free(InfdSessionProxySubscription* subscr) { g_object_unref(G_OBJECT(subscr->connection)); g_slist_free(subscr->users); g_slice_free(InfdSessionProxySubscription, subscr); } static GSList* infd_session_proxy_find_subscription_item(InfdSessionProxy* proxy, InfXmlConnection* connection) { InfdSessionProxyPrivate* priv; GSList* item; priv = INFD_SESSION_PROXY_PRIVATE(proxy); for(item = priv->subscriptions; item != NULL; item = g_slist_next(item)) if( ((InfdSessionProxySubscription*)item->data)->connection == connection) return item; return NULL; } static InfdSessionProxySubscription* infd_session_proxy_find_subscription(InfdSessionProxy* proxy, InfXmlConnection* connection) { GSList* item; item = infd_session_proxy_find_subscription_item(proxy, connection); if(item == NULL) return NULL; return (InfdSessionProxySubscription*)item->data; } static void infd_session_proxy_user_notify_status_cb(InfUser* user, const GParamSpec* pspec, gpointer user_data) { InfdSessionProxy* proxy; InfdSessionProxyPrivate* priv; InfdSessionProxySubscription* subscr; if(inf_user_get_status(user) == INF_USER_UNAVAILABLE) { proxy = INFD_SESSION_PROXY(user_data); priv = INFD_SESSION_PROXY_PRIVATE(proxy); if(inf_user_get_connection(user)) { subscr = infd_session_proxy_find_subscription( proxy, inf_user_get_connection(user) ); g_assert(subscr != NULL); subscr->users = g_slist_remove(subscr->users, user); g_object_set(G_OBJECT(user), "connection", NULL, NULL); } else { priv->local_users = g_slist_remove(priv->local_users, user); } inf_signal_handlers_disconnect_by_func( G_OBJECT(user), G_CALLBACK(infd_session_proxy_user_notify_status_cb), proxy ); } } /* * Utility functions. */ static gboolean infd_session_proxy_make_seq(InfdSessionProxy* proxy, InfXmlConnection* connection, xmlNodePtr xml, gchar** seq, GError** error) { InfdSessionProxyPrivate* priv; InfdSessionProxySubscription* subscription; GError* local_error; guint seq_num; priv = INFD_SESSION_PROXY_PRIVATE(proxy); local_error = NULL; if(!inf_xml_util_get_attribute_uint(xml, "seq", &seq_num, &local_error)) { if(local_error) { g_propagate_error(error, local_error); return FALSE; } *seq = NULL; return TRUE; } subscription = infd_session_proxy_find_subscription(proxy, connection); g_assert(subscription != NULL); *seq = g_strdup_printf("%u/%u", subscription->seq_id, seq_num); return TRUE; } /* Performs a user join on the given proxy. If connection is not null, the * user join is made from that connection, otherwise a local user join is * performed. seq is the seq of the user join request and used in * the reply, or NULL if there was no seq. */ static InfUser* infd_session_proxy_perform_user_join(InfdSessionProxy* proxy, InfXmlConnection* connection, const gchar* seq, GArray* user_props, GError** error) { InfSessionClass* session_class; InfdSessionProxyPrivate* priv; InfdSessionProxySubscription* subscription; InfUser* user; const GParameter* name_param; GParameter* param; gboolean result; xmlNodePtr xml; guint i; priv = INFD_SESSION_PROXY_PRIVATE(proxy); session_class = INF_SESSION_GET_CLASS(priv->session); g_assert(session_class->validate_user_props != NULL); g_assert(session_class->user_new != NULL); name_param = inf_session_lookup_user_property( (const GParameter*)user_props->data, user_props->len, "name" ); if(name_param == NULL) { g_set_error( error, inf_request_error_quark(), INF_REQUEST_ERROR_NO_SUCH_ATTRIBUTE, "%s", _("Request does not contain required attribute 'name'") ); return NULL; } /* TODO: Isn't this already done in validate_user_props? */ user = inf_user_table_lookup_user_by_name( inf_session_get_user_table(priv->session), g_value_get_string(&name_param->value) ); if(user != NULL && inf_user_get_status(user) != INF_USER_UNAVAILABLE) { g_set_error( error, inf_user_error_quark(), INF_USER_ERROR_NAME_IN_USE, _("Name '%s' already in use"), g_value_get_string(&name_param->value) ); return NULL; } /* User join requests must not have the id value set because the server * chooses an ID, or reuses an existing one in the case of a rejoin. */ param = inf_session_get_user_property(user_props, "id"); if(G_IS_VALUE(¶m->value)) { g_set_error( error, inf_user_error_quark(), INF_USER_ERROR_ID_PROVIDED, "%s", inf_user_strerror(INF_USER_ERROR_ID_PROVIDED) ); return NULL; } /* The user ID counter is increased in the add-user default signal * handler. */ g_value_init(¶m->value, G_TYPE_UINT); /* Reuse user ID on rejoin. */ if(user != NULL) g_value_set_uint(¶m->value, inf_user_get_id(user)); else g_value_set_uint(¶m->value, priv->user_id_counter); /* Check user status. It must not be unavailable on join/rejoin */ param = inf_session_get_user_property(user_props, "status"); if(G_IS_VALUE(¶m->value)) { if(g_value_get_enum(¶m->value) == INF_USER_UNAVAILABLE) { g_set_error( error, inf_user_error_quark(), INF_USER_ERROR_STATUS_UNAVAILABLE, "%s", _("'status' attribute is 'unavailable' in user join request") ); return NULL; } } else { g_value_init(¶m->value, INF_TYPE_USER_STATUS); g_value_set_enum(¶m->value, INF_USER_ACTIVE); } /* flags should not be set by get_xml_user_props, nor given * to infd_session_proxy_add_user. */ param = inf_session_get_user_property(user_props, "flags"); g_assert(!G_IS_VALUE(¶m->value)); g_value_init(¶m->value, INF_TYPE_USER_FLAGS); if(connection == NULL) g_value_set_flags(¶m->value, INF_USER_LOCAL); else g_value_set_flags(¶m->value, 0); /* same with connection */ param = inf_session_get_user_property(user_props, "connection"); g_assert(!G_IS_VALUE(¶m->value)); g_value_init(¶m->value, INF_TYPE_XML_CONNECTION); g_value_set_object(¶m->value, G_OBJECT(connection)); if(user == NULL) { /* This validates properties */ user = inf_session_add_user( priv->session, (const GParameter*)user_props->data, user_props->len, error ); if(user == NULL) return NULL; xml = xmlNewNode(NULL, (const xmlChar*)"user-join"); } else { /* Validate properties, but exclude the rejoining user from the check. * Otherwise, we would get conflicts because the name and the ID * of the request and the rejoining user are the same. */ result = session_class->validate_user_props( priv->session, (const GParameter*)user_props->data, user_props->len, user, error ); if(result == FALSE) return NULL; g_object_freeze_notify(G_OBJECT(user)); /* Set properties on already existing user object. */ for(i = 0; i < user_props->len; ++ i) { param = &g_array_index(user_props, GParameter, i); /* Don't set name and ID because they did not change, and we are not * even allowed to set ID because it is construct only. */ if(strcmp(param->name, "name") != 0 && strcmp(param->name, "id") != 0) g_object_set_property(G_OBJECT(user), param->name, ¶m->value); } g_object_thaw_notify(G_OBJECT(user)); xml = xmlNewNode(NULL, (const xmlChar*)"user-rejoin"); } inf_session_user_to_xml(priv->session, user, xml); if(seq != NULL) inf_xml_util_set_attribute(xml, "seq", seq); /* TODO: Send with "connection" to subscriptions that are in the same * network, and that are non-local. */ g_signal_connect( G_OBJECT(user), "notify::status", G_CALLBACK(infd_session_proxy_user_notify_status_cb), proxy ); inf_session_send_to_subscriptions(priv->session, xml); if(connection != NULL) { subscription = infd_session_proxy_find_subscription(proxy, connection); g_assert(subscription != NULL); subscription->users = g_slist_prepend(subscription->users, user); } else { priv->local_users = g_slist_prepend(priv->local_users, user); } return user; } /* * Signal handlers. */ static void infd_session_proxy_member_removed_cb(InfCommunicationGroup* group, InfXmlConnection* connection, gpointer user_data) { InfdSessionProxy* proxy; InfdSessionProxyPrivate* priv; InfdSessionProxySubscription* subscription; xmlNodePtr xml; GSList* item; InfUser* user; proxy = INFD_SESSION_PROXY(user_data); priv = INFD_SESSION_PROXY_PRIVATE(proxy); subscription = infd_session_proxy_find_subscription(proxy, connection); g_assert(subscription != NULL); /* TODO: Only send user-status-change to users that don't have a direct * connection to the closed connection. */ for(item = subscription->users; item != NULL; item = g_slist_next(item)) { user = INF_USER(item->data); /* Send user-status-change to remaining subscriptions. */ /* Note: We cannot simply use inf_session_set_user_status because it * would also try to send the status change to the subscription we are * removing, and because it only works for local users. */ xml = xmlNewNode(NULL, (const xmlChar*)"user-status-change"); inf_xml_util_set_attribute_uint(xml, "id", inf_user_get_id(user)); inf_xml_util_set_attribute( xml, "status", inf_user_status_to_string(INF_USER_UNAVAILABLE) ); /* The actual status change is performed in the default signal handler * of the remove-subscription signal. */ inf_session_send_to_subscriptions(priv->session, xml); } g_signal_emit( proxy, session_proxy_signals[REMOVE_SUBSCRIPTION], 0, connection ); } static void infd_session_proxy_add_user_cb(InfUserTable* user_table, InfUser* user, gpointer user_data) { InfdSessionProxy* proxy; InfdSessionProxyPrivate* priv; InfXmlConnection* sync_conn; InfdSessionProxySubscription* subscription; proxy = INFD_SESSION_PROXY(user_data); priv = INFD_SESSION_PROXY_PRIVATE(proxy); /* Make sure that we generate a non-existing user ID for the next user. */ if(priv->user_id_counter <= inf_user_get_id(user)) priv->user_id_counter = inf_user_get_id(user) + 1; if(inf_session_get_status(priv->session) == INF_SESSION_SYNCHRONIZING) { if(inf_user_get_status(user) != INF_USER_UNAVAILABLE) { g_object_get( G_OBJECT(priv->session), "sync-connection", &sync_conn, NULL ); g_assert(sync_conn != NULL); subscription = infd_session_proxy_find_subscription(proxy, sync_conn); /* During synchronization, available users are always considered to * belong to the synchronizing connection. Everything else is just not * supported and causes session closure. */ if(sync_conn != inf_user_get_connection(user) || subscription == NULL) { /* This actually cancels the synchronization: */ inf_session_close(priv->session); } else { subscription->users = g_slist_prepend(subscription->users, user); g_signal_connect( G_OBJECT(user), "notify::status", G_CALLBACK(infd_session_proxy_user_notify_status_cb), proxy ); } g_object_unref(sync_conn); } } } static void infd_session_proxy_synchronization_begin_cb(InfSession* session, InfCommunicationGroup* group, InfXmlConnection* connection, gpointer user_data) { InfdSessionProxy* proxy; InfdSessionProxyPrivate* priv; proxy = INFD_SESSION_PROXY(user_data); priv = INFD_SESSION_PROXY_PRIVATE(proxy); if(priv->idle) { priv->idle = FALSE; g_object_notify(G_OBJECT(proxy), "idle"); } } static void infd_session_proxy_synchronization_complete_cb(InfSession* session, InfXmlConnection* conn, gpointer user_data) { InfdSessionProxy* proxy; InfdSessionProxyPrivate* priv; proxy = INFD_SESSION_PROXY(user_data); priv = INFD_SESSION_PROXY_PRIVATE(proxy); /* Set idle if no more synchronizations are running */ if(!priv->idle && priv->subscriptions == NULL && !inf_session_has_synchronizations(session)) { priv->idle = TRUE; g_object_notify(G_OBJECT(proxy), "idle"); } } static void infd_session_proxy_synchronization_failed_cb_before(InfSession* session, InfXmlConnection* conn, const GError* error, gpointer user_data) { InfdSessionProxy* proxy; InfdSessionProxyPrivate* priv; InfSessionStatus status; InfdSessionProxySubscription* subscription; proxy = INFD_SESSION_PROXY(user_data); priv = INFD_SESSION_PROXY_PRIVATE(proxy); g_object_get(session, "status", &status, NULL); /* We do not need handle the status == INF_SESSION_PROXY_SYNCHRONIZING case * since there cannot be any subscriptions while we are synchronizing. */ if(status == INF_SESSION_RUNNING) { /* Remove from subscription group if the connection was subscribed */ subscription = infd_session_proxy_find_subscription(proxy, conn); if(subscription != NULL) { inf_communication_hosted_group_remove_member( priv->subscription_group, conn ); } } } static void infd_session_proxy_synchronization_failed_cb_after(InfSession* session, InfXmlConnection* conn, const GError* error, gpointer user_data) { InfdSessionProxy* proxy; InfdSessionProxyPrivate* priv; proxy = INFD_SESSION_PROXY(user_data); priv = INFD_SESSION_PROXY_PRIVATE(proxy); /* Set idle if no more synchronizations are running */ if(!priv->idle && priv->subscriptions == NULL && !inf_session_has_synchronizations(session)) { priv->idle = TRUE; g_object_notify(G_OBJECT(proxy), "idle"); } } static void infd_session_proxy_session_close_cb(InfSession* session, gpointer user_data) { InfdSessionProxy* proxy; InfdSessionProxyPrivate* priv; InfdSessionProxySubscription* subscription; InfSessionSyncStatus status; xmlNodePtr xml; proxy = INFD_SESSION_PROXY(user_data); priv = INFD_SESSION_PROXY_PRIVATE(proxy); inf_signal_handlers_disconnect_by_func( G_OBJECT(priv->subscription_group), G_CALLBACK(infd_session_proxy_member_removed_cb), proxy ); while(priv->subscriptions != NULL) { subscription = (InfdSessionProxySubscription*)priv->subscriptions->data; status = inf_session_get_synchronization_status( priv->session, subscription->connection ); /* If synchronization is still in progress, the default handler of * InfSession will cancel the synchronization in which case we do * not need to send an extra session-close message. */ /* We send session_close when we are in AWAITING_ACK status. In * AWAITING_ACK status we cannot cancel the synchronization anymore * because everything has already been sent out. Therefore the client * will eventuelly get in RUNNING state when he receives this message, * and process it correctly. */ if(status != INF_SESSION_SYNC_IN_PROGRESS) { xml = xmlNewNode(NULL, (const xmlChar*)"session-close"); inf_communication_group_send_message( INF_COMMUNICATION_GROUP(priv->subscription_group), subscription->connection, xml ); } /* Note that this does not call our signal handler because we already * disconnected it. This way, we make sure not to send user status updates * which would be pointless since we are closing the group anyway. */ inf_communication_hosted_group_remove_member( priv->subscription_group, subscription->connection ); g_signal_emit( proxy, session_proxy_signals[REMOVE_SUBSCRIPTION], 0, subscription->connection ); } g_object_unref(priv->subscription_group); priv->subscription_group = NULL; } /* * GObject overrides. */ static void infd_session_proxy_init(GTypeInstance* instance, gpointer g_class) { InfdSessionProxy* session_proxy; InfdSessionProxyPrivate* priv; session_proxy = INFD_SESSION_PROXY(instance); priv = INFD_SESSION_PROXY_PRIVATE(session_proxy); priv->subscriptions = NULL; priv->subscription_group = NULL; priv->user_id_counter = 1; priv->local_users = NULL; priv->idle = TRUE; } static GObject* infd_session_proxy_constructor(GType type, guint n_construct_properties, GObjectConstructParam* construct_properties) { GObject* object; InfdSessionProxy* session_proxy; InfdSessionProxyPrivate* priv; object = G_OBJECT_CLASS(parent_class)->constructor( type, n_construct_properties, construct_properties ); session_proxy = INFD_SESSION_PROXY(object); priv = INFD_SESSION_PROXY_PRIVATE(session_proxy); g_assert(priv->subscription_group != NULL); g_assert(priv->session != NULL); /* Set unidle when session is currently being synchronized */ if(inf_session_get_status(priv->session) == INF_SESSION_SYNCHRONIZING) priv->idle = FALSE; /* TODO: We could perhaps optimize by only setting the subscription * group when there are subscribed connections. */ inf_session_set_subscription_group( priv->session, INF_COMMUNICATION_GROUP(priv->subscription_group) ); return object; } static void infd_session_proxy_dispose(GObject* object) { InfdSessionProxy* proxy; InfdSessionProxyPrivate* priv; InfCommunicationManager* manager; proxy = INFD_SESSION_PROXY(object); priv = INFD_SESSION_PROXY_PRIVATE(proxy); manager = inf_session_get_communication_manager(priv->session); g_object_ref(manager); g_slist_free(priv->local_users); priv->local_users = NULL; /* We need to close the session explicitely before we unref so that * the signal handler for the close signal is called. */ /* Note this emits the close signal, removing all subscriptions and * the subscription group */ if(inf_session_get_status(priv->session) != INF_SESSION_CLOSED) inf_session_close(priv->session); inf_signal_handlers_disconnect_by_func( G_OBJECT(priv->session), G_CALLBACK(infd_session_proxy_session_close_cb), proxy ); inf_signal_handlers_disconnect_by_func( G_OBJECT(inf_session_get_user_table(priv->session)), G_CALLBACK(infd_session_proxy_add_user_cb), proxy ); inf_signal_handlers_disconnect_by_func( G_OBJECT(priv->session), G_CALLBACK(infd_session_proxy_synchronization_begin_cb), proxy ); inf_signal_handlers_disconnect_by_func( G_OBJECT(priv->session), G_CALLBACK(infd_session_proxy_synchronization_complete_cb), proxy ); inf_signal_handlers_disconnect_by_func( G_OBJECT(priv->session), G_CALLBACK(infd_session_proxy_synchronization_failed_cb_before), proxy ); inf_signal_handlers_disconnect_by_func( G_OBJECT(priv->session), G_CALLBACK(infd_session_proxy_synchronization_failed_cb_after), proxy ); g_object_unref(priv->session); priv->session = NULL; g_assert(priv->subscription_group == NULL); g_assert(priv->subscriptions == NULL); g_object_unref(manager); } static void infd_session_proxy_session_init_user_func(InfUser* user, gpointer user_data) { InfdSessionProxy* proxy; InfdSessionProxyPrivate* priv; proxy = INFD_SESSION_PROXY(user_data); priv = INFD_SESSION_PROXY_PRIVATE(proxy); if(priv->user_id_counter <= inf_user_get_id(user)) priv->user_id_counter = inf_user_get_id(user) + 1; } static void infd_session_proxy_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec) { InfdSessionProxy* proxy; InfdSessionProxyPrivate* priv; proxy = INFD_SESSION_PROXY(object); priv = INFD_SESSION_PROXY_PRIVATE(proxy); switch(prop_id) { case PROP_SESSION: g_assert(priv->session == NULL); /* construct only */ priv->session = INF_SESSION(g_value_dup_object(value)); /* Adjust user id counter so the next joining user gets a free ID */ /* TODO: Add local users to priv->local_users, assert that there are no * available non-local users. */ inf_user_table_foreach_user( inf_session_get_user_table(priv->session), infd_session_proxy_session_init_user_func, proxy ); /* This in not connect_after to fix bug #499. This makes more sense * anyway, because otherwise the signal handler does not have any * synchronization info anymore. */ g_signal_connect( G_OBJECT(priv->session), "close", G_CALLBACK(infd_session_proxy_session_close_cb), proxy ); g_signal_connect( G_OBJECT(inf_session_get_user_table(priv->session)), "add-user", G_CALLBACK(infd_session_proxy_add_user_cb), proxy ); g_signal_connect_after( G_OBJECT(priv->session), "synchronization-begin", G_CALLBACK(infd_session_proxy_synchronization_begin_cb), proxy ); g_signal_connect_after( G_OBJECT(priv->session), "synchronization-complete", G_CALLBACK(infd_session_proxy_synchronization_complete_cb), proxy ); g_signal_connect( G_OBJECT(priv->session), "synchronization-failed", G_CALLBACK(infd_session_proxy_synchronization_failed_cb_before), proxy ); g_signal_connect_after( G_OBJECT(priv->session), "synchronization-failed", G_CALLBACK(infd_session_proxy_synchronization_failed_cb_after), proxy ); break; case PROP_SUBSCRIPTION_GROUP: g_assert(priv->subscription_group == NULL); /* construct only */ priv->subscription_group = INF_COMMUNICATION_HOSTED_GROUP(g_value_dup_object(value)); g_signal_connect( G_OBJECT(priv->subscription_group), "member-removed", G_CALLBACK(infd_session_proxy_member_removed_cb), proxy ); break; case PROP_IDLE: /* read/only */ default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void infd_session_proxy_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec) { InfdSessionProxy* proxy; InfdSessionProxyPrivate* priv; proxy = INFD_SESSION_PROXY(object); priv = INFD_SESSION_PROXY_PRIVATE(proxy); switch(prop_id) { case PROP_SESSION: g_value_set_object(value, priv->session); break; case PROP_SUBSCRIPTION_GROUP: g_value_set_object(value, priv->subscription_group); break; case PROP_IDLE: g_value_set_boolean(value, priv->idle); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } /* * Default signal handlers */ static void infd_session_proxy_add_subscription(InfdSessionProxy* proxy, InfXmlConnection* connection, guint seq_id) { InfdSessionProxyPrivate* priv; InfdSessionProxySubscription* subscription; priv = INFD_SESSION_PROXY_PRIVATE(proxy); g_assert(infd_session_proxy_find_subscription(proxy, connection) == NULL); subscription = infd_session_proxy_subscription_new(connection, seq_id); priv->subscriptions = g_slist_prepend(priv->subscriptions, subscription); if(priv->idle) { priv->idle = FALSE; g_object_notify(G_OBJECT(proxy), "idle"); } } static void infd_session_proxy_remove_subscription(InfdSessionProxy* proxy, InfXmlConnection* connection) { InfdSessionProxyPrivate* priv; InfdSessionProxySubscription* subscr; priv = INFD_SESSION_PROXY_PRIVATE(proxy); subscr = infd_session_proxy_find_subscription(proxy, connection); g_assert(subscr != NULL); /* TODO: Cancel synchronization if the synchronization to this subscription * did not yet finish. */ while(subscr->users) { /* The signal handler of the user's notify::status signal removes the user * from the subscription. */ g_object_set( G_OBJECT(subscr->users->data), "status", INF_USER_UNAVAILABLE, NULL ); } priv->subscriptions = g_slist_remove(priv->subscriptions, subscr); infd_session_proxy_subscription_free(subscr); if(!priv->idle && priv->subscriptions == NULL && !inf_session_has_synchronizations(priv->session)) { priv->idle = TRUE; g_object_notify(G_OBJECT(proxy), "idle"); } } /* * Message handling. */ static gboolean infd_session_proxy_handle_user_join(InfdSessionProxy* proxy, InfXmlConnection* connection, xmlNodePtr xml, GError** error) { InfdSessionProxyPrivate* priv; InfSessionClass* session_class; GArray* array; InfUser* user; gchar* seq; guint i; priv = INFD_SESSION_PROXY_PRIVATE(proxy); session_class = INF_SESSION_GET_CLASS(priv->session); if(!infd_session_proxy_make_seq(proxy, connection, xml, &seq, error)) return FALSE; array = session_class->get_xml_user_props( priv->session, connection, xml ); user = infd_session_proxy_perform_user_join( proxy, connection, seq, array, error ); for(i = 0; i < array->len; ++ i) g_value_unset(&g_array_index(array, GParameter, i).value); g_array_free(array, TRUE); g_free(seq); if(user == NULL) return FALSE; return TRUE; } static gboolean infd_session_proxy_handle_session_unsubscribe(InfdSessionProxy* proxy, InfXmlConnection* connection, const xmlNodePtr xml, GError** error) { InfdSessionProxyPrivate* priv; priv = INFD_SESSION_PROXY_PRIVATE(proxy); g_assert(infd_session_proxy_find_subscription(proxy, connection) != NULL); inf_communication_hosted_group_remove_member( priv->subscription_group, connection ); return TRUE; } /* * InfCommunicationObject implementation */ static void infd_session_proxy_communication_object_sent(InfCommunicationObject* object, InfXmlConnection* connection, xmlNodePtr node) { InfdSessionProxy* proxy; InfdSessionProxyPrivate* priv; proxy = INFD_SESSION_PROXY(object); priv = INFD_SESSION_PROXY_PRIVATE(proxy); /* TODO: Don't forward for messages the proxy issued */ g_assert(priv->session != NULL); inf_communication_object_sent( INF_COMMUNICATION_OBJECT(priv->session), connection, node ); } static void infd_session_proxy_communication_object_enqueued(InfCommunicationObject* obj, InfXmlConnection* connection, xmlNodePtr node) { InfdSessionProxy* proxy; InfdSessionProxyPrivate* priv; proxy = INFD_SESSION_PROXY(obj); priv = INFD_SESSION_PROXY_PRIVATE(proxy); /* TODO: Don't forward for messages the proxy issued */ g_assert(priv->session != NULL); inf_communication_object_enqueued( INF_COMMUNICATION_OBJECT(priv->session), connection, node ); } static InfCommunicationScope infd_session_proxy_communication_object_received(InfCommunicationObject* obj, InfXmlConnection* connection, xmlNodePtr node, GError** error) { InfdSessionProxy* proxy; InfdSessionProxyPrivate* priv; InfSessionSyncStatus status; GError* local_error; xmlNodePtr reply_xml; gchar* seq; proxy = INFD_SESSION_PROXY(obj); priv = INFD_SESSION_PROXY_PRIVATE(proxy); /* TODO: Don't forward for messages the proxy issued */ g_assert(priv->session != NULL); status = inf_session_get_synchronization_status(priv->session, connection); local_error = NULL; if(status != INF_SESSION_SYNC_NONE) { return inf_communication_object_received( INF_COMMUNICATION_OBJECT(priv->session), connection, node, error ); } else { if(strcmp((const char*)node->name, "user-join") == 0) { infd_session_proxy_handle_user_join( proxy, connection, node, &local_error ); } else if(strcmp((const char*)node->name, "session-unsubscribe") == 0) { /* TODO: Handle this in InfSession, if possible */ infd_session_proxy_handle_session_unsubscribe( proxy, connection, node, &local_error ); } else { return inf_communication_object_received( INF_COMMUNICATION_OBJECT(priv->session), connection, node, error ); } } if(local_error != NULL) { if(!infd_session_proxy_make_seq(proxy, connection, node, &seq, error)) seq = NULL; /* Only send request-failed when it was a proxy-related request */ reply_xml = inf_xml_util_new_node_from_error(local_error, NULL, "request-failed"); if(seq != NULL) inf_xml_util_set_attribute(reply_xml, "seq", seq); g_free(seq); inf_communication_group_send_message( INF_COMMUNICATION_GROUP(priv->subscription_group), connection, reply_xml ); g_error_free(local_error); } /* Don't forward proxy-related messages */ return INF_COMMUNICATION_SCOPE_PTP; } /* * GType registration. */ static void infd_session_proxy_class_init(gpointer g_class, gpointer class_data) { GObjectClass* object_class; InfdSessionProxyClass* proxy_class; object_class = G_OBJECT_CLASS(g_class); proxy_class = INFD_SESSION_PROXY_CLASS(g_class); parent_class = G_OBJECT_CLASS(g_type_class_peek_parent(g_class)); g_type_class_add_private(g_class, sizeof(InfdSessionProxyPrivate)); object_class->constructor = infd_session_proxy_constructor; object_class->dispose = infd_session_proxy_dispose; object_class->set_property = infd_session_proxy_set_property; object_class->get_property = infd_session_proxy_get_property; proxy_class->add_subscription = infd_session_proxy_add_subscription; proxy_class->remove_subscription = infd_session_proxy_remove_subscription; g_object_class_install_property( object_class, PROP_SESSION, g_param_spec_object( "session", "Session", "The underlying session", INF_TYPE_SESSION, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); g_object_class_install_property( object_class, PROP_SUBSCRIPTION_GROUP, g_param_spec_object( "subscription-group", "Subscription group", "The communication manager group of subscribed connections", INF_COMMUNICATION_TYPE_HOSTED_GROUP, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); g_object_class_install_property( object_class, PROP_IDLE, g_param_spec_boolean( "idle", "Idle", "The session is considered idle when are no subscriptions and no " "synchronizations", TRUE, G_PARAM_READABLE ) ); /** * InfdSessionProxy::add-subscription: * @proxy: The #InfdSessionProxy emitting the signal. * @connection: The subscribed #InfXmlConnection. * @seq_id: The sequence identifier for @connection as passed to * infd_session_proxy_subscribe_to(). * * Emitted every time a connection is subscribed to the session. **/ session_proxy_signals[ADD_SUBSCRIPTION] = g_signal_new( "add-subscription", G_OBJECT_CLASS_TYPE(object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(InfdSessionProxyClass, add_subscription), NULL, NULL, inf_marshal_VOID__OBJECT_UINT, G_TYPE_NONE, 2, INF_TYPE_XML_CONNECTION, G_TYPE_UINT ); /** * InfdSessionProxy::remove-subscription: * @proxy: The #InfdSessionProxy emitting the signal. * @connection: The unsubscribed #InfXmlConnection. * * Emitted every time a connection is unsubscribed to the session, or a * subscription is removed because the session is closed. **/ session_proxy_signals[REMOVE_SUBSCRIPTION] = g_signal_new( "remove-subscription", G_OBJECT_CLASS_TYPE(object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(InfdSessionProxyClass, remove_subscription), NULL, NULL, inf_marshal_VOID__OBJECT, G_TYPE_NONE, 1, INF_TYPE_XML_CONNECTION ); } static void infd_session_proxy_communication_object_init(gpointer g_iface, gpointer iface_data) { InfCommunicationObjectIface* iface; iface = (InfCommunicationObjectIface*)g_iface; iface->sent = infd_session_proxy_communication_object_sent; iface->enqueued = infd_session_proxy_communication_object_enqueued; iface->received = infd_session_proxy_communication_object_received; } GType infd_session_proxy_get_type(void) { static GType session_proxy_type = 0; if(!session_proxy_type) { static const GTypeInfo session_proxy_type_info = { sizeof(InfdSessionProxyClass), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ infd_session_proxy_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InfdSessionProxy), /* instance_size */ 0, /* n_preallocs */ infd_session_proxy_init, /* instance_init */ NULL /* value_table */ }; static const GInterfaceInfo communication_object_info = { infd_session_proxy_communication_object_init, NULL, NULL }; session_proxy_type = g_type_register_static( G_TYPE_OBJECT, "InfdSessionProxy", &session_proxy_type_info, 0 ); g_type_add_interface_static( session_proxy_type, INF_COMMUNICATION_TYPE_OBJECT, &communication_object_info ); } return session_proxy_type; } /* * Public API. */ /** * infd_session_proxy_get_session: * @proxy: A #InfdSessionProxy. * * Returns the session proxied by @proxy. Returns %NULL if the session was * closed. * * Return Value: A #InfSession, or %NULL. **/ InfSession* infd_session_proxy_get_session(InfdSessionProxy* proxy) { g_return_val_if_fail(INFD_IS_SESSION_PROXY(proxy), NULL); return INFD_SESSION_PROXY_PRIVATE(proxy)->session; } /** * infd_session_proxy_add_user: * @proxy: A #InfdSessionProxy. * @params: Construction properties for the #InfUser (or derived) object. * @n_params: Number of parameters. * @error: Location to store error information. * * Adds a local user to @proxy's session. @params must not contain the * 'id' property because it will be choosen by the proxy. Also, if the 'name' * property is already in use by an existing, but unavailable user, this user * will be re-used. * * Return Value: The #InfUser that has been added, or %NULL in case of an * error. **/ InfUser* infd_session_proxy_add_user(InfdSessionProxy* proxy, const GParameter* params, guint n_params, GError** error) { InfUser* user; GArray* array; g_return_val_if_fail(INFD_IS_SESSION_PROXY(proxy), NULL); /* TODO: Make sure values added by infd_session_proxy_perform_user_join are * released, for example by inserting copies into the array, and freeing * the values after the call. */ array = g_array_sized_new(FALSE, FALSE, sizeof(GParameter), n_params + 2); g_array_append_vals(array, params, n_params); user = infd_session_proxy_perform_user_join( proxy, NULL, NULL, array, error ); g_array_free(array, TRUE); return user; } /** * infd_session_proxy_subscribe_to: * @proxy: A #InfdSessionProxy. * @connection: A #InfXmlConnection that is not yet subscribed. * @seq_id: The sequence identifier for @connection. * @synchronize: If %TRUE, then synchronize the session to @connection first. * * Subscribes @connection to @proxy's session. The first thing that will be * done is a synchronization (see inf_session_synchronize_to()). Then, all * changes to the session are propagated to @connection. * * @seq_id should be a unique number for @connection, and the same number must * be passed on the client side to the #InfcSessionProxy object. Normally * #InfdDirectory and #InfcBrowser take care of choosing an appropriate * sequence identifier. * * Normally, you want to set @synchronize to %TRUE in which case the whole * session state will be synchronized to @connection (within the subscription * group). However, if for whatever reason the remote site already has a * copy of the session, then you may set @synchronize to %FALSE to skip * synchronization. This happens for example for newly created documents, or * when the remote site synchronized the local site and wants to be * initially subscribed. * * If @proxy's session is not in %INF_SESSION_RUNNING status, but in * %INF_SESSION_SYNCHRONIZING, then @connection must be the connection that * synchronizes the session and @synchronize needs to be set to %FALSE. This * causes the synchronizing connection to initially be subscribed. This * needs to be called directly after having created the session proxy (i.e. * without returning to the main loop before) so that the synchronization * connection is added to the subscription group for synchronization. * * Otherwise a subscription can only be initiated if @proxy's session is in * state %INF_SESSION_RUNNING. **/ void infd_session_proxy_subscribe_to(InfdSessionProxy* proxy, InfXmlConnection* connection, guint seq_id, gboolean synchronize) { InfdSessionProxyPrivate* priv; g_return_if_fail(INFD_IS_SESSION_PROXY(proxy)); g_return_if_fail(INF_IS_XML_CONNECTION(connection)); g_return_if_fail( infd_session_proxy_find_subscription(proxy, connection) == NULL ); priv = INFD_SESSION_PROXY_PRIVATE(proxy); g_return_if_fail(priv->session != NULL); /* TODO: Also check connection against sync-conn in synchronizing case: */ g_return_if_fail( inf_session_get_status(priv->session) == INF_SESSION_RUNNING || (synchronize == FALSE) ); /* Note we can't do this in the default signal handler since it doesn't * know the parent group. TODO: We can, meanwhile. */ inf_communication_hosted_group_add_member( priv->subscription_group, connection ); g_signal_emit( G_OBJECT(proxy), session_proxy_signals[ADD_SUBSCRIPTION], 0, connection, seq_id ); /* Make sure the default handler ran. Stopping the signal emission before * would leave us in an inconsistent state. */ g_assert(infd_session_proxy_find_subscription(proxy, connection) != NULL); if(synchronize) { /* Directly synchronize within the subscription group so that we do not * need a group change after synchronization, and the connection already * receives requests from other group members to process after * synchronization. */ inf_session_synchronize_to( priv->session, INF_COMMUNICATION_GROUP(priv->subscription_group), connection ); } } /** * infd_session_proxy_has_subscriptions: * @proxy: A #InfdSessionProxy. * * Returns whether there are subscribed connections to the session. * * Returns: Whether there are subscribed connections. **/ gboolean infd_session_proxy_has_subscriptions(InfdSessionProxy* proxy) { InfdSessionProxyPrivate* priv; g_return_val_if_fail(INFD_IS_SESSION_PROXY(proxy), FALSE); priv = INFD_SESSION_PROXY_PRIVATE(proxy); if(priv->subscriptions == NULL) return FALSE; return TRUE; } /** * infd_session_proxy_is_subscribed: * @proxy: A #InfdSessionProxy. * @connection: The connection to check for being subscribed. * * Returns %TRUE when @connection is subscribed to the session and %FALSE * otherwise. * * Returns: Whether @connection is subscribed. **/ gboolean infd_session_proxy_is_subscribed(InfdSessionProxy* proxy, InfXmlConnection* connection) { g_return_val_if_fail(INFD_IS_SESSION_PROXY(proxy), FALSE); g_return_val_if_fail(INF_IS_XML_CONNECTION(connection), FALSE); if(infd_session_proxy_find_subscription(proxy, connection) == NULL) return FALSE; return TRUE; } /** * infd_session_proxy_is_idle: * @proxy: A #InfdSessionProxy. * * Returns whether the session is idle. The session is considered idle when * there are no subscriptions and no synchronizations (in either direction). * * Returns: Whether the session is idle. **/ gboolean infd_session_proxy_is_idle(InfdSessionProxy* proxy) { g_return_val_if_fail(INFD_IS_SESSION_PROXY(proxy), FALSE); return INFD_SESSION_PROXY_PRIVATE(proxy)->idle; } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/server/infd-storage.h0000644000175000017500000000760212264763732017364 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INFD_STORAGE_H__ #define __INFD_STORAGE_H__ #include G_BEGIN_DECLS #define INFD_TYPE_STORAGE (infd_storage_get_type()) #define INFD_STORAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INFD_TYPE_STORAGE, InfdStorage)) #define INFD_IS_STORAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INFD_TYPE_STORAGE)) #define INFD_STORAGE_GET_IFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE((inst), INFD_TYPE_STORAGE, InfdStorageIface)) #define INFD_TYPE_STORAGE_NODE_TYPE (infd_storage_node_type_get_type()) #define INFD_TYPE_STORAGE_NODE (infd_storage_node_get_type()) typedef struct _InfdStorage InfdStorage; typedef struct _InfdStorageIface InfdStorageIface; typedef enum _InfdStorageNodeType { INFD_STORAGE_NODE_SUBDIRECTORY, INFD_STORAGE_NODE_NOTE } InfdStorageNodeType; typedef struct _InfdStorageNode InfdStorageNode; struct _InfdStorageNode { InfdStorageNodeType type; gchar* name; gchar* identifier; /* Only set when type == INFD_STORAGE_NODE_NOTE */ }; struct _InfdStorageIface { GTypeInterface parent; /* All these calls are supposed to be synchronous, e.g. completly perform * the required task. Some day, we could implement asynchronous * behaviour in InfdDirectory (e.g. it caches operations and executes * them via the storage in the background). */ /* Virtual Table */ GSList* (*read_subdirectory)(InfdStorage* storage, const gchar* path, GError** error); gboolean (*create_subdirectory)(InfdStorage* storage, const gchar* path, GError** error); gboolean (*remove_node)(InfdStorage* storage, const gchar* identifier, const gchar* path, GError** error); /* TODO: Add further methods to copy, move and expunge nodes */ /* TODO: Notification? */ }; GType infd_storage_node_type_get_type(void) G_GNUC_CONST; GType infd_storage_node_get_type(void) G_GNUC_CONST; GType infd_storage_get_type(void) G_GNUC_CONST; InfdStorageNode* infd_storage_node_new_subdirectory(const gchar* path); InfdStorageNode* infd_storage_node_new_note(const gchar* path, const gchar* identifier); InfdStorageNode* infd_storage_node_copy(InfdStorageNode* node); void infd_storage_node_free(InfdStorageNode* node); void infd_storage_node_list_free(GSList* node_list); GSList* infd_storage_read_subdirectory(InfdStorage* storage, const gchar* path, GError** error); gboolean infd_storage_create_subdirectory(InfdStorage* storage, const gchar* path, GError** error); gboolean infd_storage_remove_node(InfdStorage* storage, const gchar* identifier, const gchar* path, GError** error); G_END_DECLS #endif /* __INFD_STORAGE_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/server/infd-directory.h0000644000175000017500000001531712264763732017726 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INFD_DIRECTORY_H__ #define __INFD_DIRECTORY_H__ #include #include #include #include #include G_BEGIN_DECLS #define INFD_TYPE_DIRECTORY (infd_directory_get_type()) #define INFD_DIRECTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INFD_TYPE_DIRECTORY, InfdDirectory)) #define INFD_DIRECTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INFD_TYPE_DIRECTORY, InfdDirectoryClass)) #define INFD_IS_DIRECTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INFD_TYPE_DIRECTORY)) #define INFD_IS_DIRECTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INFD_TYPE_DIRECTORY)) #define INFD_DIRECTORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), INFD_TYPE_DIRECTORY, InfdDirectoryClass)) #define INFD_TYPE_DIRECTORY_ITER (infd_directory_iter_get_type()) typedef struct _InfdDirectory InfdDirectory; typedef struct _InfdDirectoryClass InfdDirectoryClass; typedef struct _InfdDirectoryIter InfdDirectoryIter; struct _InfdDirectoryIter { guint node_id; gpointer node; }; struct _InfdDirectoryClass { GObjectClass parent_class; /* Signals */ void (*node_added)(InfdDirectory* directory, InfdDirectoryIter* iter); void (*node_removed)(InfdDirectory* directory, InfdDirectoryIter* iter); void (*add_session)(InfdDirectory* directory, InfdDirectoryIter* iter, InfdSessionProxy* session); void (*remove_session)(InfdDirectory* directory, InfdDirectoryIter* iter, InfdSessionProxy* session); }; struct _InfdDirectory { GObject parent; }; typedef void(*InfdDirectoryForeachConnectionFunc)(InfXmlConnection*, gpointer); GType infd_directory_iter_get_type(void) G_GNUC_CONST; GType infd_directory_get_type(void) G_GNUC_CONST; /* TODO: Do these two need to be public? */ InfdDirectoryIter* infd_directory_iter_copy(InfdDirectoryIter* iter); void infd_directory_iter_free(InfdDirectoryIter* iter); InfdDirectory* infd_directory_new(InfIo* io, InfdStorage* storage, InfCommunicationManager* comm_manager); InfIo* infd_directory_get_io(InfdDirectory* directory); InfdStorage* infd_directory_get_storage(InfdDirectory* directory); InfCommunicationManager* infd_directory_get_communication_manager(InfdDirectory* directory); gboolean infd_directory_add_plugin(InfdDirectory* directory, const InfdNotePlugin* plugin); const InfdNotePlugin* infd_directory_lookup_plugin(InfdDirectory* directory, const gchar* note_type); gboolean infd_directory_add_connection(InfdDirectory* directory, InfXmlConnection* connection); void infd_directory_foreach_connection(InfdDirectory* directory, InfdDirectoryForeachConnectionFunc func, gpointer user_data); const gchar* infd_directory_iter_get_name(InfdDirectory* directory, InfdDirectoryIter* iter); gchar* infd_directory_iter_get_path(InfdDirectory* directory, InfdDirectoryIter* iter); void infd_directory_iter_get_root(InfdDirectory* directory, InfdDirectoryIter* iter); gboolean infd_directory_iter_get_next(InfdDirectory* directory, InfdDirectoryIter* iter); gboolean infd_directory_iter_get_prev(InfdDirectory* directory, InfdDirectoryIter* iter); gboolean infd_directory_iter_get_parent(InfdDirectory* directory, InfdDirectoryIter* iter); gboolean infd_directory_iter_get_child(InfdDirectory* directory, InfdDirectoryIter* iter, GError** error); gboolean infd_directory_iter_get_explored(InfdDirectory* directory, InfdDirectoryIter* iter); gboolean infd_directory_add_subdirectory(InfdDirectory* directory, InfdDirectoryIter* parent, const gchar* name, InfdDirectoryIter* iter, GError** error); gboolean infd_directory_add_note(InfdDirectory* directory, InfdDirectoryIter* parent, const gchar* name, const InfdNotePlugin* plugin, InfdDirectoryIter* iter, GError** error); gboolean infd_directory_remove_node(InfdDirectory* directory, InfdDirectoryIter* iter, GError** error); InfdStorageNodeType infd_directory_iter_get_node_type(InfdDirectory* directory, InfdDirectoryIter* iter); const InfdNotePlugin* infd_directory_iter_get_plugin(InfdDirectory* directory, InfdDirectoryIter* iter); InfdSessionProxy* infd_directory_iter_get_session(InfdDirectory* directory, InfdDirectoryIter* iter, GError** error); InfdSessionProxy* infd_directory_iter_peek_session(InfdDirectory* directory, InfdDirectoryIter* iter); gboolean infd_directory_iter_save_session(InfdDirectory* directory, InfdDirectoryIter* iter, GError** error); void infd_directory_enable_chat(InfdDirectory* directory, gboolean enable); InfdSessionProxy* infd_directory_get_chat_session(InfdDirectory* directory); G_END_DECLS #endif /* __INFD_DIRECTORY_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/server/infd-tcp-server.c0000644000175000017500000005370412264763742020012 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include #include #include #include #ifndef G_OS_WIN32 # include # include # include # include # include # include # include # include #else # include #endif #ifdef G_OS_WIN32 # define INFD_TCP_SERVER_LAST_ERROR WSAGetLastError() # define INFD_TCP_SERVER_EINTR WSAEINTR # define INFD_TCP_SERVER_EAGAIN WSAEWOULDBLOCK #else # define INFD_TCP_SERVER_LAST_ERROR errno # define INFD_TCP_SERVER_EINTR EINTR # define INFD_TCP_SERVER_EAGAIN EAGAIN # define closesocket(s) close(s) # define INVALID_SOCKET -1 #endif typedef struct _InfdTcpServerPrivate InfdTcpServerPrivate; struct _InfdTcpServerPrivate { InfIo* io; InfIoWatch* watch; InfNativeSocket socket; InfdTcpServerStatus status; InfIpAddress* local_address; guint local_port; }; enum { PROP_0, PROP_IO, PROP_STATUS, PROP_LOCAL_ADDRESS, PROP_LOCAL_PORT }; enum { NEW_CONNECTION, ERROR_, /* ERROR is a #define on WIN32 */ LAST_SIGNAL }; #define INFD_TCP_SERVER_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), INFD_TYPE_TCP_SERVER, InfdTcpServerPrivate)) static GObjectClass* parent_class; static guint tcp_server_signals[LAST_SIGNAL]; static GQuark infd_tcp_server_error_quark; /* TODO: The following functions are merely copied from inf-tcp-connection.c. * Probably they should belong into some inf-net-util.c file in * libinfinity/common. */ static void infd_tcp_server_addr_info(InfNativeSocket socket, gboolean local, InfIpAddress** address, guint* port) { union { struct sockaddr in_generic; struct sockaddr_in in; struct sockaddr_in6 in6; } native_addr; socklen_t len; len = sizeof(native_addr); if(local == TRUE) getsockname(socket, &native_addr.in_generic, &len); else getpeername(socket, &native_addr.in_generic, &len); switch(native_addr.in_generic.sa_family) { case AF_INET: if(address != NULL) *address = inf_ip_address_new_raw4(native_addr.in.sin_addr.s_addr); if(port != NULL) *port = ntohs(native_addr.in.sin_port); break; case AF_INET6: if(address != NULL) *address = inf_ip_address_new_raw6(native_addr.in6.sin6_addr.s6_addr); if(port != NULL) *port = ntohs(native_addr.in6.sin6_port); break; default: g_assert_not_reached(); break; } } static void infd_tcp_server_make_system_error(int code, GError** error) { #ifdef G_OS_WIN32 gchar* error_message; error_message = g_win32_error_message(code); g_set_error( error, infd_tcp_server_error_quark, code, "%s", error_message ); g_free(error_message); #else g_set_error( error, infd_tcp_server_error_quark, code, "%s", strerror(code) ); #endif } static void infd_tcp_server_system_error(InfdTcpServer* server, int code) { GError* error; error = NULL; infd_tcp_server_make_system_error(code, &error); g_signal_emit(G_OBJECT(server), tcp_server_signals[ERROR_], 0, error); g_error_free(error); } static void infd_tcp_server_io(InfNativeSocket* socket, InfIoEvent events, gpointer user_data) { InfdTcpServer* server; InfdTcpServerPrivate* priv; socklen_t len; InfNativeSocket new_socket; int errcode; InfTcpConnection* connection; GError* error; union { struct sockaddr in_generic; struct sockaddr_in in; struct sockaddr_in6 in6; } native_addr; InfIpAddress* address; guint port; server = INFD_TCP_SERVER(user_data); priv = INFD_TCP_SERVER_PRIVATE(server); g_object_ref(G_OBJECT(server)); if(events & INF_IO_ERROR) { len = sizeof(int); #ifdef G_OS_WIN32 getsockopt(priv->socket, SOL_SOCKET, SO_ERROR, (char*)&errcode, &len); #else getsockopt(priv->socket, SOL_SOCKET, SO_ERROR, &errcode, &len); #endif /* TODO: Verify that we get senseful error codes here */ infd_tcp_server_system_error(server, errcode); } else if(events & INF_IO_INCOMING) { do { /* Note that we do not do anything with native_addr and len. This is * currently only for debugging purposes since there seemingly was a * case where accept returned a valid but socket and errno was set to * EAGAIN (which might have been resulted from a previous call however * since the errno = 0 line was not there yet before that either). * I hope to get some more information this way in case this occurs * again. */ #ifndef G_OS_WIN32 errno = 0; #endif len = sizeof(native_addr); new_socket = accept(priv->socket, &native_addr.in_generic, &len); errcode = INFD_TCP_SERVER_LAST_ERROR; if(new_socket == INVALID_SOCKET && errcode != INFD_TCP_SERVER_EINTR && errcode != INFD_TCP_SERVER_EAGAIN) { infd_tcp_server_system_error(server, errcode); } else if(new_socket != INVALID_SOCKET) { switch(native_addr.in_generic.sa_family) { case AF_INET: address = inf_ip_address_new_raw4(native_addr.in.sin_addr.s_addr); port = ntohs(native_addr.in.sin_port); break; case AF_INET6: address = inf_ip_address_new_raw6(native_addr.in6.sin6_addr.s6_addr); port = ntohs(native_addr.in6.sin6_port); break; default: g_assert_not_reached(); break; } error = NULL; connection = _inf_tcp_connection_accepted( priv->io, new_socket, address, port, &error ); /* _inf_tcp_connection_accepted() takes ownership of address */ if(connection != NULL) { g_signal_emit( G_OBJECT(server), tcp_server_signals[NEW_CONNECTION], 0, connection ); g_object_unref(connection); } else { g_signal_emit( G_OBJECT(server), tcp_server_signals[ERROR_], 0, error ); g_error_free(error); closesocket(new_socket); } } } while( (new_socket != INVALID_SOCKET || (new_socket == INVALID_SOCKET && errcode == INFD_TCP_SERVER_EINTR)) && (priv->socket != INVALID_SOCKET)); } g_object_unref(G_OBJECT(server)); } static void infd_tcp_server_init(GTypeInstance* instance, gpointer g_class) { InfdTcpServer* server; InfdTcpServerPrivate* priv; server = INFD_TCP_SERVER(instance); priv = INFD_TCP_SERVER_PRIVATE(server); priv->io = NULL; priv->socket = INVALID_SOCKET; priv->status = INFD_TCP_SERVER_CLOSED; priv->local_address = NULL; priv->local_port = 0; } static void infd_tcp_server_dispose(GObject* object) { InfdTcpServer* server; InfdTcpServerPrivate* priv; server = INFD_TCP_SERVER(object); priv = INFD_TCP_SERVER_PRIVATE(server); if(priv->status != INFD_TCP_SERVER_CLOSED) infd_tcp_server_close(server); if(priv->io != NULL) { g_object_unref(G_OBJECT(priv->io)); priv->io = NULL; } G_OBJECT_CLASS(parent_class)->dispose(object); } static void infd_tcp_server_finalize(GObject* object) { InfdTcpServer* server; InfdTcpServerPrivate* priv; server = INFD_TCP_SERVER(object); priv = INFD_TCP_SERVER_PRIVATE(server); if(priv->local_address != NULL) inf_ip_address_free(priv->local_address); G_OBJECT_CLASS(parent_class)->finalize(object); } static void infd_tcp_server_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec) { InfdTcpServer* server; InfdTcpServerPrivate* priv; server = INFD_TCP_SERVER(object); priv = INFD_TCP_SERVER_PRIVATE(server); switch(prop_id) { case PROP_IO: g_assert(priv->status == INFD_TCP_SERVER_CLOSED); if(priv->io != NULL) g_object_unref(G_OBJECT(priv->io)); priv->io = INF_IO(g_value_dup_object(value)); break; case PROP_LOCAL_ADDRESS: g_assert(priv->status == INFD_TCP_SERVER_CLOSED); if(priv->local_address != NULL) inf_ip_address_free(priv->local_address); priv->local_address = (InfIpAddress*)g_value_dup_boxed(value); break; case PROP_LOCAL_PORT: g_assert(priv->status == INFD_TCP_SERVER_CLOSED); priv->local_port = g_value_get_uint(value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void infd_tcp_server_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec) { InfdTcpServer* server; InfdTcpServerPrivate* priv; server = INFD_TCP_SERVER(object); priv = INFD_TCP_SERVER_PRIVATE(server); switch(prop_id) { case PROP_IO: g_value_set_object(value, G_OBJECT(priv->io)); break; case PROP_STATUS: g_value_set_enum(value, priv->status); break; case PROP_LOCAL_ADDRESS: g_value_set_static_boxed(value, priv->local_address); break; case PROP_LOCAL_PORT: g_value_set_uint(value, priv->local_port); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void infd_tcp_server_error(InfdTcpServer* server, GError* error) { InfdTcpServerPrivate* priv; priv = INFD_TCP_SERVER_PRIVATE(server); if(priv->status == INFD_TCP_SERVER_OPEN) { g_assert(priv->watch != NULL); inf_io_remove_watch(priv->io, priv->watch); priv->watch = NULL; } if(priv->socket != INVALID_SOCKET) { closesocket(priv->socket); priv->socket = INVALID_SOCKET; } if(priv->status != INFD_TCP_SERVER_CLOSED) { priv->status = INFD_TCP_SERVER_CLOSED; g_object_notify(G_OBJECT(server), "status"); } } static void infd_tcp_server_class_init(gpointer g_class, gpointer class_data) { GObjectClass* object_class; InfdTcpServerClass* tcp_server_class; object_class = G_OBJECT_CLASS(g_class); tcp_server_class = INFD_TCP_SERVER_CLASS(g_class); parent_class = G_OBJECT_CLASS(g_type_class_peek_parent(g_class)); g_type_class_add_private(g_class, sizeof(InfdTcpServerPrivate)); object_class->dispose = infd_tcp_server_dispose; object_class->finalize = infd_tcp_server_finalize; object_class->set_property = infd_tcp_server_set_property; object_class->get_property = infd_tcp_server_get_property; tcp_server_class->new_connection = NULL; tcp_server_class->error = infd_tcp_server_error; infd_tcp_server_error_quark = g_quark_from_static_string( "INFD_TCP_SERVER_ERROR" ); g_object_class_install_property( object_class, PROP_IO, g_param_spec_object( "io", "IO", "I/O handler", INF_TYPE_IO, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); g_object_class_install_property( object_class, PROP_STATUS, g_param_spec_enum( "status", "Status", "Status of the TCP server", INFD_TYPE_TCP_SERVER_STATUS, INFD_TCP_SERVER_CLOSED, G_PARAM_READABLE ) ); g_object_class_install_property( object_class, PROP_LOCAL_ADDRESS, g_param_spec_boxed( "local-address", "Local address", "Address to bind to", INF_TYPE_IP_ADDRESS, G_PARAM_READWRITE ) ); g_object_class_install_property( object_class, PROP_LOCAL_PORT, g_param_spec_uint( "local-port", "Local port", "Port to bind to", 0, 65535, 0, G_PARAM_READWRITE ) ); tcp_server_signals[NEW_CONNECTION] = g_signal_new( "new-connection", G_OBJECT_CLASS_TYPE(object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(InfdTcpServerClass, new_connection), NULL, NULL, inf_marshal_VOID__OBJECT, G_TYPE_NONE, 1, INF_TYPE_TCP_CONNECTION ); tcp_server_signals[ERROR_] = g_signal_new( "error", G_OBJECT_CLASS_TYPE(object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(InfdTcpServerClass, error), NULL, NULL, inf_marshal_VOID__POINTER, G_TYPE_NONE, 1, G_TYPE_POINTER /* actually a GError* */ ); } GType infd_tcp_server_status_get_type(void) { static GType tcp_server_status_type = 0; if(!tcp_server_status_type) { static const GEnumValue tcp_server_status_values[] = { { INFD_TCP_SERVER_CLOSED, "INFD_TCP_SERVER_CLOSED", "closed" }, { INFD_TCP_SERVER_OPEN, "INFD_TCP_SERVER_OPEN", "open" }, { 0, NULL, NULL } }; tcp_server_status_type = g_enum_register_static( "InfdTcpServerStatus", tcp_server_status_values ); } return tcp_server_status_type; } GType infd_tcp_server_get_type(void) { static GType tcp_server_type = 0; if(!tcp_server_type) { static const GTypeInfo tcp_server_type_info = { sizeof(InfdTcpServerClass), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ infd_tcp_server_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InfdTcpServer), /* instance_size */ 0, /* n_preallocs */ infd_tcp_server_init, /* instance_init */ NULL /* value_table */ }; tcp_server_type = g_type_register_static( G_TYPE_OBJECT, "InfdTcpServer", &tcp_server_type_info, 0 ); } return tcp_server_type; } /** * infd_tcp_server_bind: * @server: A #InfdTcpServer. * @error: Location to store error information, if any. * * Binds the server to the address and port given by the * #InfdTcpServer:local-address and #InfdTcpServer:local-port properties. If * the former is %NULL, it will bind on all interfaces on IPv4. If the latter * is 0, a random available port will be assigned. If the function fails, * %FALSE is returned and an error is set. * * @server must be in %INFD_TCP_SERVER_CLOSED state for this function to be * called. * * Returns: %TRUE on success, or %FALSE if an error occured. */ gboolean infd_tcp_server_bind(InfdTcpServer* server, GError** error) { InfdTcpServerPrivate* priv; union { struct sockaddr_in in; struct sockaddr_in6 in6; } native_address; struct sockaddr* addr; socklen_t addrlen; #if !defined(G_OS_WIN32) && defined(HAVE_SO_REUSEADDR) int value; #endif g_return_val_if_fail(INFD_IS_TCP_SERVER(server), FALSE); priv = INFD_TCP_SERVER_PRIVATE(server); g_return_val_if_fail(priv->status == INFD_TCP_SERVER_CLOSED, FALSE); if(priv->local_address == NULL) { priv->socket = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP); addr = (struct sockaddr*)&native_address.in; addrlen = sizeof(struct sockaddr_in); native_address.in.sin_addr.s_addr = INADDR_ANY; native_address.in.sin_family = AF_INET; native_address.in.sin_port = htons(priv->local_port); } else { switch(inf_ip_address_get_family(priv->local_address)) { case INF_IP_ADDRESS_IPV4: priv->socket = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP); addr = (struct sockaddr*)&native_address.in; addrlen = sizeof(struct sockaddr_in); memcpy( &native_address.in.sin_addr, inf_ip_address_get_raw(priv->local_address), sizeof(struct in_addr) ); native_address.in.sin_family = AF_INET; native_address.in.sin_port = htons(priv->local_port); break; case INF_IP_ADDRESS_IPV6: priv->socket = socket(PF_INET6, SOCK_STREAM, IPPROTO_TCP); addr = (struct sockaddr*)&native_address.in6; addrlen = sizeof(struct sockaddr_in6); memcpy( &native_address.in6.sin6_addr, inf_ip_address_get_raw(priv->local_address), sizeof(struct in6_addr) ); native_address.in6.sin6_family = AF_INET6; native_address.in6.sin6_port = htons(priv->local_port); native_address.in6.sin6_flowinfo = 0; native_address.in6.sin6_scope_id = 0; break; default: g_assert_not_reached(); break; } } if(priv->socket == INVALID_SOCKET) { infd_tcp_server_make_system_error(INFD_TCP_SERVER_LAST_ERROR, error); return FALSE; } #if !defined(G_OS_WIN32) && defined(HAVE_SO_REUSEADDR) /* Allow fast restarts of servers by enabling SO_REUSEADDR */ value = 1; if(setsockopt(priv->socket, SOL_SOCKET, SO_REUSEADDR, &value, sizeof(int)) == -1) { infd_tcp_server_make_system_error(INFD_TCP_SERVER_LAST_ERROR, error); closesocket(priv->socket); priv->socket = INVALID_SOCKET; return FALSE; } #endif if(bind(priv->socket, addr, addrlen) == -1) { infd_tcp_server_make_system_error(INFD_TCP_SERVER_LAST_ERROR, error); closesocket(priv->socket); priv->socket = INVALID_SOCKET; return FALSE; } g_object_freeze_notify(G_OBJECT(server)); /* Is assigned a few lines below, but notifications are frozen currently * anyway... this saves us a temporary variable here. */ if(priv->local_port == 0) g_object_notify(G_OBJECT(server), "local-port"); if(priv->local_address != NULL) { infd_tcp_server_addr_info( priv->socket, TRUE, NULL, &priv->local_port ); } else { infd_tcp_server_addr_info( priv->socket, TRUE, &priv->local_address, &priv->local_port ); g_object_notify(G_OBJECT(server), "local-address"); } g_object_notify(G_OBJECT(server), "local-port"); priv->status = INFD_TCP_SERVER_BOUND; g_object_notify(G_OBJECT(server), "status"); g_object_thaw_notify(G_OBJECT(server)); return TRUE; } /** * infd_tcp_server_open: * @server: A #InfdTcpServer. * @error: Location to store error information. * * Attempts to open @server. This means binding its local address and port * if not already (see infd_tcp_server_bind()) and accepting incoming * connections. * * @server needs to be in %INFD_TCP_SERVER_CLOSED or %INFD_TCP_SERVER_BOUND * status for this function to be called. If @server's status is * %INFD_TCP_SERVER_CLOSED, then infd_tcp_server_bind() is called before * actually opening the server. * * Returns: %TRUE on success, or %FALSE if an error occured. **/ gboolean infd_tcp_server_open(InfdTcpServer* server, GError** error) { InfdTcpServerPrivate* priv; gboolean was_bound; #ifdef G_OS_WIN32 u_long argp; #else int result; #endif g_return_val_if_fail(INFD_IS_TCP_SERVER(server), FALSE); priv = INFD_TCP_SERVER_PRIVATE(server); g_return_val_if_fail(priv->io != NULL, FALSE); g_return_val_if_fail(priv->status != INFD_TCP_SERVER_OPEN, FALSE); g_assert(priv->watch == NULL); g_object_freeze_notify(G_OBJECT(server)); was_bound = (priv->status != INFD_TCP_SERVER_CLOSED); if(!was_bound) { if(!infd_tcp_server_bind(server, error)) { g_object_thaw_notify(G_OBJECT(server)); return FALSE; } } #ifndef G_OS_WIN32 result = fcntl(priv->socket, F_GETFL); if(result == -1) { infd_tcp_server_make_system_error(INFD_TCP_SERVER_LAST_ERROR, error); if(!was_bound) infd_tcp_server_close(server); g_object_thaw_notify(G_OBJECT(server)); return FALSE; } if(fcntl(priv->socket, F_SETFL, result | O_NONBLOCK) == -1) { infd_tcp_server_make_system_error(INFD_TCP_SERVER_LAST_ERROR, error); if(!was_bound) infd_tcp_server_close(server); g_object_thaw_notify(G_OBJECT(server)); return FALSE; } #else argp = 1; if(ioctlsocket(priv->socket, FIONBIO, &argp) != 0) { infd_tcp_server_make_system_error(INFD_TCP_SERVER_LAST_ERROR, error); if(!was_bound) infd_tcp_server_close(server); g_object_thaw_notify(G_OBJECT(server)); return FALSE; } #endif if(listen(priv->socket, 5) == -1) { infd_tcp_server_make_system_error(INFD_TCP_SERVER_LAST_ERROR, error); if(!was_bound) infd_tcp_server_close(server); g_object_thaw_notify(G_OBJECT(server)); return FALSE; } priv->watch = inf_io_add_watch( priv->io, &priv->socket, INF_IO_INCOMING | INF_IO_ERROR, infd_tcp_server_io, server, NULL ); priv->status = INFD_TCP_SERVER_OPEN; g_object_notify(G_OBJECT(server), "status"); g_object_thaw_notify(G_OBJECT(server)); return TRUE; } /** * infd_tcp_server_close: * @server: A #InfdTcpServer. * * Closes a TCP server that is open or bound. **/ void infd_tcp_server_close(InfdTcpServer* server) { InfdTcpServerPrivate* priv; g_return_if_fail(INFD_IS_TCP_SERVER(server)); priv = INFD_TCP_SERVER_PRIVATE(server); g_return_if_fail(priv->status != INFD_TCP_SERVER_CLOSED); if(priv->status == INFD_TCP_SERVER_OPEN) { g_assert(priv->watch != NULL); inf_io_remove_watch(priv->io, priv->watch); priv->watch = NULL; } closesocket(priv->socket); priv->socket = INVALID_SOCKET; priv->status = INFD_TCP_SERVER_CLOSED; g_object_notify(G_OBJECT(server), "status"); } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/server/infd-server-pool.h0000644000175000017500000000566712264763732020206 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INFD_SERVER_POOL_H__ #define __INFD_SERVER_POOL_H__ #include #include #include #include #include G_BEGIN_DECLS #define INFD_TYPE_SERVER_POOL (infd_server_pool_get_type()) #define INFD_SERVER_POOL(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INFD_TYPE_SERVER_POOL, InfdServerPool)) #define INFD_SERVER_POOL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INFD_TYPE_SERVER_POOL, InfdServerPoolClass)) #define INFD_IS_SERVER_POOL(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INFD_TYPE_SERVER_POOL)) #define INFD_IS_SERVER_POOL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INFD_TYPE_SERVER_POOL)) #define INFD_SERVER_POOL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), INFD_TYPE_SERVER_POOL, InfdServerPoolClass)) typedef struct _InfdServerPool InfdServerPool; typedef struct _InfdServerPoolClass InfdServerPoolClass; struct _InfdServerPoolClass { GObjectClass parent_class; }; struct _InfdServerPool { GObject parent; }; typedef void(*InfdServerPoolForeachServerFunc)(InfdXmlServer* server, gpointer user_data); GType infd_server_pool_get_type(void) G_GNUC_CONST; InfdServerPool* infd_server_pool_new(InfdDirectory* directory); void infd_server_pool_add_server(InfdServerPool* server_pool, InfdXmlServer* server); void infd_server_pool_add_local_publisher(InfdServerPool* server_pool, InfdXmppServer* server, InfLocalPublisher* publisher); void infd_server_pool_remove_server(InfdServerPool* server_pool, InfdXmlServer* server); void infd_server_pool_foreach_server(InfdServerPool* server_pool, InfdServerPoolForeachServerFunc func, gpointer user_data); G_END_DECLS #endif /* __INFD_SERVER_POOL_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/server/infd-xmpp-server.c0000644000175000017500000005313212264763732020202 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include #include #include #include /* Some Windows header #defines ERROR for no good */ #ifdef G_OS_WIN32 # ifdef ERROR # undef ERROR # endif #endif typedef enum InfdXmppServerStatus_ { INFD_XMPP_SERVER_CLOSED, INFD_XMPP_SERVER_OPEN } InfdXmppServerStatus; typedef struct _InfdXmppServerPrivate InfdXmppServerPrivate; struct _InfdXmppServerPrivate { InfdTcpServer* tcp; InfdXmppServerStatus status; gchar* local_hostname; InfXmppConnectionSecurityPolicy security_policy; InfCertificateCredentials* tls_creds; InfSaslContext* sasl_context; InfSaslContext* sasl_own_context; gchar* sasl_mechanisms; }; enum { PROP_0, PROP_TCP, PROP_LOCAL_HOSTNAME, PROP_CREDENTIALS, PROP_SASL_CONTEXT, PROP_SASL_MECHANISMS, PROP_SECURITY_POLICY, /* Overridden from XML server */ PROP_STATUS }; enum { ERROR, LAST_SIGNAL }; #define INFD_XMPP_SERVER_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), INFD_TYPE_XMPP_SERVER, InfdXmppServerPrivate)) static GObjectClass* parent_class; static guint xmpp_server_signals[LAST_SIGNAL]; static void infd_xmpp_server_new_connection_cb(InfdTcpServer* tcp_server, InfTcpConnection* tcp_connection, gpointer user_data) { InfdXmppServer* xmpp_server; InfdXmppServerPrivate* priv; InfXmppConnection* xmpp_connection; InfIpAddress* addr; gchar* addr_str; xmpp_server = INFD_XMPP_SERVER(user_data); priv = INFD_XMPP_SERVER_PRIVATE(xmpp_server); /* TODO: We could perform a reverse DNS lookup to find the client hostname * here. */ g_object_get(G_OBJECT(tcp_connection), "remote-address", &addr, NULL); addr_str = inf_ip_address_to_string(addr); inf_ip_address_free(addr); xmpp_connection = inf_xmpp_connection_new( tcp_connection, INF_XMPP_CONNECTION_SERVER, priv->local_hostname, addr_str, priv->security_policy, priv->tls_creds, priv->sasl_context, priv->sasl_own_context != NULL ? "ANONYMOUS" : priv->sasl_mechanisms ); g_free(addr_str); /* We could, alternatively, keep the connection around until authentication * has completed and emit the new_connection signal after that, to guarantee * that the connection is open when new_connection is emitted. */ infd_xml_server_new_connection( INFD_XML_SERVER(xmpp_server), INF_XML_CONNECTION(xmpp_connection) ); g_object_unref(G_OBJECT(xmpp_connection)); } static void infd_xmpp_server_error_cb(InfdTcpServer* tcp_server, GError* error, gpointer user_data) { g_signal_emit( G_OBJECT(user_data), xmpp_server_signals[ERROR], 0, error ); } static void infd_xmpp_server_notify_status_cb(InfdTcpServer* tcp_server, GParamSpec* pspec, gpointer user_data) { InfdXmppServer* xmpp; InfdXmppServerPrivate* priv; InfdTcpServerStatus status; xmpp = INFD_XMPP_SERVER(user_data); priv = INFD_XMPP_SERVER_PRIVATE(xmpp); g_object_get(G_OBJECT(tcp_server), "status", &status, NULL); switch(status) { case INFD_TCP_SERVER_CLOSED: case INFD_TCP_SERVER_BOUND: if(priv->status != INFD_XMPP_SERVER_CLOSED) { priv->status = INFD_XMPP_SERVER_CLOSED; g_object_notify(G_OBJECT(xmpp), "status"); } break; case INFD_TCP_SERVER_OPEN: if(priv->status != INFD_XMPP_SERVER_OPEN) { priv->status = INFD_XMPP_SERVER_OPEN; g_object_notify(G_OBJECT(xmpp), "status"); } break; default: g_assert_not_reached(); break; } } static void infd_xmpp_server_sasl_cb(InfSaslContextSession* session, Gsasl_property property, gpointer session_data, gpointer user_data) { InfdXmppServer* xmpp; InfdXmppServerPrivate* priv; xmpp = INFD_XMPP_SERVER(user_data); priv = INFD_XMPP_SERVER_PRIVATE(xmpp); switch(property) { case GSASL_ANONYMOUS_TOKEN: inf_sasl_context_session_set_property( session, GSASL_ANONYMOUS_TOKEN, priv->local_hostname ); inf_sasl_context_session_continue(session, GSASL_OK); break; case GSASL_VALIDATE_ANONYMOUS: /* Authentaction always successful */ inf_sasl_context_session_continue(session, GSASL_OK); break; default: /* This is only used when using built-in SASL context, and this one * only supports anonymous authentication. */ g_assert_not_reached(); inf_sasl_context_session_continue(session, GSASL_NO_CALLBACK); break; } } /* Set own SASL context based on whether an external one is given or not */ static void infd_xmpp_server_setup_own_sasl_context(InfdXmppServer* xmpp) { InfdXmppServerPrivate* priv; priv = INFD_XMPP_SERVER_PRIVATE(xmpp); g_assert(priv->sasl_own_context == NULL); if(priv->sasl_context == NULL && priv->tcp != NULL) { /* Failure does not matter too much because every XMPP connection will * generate an own SASL context in this case, and error out if that * fails again. */ priv->sasl_own_context = inf_sasl_context_new(NULL); if(priv->sasl_own_context != NULL) { priv->sasl_context = priv->sasl_own_context; inf_sasl_context_ref(priv->sasl_context); inf_sasl_context_set_callback( priv->sasl_context, infd_xmpp_server_sasl_cb, xmpp ); g_object_notify(G_OBJECT(xmpp), "sasl-context"); } } } static void infd_xmpp_server_set_tcp(InfdXmppServer* xmpp, InfdTcpServer* tcp) { InfdXmppServerPrivate* priv; InfdTcpServerStatus tcp_status; priv = INFD_XMPP_SERVER_PRIVATE(xmpp); g_object_freeze_notify(G_OBJECT(xmpp)); if(priv->tcp != NULL) { g_object_get(G_OBJECT(priv->tcp), "status", &tcp_status, NULL); /* This will cause a notify that will adjust the XMPP status later */ if(tcp_status != INFD_TCP_SERVER_CLOSED) infd_tcp_server_close(priv->tcp); /* TODO: Make sure there are no connections with sasl_own_context out * there anymore because otherwise the SASL callback might access an * invalid InfdServer pointer once we get finalized. */ #if 0 if(priv->sasl_own_context != NULL) { inf_sasl_context_unref(priv->sasl_own_context); priv->sasl_own_context = NULL; } #endif inf_signal_handlers_disconnect_by_func( G_OBJECT(priv->tcp), G_CALLBACK(infd_xmpp_server_new_connection_cb), xmpp ); inf_signal_handlers_disconnect_by_func( G_OBJECT(priv->tcp), G_CALLBACK(infd_xmpp_server_error_cb), xmpp ); inf_signal_handlers_disconnect_by_func( G_OBJECT(priv->tcp), G_CALLBACK(infd_xmpp_server_notify_status_cb), xmpp ); g_object_unref(G_OBJECT(priv->tcp)); } priv->tcp = tcp; if(tcp != NULL) { g_object_ref(G_OBJECT(tcp)); g_signal_connect( G_OBJECT(tcp), "new-connection", G_CALLBACK(infd_xmpp_server_new_connection_cb), xmpp ); g_signal_connect( G_OBJECT(tcp), "error", G_CALLBACK(infd_xmpp_server_error_cb), xmpp ); g_signal_connect( G_OBJECT(tcp), "notify::status", G_CALLBACK(infd_xmpp_server_notify_status_cb), xmpp ); g_object_get(G_OBJECT(tcp), "status", &tcp_status, NULL); switch(tcp_status) { case INFD_TCP_SERVER_CLOSED: case INFD_TCP_SERVER_BOUND: g_assert(priv->status == INFD_XMPP_SERVER_CLOSED); break; case INFD_TCP_SERVER_OPEN: priv->status = INFD_XMPP_SERVER_OPEN; g_object_notify(G_OBJECT(xmpp), "status"); break; default: g_assert_not_reached(); break; } } infd_xmpp_server_setup_own_sasl_context(xmpp); g_object_thaw_notify(G_OBJECT(xmpp)); } static void infd_xmpp_server_init(GTypeInstance* instance, gpointer g_class) { InfdXmppServer* xmpp; InfdXmppServerPrivate* priv; xmpp = INFD_XMPP_SERVER(instance); priv = INFD_XMPP_SERVER_PRIVATE(xmpp); priv->tcp = NULL; priv->status = INFD_XMPP_SERVER_CLOSED; priv->local_hostname = g_strdup(g_get_host_name()); priv->security_policy = INF_XMPP_CONNECTION_SECURITY_ONLY_UNSECURED; priv->tls_creds = NULL; priv->sasl_context = NULL; priv->sasl_own_context = NULL; priv->sasl_mechanisms = NULL; } static GObject* infd_xmpp_server_constructor(GType type, guint n_construct_properties, GObjectConstructParam* construct_properties) { InfdXmppServerPrivate* priv; GObject* obj; obj = G_OBJECT_CLASS(parent_class)->constructor( type, n_construct_properties, construct_properties ); priv = INFD_XMPP_SERVER_PRIVATE(obj); g_assert(priv->tcp != NULL); g_assert( priv->security_policy == INF_XMPP_CONNECTION_SECURITY_ONLY_UNSECURED || priv->tls_creds != NULL ); return obj; } static void infd_xmpp_server_dispose(GObject* object) { InfdXmppServer* xmpp; InfdXmppServerPrivate* priv; xmpp = INFD_XMPP_SERVER(object); priv = INFD_XMPP_SERVER_PRIVATE(xmpp); if(priv->status != INFD_XMPP_SERVER_CLOSED) infd_xml_server_close(INFD_XML_SERVER(xmpp)); infd_xmpp_server_set_tcp(xmpp, NULL); if(priv->sasl_own_context != NULL) { inf_sasl_context_unref(priv->sasl_own_context); priv->sasl_own_context = NULL; } if(priv->sasl_context != NULL) { inf_sasl_context_unref(priv->sasl_context); priv->sasl_context = NULL; } if(priv->tls_creds != NULL) { inf_certificate_credentials_unref(priv->tls_creds); priv->tls_creds = NULL; } G_OBJECT_CLASS(parent_class)->dispose(object); } static void infd_xmpp_server_finalize(GObject* object) { InfdXmppServer* xmpp; InfdXmppServerPrivate* priv; xmpp = INFD_XMPP_SERVER(object); priv = INFD_XMPP_SERVER_PRIVATE(xmpp); g_free(priv->local_hostname); g_free(priv->sasl_mechanisms); G_OBJECT_CLASS(parent_class)->finalize(object); } static void infd_xmpp_server_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec) { InfdXmppServer* xmpp; InfdXmppServerPrivate* priv; xmpp = INFD_XMPP_SERVER(object); priv = INFD_XMPP_SERVER_PRIVATE(xmpp); switch(prop_id) { case PROP_TCP: infd_xmpp_server_set_tcp( xmpp, INFD_TCP_SERVER(g_value_get_object(value)) ); break; case PROP_LOCAL_HOSTNAME: g_free(priv->local_hostname); priv->local_hostname = g_value_dup_string(value); if(priv->local_hostname == NULL) priv->local_hostname = g_strdup(g_get_host_name()); break; case PROP_CREDENTIALS: if(priv->tls_creds != NULL) inf_certificate_credentials_unref(priv->tls_creds); priv->tls_creds = g_value_dup_boxed(value); break; case PROP_SASL_CONTEXT: if(priv->sasl_own_context != NULL) { inf_sasl_context_unref(priv->sasl_own_context); priv->sasl_own_context = NULL; } if(priv->sasl_context != NULL) inf_sasl_context_unref(priv->sasl_context); priv->sasl_context = g_value_dup_boxed(value); infd_xmpp_server_setup_own_sasl_context(xmpp); break; case PROP_SASL_MECHANISMS: g_free(priv->sasl_mechanisms); priv->sasl_mechanisms = g_value_dup_string(value); break; case PROP_SECURITY_POLICY: infd_xmpp_server_set_security_policy(xmpp, g_value_get_enum(value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void infd_xmpp_server_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec) { InfdXmppServer* xmpp; InfdXmppServerPrivate* priv; xmpp = INFD_XMPP_SERVER(object); priv = INFD_XMPP_SERVER_PRIVATE(xmpp); switch(prop_id) { case PROP_STATUS: switch(priv->status) { case INFD_XMPP_SERVER_CLOSED: g_value_set_enum(value, INFD_XML_SERVER_CLOSED); break; case INFD_XMPP_SERVER_OPEN: g_value_set_enum(value, INFD_XML_SERVER_OPEN); break; default: g_assert_not_reached(); break; } break; case PROP_TCP: g_value_set_object(value, priv->tcp); break; case PROP_LOCAL_HOSTNAME: g_value_set_string(value, priv->local_hostname); break; case PROP_CREDENTIALS: g_value_set_boxed(value, priv->tls_creds); break; case PROP_SASL_CONTEXT: g_value_set_boxed(value, priv->sasl_context); break; case PROP_SASL_MECHANISMS: g_value_set_string(value, priv->sasl_mechanisms); break; case PROP_SECURITY_POLICY: g_value_set_enum(value, priv->security_policy); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void infd_xmpp_server_xml_server_close(InfdXmlServer* xml) { InfdXmppServerPrivate* priv; priv = INFD_XMPP_SERVER_PRIVATE(xml); g_return_if_fail(priv->status != INFD_XMPP_SERVER_CLOSED); switch(priv->status) { case INFD_XMPP_SERVER_OPEN: /* This will cause a status notify that will adjust the XMPP status */ infd_tcp_server_close(priv->tcp); break; case INFD_XMPP_SERVER_CLOSED: default: g_assert_not_reached(); break; } } static void infd_xmpp_server_class_init(gpointer g_class, gpointer class_data) { GObjectClass* object_class; InfdXmppServerClass* xmpp_class; object_class = G_OBJECT_CLASS(g_class); xmpp_class = INFD_XMPP_SERVER_CLASS(g_class); parent_class = G_OBJECT_CLASS(g_type_class_peek_parent(g_class)); g_type_class_add_private(g_class, sizeof(InfdXmppServerPrivate)); object_class->constructor = infd_xmpp_server_constructor; object_class->dispose = infd_xmpp_server_dispose; object_class->finalize = infd_xmpp_server_finalize; object_class->set_property = infd_xmpp_server_set_property; object_class->get_property = infd_xmpp_server_get_property; xmpp_class->error = NULL; g_object_class_install_property( object_class, PROP_TCP, g_param_spec_object( "tcp-server", "TCP server", "Underlaying TCP server", INFD_TYPE_TCP_SERVER, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); g_object_class_install_property( object_class, PROP_LOCAL_HOSTNAME, g_param_spec_string( "local-hostname", "Local hostname", "Hostname of the server", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); g_object_class_install_property( object_class, PROP_CREDENTIALS, g_param_spec_boxed( "credentials", "Credentials", "The certificate credentials for GnuTLS", INF_TYPE_CERTIFICATE_CREDENTIALS, G_PARAM_READWRITE | G_PARAM_CONSTRUCT ) ); g_object_class_install_property( object_class, PROP_SASL_CONTEXT, g_param_spec_boxed( "sasl-context", "SASL context", "The SASL context used for authentaction", INF_TYPE_SASL_CONTEXT, G_PARAM_READWRITE | G_PARAM_CONSTRUCT ) ); g_object_class_install_property( object_class, PROP_SASL_MECHANISMS, g_param_spec_string( "sasl-mechanisms", "SASL mechanisms", "The SASL mechanisms offered to the client for authentication", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT ) ); g_object_class_install_property( object_class, PROP_SECURITY_POLICY, g_param_spec_enum( "security-policy", "Security policy", "Whether to offer or require TLS", INF_TYPE_XMPP_CONNECTION_SECURITY_POLICY, INF_XMPP_CONNECTION_SECURITY_ONLY_UNSECURED, G_PARAM_READWRITE | G_PARAM_CONSTRUCT ) ); g_object_class_override_property(object_class, PROP_STATUS, "status"); xmpp_server_signals[ERROR] = g_signal_new( "error", G_OBJECT_CLASS_TYPE(object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(InfdXmppServerClass, error), NULL, NULL, inf_marshal_VOID__POINTER, G_TYPE_NONE, 1, G_TYPE_POINTER /* actually a GError* */ ); } static void infd_xmpp_server_xml_server_init(gpointer g_iface, gpointer iface_data) { InfdXmlServerIface* iface; iface = (InfdXmlServerIface*)g_iface; iface->close = infd_xmpp_server_xml_server_close; } GType infd_xmpp_server_get_type(void) { static GType xmpp_server_type = 0; if(!xmpp_server_type) { static const GTypeInfo xmpp_server_type_info = { sizeof(InfdXmppServerClass), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ infd_xmpp_server_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InfdXmppServer), /* instance_size */ 0, /* n_preallocs */ infd_xmpp_server_init, /* instance_init */ NULL /* value_table */ }; static const GInterfaceInfo xml_server_info = { infd_xmpp_server_xml_server_init, NULL, NULL }; xmpp_server_type = g_type_register_static( G_TYPE_OBJECT, "InfdXmppServer", &xmpp_server_type_info, 0 ); g_type_add_interface_static( xmpp_server_type, INFD_TYPE_XML_SERVER, &xml_server_info ); } return xmpp_server_type; } /** * infd_xmpp_server_new: * @tcp: A #InfdTcpServer. * @policy: The initial security policy. * @creds: Certificate credentials used to secure any communication. * @sasl_context: A SASL context used for authentication. * @sasl_mechanisms: A whitespace-sparated list of SASL mechanisms. * * Creates a new #InfdXmppServer with @tcp as underlaying TCP server object. * No attempt is being made to open @tcp, if it is not already open. When a * new connection comes in, the XMPP server creates a XMPP connection that * may be used to communicate with the client. Note however that the * resulting connection will be in status OPENING until authentication has * completed. * * If @policy is %INF_XMPP_CONNECTION_SECURITY_ONLY_UNSECURED, then @creds may * be %NULL. If @creds is non-%NULL nevertheless, then it is possible to change * the security policy later using infd_xmpp_server_set_security_policy(). * @creds can also be changed later while the server is running. So just set * valid credentials before changing @policy to allow TLS. * * If @sasl_context is %NULL, the server uses a built-in context that only * supports ANONYMOUS authentication. If @sasl_context is not %NULL, then * @sasl_mechanisms specifies the mechanisms offered to clients. If * @sasl_mechanisms is %NULL, then all available mechanims will be offered. * If @sasl_context is %NULL, then this parameter is ignored. * * Return Value: A new #InfdXmppServer. **/ InfdXmppServer* infd_xmpp_server_new(InfdTcpServer* tcp, InfXmppConnectionSecurityPolicy policy, InfCertificateCredentials* creds, InfSaslContext* sasl_context, const gchar* sasl_mechanisms) { GObject* object; g_return_val_if_fail(INFD_IS_TCP_SERVER(tcp), NULL); g_return_val_if_fail( policy == INF_XMPP_CONNECTION_SECURITY_ONLY_UNSECURED || creds != NULL, NULL ); object = g_object_new( INFD_TYPE_XMPP_SERVER, "tcp-server", tcp, "credentials", creds, "security-policy", policy, "sasl-context", sasl_context, "sasl-mechanisms", sasl_mechanisms, NULL ); return INFD_XMPP_SERVER(object); } /** * infd_xmpp_server_set_security_policy: * @server: A #InfdXmppServer. * @policy: The new security policy. * * Sets the security policy for newly accepted #InfXmppConnections. * Does not already established connections. */ void infd_xmpp_server_set_security_policy(InfdXmppServer* server, InfXmppConnectionSecurityPolicy policy) { InfdXmppServerPrivate* priv; g_return_if_fail(INFD_IS_XMPP_SERVER(server)); priv = INFD_XMPP_SERVER_PRIVATE(server); if(policy != priv->security_policy) { g_return_if_fail( policy == INF_XMPP_CONNECTION_SECURITY_ONLY_UNSECURED || priv->tls_creds != NULL ); priv->security_policy = policy; g_object_notify(G_OBJECT(server), "security-policy"); } } /** * infd_xmpp_server_get_security_policy: * @server: A #InfdXmppServer. * * Returns the current security policy for newly accepted * #InfXmppConnections. * * Returns: The current security policy. */ InfXmppConnectionSecurityPolicy infd_xmpp_server_get_security_policy(InfdXmppServer* server) { g_return_val_if_fail( INFD_IS_XMPP_SERVER(server), INF_XMPP_CONNECTION_SECURITY_BOTH_PREFER_TLS ); return INFD_XMPP_SERVER_PRIVATE(server)->security_policy; } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/server/infd-storage.c0000644000175000017500000002006712264763732017357 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include GType infd_storage_node_type_get_type(void) { static GType storage_node_type_type = 0; if(!storage_node_type_type) { static const GEnumValue storage_node_type_values[] = { { INFD_STORAGE_NODE_SUBDIRECTORY, "INFD_STORAGE_NODE_SUBDIRECTORY", "subdirectory" }, { INFD_STORAGE_NODE_NOTE, "INFD_STORAGE_NODE_NOTE", "note" }, { 0, NULL, NULL } }; storage_node_type_type = g_enum_register_static( "InfdStorageNodeType", storage_node_type_values ); } return storage_node_type_type; } GType infd_storage_node_get_type(void) { static GType storage_node_type = 0; if(!storage_node_type) { storage_node_type = g_boxed_type_register_static( "InfdStorageNode", (GBoxedCopyFunc)infd_storage_node_copy, (GBoxedFreeFunc)infd_storage_node_free ); } return storage_node_type; } GType infd_storage_get_type(void) { static GType storage_type = 0; if(!storage_type) { static const GTypeInfo storage_info = { sizeof(InfdStorageIface), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ NULL, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ 0, /* instance_size */ 0, /* n_preallocs */ NULL, /* instance_init */ NULL /* value_table */ }; storage_type = g_type_register_static( G_TYPE_INTERFACE, "InfdStorage", &storage_info, 0 ); g_type_interface_add_prerequisite(storage_type, G_TYPE_OBJECT); } return storage_type; } /** * infd_storage_node_new_subdirectory: * @path: Path to the node. * * Creates a new #InfdStorageNode with type * %INFD_STORAGE_NODE_SUBDIRECTORY and the given path. This * is most likely only going to be used by #InfdStorage * implementations. * * Return Value: A new #InfdStorageNode. **/ InfdStorageNode* infd_storage_node_new_subdirectory(const gchar* path) { InfdStorageNode* node; g_return_val_if_fail(path != NULL, NULL); node = g_slice_new(InfdStorageNode); node->type = INFD_STORAGE_NODE_SUBDIRECTORY; node->name = g_strdup(path); return node; } /** * infd_storage_node_new_note: * @path: Path to the node. * @identifier: Identifier of the note type, for example 'InfText' for text * notes. * * Creates a new #InfdStorageNode with type * %INFD_STORAGE_NODE_NOTE and the given path and identifier. This * is most likely only going to be used by #InfdStorage * implementations. * * Return Value: A new #InfdStorageNode. **/ InfdStorageNode* infd_storage_node_new_note(const gchar* path, const gchar* identifier) { InfdStorageNode* node; g_return_val_if_fail(path != NULL, NULL); g_return_val_if_fail(identifier != NULL, NULL); node = g_slice_new(InfdStorageNode); node->type = INFD_STORAGE_NODE_NOTE; node->name = g_strdup(path); node->identifier = g_strdup(identifier); return node; } /** * infd_storage_node_copy: * @node: Node from which to make a copy. * * Creates a copy of a #InfdStorageNode object. * * Return Value: A copy of @node. **/ InfdStorageNode* infd_storage_node_copy(InfdStorageNode* node) { InfdStorageNode* new_node; g_return_val_if_fail(node != NULL, NULL); new_node = g_slice_new(InfdStorageNode); new_node->type = node->type; new_node->name = g_strdup(node->name); if(node->type == INFD_STORAGE_NODE_NOTE) new_node->identifier = g_strdup(node->identifier); return new_node; } /** * infd_storage_node_free: * @node: A #InfdStorageNode. * * Frees a #InfdStorageNode allocated with * infd_storage_node_new_subdirectory(), infd_storage_node_new_node() or * infd_storage_node_copy(). **/ void infd_storage_node_free(InfdStorageNode* node) { g_return_if_fail(node != NULL); g_free(node->name); if(node->type == INFD_STORAGE_NODE_NOTE) g_free(node->identifier); g_slice_free(InfdStorageNode, node); } /** * infd_storage_node_list_free: * @node_list: A list of #InfdStorageNode objects. * * Frees a singly-linked list of #InfdStorageNode as returned by * infd_storage_read_subdirectory(). **/ void infd_storage_node_list_free(GSList* node_list) { GSList* iter; GSList* next; for(iter = node_list; iter != NULL; iter = next) { next = g_slist_next(iter); infd_storage_node_free(iter->data); g_slist_free_1(iter); } } /** * infd_directory_read_subdirectory: * @storage: A #InfdStorage * @path: A path pointing to a subdirectory node. * @error: Location to store error information. * * Reads a subdirectory from the storage. Returns a list of * InfdStorageNode objects. Both the list and the objects need to * be freed by the caller via infd_directory_free_node_list(). * * Return Value: A #GSList that contains #InfdStorageNode objects, * or %NULL if either the subdirectory is empty or an * error occured. **/ GSList* infd_storage_read_subdirectory(InfdStorage* storage, const gchar* path, GError** error) { InfdStorageIface* iface; g_return_val_if_fail(INFD_IS_STORAGE(storage), NULL); g_return_val_if_fail(path != NULL, NULL); iface = INFD_STORAGE_GET_IFACE(storage); g_return_val_if_fail(iface->read_subdirectory != NULL, NULL); return iface->read_subdirectory(storage, path, error); } /** * infd_storage_create_subdirectory: * @storage: A #InfdStorage. * @path: A path pointing to non-existing node. * @error: Location to store error information. * * Creates a new subdirectory at the given path that is initially empty. * * Return Value: %TRUE on success. **/ gboolean infd_storage_create_subdirectory(InfdStorage* storage, const gchar* path, GError** error) { InfdStorageIface* iface; g_return_val_if_fail(INFD_IS_STORAGE(storage), FALSE); g_return_val_if_fail(path != NULL, FALSE); iface = INFD_STORAGE_GET_IFACE(storage); g_return_val_if_fail(iface->create_subdirectory != NULL, FALSE); return iface->create_subdirectory(storage, path, error); } /** * infd_storage_remove_node: * @storage: A #InfdStorage * @identifier: The type of the node to remove, or %NULL to remove a * subdirectory (TODO: This shouldn't be necessary). * @path: A path pointing to an existing node. * @error: Location to store error information. * * Removes the node at path from storage. If it is a subdirectory node, all * containing nodes and subdirectory nodes are removed recursively. * * Return Value: %TRUE on success. **/ gboolean infd_storage_remove_node(InfdStorage* storage, const gchar* identifier, const gchar* path, GError** error) { InfdStorageIface* iface; g_return_val_if_fail(INFD_IS_STORAGE(storage), FALSE); g_return_val_if_fail(path != NULL, FALSE); iface = INFD_STORAGE_GET_IFACE(storage); g_return_val_if_fail(iface->remove_node != NULL, FALSE); return iface->remove_node(storage, identifier, path, error); } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/server/infd-xml-server.c0000644000175000017500000001034412264763732020014 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include enum { NEW_CONNECTION, LAST_SIGNAL }; static guint server_signals[LAST_SIGNAL]; static void infd_xml_server_base_init(gpointer g_class) { static gboolean initialized = FALSE; if(!initialized) { server_signals[NEW_CONNECTION] = g_signal_new( "new-connection", INFD_TYPE_XML_SERVER, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(InfdXmlServerIface, new_connection), NULL, NULL, inf_marshal_VOID__OBJECT, G_TYPE_NONE, 1, INF_TYPE_XML_CONNECTION ); g_object_interface_install_property( g_class, g_param_spec_enum( "status", "XmlServer Status", "The status of the server", INFD_TYPE_XML_SERVER_STATUS, INFD_XML_SERVER_CLOSED, G_PARAM_READABLE ) ); initialized = TRUE; } } GType infd_xml_server_status_get_type(void) { static GType xml_server_status_type = 0; if(!xml_server_status_type) { static const GEnumValue xml_server_status_values[] = { { INFD_XML_SERVER_CLOSED, "INFD_XML_SERVER_CLOSED", "closed" }, { INFD_XML_SERVER_CLOSING, "INFD_XML_SERVER_CLOSING", "closing" }, { INFD_XML_SERVER_OPEN, "INFD_XML_SERVER_OPEN", "open" }, { INFD_XML_SERVER_OPENING, "INFD_XML_SERVER_OPENING", "opening" }, { 0, NULL, NULL } }; xml_server_status_type = g_enum_register_static( "InfdXmlServerStatus", xml_server_status_values ); } return xml_server_status_type; } GType infd_xml_server_get_type(void) { static GType xml_server_type = 0; if(!xml_server_type) { static const GTypeInfo xml_server_info = { sizeof(InfdXmlServerIface), /* class_size */ infd_xml_server_base_init, /* base_init */ NULL, /* base_finalize */ NULL, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ 0, /* instance_size */ 0, /* n_preallocs */ NULL, /* instance_init */ NULL /* value_table */ }; xml_server_type = g_type_register_static( G_TYPE_INTERFACE, "InfdXmlServer", &xml_server_info, 0 ); g_type_interface_add_prerequisite(xml_server_type, G_TYPE_OBJECT); } return xml_server_type; } /** * infd_xml_server_close: * @server: A #InfdXmlServer. * * Closes @server. **/ void infd_xml_server_close(InfdXmlServer* server) { InfdXmlServerIface* iface; g_return_if_fail(INFD_IS_XML_SERVER(server)); iface = INFD_XML_SERVER_GET_IFACE(server); g_return_if_fail(iface->close); iface->close(server); } /** * infd_xml_server_new_connection: * @server: A #InfdXmlServer. * @connection: A #InfXmlConnection. * * Emits the "new-connection" signal on @server. **/ void infd_xml_server_new_connection(InfdXmlServer* server, InfXmlConnection* connection) { g_return_if_fail(INFD_IS_XML_SERVER(server)); g_return_if_fail(INF_IS_XML_CONNECTION(connection)); g_signal_emit( G_OBJECT(server), server_signals[NEW_CONNECTION], 0, connection ); } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/server/infd-server-pool.c0000644000175000017500000004010112264763732020157 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include typedef enum _InfdServerPoolPublisherType { INFD_SERVER_POOL_PUBLISHER_LOCAL } InfdServerPoolPublisherType; typedef struct _InfdServerPoolPublisher InfdServerPoolPublisher; struct _InfdServerPoolPublisher { InfdServerPoolPublisherType type; union { struct { InfLocalPublisher* publisher; InfLocalPublisherItem* item; } local; } shared; }; typedef struct _InfdServerPoolEntry InfdServerPoolEntry; struct _InfdServerPoolEntry { InfdXmlServer* server; GSList* publishers; }; typedef struct _InfdServerPoolPrivate InfdServerPoolPrivate; struct _InfdServerPoolPrivate { InfdDirectory* directory; GHashTable* servers; /* server -> entry */ }; enum { PROP_0, PROP_DIRECTORY }; #define INFD_SERVER_POOL_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), INFD_TYPE_SERVER_POOL, InfdServerPoolPrivate)) static GObjectClass* parent_class; static const gchar* infd_server_pool_get_local_service_name(void) { /* TODO: It would be nice to have the host name as service name for * dedicated servers and user name otherwise. This should maybe be a * property. */ const gchar* name; name = g_get_real_name(); if(name == NULL || g_ascii_strcasecmp(name, "unknown") == 0) name = g_get_user_name(); return name; } static void infd_server_pool_entry_publish_with(InfdServerPoolEntry* entry, InfdServerPoolPublisher* publisher) { InfdTcpServer* tcp; guint port; switch(publisher->type) { case INFD_SERVER_POOL_PUBLISHER_LOCAL: g_assert(INFD_IS_XMPP_SERVER(entry->server)); if(publisher->shared.local.item == NULL) { g_object_get(G_OBJECT(entry->server), "tcp-server", &tcp, NULL); g_object_get(G_OBJECT(tcp), "local-port", &port, NULL); g_object_unref(G_OBJECT(tcp)); publisher->shared.local.item = inf_local_publisher_publish( publisher->shared.local.publisher, "_infinote._tcp", infd_server_pool_get_local_service_name(), port ); } break; default: g_assert_not_reached(); break; } } static void infd_server_pool_entry_unpublish_with(InfdServerPoolEntry* entry, InfdServerPoolPublisher* publisher) { switch(publisher->type) { case INFD_SERVER_POOL_PUBLISHER_LOCAL: if(publisher->shared.local.item != NULL) { inf_local_publisher_unpublish( publisher->shared.local.publisher, publisher->shared.local.item ); publisher->shared.local.item = NULL; } break; default: g_assert_not_reached(); break; } } static void infd_server_pool_entry_publish(InfdServerPoolEntry* entry) { GSList* item; for(item = entry->publishers; item != NULL; item = g_slist_next(item)) { infd_server_pool_entry_publish_with( entry, (InfdServerPoolPublisher*)item->data ); } } static void infd_server_pool_entry_unpublish(InfdServerPoolEntry* entry) { GSList* item; for(item = entry->publishers; item != NULL; item = g_slist_next(item)) { infd_server_pool_entry_unpublish_with( entry, (InfdServerPoolPublisher*)item->data ); } } static void infd_server_pool_notify_status_cb(InfdXmlServer* server, GParamSpec* pspec, gpointer user_data) { InfdServerPool* server_pool; InfdServerPoolPrivate* priv; InfdServerPoolEntry* entry; InfdXmlServerStatus status; server_pool = INFD_SERVER_POOL(user_data); priv = INFD_SERVER_POOL_PRIVATE(server_pool); entry = (InfdServerPoolEntry*)g_hash_table_lookup(priv->servers, server); g_assert(entry != NULL); g_object_get(G_OBJECT(server), "status", &status, NULL); if(status == INFD_XML_SERVER_OPEN) infd_server_pool_entry_publish(entry); else infd_server_pool_entry_unpublish(entry); } static void infd_server_pool_new_connection_cb(InfdXmlServer* server, InfXmlConnection* connection, gpointer user_data) { InfdServerPool* server_pool; InfdServerPoolPrivate* priv; server_pool = INFD_SERVER_POOL(user_data); priv = INFD_SERVER_POOL_PRIVATE(server_pool); /* If the addition fails, then the directory does not ref the connection and * it will be unrefed (and therefore be closed) right after this function * terminates. */ if(priv->directory != NULL) infd_directory_add_connection(priv->directory, connection); } static void infd_server_pool_entry_free(InfdServerPool* server_pool, InfdServerPoolEntry* entry) { GSList* item; InfdServerPoolPublisher* publisher; inf_signal_handlers_disconnect_by_func( G_OBJECT(entry->server), G_CALLBACK(infd_server_pool_notify_status_cb), server_pool ); inf_signal_handlers_disconnect_by_func( G_OBJECT(entry->server), G_CALLBACK(infd_server_pool_new_connection_cb), server_pool ); for(item = entry->publishers; item != NULL; item = g_slist_next(item)) { publisher = (InfdServerPoolPublisher*)item->data; switch(publisher->type) { case INFD_SERVER_POOL_PUBLISHER_LOCAL: infd_server_pool_entry_unpublish_with(entry, publisher); g_object_unref(G_OBJECT(publisher->shared.local.publisher)); break; default: g_assert_not_reached(); break; } g_slice_free(InfdServerPoolPublisher, publisher); } g_slist_free(entry->publishers); g_slice_free(InfdServerPoolEntry, entry); } static void infd_server_pool_init(GTypeInstance* instance, gpointer g_class) { InfdServerPool* server_pool; InfdServerPoolPrivate* priv; server_pool = INFD_SERVER_POOL(instance); priv = INFD_SERVER_POOL_PRIVATE(server_pool); priv->directory = NULL; /* We don't set a value destroy func but rather make sure we free the * InfdServerPoolEntrys ourselves before removing them from the hashtable. * This is because the GDestroyNotify doesn't allow a user_data parameter * and therefore doesn't know the InfdServerPool from which the entry is * removed, but it is required to correctly disconnect the signals from * the InfXmlServer. */ priv->servers = g_hash_table_new(NULL, NULL); } static void infd_server_pool_dispose_foreach_func(gpointer key, gpointer value, gpointer user_data) { infd_server_pool_entry_free( INFD_SERVER_POOL(user_data), (InfdServerPoolEntry*)value ); } static void infd_server_pool_dispose(GObject* object) { InfdServerPool* server_pool; InfdServerPoolPrivate* priv; server_pool = INFD_SERVER_POOL(object); priv = INFD_SERVER_POOL_PRIVATE(server_pool); g_hash_table_foreach( priv->servers, infd_server_pool_dispose_foreach_func, server_pool ); g_hash_table_remove_all(priv->servers); if(priv->directory != NULL) { g_object_unref(G_OBJECT(priv->directory)); priv->directory = NULL; } G_OBJECT_CLASS(parent_class)->dispose(object); } static void infd_server_pool_finalize(GObject* object) { InfdServerPool* server_pool; InfdServerPoolPrivate* priv; server_pool = INFD_SERVER_POOL(object); priv = INFD_SERVER_POOL_PRIVATE(server_pool); /* Should have been cleared in dispose */ g_assert(g_hash_table_size(priv->servers) == 0); g_hash_table_destroy(priv->servers); G_OBJECT_CLASS(parent_class)->finalize(object); } static void infd_server_pool_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec) { InfdServerPool* server_pool; InfdServerPoolPrivate* priv; server_pool = INFD_SERVER_POOL(object); priv = INFD_SERVER_POOL_PRIVATE(server_pool); switch(prop_id) { case PROP_DIRECTORY: g_assert(priv->directory == NULL); /* construct only */ priv->directory = INFD_DIRECTORY(g_value_dup_object(value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void infd_server_pool_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec) { InfdServerPool* server_pool; InfdServerPoolPrivate* priv; server_pool = INFD_SERVER_POOL(object); priv = INFD_SERVER_POOL_PRIVATE(server_pool); switch(prop_id) { case PROP_DIRECTORY: g_value_set_object(value, G_OBJECT(priv->directory)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void infd_server_pool_class_init(gpointer g_class, gpointer class_data) { GObjectClass* object_class; object_class = G_OBJECT_CLASS(g_class); parent_class = G_OBJECT_CLASS(g_type_class_peek_parent(g_class)); g_type_class_add_private(g_class, sizeof(InfdServerPoolPrivate)); object_class->dispose = infd_server_pool_dispose; object_class->finalize = infd_server_pool_finalize; object_class->set_property = infd_server_pool_set_property; object_class->get_property = infd_server_pool_get_property; g_object_class_install_property( object_class, PROP_DIRECTORY, g_param_spec_object( "directory", "Directory", "The directory to which to register incoming connections to", INFD_TYPE_DIRECTORY, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); } GType infd_server_pool_get_type(void) { static GType server_pool_type = 0; if(!server_pool_type) { static const GTypeInfo server_pool_type_info = { sizeof(InfdServerPoolClass), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ infd_server_pool_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InfdServerPool), /* instance_size */ 0, /* n_preallocs */ infd_server_pool_init, /* instance_init */ NULL /* value_table */ }; server_pool_type = g_type_register_static( G_TYPE_OBJECT, "InfdServerPool", &server_pool_type_info, 0 ); } return server_pool_type; } /** * infd_server_pool_new: * @directory: A #InfdDirectory to which to add incoming connections. * * Creates a new #InfdServerPool. * * Return Value: A new #InfdServerPool. */ InfdServerPool* infd_server_pool_new(InfdDirectory* directory) { GObject* object; g_return_val_if_fail(INFD_IS_DIRECTORY(directory), NULL); object = g_object_new( INFD_TYPE_SERVER_POOL, "directory", directory, NULL ); return INFD_SERVER_POOL(object); } /** * infd_server_pool_add_server: * @server_pool: A #InfdServerPool. * @server: A #InfdXmlServer. * * Adds @server to @server_pool. The server pool accepts incoming connections * and gives them to its directory which processes incoming requests. */ void infd_server_pool_add_server(InfdServerPool* server_pool, InfdXmlServer* server) { InfdServerPoolPrivate* priv; InfdServerPoolEntry* entry; g_return_if_fail(INFD_IS_SERVER_POOL(server_pool)); g_return_if_fail(INFD_IS_XML_SERVER(server)); priv = INFD_SERVER_POOL_PRIVATE(server_pool); g_return_if_fail(g_hash_table_lookup(priv->servers, server) == NULL); g_signal_connect_after( G_OBJECT(server), "notify::status", G_CALLBACK(infd_server_pool_notify_status_cb), server_pool ); g_signal_connect_after( G_OBJECT(server), "new-connection", G_CALLBACK(infd_server_pool_new_connection_cb), server_pool ); entry = g_slice_new(InfdServerPoolEntry); entry->server = server; entry->publishers = NULL; g_hash_table_insert(priv->servers, server, entry); g_object_ref(G_OBJECT(server)); } /** * inf_server_pool_add_local_publisher: * @server_pool: A #InfdServerPool. * @server: A #InfdXmppServer added to @server_pool. * @publisher: A #InfLocalPublisher. * * Publishes a service offered by @server on the local network via * @publisher. This can safely be called when @server is not yet open. The * service will be published as soon as the server opens. */ /* TODO: Make a InfdLocalServer interface to query the port? */ void infd_server_pool_add_local_publisher(InfdServerPool* server_pool, InfdXmppServer* server, InfLocalPublisher* publisher) { InfdServerPoolPrivate* priv; InfdServerPoolEntry* entry; InfdServerPoolPublisher* server_pool_publisher; InfdXmlServerStatus status; g_return_if_fail(INFD_IS_SERVER_POOL(server_pool)); g_return_if_fail(INFD_IS_XMPP_SERVER(server)); g_return_if_fail(INF_IS_LOCAL_PUBLISHER(publisher)); priv = INFD_SERVER_POOL_PRIVATE(server_pool); entry = (InfdServerPoolEntry*)g_hash_table_lookup(priv->servers, server); g_return_if_fail(entry != NULL); /* TODO: Bail if we are already publishing via this publisher */ /* TODO: Only announce on the address family server is listening on. * Otherwise we might announce the service on ipv6 without anyone * listening there. */ server_pool_publisher = g_slice_new(InfdServerPoolPublisher); server_pool_publisher->type = INFD_SERVER_POOL_PUBLISHER_LOCAL; server_pool_publisher->shared.local.publisher = publisher; server_pool_publisher->shared.local.item = NULL; g_object_ref(G_OBJECT(publisher)); entry->publishers = g_slist_prepend( entry->publishers, server_pool_publisher ); /* Initial publish when server is open */ g_object_get(G_OBJECT(server), "status", &status, NULL); if(status == INFD_XML_SERVER_OPEN) infd_server_pool_entry_publish_with(entry, server_pool_publisher); } /** * infd_server_pool_remove_server: * @server_pool: A #InfdServerPool. * @server: A #InfdXmlServer which was previously added to @server_pool. * * Removed @server from @servor_pool. If @server was published via * some publishers then it will be unpublished automatically. */ void infd_server_pool_remove_server(InfdServerPool* server_pool, InfdXmlServer* server) { InfdServerPoolPrivate* priv; InfdServerPoolEntry* entry; g_return_if_fail(INFD_IS_SERVER_POOL(server_pool)); g_return_if_fail(INFD_IS_XML_SERVER(server)); priv = INFD_SERVER_POOL_PRIVATE(server_pool); entry = (InfdServerPoolEntry*)g_hash_table_lookup(priv->servers, server); g_return_if_fail(entry != NULL); infd_server_pool_entry_free(server_pool, entry); g_hash_table_remove(priv->servers, server); } /** * infd_server_pool_foreach_server: * @server_pool: A #InfdServerPool. * @func: The function to be called for each server. * @user_data: Additional data to pass to @func. * * Calls @func for each server in pool registered with * infd_server_pool_add_server(). */ void infd_server_pool_foreach_server(InfdServerPool* server_pool, InfdServerPoolForeachServerFunc func, gpointer user_data) { InfdServerPoolPrivate* priv; GHashTableIter iter; gpointer value; priv = INFD_SERVER_POOL_PRIVATE(server_pool); g_hash_table_iter_init(&iter, priv->servers); while(g_hash_table_iter_next(&iter, NULL, &value)) func( ((InfdServerPoolEntry*)value)->server, user_data); } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/server/infd-filesystem-storage.c0000644000175000017500000005025312264763732021541 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include "config.h" #include #include #include #include #include #include #ifdef G_OS_WIN32 # include #else # include # include # include # include # include #endif typedef struct _InfdFilesystemStoragePrivate InfdFilesystemStoragePrivate; struct _InfdFilesystemStoragePrivate { gchar* root_directory; }; enum { PROP_0, PROP_ROOT_DIRECTORY }; #define INFD_FILESYSTEM_STORAGE_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), INFD_TYPE_FILESYSTEM_STORAGE, InfdFilesystemStoragePrivate)) static GObjectClass* parent_class; static GQuark infd_filesystem_storage_error_quark; static GQuark infd_filesystem_storage_system_error_quark; /* Checks whether path is valid, and sets error if not */ static gboolean infd_filesystem_storage_verify_path(const gchar* path, GError** error) { gchar** components; gchar** component; components = g_strsplit(path, "/", 0); for(component = components; *component != NULL; ++ component) { if(*component == '\0' || strcmp(*component, ".") == 0 || strcmp(*component, "..") == 0) { g_set_error( error, infd_filesystem_storage_error_quark, INFD_FILESYSTEM_STORAGE_ERROR_INVALID_PATH, "%s", _("The path contains invalid components") ); g_strfreev(components); return FALSE; } } g_strfreev(components); return TRUE; } static void infd_filesystem_storage_set_root_directory(InfdFilesystemStorage* storage, const gchar* root_directory) { InfdFilesystemStoragePrivate* priv; gchar* converted; GError* error; int ret; priv = INFD_FILESYSTEM_STORAGE_PRIVATE(storage); error = NULL; converted = g_filename_from_utf8(root_directory, -1, NULL, NULL, &error); /* TODO: We should somehow report at least this error further upwards */ if(converted == NULL) { g_warning( _("Failed to convert root directory to filename encoding: %s"), error->message ); g_error_free(error); } else { ret = g_mkdir_with_parents(converted, 0755); if(ret == -1) { g_warning( _("Failed to create root directory: %s\n" "Subsequent storage operations will most likely fail\n"), strerror(errno) ); } g_free(priv->root_directory); priv->root_directory = converted; } } static void infd_filesystem_storage_system_error(int code, GError** error) { /* TODO_Win32: Use FormatMessage or something on Win32, * or probably better g_win32_error_message(). */ /* TODO: Actually we should get away from including system error codes * in these errors, as they get eventually sent over the net */ g_set_error( error, infd_filesystem_storage_system_error_quark, code, "%s", strerror(code) ); } static gboolean infd_filesystem_storage_remove_rec(const gchar* path, GError** error) { #ifdef G_OS_WIN32 SHFILEOPSTRUCTW op; gunichar2* from; glong len; gboolean result; int error_code; from = g_utf8_to_utf16(path, -1, NULL, &len, error); if(!from) return FALSE; from = g_realloc(from, (len+2)*sizeof(gunichar2)); from[len+1] = L'\0'; op.hwnd = NULL; op.wFunc = FO_DELETE; op.pFrom = from; op.pTo = NULL; op.fFlags = FOF_SILENT | FOF_NOERRORUI | FOF_NOCONFIRMATION; op.fAnyOperationsAborted = 0; op.hNameMappings = NULL; op.lpszProgressTitle = NULL; result = TRUE; error_code = SHFileOperationW(&op); if(error_code != 0 || op.fAnyOperationsAborted != 0) { g_set_error( error, infd_filesystem_storage_error_quark, INFD_FILESYSTEM_STORAGE_ERROR_REMOVE_FILES, "Failed to remove files from disk" ); result = FALSE; } g_free(from); return result; #else /* TODO: Use the REMOVE_FILES error code when something fails below */ GDir* dir; const gchar* name; gchar* child; int ret; ret = g_unlink(path); if(ret == -1) { if(errno == EISDIR || errno == EPERM) { dir = g_dir_open(path, 0, error); if(dir == NULL) return FALSE; for(name = g_dir_read_name(dir); name != NULL; name = g_dir_read_name(dir)) { child = g_build_filename(path, name, NULL); if(infd_filesystem_storage_remove_rec(child, error) == FALSE) { g_free(child); return FALSE; } g_free(child); } g_dir_close(dir); ret = g_rmdir(path); if(ret == -1) { infd_filesystem_storage_system_error(errno, error); return FALSE; } } else { infd_filesystem_storage_system_error(errno, error); return FALSE; } } return TRUE; #endif } static void infd_filesystem_storage_init(GTypeInstance* instance, gpointer g_class) { InfdFilesystemStorage* storage; InfdFilesystemStoragePrivate* priv; storage = INFD_FILESYSTEM_STORAGE(instance); priv = INFD_FILESYSTEM_STORAGE_PRIVATE(storage); priv->root_directory = NULL; } static void infd_filesystem_storage_finalize(GObject* object) { InfdFilesystemStorage* storage; InfdFilesystemStoragePrivate* priv; storage = INFD_FILESYSTEM_STORAGE(object); priv = INFD_FILESYSTEM_STORAGE_PRIVATE(storage); g_free(priv->root_directory); G_OBJECT_CLASS(parent_class)->finalize(object); } static void infd_filesystem_storage_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec) { InfdFilesystemStorage* storage; InfdFilesystemStoragePrivate* priv; storage = INFD_FILESYSTEM_STORAGE(object); priv = INFD_FILESYSTEM_STORAGE_PRIVATE(storage); switch(prop_id) { case PROP_ROOT_DIRECTORY: infd_filesystem_storage_set_root_directory( storage, g_value_get_string(value) ); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static void infd_filesystem_storage_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec) { InfdFilesystemStorage* storage; InfdFilesystemStoragePrivate* priv; storage = INFD_FILESYSTEM_STORAGE(object); priv = INFD_FILESYSTEM_STORAGE_PRIVATE(storage); switch(prop_id) { case PROP_ROOT_DIRECTORY: g_value_set_string(value, priv->root_directory); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; } } static GSList* infd_filesystem_storage_storage_read_subdirectory(InfdStorage* storage, const gchar* path, GError** error) { InfdFilesystemStorage* fs_storage; InfdFilesystemStoragePrivate* priv; GSList* list; #if !defined(G_OS_WIN32) && !defined(__APPLE__) int dir_fd; DIR* dir; struct dirent* dir_entry; struct dirent* dir_result; struct stat stat_buf; int saved_errno; enum { F_UNKNOWN, F_DIR, F_REG, F_LNK } filetype; #else GDir* dir; const gchar* name; #endif gchar* converted_name; gchar* full_name; gchar* file_path; gchar* separator; gsize name_len; fs_storage = INFD_FILESYSTEM_STORAGE(storage); priv = INFD_FILESYSTEM_STORAGE_PRIVATE(fs_storage); if(infd_filesystem_storage_verify_path(path, error) == FALSE) return NULL; converted_name = g_filename_from_utf8(path, -1, NULL, NULL, error); if(converted_name == NULL) return NULL; full_name = g_build_filename(priv->root_directory, converted_name, NULL); g_free(converted_name); list = NULL; #if !defined(G_OS_WIN32) && !defined(__APPLE__) dir_fd = open(full_name, O_NOFOLLOW | O_RDONLY); if(dir_fd == -1 || (dir = fdopendir(dir_fd)) == NULL) { infd_filesystem_storage_system_error(errno, error); if(dir_fd != -1) close(dir_fd); g_free(full_name); return NULL; } dir_entry = g_malloc(offsetof(struct dirent, d_name) + fpathconf(dir_fd, _PC_NAME_MAX) + 1); for(saved_errno = readdir_r(dir, dir_entry, &dir_result); saved_errno == 0 && dir_result != NULL; saved_errno = readdir_r(dir, dir_entry, &dir_result)) { converted_name = g_filename_to_utf8(dir_result->d_name, -1, NULL, &name_len, NULL); if(converted_name != NULL && strcmp(converted_name, ".") != 0 && strcmp(converted_name, "..") != 0) { filetype = F_UNKNOWN; #ifdef HAVE_D_TYPE if(dir_result->d_type == DT_LNK) filetype = F_LNK; else if(dir_result->d_type == DT_DIR) filetype = F_DIR; else if(dir_result->d_type == DT_REG) filetype = F_REG; else if(dir_result->d_type == DT_UNKNOWN) #endif { /* Some filesystems, such as reiserfs, don't support reporting the * entry's file type. In that case we do an additional lstat here. * Also lstat if d_type is not available on this platform. */ file_path = g_build_filename(full_name, dir_result->d_name, NULL); if(lstat(file_path, &stat_buf) == 0) { if(S_ISDIR(stat_buf.st_mode)) filetype = F_DIR; else if(S_ISREG(stat_buf.st_mode)) filetype = F_REG; else if(S_ISLNK(stat_buf.st_mode)) filetype = F_LNK; } g_free(file_path); } if(filetype != F_LNK && filetype != F_UNKNOWN) { if(filetype == F_DIR) { list = g_slist_prepend( list, infd_storage_node_new_subdirectory(converted_name) ); } else if(filetype == F_REG) { /* The note type identifier is behind the last '.' */ separator = g_strrstr_len(converted_name, name_len, "."); if(separator != NULL) { *separator = '\0'; list = g_slist_prepend( list, infd_storage_node_new_note(converted_name, separator + 1) ); } } } } g_free(converted_name); } g_free(dir_entry); if(closedir(dir) == -1) { infd_filesystem_storage_system_error(errno, error); infd_storage_node_list_free(list); g_free(full_name); return NULL; } if(saved_errno != 0) { infd_filesystem_storage_system_error(saved_errno, error); infd_storage_node_list_free(list); g_free(full_name); return NULL; } #else dir = g_dir_open(full_name, 0, error); if(dir == NULL) return NULL; for(name = g_dir_read_name(dir); name != NULL; name = g_dir_read_name(dir)) { converted_name = g_filename_to_utf8(name, -1, NULL, &name_len, NULL); if(converted_name != NULL) { file_path = g_build_filename(full_name, name, NULL); if(g_file_test(file_path, G_FILE_TEST_IS_DIR)) { list = g_slist_prepend( list, infd_storage_node_new_subdirectory(converted_name) ); } else if(g_file_test(file_path, G_FILE_TEST_IS_REGULAR)) { /* The note type identifier is behind the last '.' */ separator = g_strrstr_len(converted_name, name_len, "."); if(separator != NULL) { *separator = '\0'; list = g_slist_prepend( list, infd_storage_node_new_note(converted_name, separator + 1) ); } } g_free(converted_name); g_free(file_path); } } g_dir_close(dir); #endif g_free(full_name); return list; } static gboolean infd_filesystem_storage_storage_create_subdirectory(InfdStorage* storage, const gchar* path, GError** error) { InfdFilesystemStorage* fs_storage; InfdFilesystemStoragePrivate* priv; gchar* converted_name; gchar* full_name; int ret; int save_errno; fs_storage = INFD_FILESYSTEM_STORAGE(storage); priv = INFD_FILESYSTEM_STORAGE_PRIVATE(fs_storage); if(infd_filesystem_storage_verify_path(path, error) == FALSE) return FALSE; converted_name = g_filename_from_utf8(path, -1, NULL, NULL, error); if(converted_name == NULL) return FALSE; full_name = g_build_filename(priv->root_directory, converted_name, NULL); g_free(converted_name); ret = g_mkdir(full_name, 0755); save_errno = errno; g_free(full_name); if(ret == -1) { infd_filesystem_storage_system_error(save_errno, error); return FALSE; } return TRUE; } static gboolean infd_filesystem_storage_storage_remove_node(InfdStorage* storage, const gchar* identifier, const gchar* path, GError** error) { InfdFilesystemStorage* fs_storage; InfdFilesystemStoragePrivate* priv; gchar* converted_name; gchar* disk_name; gchar* full_name; #ifdef G_OS_WIN32 gchar* sep; #endif gboolean ret; fs_storage = INFD_FILESYSTEM_STORAGE(storage); priv = INFD_FILESYSTEM_STORAGE_PRIVATE(fs_storage); if(infd_filesystem_storage_verify_path(path, error) == FALSE) return FALSE; converted_name = g_filename_from_utf8(path, -1, NULL, NULL, error); if(converted_name == NULL) return FALSE; #ifdef G_OS_WIN32 /* This is required for SHFileOperation. Maybe we should do it at a central * place also for the other file operations... */ for(sep = converted_name; *sep != '\0'; ++sep) if(*sep == '/') *sep = '\\'; #endif if(identifier != NULL) { disk_name = g_strconcat(converted_name, ".", identifier, NULL); g_free(converted_name); } else { disk_name = converted_name; } full_name = g_build_filename(priv->root_directory, disk_name, NULL); g_free(disk_name); ret = infd_filesystem_storage_remove_rec(full_name, error); g_free(full_name); return ret; } static void infd_filesystem_storage_class_init(gpointer g_class, gpointer class_data) { GObjectClass* object_class; InfdFilesystemStorageClass* filesystem_storage_class; object_class = G_OBJECT_CLASS(g_class); filesystem_storage_class = INFD_FILESYSTEM_STORAGE_CLASS(g_class); parent_class = G_OBJECT_CLASS(g_type_class_peek_parent(g_class)); g_type_class_add_private(g_class, sizeof(InfdFilesystemStoragePrivate)); object_class->finalize = infd_filesystem_storage_finalize; object_class->set_property = infd_filesystem_storage_set_property; object_class->get_property = infd_filesystem_storage_get_property; infd_filesystem_storage_error_quark = g_quark_from_static_string( "INFD_FILESYSTEM_STORAGE_ERROR" ); infd_filesystem_storage_system_error_quark = g_quark_from_static_string( "INFD_FILESYSTEM_STORAGE_SYSTEM_ERROR" ); g_object_class_install_property( object_class, PROP_ROOT_DIRECTORY, g_param_spec_string( "root-directory", "Root directory", "The directory in which the storage stores its content", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY ) ); } static void infd_filesystem_storage_storage_init(gpointer g_iface, gpointer iface_data) { InfdStorageIface* iface; iface = (InfdStorageIface*)g_iface; iface->read_subdirectory = infd_filesystem_storage_storage_read_subdirectory; iface->create_subdirectory = infd_filesystem_storage_storage_create_subdirectory; iface->remove_node = infd_filesystem_storage_storage_remove_node; } GType infd_filesystem_storage_get_type(void) { static GType filesystem_storage_type = 0; if(!filesystem_storage_type) { static const GTypeInfo filesystem_storage_type_info = { sizeof(InfdFilesystemStorageClass), /* class_size */ NULL, /* base_init */ NULL, /* base_finalize */ infd_filesystem_storage_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ sizeof(InfdFilesystemStorage), /* instance_size */ 0, /* n_preallocs */ infd_filesystem_storage_init, /* instance_init */ NULL /* value_table */ }; static const GInterfaceInfo storage_info = { infd_filesystem_storage_storage_init, NULL, NULL }; filesystem_storage_type = g_type_register_static( G_TYPE_OBJECT, "InfdFilesystemStorage", &filesystem_storage_type_info, 0 ); g_type_add_interface_static( filesystem_storage_type, INFD_TYPE_STORAGE, &storage_info ); } return filesystem_storage_type; } /** * infd_filesystem_storage_new: * @root_directory: A directory name in UTF-8. * * Creates a new #InfdFilesystemStorage that stores its nodes in the * given directory on the file system. The directory is created if it does * not exist. * * Return Value: A new #InfdFilesystemStorage. **/ InfdFilesystemStorage* infd_filesystem_storage_new(const gchar* root_directory) { GObject* object; object = g_object_new( INFD_TYPE_FILESYSTEM_STORAGE, "root-directory", root_directory, NULL ); return INFD_FILESYSTEM_STORAGE(object); } /** * infd_filesystem_storage_open: * @storage: A #InfdFilesystemStorage. * @identifier: The type of node to open. * @path: Tha path to open. * @mode: Either "r" for reading or "w" for writing. * @error: Location to store error information, if any. * * Opens a file in the given path within the storage's root directory. If * the file exists already, and @mode is set to "w", the file is overwritten. * * Return Value: A stream for the open file. Close with fclose(). **/ FILE* infd_filesystem_storage_open(InfdFilesystemStorage* storage, const gchar* identifier, const gchar* path, const gchar* mode, GError** error) { InfdFilesystemStoragePrivate* priv; gchar* converted_name; gchar* disk_name; gchar* full_name; FILE* res; int save_errno; #ifndef G_OS_WIN32 int fd; int open_mode; #endif priv = INFD_FILESYSTEM_STORAGE_PRIVATE(storage); if(infd_filesystem_storage_verify_path(path, error) == FALSE) return NULL; converted_name = g_filename_from_utf8(path, -1, NULL, NULL, error); if(converted_name == NULL) return NULL; disk_name = g_strconcat(converted_name, ".", identifier, NULL); g_free(converted_name); full_name = g_build_filename(priv->root_directory, disk_name, NULL); g_free(disk_name); #ifdef G_OS_WIN32 res = g_fopen(full_name, mode); #else if(strcmp(mode, "r") == 0) open_mode = O_RDONLY; else if(strcmp(mode, "w") == 0) open_mode = O_CREAT | O_WRONLY | O_TRUNC; else g_assert_not_reached(); fd = open(full_name, O_NOFOLLOW | open_mode, 0600); if(fd == -1) res = NULL; else res = fdopen(fd, mode); #endif save_errno = errno; g_free(full_name); if(res == NULL) { infd_filesystem_storage_system_error(save_errno, error); return NULL; } return res; } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/server/infd-xmpp-server.h0000644000175000017500000000542212264763732020206 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INFD_XMPP_SERVER_H__ #define __INFD_XMPP_SERVER_H__ #include #include #include #include /* Get ssize_t on MSVC, required by gnutls.h */ #include #include G_BEGIN_DECLS #define INFD_TYPE_XMPP_SERVER (infd_xmpp_server_get_type()) #define INFD_XMPP_SERVER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), INFD_TYPE_XMPP_SERVER, InfdXmppServer)) #define INFD_XMPP_SERVER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), INFD_TYPE_XMPP_SERVER, InfdXmppServerClass)) #define INFD_IS_XMPP_SERVER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), INFD_TYPE_XMPP_SERVER)) #define INFD_IS_XMPP_SERVER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), INFD_TYPE_XMPP_SERVER)) #define INFD_XMPP_SERVER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), INFD_TYPE_XMPP_SERVER, InfdXmppServerClass)) typedef struct _InfdXmppServer InfdXmppServer; typedef struct _InfdXmppServerClass InfdXmppServerClass; struct _InfdXmppServerClass { GObjectClass parent_class; /* Signals */ void (*error)(InfdXmppServer* server, GError* error); }; struct _InfdXmppServer { GObject parent; }; GType infd_xmpp_server_get_type(void) G_GNUC_CONST; InfdXmppServer* infd_xmpp_server_new(InfdTcpServer* tcp, InfXmppConnectionSecurityPolicy policy, InfCertificateCredentials* creds, InfSaslContext* sasl_context, const gchar* sasl_mechanisms); void infd_xmpp_server_set_security_policy(InfdXmppServer* server, InfXmppConnectionSecurityPolicy policy); InfXmppConnectionSecurityPolicy infd_xmpp_server_get_security_policy(InfdXmppServer* server); G_END_DECLS #endif /* __INFD_XMPP_SERVER_H__ */ /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/libinfinity/inf-signals.c0000644000175000017500000000667212264763732015707 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include /** * inf_signal_handlers_disconnect_by_func: * @instance: The instance to remove handlers from. * @func: The C closure callback of the handlers (useless for non-C closures). * @data: The closure data of the handlers' closures. * * Disconnects all handlers on an instance that match @func and @data. This is * basically g_signal_handlers_disconnect_by_func(), except that it does not * cause warnings for implicitly converting a function pointer to a void * pointer. * * Returns: The number of handlers that matched. */ guint inf_signal_handlers_disconnect_by_func(gpointer instance, GCallback func, gpointer data) { return g_signal_handlers_disconnect_by_func(instance, *(gpointer*)&func, data); } /** * inf_signal_handlers_block_by_func: * @instance: The instance to block handlers from. * @func: The C closure callback of the handlers (useless for non-C closures). * @data: The closure data of the handlers' closures. * * Blocks all handlers on an instance that match @func and @data. This is * basically g_signal_handlers_block_by_func(), except that it does not * cause warnings for implicitly converting a function pointer to a void * pointer. * * Returns: The number of handlers that matched. */ guint inf_signal_handlers_block_by_func(gpointer instance, GCallback func, gpointer data) { return g_signal_handlers_block_by_func(instance, *(gpointer*)&func, data); } /** * inf_signal_handlers_unblock_by_func: * @instance: The instance to unblock handlers from. * @func: The C closure callback of the handlers (useless for non-C closures). * @data: The closure data of the handlers' closures. * * Unblocks all handlers on an instance that match @func and @data. This is * basically g_signal_handlers_unblock_by_func(), except that it does not * cause warnings for implicitly converting a function pointer to a void * pointer. * * Returns: The number of handlers that matched. */ guint inf_signal_handlers_unblock_by_func(gpointer instance, GCallback func, gpointer data) { return g_signal_handlers_unblock_by_func(instance, *(gpointer*)&func, data); } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/NEWS0000644000175000017500000001135412264766040011474 00000000000000libinfinity 0.5.5: * Fix a crash in infinoted when nmap scans the infinote port (Rainer Rehak). libinfinity 0.5.4: * Fix crashes that can happen when the connection goes down at unexpected moments. * Fix a crash when when drawing remote cursors or selections and the initial document has not yet been fully transmitted. * Fix a possible crash when undoing or redoing many operations in a row (Sven Brauch). libinfinity 0.5.3: * Fix a crash when a connection goes down at the moment libinfinity is trying to send data. * Fix possible undefined behavior at type registration (Colomban Wendling). libinfinity 0.5.2: * Fix a crash when a server certificate does not have a hostname set * Fix a crash when the remote side sends invalid UTF-8 * Fix compilation with glib >= 2.31 libinfinity 0.5.1: * infinoted: Update directory sync settings on config reload * infinoted: Fix a crash when directory sync was enabled (#556) * Fix the build on Mac OS X (#563) * Disallow node names containing non-printable or only space characters * Fixed a reference leak in infd_directory_add_note() * Fixed a crash in infd_directory_iter_get_session() libinfinity 0.5.0: * infinoted: Added the --pam-server, --allow-user and --allow-group command line options. * Show cursor and selection of remote users in the own textview and the scrollbar. * Add optional support for GTK+ 3. * Provide asynchronous SASL authentication. libinfinity 0.4.2: * infinoted: Fixed a bug when infinoted did not launch in daemonized mode when the global PID file directory did not exist. * Fixed a crash which could occur in high latency concurrent situations. * Fixed a possible crash when multiple connections time out at the same time. * Fixed a crash when receiving an unexpected XML opening and ending tag on the top-level. libinfinity 0.4.1: * infinoted: Avoid a runtime warning when infinoted can not be started. * Fixed a crash in undo grouping when undoing a large number of requests. * Fixed a crash when showing closed connections in a InfGtkBrowserView (Jesse van den Kieboom). * Fixed expander arrows on non-expandable columns in InfGtkBrowserView. * Fixed a crash when closing an XML connection still in use by a session (Jesse van den Kieboom). * Introduced new API: - inf_xmpp_connection_get_tls_enabled() - inf_gtk_browser_store_remove_connection() - inf_gtk_browser_store_set_connection_name() - inf_gtk_browser_store_clear_connection_error() - inf_text_gtk_buffer_is_tag_toggle() - inf_text_gtk_buffer_forward_to_tag_toggle() - inf_text_gtk_buffer_backward_to_tag_toggle() libinfinity 0.4.0: * infinoted: Added the --password, --sync-directory, --sync-interval, --daemonize and --kill-daemon command line options. * infinoted: Reload configuration file at runtime on SIGHUP * Added an IRC-like chat, driven by InfChatSession. * Added functionality to group undo requests to be undone in a single step. libinfinity 0.3.1: * Avoid a crash when synchronizing a zero-length delete operation * Fix sporadic disconnections on Windows libinfinity 0.3.0: * infinoted: Added the --certificate-chain command line option. * Support rejecting a subscription on the client side, for example when the client does not support the communication method. * Made libinfinity parallel-installable with future versions. libinfinity 0.2.1: * Fixed compilation on FreeBSD (#430, Romain Tartière) * Fixed a crash that could occur on connection loss. * Accept v1 X.509 certificates. libinfinity 0.2.0: * infinoted records sessions to ~/.infinoted-records * Added proper modification tracking, and an autosave feature for infinoted. * Implemented InfStandaloneIo on Windows, making infinoted run on Windows * Refactored connection manager, introducing InfCommunication API for high-level network handling. This breaks protocol compatibility with libinfinity 0.1.x. libinfinity 0.1.2: * Fixed required dependencies in pkg-config files * Improved error message when the remote host does not send XMPP * Fixed a crash when compiling with -O2 or above * Fixed a few memory leaks * Fixed build with cairo 1.4 (#393) libinfinity 0.1.1: * Made libinfinity properly relocatable on Windows * Fixed the documentation build when avahi is disabled (#386, Gregory Haynes) * Fixed a segfault when showing the file list (#388, Georg) * Fixed pasting a lot amount of text (#387, Benjamin Herr) * Fixed connection to server with much history (#389, Matthias Prinz) libinfinity 0.1.0: * Initial release of libinfinity * Provides an API for real-time collaboration on plain text documents * This in an UNSTABLE release! Both API and ABI are about to change in future versions. The 0.1.x line is guaranteed to be stable, though. libinfinity-0.5.5/docs/0000755000175000017500000000000012264766270012006 500000000000000libinfinity-0.5.5/docs/reference/0000755000175000017500000000000012264766271013745 500000000000000libinfinity-0.5.5/docs/reference/api_version.xml0000644000175000017500000000000312264766142016713 000000000000000.5libinfinity-0.5.5/docs/reference/Makefile.am0000644000175000017500000000115312041011626015675 00000000000000SUBDIRS = . libinfinity libinftext libinfgtk libinftextgtk # Note that nodist doesn't work here actually because gtk-doc pulls them # in anyway (see content_files in a subdirectory's Makefile.am) nodist_noinst_DATA = version.xml api_version.xml # Remove the trailing newline of the version files, to have the entities # in the docbook XML substituted without it. version.xml: version.xml.in echo -n `cat version.xml.in` > version.xml api_version.xml: api_version.xml.in echo -n `cat api_version.xml.in` > api_version.xml CLEANFILES = version.xml api_version.xml DISTCLEANFILES = version.xml.in api_version.xml.in libinfinity-0.5.5/docs/reference/api_version.xml.in.in0000644000175000017500000000003211204026376017716 00000000000000@LIBINFINITY_API_VERSION@ libinfinity-0.5.5/docs/reference/version.xml0000644000175000017500000000000512264766142016064 000000000000000.5.5libinfinity-0.5.5/docs/reference/libinftext/0000755000175000017500000000000012264766270016114 500000000000000libinfinity-0.5.5/docs/reference/libinftext/libinftext-0.5-sections.txt0000644000175000017500000001417412264766270023101 00000000000000
inf-text-default-delete-operation InfTextDefaultDeleteOperation InfTextDefaultDeleteOperation inf_text_default_delete_operation_new inf_text_default_delete_operation_get_chunk InfTextDefaultDeleteOperationClass INF_TEXT_DEFAULT_DELETE_OPERATION INF_TEXT_IS_DEFAULT_DELETE_OPERATION INF_TEXT_TYPE_DEFAULT_DELETE_OPERATION inf_text_default_delete_operation_get_type INF_TEXT_DEFAULT_DELETE_OPERATION_CLASS INF_TEXT_IS_DEFAULT_DELETE_OPERATION_CLASS INF_TEXT_DEFAULT_DELETE_OPERATION_GET_CLASS
inf-text-insert-operation InfTextInsertOperationIface inf_text_insert_operation_get_position inf_text_insert_operation_get_length inf_text_insert_operation_need_concurrency_id inf_text_insert_operation_get_concurrency_id inf_text_insert_operation_transform_insert inf_text_insert_operation_transform_delete INF_TEXT_INSERT_OPERATION INF_TEXT_IS_INSERT_OPERATION INF_TEXT_TYPE_INSERT_OPERATION inf_text_insert_operation_get_type INF_TEXT_INSERT_OPERATION_GET_IFACE
inf-text-remote-delete-operation InfTextRemoteDeleteOperation InfTextRemoteDeleteOperation inf_text_remote_delete_operation_new InfTextRemoteDeleteOperationClass INF_TEXT_REMOTE_DELETE_OPERATION INF_TEXT_IS_REMOTE_DELETE_OPERATION INF_TEXT_TYPE_REMOTE_DELETE_OPERATION inf_text_remote_delete_operation_get_type INF_TEXT_REMOTE_DELETE_OPERATION_CLASS INF_TEXT_IS_REMOTE_DELETE_OPERATION_CLASS INF_TEXT_REMOTE_DELETE_OPERATION_GET_CLASS
inf-text-session InfTextSessionError InfTextSession InfTextSession inf_text_session_new inf_text_session_new_with_user_table inf_text_session_set_user_color inf_text_session_flush_requests_for_user InfTextSessionClass INF_TEXT_SESSION INF_TEXT_IS_SESSION INF_TEXT_TYPE_SESSION inf_text_session_get_type INF_TEXT_SESSION_CLASS INF_TEXT_IS_SESSION_CLASS INF_TEXT_SESSION_GET_CLASS
inf-text-undo-grouping InfTextUndoGrouping InfTextUndoGrouping inf_text_undo_grouping_new InfTextUndoGroupingClass INF_TEXT_UNDO_GROUPING INF_TEXT_IS_UNDO_GROUPING INF_TEXT_TYPE_UNDO_GROUPING inf_text_undo_grouping_get_type INF_TEXT_UNDO_GROUPING_CLASS INF_TEXT_IS_UNDO_GROUPING_CLASS INF_TEXT_UNDO_GROUPING_GET_CLASS
inf-text-user InfTextUser InfTextUser inf_text_user_new inf_text_user_get_caret_position inf_text_user_get_selection_length inf_text_user_set_selection inf_text_user_get_hue InfTextUserClass INF_TEXT_USER INF_TEXT_IS_USER INF_TEXT_TYPE_USER inf_text_user_get_type INF_TEXT_USER_CLASS INF_TEXT_IS_USER_CLASS INF_TEXT_USER_GET_CLASS
inf-text-default-insert-operation InfTextDefaultInsertOperation InfTextDefaultInsertOperation inf_text_default_insert_operation_new inf_text_default_insert_operation_get_chunk InfTextDefaultInsertOperationClass INF_TEXT_DEFAULT_INSERT_OPERATION INF_TEXT_IS_DEFAULT_INSERT_OPERATION INF_TEXT_TYPE_DEFAULT_INSERT_OPERATION inf_text_default_insert_operation_get_type INF_TEXT_DEFAULT_INSERT_OPERATION_CLASS INF_TEXT_IS_DEFAULT_INSERT_OPERATION_CLASS INF_TEXT_DEFAULT_INSERT_OPERATION_GET_CLASS
inf-text-delete-operation InfTextDeleteOperationIface inf_text_delete_operation_get_position inf_text_delete_operation_get_length inf_text_delete_operation_need_concurrency_id inf_text_delete_operation_get_concurrency_id inf_text_delete_operation_transform_insert inf_text_delete_operation_transform_delete INF_TEXT_DELETE_OPERATION INF_TEXT_IS_DELETE_OPERATION INF_TEXT_TYPE_DELETE_OPERATION inf_text_delete_operation_get_type INF_TEXT_DELETE_OPERATION_GET_IFACE
inf-text-buffer InfTextBuffer InfTextBufferIface InfTextBufferIter inf_text_buffer_get_encoding inf_text_buffer_get_length inf_text_buffer_get_slice inf_text_buffer_insert_text inf_text_buffer_insert_chunk inf_text_buffer_erase_text inf_text_buffer_create_iter inf_text_buffer_destroy_iter inf_text_buffer_iter_next inf_text_buffer_iter_prev inf_text_buffer_iter_get_text inf_text_buffer_iter_get_length inf_text_buffer_iter_get_bytes inf_text_buffer_iter_get_author inf_text_buffer_text_inserted inf_text_buffer_text_erased INF_TEXT_BUFFER INF_TEXT_IS_BUFFER INF_TEXT_TYPE_BUFFER inf_text_buffer_get_type INF_TEXT_BUFFER_GET_IFACE
inf-text-default-buffer InfTextDefaultBuffer InfTextDefaultBuffer inf_text_default_buffer_new InfTextDefaultBufferClass INF_TEXT_DEFAULT_BUFFER INF_TEXT_IS_DEFAULT_BUFFER INF_TEXT_TYPE_DEFAULT_BUFFER inf_text_default_buffer_get_type INF_TEXT_DEFAULT_BUFFER_CLASS INF_TEXT_IS_DEFAULT_BUFFER_CLASS INF_TEXT_DEFAULT_BUFFER_GET_CLASS
inf-text-move-operation InfTextMoveOperation InfTextMoveOperation inf_text_move_operation_new inf_text_move_operation_get_position inf_text_move_operation_get_length inf_text_move_operation_transform_insert inf_text_move_operation_transform_delete InfTextMoveOperationClass INF_TEXT_MOVE_OPERATION INF_TEXT_IS_MOVE_OPERATION INF_TEXT_TYPE_MOVE_OPERATION inf_text_move_operation_get_type INF_TEXT_MOVE_OPERATION_CLASS INF_TEXT_IS_MOVE_OPERATION_CLASS INF_TEXT_MOVE_OPERATION_GET_CLASS
inf-text-operations InfTextDeleteOperation InfTextInsertOperation
inf-text-chunk InfTextChunk InfTextChunkIter inf_text_chunk_new inf_text_chunk_copy inf_text_chunk_free inf_text_chunk_get_encoding inf_text_chunk_get_length inf_text_chunk_substring inf_text_chunk_insert_text inf_text_chunk_insert_chunk inf_text_chunk_erase inf_text_chunk_get_text inf_text_chunk_equal inf_text_chunk_iter_init inf_text_chunk_iter_next inf_text_chunk_iter_prev inf_text_chunk_iter_get_text inf_text_chunk_iter_get_length inf_text_chunk_iter_get_bytes inf_text_chunk_iter_get_author INF_TEXT_TYPE_CHUNK inf_text_chunk_get_type
libinfinity-0.5.5/docs/reference/libinftext/Makefile.am0000644000175000017500000000642112041011626020050 00000000000000## Process this file with automake to produce Makefile.in # We require automake 1.6 at least. AUTOMAKE_OPTIONS = 1.6 # This is a blank Makefile.am for using gtk-doc. # Copy this to your project's API docs directory and modify the variables to # suit your project. See the GTK+ Makefiles in gtk+/docs/reference for examples # of using the various options. # The name of the module, e.g. 'glib'. DOC_MODULE=libinftext-$(LIBINFINITY_API_VERSION) # The top-level SGML file. You can change this if you want to. DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml # The directory containing the source code. Relative to $(srcdir). # gtk-doc will search all .c & .h files beneath here for inline comments # documenting the functions and macros. # e.g. DOC_SOURCE_DIR=../../../gtk DOC_SOURCE_DIR=$(top_srcdir)/libinftext # Extra options to pass to gtkdoc-scangobj. Not normally needed. SCANGOBJ_OPTIONS= # Extra options to supply to gtkdoc-scan. # e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED" SCAN_OPTIONS=--rebuild-types # Extra options to supply to gtkdoc-mkdb. # e.g. MKDB_OPTIONS=--sgml-mode --output-format=xml MKDB_OPTIONS=--sgml-mode --output-format=xml # Extra options to supply to gtkdoc-mktmpl # e.g. MKTMPL_OPTIONS=--only-section-tmpl MKTMPL_OPTIONS= # Extra options to supply to gtkdoc-fixref. Not normally needed. # e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html FIXXREF_OPTIONS = \ --extra-dir=../libinfinity/html # Used for dependencies. The docs will be rebuilt if any of these change. # e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h # e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c HFILE_GLOB = \ $(top_srcdir)/libinftext/*.h CFILE_GLOB = \ $(top_srcdir)/libinftext/*.c # Header files to ignore when scanning. # e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h IGNORE_HFILES = # Images to copy into HTML directory. # e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png HTML_IMAGES= # Extra SGML files that are included by $(DOC_MAIN_SGML_FILE). # e.g. content_files=running.sgml building.sgml changes-2.0.sgml content_files = \ ../version.xml # SGML files where gtk-doc abbrevations (#GtkWidget) are expanded # These files must be listed here *and* in content_files # e.g. expand_content_files=running.sgml expand_content_files= # CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library. # Only needed if you are using gtkdoc-scangobj to dynamically query widget # signals and properties. # e.g. INCLUDES=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS) # e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib) #INCLUDES=$(inftext_CFLAGS) AM_CPPFLAGS=$(inftext_CFLAGS) GTKDOC_LIBS = \ $(inftext_LIBS) \ $(top_builddir)/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ $(top_builddir)/libinftext/libinftext-$(LIBINFINITY_API_VERSION).la # This includes the standard gtk-doc make rules, copied by gtkdocize. include $(top_srcdir)/gtk-doc.make # Other files to distribute # e.g. EXTRA_DIST += version.xml.in EXTRA_DIST += # Files not to distribute # for --rebuild-types in $(SCAN_OPTIONS), e.g. $(DOC_MODULE).types # for --rebuild-sections in $(SCAN_OPTIONS) e.g. $(DOC_MODULE)-sections.txt DISTCLEANFILES = libinftext-$(LIBINFINITY_API_VERSION).types version.xml # Comment this out if you want your docs-status tested during 'make check' #TESTS = $(GTKDOC_CHECK) libinfinity-0.5.5/docs/reference/libinftext/libinftext-0.5-docs.sgml0000644000175000017500000000277012264763732022324 00000000000000 ]> libinftext-&api_version; Reference Manual for libinftext &version;. The latest version of this documentation can be found on-line at http://infinote.0x539.de/libinfinity/API/libinftext/. libinftext API reference libinfinity-0.5.5/docs/reference/libinftext/html/0000755000175000017500000000000012264766270017060 500000000000000libinfinity-0.5.5/docs/reference/libinftext/html/InfTextDefaultInsertOperation.html0000644000175000017500000002410312264766270025622 00000000000000 InfTextDefaultInsertOperation

InfTextDefaultInsertOperation

InfTextDefaultInsertOperation

Object Hierarchy

  GObject
   +----InfTextDefaultInsertOperation

Implemented Interfaces

InfTextDefaultInsertOperation implements InfAdoptedOperation and InfTextInsertOperation.

Properties

  "chunk"                    InfTextChunk*         : Read / Write / Construct Only
  "position"                 guint                 : Read / Write / Construct Only

Description

Details

InfTextDefaultInsertOperation

typedef struct _InfTextDefaultInsertOperation InfTextDefaultInsertOperation;


inf_text_default_insert_operation_new ()

InfTextDefaultInsertOperation * inf_text_default_insert_operation_new
                                                        (guint pos,
                                                         InfTextChunk *chunk);

Creates a new insert operation that, when applied, inserts chunk at pos.

pos :

The position at which to insert text.

chunk :

The text to insert.

Returns :

A new InfTextDefaultInsertOperation.

inf_text_default_insert_operation_get_chunk ()

InfTextChunk *      inf_text_default_insert_operation_get_chunk
                                                        (InfTextDefaultInsertOperation *operation);

Returns the text inserted by operation.

operation :

A InfTextDefaultInsertOperation.

Returns :

A InfTextChunk, owned by the operation.

Property Details

The "chunk" property

  "chunk"                    InfTextChunk*         : Read / Write / Construct Only

The text to insert.


The "position" property

  "position"                 guint                 : Read / Write / Construct Only

Insertion position.

Default value: 0

libinfinity-0.5.5/docs/reference/libinftext/html/left.png0000644000175000017500000000055612264766270020446 00000000000000‰PNG  IHDRשÍÊ~PLTEÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ(((;;;@@@€€€ƒƒƒ§§§×××ßßßãããçççëëëóóóûûûÿÿÿv:òütRNS $04 libinfinity-0.5.5/docs/reference/libinftext/html/ch01.html0000644000175000017500000000701412264766270020423 00000000000000 libinftext API reference libinfinity-0.5.5/docs/reference/libinftext/html/InfTextRemoteDeleteOperation.html0000644000175000017500000002134112264766270025430 00000000000000 InfTextRemoteDeleteOperation

InfTextRemoteDeleteOperation

InfTextRemoteDeleteOperation

Object Hierarchy

  GObject
   +----InfTextRemoteDeleteOperation

Implemented Interfaces

InfTextRemoteDeleteOperation implements InfAdoptedOperation and InfTextDeleteOperation.

Properties

  "length"                   guint                 : Read / Write / Construct Only
  "position"                 guint                 : Read / Write / Construct Only

Description

Details

InfTextRemoteDeleteOperation

typedef struct _InfTextRemoteDeleteOperation InfTextRemoteDeleteOperation;


inf_text_remote_delete_operation_new ()

InfTextRemoteDeleteOperation * inf_text_remote_delete_operation_new
                                                        (guint position,
                                                         guint length);

Creates a new delete operation that, when applied, deletes length characters starting from position position. Note that this operation is not reversible because it does not know the text to delete and is therefore only used to transmit a delete operation through the network to reduce bandwidth usage. The other part can then reconstruct the deleted text using the make_reversible vfunc.

However, it is easier to just use InfTextDefaultDeleteOperation if you want the operation to be reversible.

position :

The position at which to delete text.

length :

The number of characters to delete.

Returns :

A new InfTextRemoteDeleteOperation.

Property Details

The "length" property

  "length"                   guint                 : Read / Write / Construct Only

The length of the deleted text.

Default value: 0


The "position" property

  "position"                 guint                 : Read / Write / Construct Only

Position where to start deleting characters.

Default value: 0

libinfinity-0.5.5/docs/reference/libinftext/html/InfTextMoveOperation.html0000644000175000017500000004620412264766270023765 00000000000000 InfTextMoveOperation

InfTextMoveOperation

InfTextMoveOperation

Synopsis

                    InfTextMoveOperation;
InfTextMoveOperation * inf_text_move_operation_new      (guint position,
                                                         gint length);
guint               inf_text_move_operation_get_position
                                                        (InfTextMoveOperation *operation);
gint                inf_text_move_operation_get_length  (InfTextMoveOperation *operation);
void                inf_text_move_operation_transform_insert
                                                        (guint insert_position,
                                                         guint insert_length,
                                                         guint *move_position,
                                                         gint *move_length,
                                                         gboolean left_gravity);
void                inf_text_move_operation_transform_delete
                                                        (guint delete_position,
                                                         guint delete_length,
                                                         guint *move_position,
                                                         gint *move_length);

Object Hierarchy

  GObject
   +----InfTextMoveOperation

Implemented Interfaces

InfTextMoveOperation implements InfAdoptedOperation.

Properties

  "length"                   gint                  : Read / Write / Construct Only
  "position"                 guint                 : Read / Write / Construct Only

Description

Details

InfTextMoveOperation

typedef struct _InfTextMoveOperation InfTextMoveOperation;


inf_text_move_operation_new ()

InfTextMoveOperation * inf_text_move_operation_new      (guint position,
                                                         gint length);

Creates a new move operation that, when applied, changes the caret and selection of the applying user.

position :

The position to place the user's caret at.

length :

The number of characters to select. Negative means selection towards the beginning of the buffer.

Returns :

A new InfTextMoveOperation.

inf_text_move_operation_get_position ()

guint               inf_text_move_operation_get_position
                                                        (InfTextMoveOperation *operation);

Returns the position at which operation places the user's cursor.

operation :

A InfTextMoveOperation.

Returns :

The position of operation.

inf_text_move_operation_get_length ()

gint                inf_text_move_operation_get_length  (InfTextMoveOperation *operation);

Returns the length to which operation changes the user's selection. Negative means selection towards the beginning of the buffer.

operation :

A InfTextMoveOperation.

Returns :

The length of operation.

inf_text_move_operation_transform_insert ()

void                inf_text_move_operation_transform_insert
                                                        (guint insert_position,
                                                         guint insert_length,
                                                         guint *move_position,
                                                         gint *move_length,
                                                         gboolean left_gravity);

Changes *move_position and *move_length so that they point to the same region when insert_length characters are inserted at insert_position.

If text is inserted at the same position as move_position, then move_position is kept at the position it currently is if left_gravity is TRUE, otherwise it is shifted to the right.

If *move_length is nonzero, then the selection length is never enlarged if text is inserted at the selection bounds, not depending on whether left_gravity is set or not.

insert_position :

The position at which text is inserted.

insert_length :

The number of inserted characters.

move_position :

Points to the character offset to which the caret is moved.

move_length :

Points to the number of characters selected. Negative means towards the beginning.

left_gravity :

Whether the move position and length have left gravity.

inf_text_move_operation_transform_delete ()

void                inf_text_move_operation_transform_delete
                                                        (guint delete_position,
                                                         guint delete_length,
                                                         guint *move_position,
                                                         gint *move_length);

Changes *move_position and *move_length so that they point to the same region when delete_length characters are deleted starting from delete_position.

delete_position :

The position at which text is deleted.

delete_length :

The number of deleted characters.

move_position :

Points to the character offset to which the caret is moved.

move_length :

Points to the number of characters selected. Negative means towards the beginning.

Property Details

The "length" property

  "length"                   gint                  : Read / Write / Construct Only

The number of characters of the selected text.

Default value: 0


The "position" property

  "position"                 guint                 : Read / Write / Construct Only

Position where to place the user's caret at.

Default value: 0

libinfinity-0.5.5/docs/reference/libinftext/html/home.png0000644000175000017500000000107512264766270020441 00000000000000‰PNG  IHDRשÍÊðPLTEÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  $$$(((,,,000888<<<@@@OOOPPP[[[___```lll{{{€€€‹‹‹£££¯¯¯¿¿¿ÃÃÃÇÇÇÏÏÏÓÓÓÛÛÛßßßãããëëëïïïóóó÷÷÷ÿÿÿÕ?“*tRNS  $(,4@GKSghkotw‡‹›Ÿ«·»¿ÃËÏÓÛßçïó÷ûa7™ÞÒIDATx­Í[7†@Æñ^EÈù ”b'…qˆ!DŒdÿocD™Y±– ¿ËçñÀŒÌÎÃ&}¢Ðž°,sTÓa}y&èC`+ûÂþ CLn9¿ÁP;«ô˜ aÆsûÚ.Ýà'Aç2t·7غª» o/ð;ÎÉén5iI+Ì4·ºøž–a£Š±¯ô`í-;Å#®`ȲWÌrRäXÐÞÀ`§vGAÚìþ?¤\qÒ†õ*BMôä5aŽD¡y¦%h8[¾f{р߽C‰VF3‹ÔIEND®B`‚libinfinity-0.5.5/docs/reference/libinftext/html/style.css0000644000175000017500000001210012264766270020644 00000000000000.synopsis, .classsynopsis { /* tango:aluminium 1/2 */ background: #eeeeec; border: solid 1px #d3d7cf; padding: 0.5em; } .programlisting { /* tango:sky blue 0/1 */ background: #e6f3ff; border: solid 1px #729fcf; padding: 0.5em; } .variablelist { padding: 4px; margin-left: 3em; } .variablelist td:first-child { vertical-align: top; } @media screen { sup a.footnote { position: relative; top: 0em ! important; } /* this is needed so that the local anchors are displayed below the naviagtion */ div.footnote a[name], div.refnamediv a[name], div.refsect1 a[name], div.refsect2 a[name], div.index a[name], div.glossary a[name], div.sect1 a[name] { display: inline-block; position: relative; top:-5em; } /* this seems to be a bug in the xsl style sheets when generating indexes */ div.index div.index { top: 0em; } /* make space for the fixed navigation bar and add space at the bottom so that * link targets appear somewhat close to top */ body { padding-top: 3.2em; padding-bottom: 20em; } /* style and size the navigation bar */ table.navigation#top { position: fixed; /* tango:scarlet red 0/1 */ background: #ffe6e6; border: solid 1px #ef2929; margin-top: 0; margin-bottom: 0; top: 0; left: 0; height: 3em; z-index: 10; } .navigation a, .navigation a:visited { /* tango:scarlet red 3 */ color: #a40000; } .navigation a:hover { /* tango:scarlet red 1 */ color: #ef2929; } td.shortcuts { /* tango:scarlet red 1 */ color: #ef2929; font-size: 80%; white-space: nowrap; } } @media print { table.navigation { visibility: collapse; display: none; } div.titlepage table.navigation { visibility: visible; display: table; /* tango:scarlet red 0/1 */ background: #ffe6e6; border: solid 1px #ef2929; margin-top: 0; margin-bottom: 0; top: 0; left: 0; height: 3em; } } .navigation .title { font-size: 200%; } div.gallery-float { float: left; padding: 10px; } div.gallery-float img { border-style: none; } div.gallery-spacer { clear: both; } a, a:visited { text-decoration: none; /* tango:sky blue 2 */ color: #3465a4; } a:hover { text-decoration: underline; /* tango:sky blue 1 */ color: #729fcf; } div.table table { border-collapse: collapse; border-spacing: 0px; /* tango:aluminium 3 */ border: solid 1px #babdb6; } div.table table td, div.table table th { /* tango:aluminium 3 */ border: solid 1px #babdb6; padding: 3px; vertical-align: top; } div.table table th { /* tango:aluminium 2 */ background-color: #d3d7cf; } hr { /* tango:aluminium 3 */ color: #babdb6; background: #babdb6; border: none 0px; height: 1px; clear: both; } .footer { padding-top: 3.5em; /* tango:aluminium 3 */ color: #babdb6; text-align: center; font-size: 80%; } .warning { /* tango:orange 0/1 */ background: #ffeed9; border-color: #ffb04f; } .note { /* tango:chameleon 0/0.5 */ background: #d8ffb2; border-color: #abf562; } .note, .warning { padding: 0.5em; border-width: 1px; border-style: solid; } .note h3, .warning h3 { margin-top: 0.0em } .note p, .warning p { margin-bottom: 0.0em } /* blob links */ h2 .extralinks, h3 .extralinks { float: right; /* tango:aluminium 3 */ color: #babdb6; font-size: 80%; font-weight: normal; } .annotation { /* tango:aluminium 5 */ color: #555753; font-size: 80%; font-weight: normal; } /* code listings */ .listing_code .programlisting .cbracket { color: #a40000; } /* tango: scarlet red 3 */ .listing_code .programlisting .comment { color: #a1a39d; } /* tango: aluminium 4 */ .listing_code .programlisting .function { color: #000000; font-weight: bold; } .listing_code .programlisting .function a { color: #11326b; font-weight: bold; } /* tango: sky blue 4 */ .listing_code .programlisting .keyword { color: #4e9a06; } /* tango: chameleon 3 */ .listing_code .programlisting .linenum { color: #babdb6; } /* tango: aluminium 3 */ .listing_code .programlisting .normal { color: #000000; } .listing_code .programlisting .number { color: #75507b; } /* tango: plum 2 */ .listing_code .programlisting .preproc { color: #204a87; } /* tango: sky blue 3 */ .listing_code .programlisting .string { color: #c17d11; } /* tango: chocolate 2 */ .listing_code .programlisting .type { color: #000000; } .listing_code .programlisting .type a { color: #11326b; } /* tango: sky blue 4 */ .listing_code .programlisting .symbol { color: #ce5c00; } /* tango: orange 3 */ .listing_frame { /* tango:sky blue 1 */ border: solid 1px #729fcf; padding: 0px; } .listing_lines, .listing_code { margin-top: 0px; margin-bottom: 0px; padding: 0.5em; } .listing_lines { /* tango:sky blue 0.5 */ background: #a6c5e3; /* tango:aluminium 6 */ color: #2e3436; } .listing_code { /* tango:sky blue 0 */ background: #e6f3ff; } .listing_code .programlisting { /* override from previous */ border: none 0px; padding: 0px; } .listing_lines pre, .listing_code pre { margin: 0px; } libinfinity-0.5.5/docs/reference/libinftext/html/libinftext-0.5-inf-text-delete-operation.html0000644000175000017500000004735212264766270027343 00000000000000 inf-text-delete-operation

inf-text-delete-operation

inf-text-delete-operation

Description

Details

struct InfTextDeleteOperationIface

struct InfTextDeleteOperationIface {
  GTypeInterface parent;

  /* Virtual table */
  guint(*get_position)(InfTextDeleteOperation* operation);

  guint(*get_length)(InfTextDeleteOperation* operation);

  InfTextDeleteOperation*(*transform_position)(InfTextDeleteOperation* op,
                                               guint position);

  InfTextDeleteOperation*(*transform_overlap)(InfTextDeleteOperation* op,
                                              InfTextDeleteOperation* other,
                                              guint position,
                                              guint begin,
                                              guint other_begin,
                                              guint length);

  InfAdoptedSplitOperation*(*transform_split)(InfTextDeleteOperation* op,
                                              guint split_pos,
                                              guint split_length);
};


inf_text_delete_operation_get_position ()

guint               inf_text_delete_operation_get_position
                                                        (InfTextDeleteOperation *operation);

Returns the position at which operation starts to delete dext.

operation :

A InfTextDeleteOperation.

Returns :

The position of operation.

inf_text_delete_operation_get_length ()

guint               inf_text_delete_operation_get_length
                                                        (InfTextDeleteOperation *operation);

Returns the number of characters deleted by operation.

operation :

A InfTextDeleteOperation.

Returns :

The length of operation.

inf_text_delete_operation_need_concurrency_id ()

gboolean            inf_text_delete_operation_need_concurrency_id
                                                        (InfTextDeleteOperation *op,
                                                         InfAdoptedOperation *against);

Returns whether transforming op against against requires a concurrency ID (see inf_adopted_operation_need_concurrency_id() for further information).

op :

A InfTextDeleteOperation.

against :

Another InfAdoptedOperation.

Returns :

Whether transforming op against against requires a concurrency ID.

inf_text_delete_operation_get_concurrency_id ()

InfAdoptedConcurrencyId inf_text_delete_operation_get_concurrency_id
                                                        (InfTextDeleteOperation *op,
                                                         InfAdoptedOperation *against);

Returns a concurrency ID for transformation of op against against (see inf_adopted_operation_get_concurrency_id() for further information).

op :

A InfTextDeleteOperation.

against :

Another InfAdoptedOperation.

Returns :

A concurrency ID between op and against.

inf_text_delete_operation_transform_insert ()

InfAdoptedOperation * inf_text_delete_operation_transform_insert
                                                        (InfTextDeleteOperation *operation,
                                                         InfTextInsertOperation *against,
                                                         InfAdoptedConcurrencyId cid);

Returns a new operation that includes the effect of against into operation.

operation :

A InfTextDeleteOperation.

against :

A InfTextInsertOperation.

cid :

The concurrency ID for the transformation.

Returns :

A new InfAdoptedOperation.

inf_text_delete_operation_transform_delete ()

InfAdoptedOperation * inf_text_delete_operation_transform_delete
                                                        (InfTextDeleteOperation *operation,
                                                         InfTextDeleteOperation *against,
                                                         InfAdoptedConcurrencyId cid);

Returns a new operation that includes the effect of against into operation.

operation :

A InfTextDeleteOperation.

against :

Another InfTextDeleteOperation.

cid :

The concurrency ID for the transformation.

Returns :

A new InfAdoptedOperation.
libinfinity-0.5.5/docs/reference/libinftext/html/libinftext-0.5-inf-text-buffer.html0000644000175000017500000016035212264766270025350 00000000000000 inf-text-buffer

inf-text-buffer

inf-text-buffer

Synopsis

                    InfTextBuffer;
struct              InfTextBufferIface;
                    InfTextBufferIter;
const gchar *       inf_text_buffer_get_encoding        (InfTextBuffer *buffer);
guint               inf_text_buffer_get_length          (InfTextBuffer *buffer);
InfTextChunk *      inf_text_buffer_get_slice           (InfTextBuffer *buffer,
                                                         guint pos,
                                                         guint len);
void                inf_text_buffer_insert_text         (InfTextBuffer *buffer,
                                                         guint pos,
                                                         gconstpointer text,
                                                         gsize bytes,
                                                         guint len,
                                                         InfUser *user);
void                inf_text_buffer_insert_chunk        (InfTextBuffer *buffer,
                                                         guint pos,
                                                         InfTextChunk *chunk,
                                                         InfUser *user);
void                inf_text_buffer_erase_text          (InfTextBuffer *buffer,
                                                         guint pos,
                                                         guint len,
                                                         InfUser *user);
InfTextBufferIter * inf_text_buffer_create_iter         (InfTextBuffer *buffer);
void                inf_text_buffer_destroy_iter        (InfTextBuffer *buffer,
                                                         InfTextBufferIter *iter);
gboolean            inf_text_buffer_iter_next           (InfTextBuffer *buffer,
                                                         InfTextBufferIter *iter);
gboolean            inf_text_buffer_iter_prev           (InfTextBuffer *buffer,
                                                         InfTextBufferIter *iter);
gpointer            inf_text_buffer_iter_get_text       (InfTextBuffer *buffer,
                                                         InfTextBufferIter *iter);
guint               inf_text_buffer_iter_get_length     (InfTextBuffer *buffer,
                                                         InfTextBufferIter *iter);
gsize               inf_text_buffer_iter_get_bytes      (InfTextBuffer *buffer,
                                                         InfTextBufferIter *iter);
guint               inf_text_buffer_iter_get_author     (InfTextBuffer *buffer,
                                                         InfTextBufferIter *iter);
void                inf_text_buffer_text_inserted       (InfTextBuffer *buffer,
                                                         guint pos,
                                                         InfTextChunk *chunk,
                                                         InfUser *user);
void                inf_text_buffer_text_erased         (InfTextBuffer *buffer,
                                                         guint pos,
                                                         InfTextChunk *chunk,
                                                         InfUser *user);

Object Hierarchy

  GInterface
   +----InfTextBuffer

Prerequisites

InfTextBuffer requires InfBuffer and GObject.

Known Implementations

InfTextBuffer is implemented by InfTextDefaultBuffer.

Description

Details

InfTextBuffer

typedef struct _InfTextBuffer InfTextBuffer;


struct InfTextBufferIface

struct InfTextBufferIface {
  GTypeInterface parent;

  /* Virtual table */
  const gchar* (*get_encoding)(InfTextBuffer* buffer);

  guint(*get_length)(InfTextBuffer* buffer);

  InfTextChunk*(*get_slice)(InfTextBuffer* buffer,
                            guint pos,
                            guint len);

  void(*insert_text)(InfTextBuffer* buffer,
                     guint pos,
                     InfTextChunk* chunk,
                     InfUser* user);

  void(*erase_text)(InfTextBuffer* buffer,
                    guint pos,
                    guint len,
                    InfUser* user);

  InfTextBufferIter*(*create_iter)(InfTextBuffer* buffer);

  void(*destroy_iter)(InfTextBuffer* buffer,
                      InfTextBufferIter* iter);

  gboolean(*iter_next)(InfTextBuffer* buffer,
                       InfTextBufferIter* iter);
  
  gboolean(*iter_prev)(InfTextBuffer* buffer,
                       InfTextBufferIter* iter);

  gpointer(*iter_get_text)(InfTextBuffer* buffer,
                           InfTextBufferIter* iter);

  guint(*iter_get_length)(InfTextBuffer* buffer,
                          InfTextBufferIter* iter);

  gsize(*iter_get_bytes)(InfTextBuffer* buffer,
                         InfTextBufferIter* iter);

  guint(*iter_get_author)(InfTextBuffer* buffer,
                          InfTextBufferIter* iter);

  /* Signals */
  void(*text_inserted)(InfTextBuffer* buffer,
                       guint pos,
                       InfTextChunk* chunk,
                       InfUser* user);

  void(*text_erased)(InfTextBuffer* buffer,
                     guint pos,
                     InfTextChunk* chunk,
                     InfUser* user);
};


InfTextBufferIter

typedef struct _InfTextBufferIter InfTextBufferIter;


inf_text_buffer_get_encoding ()

const gchar *       inf_text_buffer_get_encoding        (InfTextBuffer *buffer);

Returns the character encoding that the buffer uses. This means that all InfTextChunk return values are encoded in this encoding and all InfTextChunk parameters are expected to be encoded in that encoding.

buffer :

A InfTextBuffer.

Returns :

The character encoding for buffer.

inf_text_buffer_get_length ()

guint               inf_text_buffer_get_length          (InfTextBuffer *buffer);

Returns the number of characters in buffer.

buffer :

A InfTextBuffer.

Returns :

The length of buffer.

inf_text_buffer_get_slice ()

InfTextChunk *      inf_text_buffer_get_slice           (InfTextBuffer *buffer,
                                                         guint pos,
                                                         guint len);

Reads len characters, starting at pos, from the buffer, and returns them as a InfTextChunk.

buffer :

A InfTextBuffer.

pos :

Character offset of where to start extracting.

len :

Number of characters to extract.

Returns :

A InfTextChunk.

inf_text_buffer_insert_text ()

void                inf_text_buffer_insert_text         (InfTextBuffer *buffer,
                                                         guint pos,
                                                         gconstpointer text,
                                                         gsize bytes,
                                                         guint len,
                                                         InfUser *user);

Inserts text into buffer as written by author. text must be encoded in the character encoding of the buffer, see inf_text_buffer_get_encoding().

buffer :

A InfTextBuffer.

pos :

A character offset into buffer.

text :

A pointer to the text to insert.

bytes :

The length (in bytes) of text.

len :

The length (in characters) of text.

user :

A InfUser that has inserted the new text, or NULL.

inf_text_buffer_insert_chunk ()

void                inf_text_buffer_insert_chunk        (InfTextBuffer *buffer,
                                                         guint pos,
                                                         InfTextChunk *chunk,
                                                         InfUser *user);

Inserts a InfTextChunk into buffer. user must not necessarily be the author of chunk (chunk may even consist of multiple segments). This happens when undoing a delete operation that erased another user's text.

buffer :

A InfTextBuffer.

pos :

A character offset into buffer.

chunk :

A InfTextChunk.

user :

A InfUser inserting chunk, or NULL.

inf_text_buffer_erase_text ()

void                inf_text_buffer_erase_text          (InfTextBuffer *buffer,
                                                         guint pos,
                                                         guint len,
                                                         InfUser *user);

Erases characters from the text buffer.

buffer :

A InfTextBuffer.

pos :

The position to begin deleting characters from.

len :

The amount of characters to delete.

user :

A InfUser that erases the text, or NULL.

inf_text_buffer_create_iter ()

InfTextBufferIter * inf_text_buffer_create_iter         (InfTextBuffer *buffer);

Creates a InfTextBufferIter pointing to the first segment of buffer. A InfTextBufferIter is used to traverse the buffer contents in steps of so-called segments each of which is written by the same user. The function returns NULL if there are no segments (i.e. the buffer is empty).

The iterator stays valid as long as the buffer remains unmodified and must be freed with inf_text_buffer_destroy_iter() before.

buffer :

A InfTextBuffer.

Returns :

A InfTextBufferIter to be freed by inf_text_buffer_destroy_iter() when done using it, or NULL.

inf_text_buffer_destroy_iter ()

void                inf_text_buffer_destroy_iter        (InfTextBuffer *buffer,
                                                         InfTextBufferIter *iter);

Destroys a InfTextBufferIter created by inf_text_buffer_create_iter().

buffer :

A InfTextBuffer.

iter :

A InfTextBufferIter pointing into buffer.

inf_text_buffer_iter_next ()

gboolean            inf_text_buffer_iter_next           (InfTextBuffer *buffer,
                                                         InfTextBufferIter *iter);

Moves iter to point to the next segment in the buffer. If iter already points to the last segment, iter is left unmodified and the function returns FALSE.

buffer :

A InfTextBuffer.

iter :

A InfTextBufferIter pointing into buffer.

Returns :

Whether iter was moved.

inf_text_buffer_iter_prev ()

gboolean            inf_text_buffer_iter_prev           (InfTextBuffer *buffer,
                                                         InfTextBufferIter *iter);

Moves iter to point to the previous segment in the buffer. If iter already points to the first segment, iter is left unmodified and the function returns FALSE.

buffer :

A InfTextBuffer.

iter :

A InfTextBufferIter pointing into buffer.

Returns :

Whether iter was moved.

inf_text_buffer_iter_get_text ()

gpointer            inf_text_buffer_iter_get_text       (InfTextBuffer *buffer,
                                                         InfTextBufferIter *iter);

Returns the text of the segment iter points to. It is encoded in buffer's encoding (see inf_text_buffer_get_encoding()).

buffer :

A InfTextBuffer.

iter :

A InfTextBufferIter pointing into buffer.

Returns :

The text of the segment iter points to. Free with g_free() when done using it.

inf_text_buffer_iter_get_length ()

guint               inf_text_buffer_iter_get_length     (InfTextBuffer *buffer,
                                                         InfTextBufferIter *iter);

Returns the length of the segment iter points to, in characters.

buffer :

A InfTextBuffer.

iter :

A InfTextBufferIter pointing into buffer.

Returns :

The number of characters of the segment iter points to.

inf_text_buffer_iter_get_bytes ()

gsize               inf_text_buffer_iter_get_bytes      (InfTextBuffer *buffer,
                                                         InfTextBufferIter *iter);

Returns the length of the segment iter points to, in bytes.

buffer :

A InfTextBuffer.

iter :

A InfTextBufferIter pointing into buffer.

Returns :

The number of bytes of the segment iter points to.

inf_text_buffer_iter_get_author ()

guint               inf_text_buffer_iter_get_author     (InfTextBuffer *buffer,
                                                         InfTextBufferIter *iter);

Returns the user ID of the user that has written the segment iter points to.

buffer :

A InfTextBuffer.

iter :

A InfTextBufferIter pointing into buffer.

Returns :

The user ID of the user that wrote the segment iter points to.

inf_text_buffer_text_inserted ()

void                inf_text_buffer_text_inserted       (InfTextBuffer *buffer,
                                                         guint pos,
                                                         InfTextChunk *chunk,
                                                         InfUser *user);

Emits the "text-inserted" signal. This is meant to be used by interface implementations in their insert_text function, or when text was inserted by other means.

buffer :

A InfTextBuffer.

pos :

A character offset into buffer.

chunk :

A InfTextChunk.

user :

A InfUser inserting chunk, or NULL.

inf_text_buffer_text_erased ()

void                inf_text_buffer_text_erased         (InfTextBuffer *buffer,
                                                         guint pos,
                                                         InfTextChunk *chunk,
                                                         InfUser *user);

Emits the "text-erased" signal. This is meant to be used by interface implementations in their erase_text function, or when text was erased by other means.

buffer :

A InfTextBuffer.

pos :

The position to begin deleting characters from.

chunk :

A InfTextChunk containing the erased text.

user :

A InfUser that erases the text, or NULL.

Signal Details

The "text-erased" signal

void                user_function                      (InfTextBuffer *inftextbuffer,
                                                        guint          arg1,
                                                        InfTextChunk  *arg2,
                                                        InfUser       *arg3,
                                                        gpointer       user_data)          : Run First

inftextbuffer :

the object which received the signal.

user_data :

user data set when the signal handler was connected.

The "text-inserted" signal

void                user_function                      (InfTextBuffer *inftextbuffer,
                                                        guint          arg1,
                                                        InfTextChunk  *arg2,
                                                        InfUser       *arg3,
                                                        gpointer       user_data)          : Run First

inftextbuffer :

the object which received the signal.

user_data :

user data set when the signal handler was connected.
libinfinity-0.5.5/docs/reference/libinftext/html/libinftext-0.5-inf-text-operations.html0000644000175000017500000001235012264766270026254 00000000000000 inf-text-operations

inf-text-operations

inf-text-operations

Object Hierarchy

  GInterface
   +----InfTextDeleteOperation
  GInterface
   +----InfTextInsertOperation

Prerequisites

InfTextDeleteOperation requires InfAdoptedOperation and GObject.

InfTextInsertOperation requires InfAdoptedOperation and GObject.

Known Implementations

InfTextDeleteOperation is implemented by InfTextDefaultDeleteOperation and InfTextRemoteDeleteOperation.

InfTextInsertOperation is implemented by InfTextDefaultInsertOperation.

Description

Details

InfTextDeleteOperation

typedef struct _InfTextDeleteOperation InfTextDeleteOperation;


InfTextInsertOperation

typedef struct _InfTextInsertOperation InfTextInsertOperation;

libinfinity-0.5.5/docs/reference/libinftext/html/libinftext-0.5-inf-text-insert-operation.html0000644000175000017500000004613612264766270027404 00000000000000 inf-text-insert-operation

inf-text-insert-operation

inf-text-insert-operation

Description

Details

struct InfTextInsertOperationIface

struct InfTextInsertOperationIface {
  GTypeInterface parent;

  /* Virtual table */
  guint(*get_position)(InfTextInsertOperation* operation);

  guint(*get_length)(InfTextInsertOperation* operation);

  InfTextInsertOperation*(*transform_position)(InfTextInsertOperation* op,
                                               guint position);
};


inf_text_insert_operation_get_position ()

guint               inf_text_insert_operation_get_position
                                                        (InfTextInsertOperation *operation);

Returns the position at which operation inserts text.

operation :

A InfTextInsertOperation.

Returns :

The position to insert text.

inf_text_insert_operation_get_length ()

guint               inf_text_insert_operation_get_length
                                                        (InfTextInsertOperation *operation);

Returns the length of the text inserted by operation.

operation :

A InfTextInsertOperation.

Returns :

The length of operation.

inf_text_insert_operation_need_concurrency_id ()

gboolean            inf_text_insert_operation_need_concurrency_id
                                                        (InfTextInsertOperation *op,
                                                         InfAdoptedOperation *against);

Returns whether transforming op against against requires a concurrency ID (see inf_adopted_operation_need_concurrency_id() for further information).

op :

A InfTextInsertOperation.

against :

Another InfAdoptedOperation.

Returns :

Whether transforming op against against requires a concurrency ID.

inf_text_insert_operation_get_concurrency_id ()

InfAdoptedConcurrencyId inf_text_insert_operation_get_concurrency_id
                                                        (InfTextInsertOperation *op,
                                                         InfAdoptedOperation *against);

Returns a concurrency ID for transformation of op against against (see inf_adopted_operation_get_concurrency_id() for further information).

op :

A InfTextInsertOperation.

against :

Another InfAdoptedOperation.

Returns :

A concurrency ID between op and against.

inf_text_insert_operation_transform_insert ()

InfAdoptedOperation * inf_text_insert_operation_transform_insert
                                                        (InfTextInsertOperation *operation,
                                                         InfTextInsertOperation *against,
                                                         InfAdoptedConcurrencyId cid);

Returns a new operation that includes the effect of against into operation.

operation :

A InfTextInsertOperation.

against :

Another InfTextInsertOperation.

cid :

The concurrency ID for the transformation.

Returns :

A new InfAdoptedOperation.

inf_text_insert_operation_transform_delete ()

InfAdoptedOperation * inf_text_insert_operation_transform_delete
                                                        (InfTextInsertOperation *operation,
                                                         InfTextDeleteOperation *against,
                                                         InfAdoptedConcurrencyId cid);

Returns a new operation that includes the effect of against into operation.

operation :

A InfTextInsertOperation.

against :

A InfTextDeleteOperation.

cid :

The concurrency ID for the transformation.

Returns :

A new InfAdoptedOperation.
libinfinity-0.5.5/docs/reference/libinftext/html/right.png0000644000175000017500000000057412264766270020631 00000000000000‰PNG  IHDRשÍÊ{PLTEÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ###+++@@@«««¿¿¿ÃÃÃÇÇÇÏÏÏïïïÿÿÿçWôtRNS (48@GX[«·¿ÃÏÓ×ßãçï÷yþ±t–IDATxÚ…ÐÉÂ0 PS–@XZ -%”­eþÿ Iä‰ÁÜ<ï`ÙeAÙ¬Zìç9(ñÆ1'n/îÊ"Á¤²ÜU!‡DЉhŒwÎÅ$¢ñ4QX$°Ô AlþXRü^>8ŽMzšãmtúºü¾Ä>äk¸Ð7â½ œïOŠ$ôÙž³=mVQ.JO£é9 »ñ• IEND®B`‚libinfinity-0.5.5/docs/reference/libinftext/html/index.html0000644000175000017500000000645112264766270021003 00000000000000 libinftext-0.5 Reference Manual libinfinity-0.5.5/docs/reference/libinftext/html/libinftext-0.5-inf-text-session.html0000644000175000017500000006061212264766270025560 00000000000000 InfTextSession

InfTextSession

InfTextSession

Object Hierarchy

  GObject
   +----InfSession
         +----InfAdoptedSession
               +----InfTextSession

Implemented Interfaces

InfTextSession implements InfCommunicationObject.

Properties

  "caret-update-interval"    guint                 : Read / Write / Construct

Description

Details

enum InfTextSessionError

typedef enum {
  INF_TEXT_SESSION_ERROR_INVALID_HUE,

  INF_TEXT_SESSION_ERROR_FAILED
} InfTextSessionError;

INF_TEXT_SESSION_ERROR_INVALID_HUE

INF_TEXT_SESSION_ERROR_FAILED


InfTextSession

typedef struct _InfTextSession InfTextSession;


inf_text_session_new ()

InfTextSession *    inf_text_session_new                (InfCommunicationManager *manager,
                                                         InfTextBuffer *buffer,
                                                         InfIo *io,
                                                         InfSessionStatus status,
                                                         InfCommunicationGroup *sync_group,
                                                         InfXmlConnection *sync_connection);

Creates a new InfTextSession. The communication manager is used to send and receive requests from subscription and synchronization. buffer will be set to be initially empty if the session is initially synchronized (see below). io is required to trigger timeouts.

If status is INF_SESSION_PRESYNC or INF_SESSION_SYNCHRONIZING, then the session will initially be sychronized, meaning the initial content is retrieved from sync_connection. If you are subscribed to the session, set the subscription group via inf_session_set_subscription_group().

manager :

A InfCommunicationManager.

buffer :

An initial InfTextBuffer.

io :

A InfIo object.

status :

The initial status of the session.

sync_group :

A group in which the session is synchronized. Ignored if status is INF_SESSION_RUNNING.

sync_connection :

A connection to synchronize the session from. Ignored if status is INF_SESSION_RUNNING.

Returns :

A new InfTextSession.

inf_text_session_new_with_user_table ()

InfTextSession *    inf_text_session_new_with_user_table
                                                        (InfCommunicationManager *manager,
                                                         InfTextBuffer *buffer,
                                                         InfIo *io,
                                                         InfUserTable *user_table,
                                                         InfSessionStatus status,
                                                         InfCommunicationGroup *sync_group,
                                                         InfXmlConnection *sync_connection);

Creates a new InfTextSession. The connection manager is used to send and receive requests from subscription and synchronization. buffer will be set to be initially empty if the session is initially synchronized (see below). io is required to trigger timeouts.

If status is INF_SESSION_PRESYNC or INF_SESSION_SYNCHRONIZING, then the session will initially be sychronized, meaning the initial content is retrieved from sync_connection. If you are subscribed to the session, set the subscription group via inf_session_set_subscription_group().

user_table is used as an initial user table. The user table should only contain unavailable users, if any, that may rejoin during the session. If there was an available user in the user table, it would probably belong to another session, but different sessions cannot share the same user object.

manager :

A InfCommunicationManager.

buffer :

An initial InfTextBuffer.

io :

A InfIo object.

user_table :

A InfUserTable.

status :

The initial status for the session.

sync_group :

A group in which the session is synchronized. Ignored if status is INF_SESSION_RUNNING.

sync_connection :

A connection to synchronize the session from. Ignored if status is INF_SESSION_RUNNING.

Returns :

A new InfTextSession.

inf_text_session_set_user_color ()

void                inf_text_session_set_user_color     (InfTextSession *session,
                                                         InfTextUser *user,
                                                         gdouble hue);

Changes the user color of user. user must have the INF_USER_LOCAL flag set.

session :

A InfTextSession.

user :

A local InfTextUser from session's user table.

hue :

New hue value for user's color. Ranges from 0.0 (red) to 1.0 (red).

inf_text_session_flush_requests_for_user ()

void                inf_text_session_flush_requests_for_user
                                                        (InfTextSession *session,
                                                         InfTextUser *user);

This function sends all pending requests for user immediately. Requests that modify the buffer are not queued normally, but cursor movement requests are delayed in case are issued frequently, to save bandwidth.

The main purpose of this function is to send all pending requests before changing a user's status to inactive or unavailable since inactive users are automatically activated as soon as they issue a request.

TODO: We should probably detect this automatically, without requiring people to call this function, i.e. flush requests for local users just before they become inactive.

user must have the INF_USER_LOCAL flag set.

session :

A InfTextSession.

user :

The InfTextUser for which to flush messages.

Property Details

The "caret-update-interval" property

  "caret-update-interval"    guint                 : Read / Write / Construct

Minimum number of milliseconds between caret update broadcasts.

Default value: 500

libinfinity-0.5.5/docs/reference/libinftext/html/libinftext-0.5-inf-text-chunk.html0000644000175000017500000012475012264766270025211 00000000000000 inf-text-chunk

inf-text-chunk

inf-text-chunk

Object Hierarchy

  GBoxed
   +----InfTextChunk

Description

Details

InfTextChunk

typedef struct _InfTextChunk InfTextChunk;


struct InfTextChunkIter

struct InfTextChunkIter {
  InfTextChunk* chunk;
  GSequenceIter* first;
  GSequenceIter* second;
};


inf_text_chunk_new ()

InfTextChunk *      inf_text_chunk_new                  (const gchar *encoding);

Creates a new InfTextChunk with no initial content that holds text in the given encoding. TODO: Allow binary data with NULL encoding.

encoding :

A content encoding, such as "UTF-8" or "LATIN1".

Returns :

A new InfTextChunk.

inf_text_chunk_copy ()

InfTextChunk *      inf_text_chunk_copy                 (InfTextChunk *self);

Returns a copy of self.

self :

A InfTextChunk.

Returns :

A new InfTextChunk.

inf_text_chunk_free ()

void                inf_text_chunk_free                 (InfTextChunk *self);

Frees a InfTextChunk allocated with inf_text_chunk_new(), inf_text_chunk_copy() or inf_text_chunk_substring().

self :

A InfTextChunk.

inf_text_chunk_get_encoding ()

const gchar *       inf_text_chunk_get_encoding         (InfTextChunk *self);

Returns the character encoding in which the content of self is encoded.

self :

A InfTextChunk.

Returns :

The encoding of self.

inf_text_chunk_get_length ()

guint               inf_text_chunk_get_length           (InfTextChunk *self);

Returns the number of characters contained in self.

self :

A InfTextChunk.

Returns :

The number of characters of self.

inf_text_chunk_substring ()

InfTextChunk *      inf_text_chunk_substring            (InfTextChunk *self,
                                                         guint begin,
                                                         guint length);

Returns a new InfTextChunk containing a substring of self, beginning at character offset begin and length characters long.

self :

A InfTextChunk.

begin :

A character offset into self.

length :

The length of the text to extract.

Returns :

A new InfTextChunk.

inf_text_chunk_insert_text ()

void                inf_text_chunk_insert_text          (InfTextChunk *self,
                                                         guint offset,
                                                         gconstpointer text,
                                                         gsize bytes,
                                                         guint length,
                                                         guint author);

Inserts text written by author into self. text is expected to be in the chunk's encoding.

self :

A InfTextChunk.

offset :

Character offset at which to insert text

text :

Text to insert.

bytes :

Number of bytes of text.

length :

Number of characters contained in text.

author :

User that wrote text.

inf_text_chunk_insert_chunk ()

void                inf_text_chunk_insert_chunk         (InfTextChunk *self,
                                                         guint offset,
                                                         InfTextChunk *text);

Inserts text into self at position offset. text and self must have the same encoding.

self :

A InfTextChunk.

offset :

Character offset at which to insert text.

text :

Chunk to insert into self.

inf_text_chunk_erase ()

void                inf_text_chunk_erase                (InfTextChunk *self,
                                                         guint begin,
                                                         guint length);

Removes length characters of self, starting from character offset begin.

self :

A InfTextChunk.

begin :

A character offset into self.

length :

Number of characters to erase.

inf_text_chunk_get_text ()

gpointer            inf_text_chunk_get_text             (InfTextChunk *self,
                                                         gsize *length);

Returns the content of self as an array. The text is encoded in self's encoding. length is set to the number of bytes in the returned buffer, if non-NULL. The result is _not_ zero-terminated.

self :

A InfTextChunk.

length :

Location to write the number of bytes to, or NULL.

Returns :

Content of self. Free with g_free() if no longer in use.

inf_text_chunk_equal ()

gboolean            inf_text_chunk_equal                (InfTextChunk *self,
                                                         InfTextChunk *other);

Returns whether the two text chunks contain the same text and the same segments were written by the same authors.

self :

A InfTextChunk.

other :

Another InfTextChunk.

Returns :

Whether the two chunks are equal.

inf_text_chunk_iter_init ()

gboolean            inf_text_chunk_iter_init            (InfTextChunk *self,
                                                         InfTextChunkIter *iter);

Sets iter to point to the first segment of self. If there are no segments (i.e. self is empty), iter is left untouched and the function returns FALSE.

self :

A InfTextChunk.

iter :

A InfTextChunkIter.

Returns :

Whether iter was set.

inf_text_chunk_iter_next ()

gboolean            inf_text_chunk_iter_next            (InfTextChunkIter *iter);

Sets iter to point to the next segment. If iter already points to the last segment, the function returns FALSE.

iter :

An initialized InfTextChunkIter.

Returns :

Whether iter was set.

inf_text_chunk_iter_prev ()

gboolean            inf_text_chunk_iter_prev            (InfTextChunkIter *iter);

Sets iter to point to the previous segment. If iter already points to the first segment, the function returns FALSE.

iter :

An initialized InfTextChunkIter.

Returns :

Whether iter has changed.

inf_text_chunk_iter_get_text ()

gconstpointer       inf_text_chunk_iter_get_text        (InfTextChunkIter *iter);

Returns the text of the segment iter points to. The text is in the underlaying InfTextChunk's encoding.

iter :

An initialized InfTextChunkIter.

Returns :

The text of the segment iter points to.

inf_text_chunk_iter_get_length ()

guint               inf_text_chunk_iter_get_length      (InfTextChunkIter *iter);

Returns the number of characters in the segment iter points to.

iter :

An initialized InfTextChunkIter.

Returns :

The number of characters in the segment iter points to.

inf_text_chunk_iter_get_bytes ()

gsize               inf_text_chunk_iter_get_bytes       (InfTextChunkIter *iter);

Returns the number of bytes in the segment iter points to.

iter :

An initialized InfTextChunkIter.

Returns :

The number of bytes in the segment iter points to.

inf_text_chunk_iter_get_author ()

guint               inf_text_chunk_iter_get_author      (InfTextChunkIter *iter);

Returns the user ID of the author of the segment iter points to.

iter :

An initialized InfTextChunkIter.

Returns :

The user ID of the author of the segment iter points to.
libinfinity-0.5.5/docs/reference/libinftext/html/InfTextDefaultDeleteOperation.html0000644000175000017500000002442412264766270025566 00000000000000 InfTextDefaultDeleteOperation

InfTextDefaultDeleteOperation

InfTextDefaultDeleteOperation

Object Hierarchy

  GObject
   +----InfTextDefaultDeleteOperation

Implemented Interfaces

InfTextDefaultDeleteOperation implements InfAdoptedOperation and InfTextDeleteOperation.

Properties

  "chunk"                    InfTextChunk*         : Read / Write / Construct Only
  "position"                 guint                 : Read / Write / Construct Only

Description

Details

InfTextDefaultDeleteOperation

typedef struct _InfTextDefaultDeleteOperation InfTextDefaultDeleteOperation;


inf_text_default_delete_operation_new ()

InfTextDefaultDeleteOperation * inf_text_default_delete_operation_new
                                                        (guint position,
                                                         InfTextChunk *chunk);

Creates a new delete operation that, when applied, deletes the text chunk that starts at character offset position in the buffer. The operation cannot be applied, if there is some other text at that position in the buffer.

position :

The position at which to delete text.

chunk :

The text to delete.

Returns :

A new InfTextDefaultDeleteOperation.

inf_text_default_delete_operation_get_chunk ()

InfTextChunk *      inf_text_default_delete_operation_get_chunk
                                                        (InfTextDefaultDeleteOperation *operation);

Returns the text deleted by operation.

operation :

A InfTextDefaultDeleteOperation.

Returns :

A InfTextChunk, owned by the operation.

Property Details

The "chunk" property

  "chunk"                    InfTextChunk*         : Read / Write / Construct Only

The deleted text.


The "position" property

  "position"                 guint                 : Read / Write / Construct Only

Position where to start deleting characters.

Default value: 0

libinfinity-0.5.5/docs/reference/libinftext/html/InfTextDefaultBuffer.html0000644000175000017500000001453412264766270023715 00000000000000 InfTextDefaultBuffer

InfTextDefaultBuffer

InfTextDefaultBuffer

Object Hierarchy

  GObject
   +----InfTextDefaultBuffer

Implemented Interfaces

InfTextDefaultBuffer implements InfBuffer and InfTextBuffer.

Properties

  "encoding"                 gchar*                : Read / Write / Construct Only

Description

Details

InfTextDefaultBuffer

typedef struct _InfTextDefaultBuffer InfTextDefaultBuffer;


inf_text_default_buffer_new ()

InfTextDefaultBuffer * inf_text_default_buffer_new      (const gchar *encoding);

Creates a new, empty InfTextDefaultBuffer.

encoding :

The character encoding to use for the buffer.

Returns :

A InfTextDefaultBuffer.

Property Details

The "encoding" property

  "encoding"                 gchar*                : Read / Write / Construct Only

The character encoding of the text buffer.

Default value: NULL

libinfinity-0.5.5/docs/reference/libinftext/html/InfTextUser.html0000644000175000017500000004677512264766270022131 00000000000000 InfTextUser

InfTextUser

InfTextUser

Object Hierarchy

  GObject
   +----InfUser
         +----InfAdoptedUser
               +----InfTextUser

Properties

  "caret-position"           guint                 : Read / Write / Construct
  "hue"                      gdouble               : Read / Write / Construct
  "selection-length"         gint                  : Read / Write / Construct

Description

Details

InfTextUser

typedef struct _InfTextUser InfTextUser;


inf_text_user_new ()

InfTextUser *       inf_text_user_new                   (guint id,
                                                         const gchar *name,
                                                         InfAdoptedStateVector *vector,
                                                         double hue);

Creates a new InfTextUser. id should be unique for all users working together. InfUserTable will refuse to add users with duplicate id. If vector is NULL, then the vector with all components zero is used.

id :

The user ID for this user.

name :

The user's name.

vector :

The state at which the user is at, or NULL.

hue :

The hue value of the user's color.

Returns :

A new InfTextUser. Free with g_object_unref() when no longer needed.

inf_text_user_get_caret_position ()

guint               inf_text_user_get_caret_position    (InfTextUser *user);

Returns the position of user's caret.

user :

A InfTextUser.

Returns :

user's caret position.

inf_text_user_get_selection_length ()

gint                inf_text_user_get_selection_length  (InfTextUser *user);

Returns the number of characters this user has selected, starting from the caret position. Negative number mean selection towards the beginning of the buffer.

user :

A InfTextUser.

Returns :

user's selection length in characters.

inf_text_user_set_selection ()

void                inf_text_user_set_selection         (InfTextUser *user,
                                                         guint position,
                                                         gint length,
                                                         gboolean by_request);

Changes user's selection (i.e. caret position and selection length).

user :

A InfTextUser.

position :

The new position for the user's caret.

length :

The number of characters to select. Negative numbers mean selection towards the beginning.

inf_text_user_get_hue ()

gdouble             inf_text_user_get_hue               (InfTextUser *user);

Returns the hue of the user's color as a double ranging from 0 to 1. The other components (saturation and lightness) are not specific to the user and may be chosen indivudually to optimize the actual visual display.

user :

A InfTextUser.

Returns :

The hue of the user's color.

Property Details

The "caret-position" property

  "caret-position"           guint                 : Read / Write / Construct

The position of this user's caret.

Default value: 0


The "hue" property

  "hue"                      gdouble               : Read / Write / Construct

The hue value of the user's color. saturation and lightness are set by each client individually.

Allowed values: [0,1]

Default value: 0


The "selection-length" property

  "selection-length"         gint                  : Read / Write / Construct

The number of characters of this user's selection.

Default value: 0

Signal Details

The "selection-changed" signal

void                user_function                      (InfTextUser *inftextuser,
                                                        guint        arg1,
                                                        gint         arg2,
                                                        gboolean     arg3,
                                                        gpointer     user_data)        : Run Last

inftextuser :

the object which received the signal.

user_data :

user data set when the signal handler was connected.
libinfinity-0.5.5/docs/reference/libinftext/html/libinftext-0.5.devhelp20000644000175000017500000003740512264766270023114 00000000000000 libinfinity-0.5.5/docs/reference/libinftext/html/up.png0000644000175000017500000000044212264766270020132 00000000000000‰PNG  IHDRàw=øéIDATxí•!‚@† Ä ‘H0ˆîÀô(4À6Œ£Á` l$n$ áùpæÍl]åáHðŸùʆï›yà ެ+$þ†ØGö턈)å꺭5E.™LEAUUY" yÿŒX"|¹5•3"n9#ÂÛ"|¹;²0’#7#eYRD!~/_"Ð4 ÉY!@)E‘„Îs‡¥i:( ÃÌi­Ÿ´mKO1(CnÌ€¹Ù¹>Ùóm•ý³ RBžç/)Š‚×1 éà½mÆþtÖÈÖAâýrt¾)_&›IEND®B`‚libinfinity-0.5.5/docs/reference/libinftext/html/InfTextUndoGrouping.html0000644000175000017500000001336112264766270023614 00000000000000 InfTextUndoGrouping

InfTextUndoGrouping

InfTextUndoGrouping — Undo grouping for text operations

Synopsis

#include <libinftext/inf-text-undo-grouping.h>

                    InfTextUndoGrouping;
InfTextUndoGrouping * inf_text_undo_grouping_new        (void);

Object Hierarchy

  GObject
   +----InfAdoptedUndoGrouping
         +----InfTextUndoGrouping

Description

InfTextUndoGrouping handles undo grouping for text operations. It makes sure many insert or delete operations occuring in a row can be undone simultaneousely, taking into account that other users might have issued requests inbetween.

Using this class you don't need to connect to "group-requests" to perform the grouping.

Details

InfTextUndoGrouping

typedef struct _InfTextUndoGrouping InfTextUndoGrouping;

InfTextUndoGrouping is an opaque data type. You should only access it via the public API functions.


inf_text_undo_grouping_new ()

InfTextUndoGrouping * inf_text_undo_grouping_new        (void);

Creates a new InfTextUndoGrouping.

Returns :

A new InfTextUndoGrouping. To be freed with g_object_unref().
libinfinity-0.5.5/docs/reference/libinftext/Makefile.in0000644000175000017500000006503112264766065020110 00000000000000# Makefile.in generated by automake 1.13.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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@ # -*- mode: makefile -*- #################################### # Everything below here is generic # #################################### VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(top_srcdir)/gtk-doc.make $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am $(top_srcdir)/mkinstalldirs subdir = docs/reference/libinftext ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/libinfinity/inf-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBINFINITY_API_VERSION = @LIBINFINITY_API_VERSION@ LIBINFINITY_LIBTOOL_VERSION = @LIBINFINITY_LIBTOOL_VERSION@ LIBINFINITY_VERSION = @LIBINFINITY_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ avahi_CFLAGS = @avahi_CFLAGS@ avahi_LIBS = @avahi_LIBS@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gtk_requirement = @gtk_requirement@ gtk_version = @gtk_version@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infgtk_CFLAGS = @infgtk_CFLAGS@ infgtk_LIBS = @infgtk_LIBS@ infinity_CFLAGS = @infinity_CFLAGS@ infinity_LIBS = @infinity_LIBS@ infinoted_CFLAGS = @infinoted_CFLAGS@ infinoted_LIBS = @infinoted_LIBS@ infodir = @infodir@ inftext_CFLAGS = @inftext_CFLAGS@ inftext_LIBS = @inftext_LIBS@ inftextgtk_CFLAGS = @inftextgtk_CFLAGS@ inftextgtk_LIBS = @inftextgtk_LIBS@ install_sh = @install_sh@ libdaemon_CFLAGS = @libdaemon_CFLAGS@ libdaemon_LIBS = @libdaemon_LIBS@ 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@ # We require automake 1.6 at least. AUTOMAKE_OPTIONS = 1.6 # This is a blank Makefile.am for using gtk-doc. # Copy this to your project's API docs directory and modify the variables to # suit your project. See the GTK+ Makefiles in gtk+/docs/reference for examples # of using the various options. # The name of the module, e.g. 'glib'. DOC_MODULE = libinftext-$(LIBINFINITY_API_VERSION) # The top-level SGML file. You can change this if you want to. DOC_MAIN_SGML_FILE = $(DOC_MODULE)-docs.sgml # The directory containing the source code. Relative to $(srcdir). # gtk-doc will search all .c & .h files beneath here for inline comments # documenting the functions and macros. # e.g. DOC_SOURCE_DIR=../../../gtk DOC_SOURCE_DIR = $(top_srcdir)/libinftext # Extra options to pass to gtkdoc-scangobj. Not normally needed. SCANGOBJ_OPTIONS = # Extra options to supply to gtkdoc-scan. # e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED" SCAN_OPTIONS = --rebuild-types # Extra options to supply to gtkdoc-mkdb. # e.g. MKDB_OPTIONS=--sgml-mode --output-format=xml MKDB_OPTIONS = --sgml-mode --output-format=xml # Extra options to supply to gtkdoc-mktmpl # e.g. MKTMPL_OPTIONS=--only-section-tmpl MKTMPL_OPTIONS = # Extra options to supply to gtkdoc-fixref. Not normally needed. # e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html FIXXREF_OPTIONS = \ --extra-dir=../libinfinity/html # Used for dependencies. The docs will be rebuilt if any of these change. # e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h # e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c HFILE_GLOB = \ $(top_srcdir)/libinftext/*.h CFILE_GLOB = \ $(top_srcdir)/libinftext/*.c # Header files to ignore when scanning. # e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h IGNORE_HFILES = # Images to copy into HTML directory. # e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png HTML_IMAGES = # Extra SGML files that are included by $(DOC_MAIN_SGML_FILE). # e.g. content_files=running.sgml building.sgml changes-2.0.sgml content_files = \ ../version.xml # SGML files where gtk-doc abbrevations (#GtkWidget) are expanded # These files must be listed here *and* in content_files # e.g. expand_content_files=running.sgml expand_content_files = # CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library. # Only needed if you are using gtkdoc-scangobj to dynamically query widget # signals and properties. # e.g. INCLUDES=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS) # e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib) #INCLUDES=$(inftext_CFLAGS) AM_CPPFLAGS = $(inftext_CFLAGS) GTKDOC_LIBS = \ $(inftext_LIBS) \ $(top_builddir)/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ $(top_builddir)/libinftext/libinftext-$(LIBINFINITY_API_VERSION).la @GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_CC = $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_LD = $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) @GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) @GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_RUN = @GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_RUN = $(LIBTOOL) --mode=execute # We set GPATH here; this gives us semantics for GNU make # which are more like other make's VPATH, when it comes to # whether a source that is a target of one rule is then # searched for in VPATH/GPATH. # GPATH = $(srcdir) TARGET_DIR = $(HTML_DIR)/$(DOC_MODULE) SETUP_FILES = \ $(content_files) \ $(DOC_MAIN_SGML_FILE) \ $(DOC_MODULE)-sections.txt \ $(DOC_MODULE)-overrides.txt # This includes the standard gtk-doc make rules, copied by gtkdocize. # Other files to distribute # e.g. EXTRA_DIST += version.xml.in EXTRA_DIST = $(HTML_IMAGES) $(SETUP_FILES) DOC_STAMPS = setup-build.stamp scan-build.stamp tmpl-build.stamp sgml-build.stamp \ html-build.stamp pdf-build.stamp \ tmpl.stamp sgml.stamp html.stamp pdf.stamp SCANOBJ_FILES = \ $(DOC_MODULE).args \ $(DOC_MODULE).hierarchy \ $(DOC_MODULE).interfaces \ $(DOC_MODULE).prerequisites \ $(DOC_MODULE).signals REPORT_FILES = \ $(DOC_MODULE)-undocumented.txt \ $(DOC_MODULE)-undeclared.txt \ $(DOC_MODULE)-unused.txt CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) @ENABLE_GTK_DOC_TRUE@@GTK_DOC_BUILD_HTML_FALSE@HTML_BUILD_STAMP = @ENABLE_GTK_DOC_TRUE@@GTK_DOC_BUILD_HTML_TRUE@HTML_BUILD_STAMP = html-build.stamp @ENABLE_GTK_DOC_TRUE@@GTK_DOC_BUILD_PDF_FALSE@PDF_BUILD_STAMP = @ENABLE_GTK_DOC_TRUE@@GTK_DOC_BUILD_PDF_TRUE@PDF_BUILD_STAMP = pdf-build.stamp #### setup #### GTK_DOC_V_SETUP = $(GTK_DOC_V_SETUP_$(V)) GTK_DOC_V_SETUP_ = $(GTK_DOC_V_SETUP_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_SETUP_0 = @echo " DOC Preparing build"; #### scan #### GTK_DOC_V_SCAN = $(GTK_DOC_V_SCAN_$(V)) GTK_DOC_V_SCAN_ = $(GTK_DOC_V_SCAN_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_SCAN_0 = @echo " DOC Scanning header files"; GTK_DOC_V_INTROSPECT = $(GTK_DOC_V_INTROSPECT_$(V)) GTK_DOC_V_INTROSPECT_ = $(GTK_DOC_V_INTROSPECT_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_INTROSPECT_0 = @echo " DOC Introspecting gobjects"; #### templates #### GTK_DOC_V_TMPL = $(GTK_DOC_V_TMPL_$(V)) GTK_DOC_V_TMPL_ = $(GTK_DOC_V_TMPL_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_TMPL_0 = @echo " DOC Rebuilding template files"; #### xml #### GTK_DOC_V_XML = $(GTK_DOC_V_XML_$(V)) GTK_DOC_V_XML_ = $(GTK_DOC_V_XML_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_XML_0 = @echo " DOC Building XML"; #### html #### GTK_DOC_V_HTML = $(GTK_DOC_V_HTML_$(V)) GTK_DOC_V_HTML_ = $(GTK_DOC_V_HTML_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_HTML_0 = @echo " DOC Building HTML"; GTK_DOC_V_XREF = $(GTK_DOC_V_XREF_$(V)) GTK_DOC_V_XREF_ = $(GTK_DOC_V_XREF_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_XREF_0 = @echo " DOC Fixing cross-references"; #### pdf #### GTK_DOC_V_PDF = $(GTK_DOC_V_PDF_$(V)) GTK_DOC_V_PDF_ = $(GTK_DOC_V_PDF_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_PDF_0 = @echo " DOC Building PDF"; # Files not to distribute # for --rebuild-types in $(SCAN_OPTIONS), e.g. $(DOC_MODULE).types # for --rebuild-sections in $(SCAN_OPTIONS) e.g. $(DOC_MODULE)-sections.txt DISTCLEANFILES = libinftext-$(LIBINFINITY_API_VERSION).types version.xml all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/gtk-doc.make $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu docs/reference/libinftext/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu docs/reference/libinftext/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_srcdir)/gtk-doc.make: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook check-am: all-am check: check-am all-am: Makefile all-local installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -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) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-local mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-local dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-data-local install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic \ maintainer-clean-local mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-local .MAKE: install-am install-strip .PHONY: all all-am all-local check check-am clean clean-generic \ clean-libtool clean-local cscopelist-am ctags-am dist-hook \ distclean distclean-generic distclean-libtool distclean-local \ distdir dvi dvi-am html html-am info info-am install \ install-am install-data install-data-am install-data-local \ install-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ maintainer-clean-local mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-local @ENABLE_GTK_DOC_TRUE@all-local: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) @ENABLE_GTK_DOC_FALSE@all-local: docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) $(REPORT_FILES): sgml-build.stamp setup-build.stamp: -$(GTK_DOC_V_SETUP)if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ files=`echo $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types`; \ if test "x$$files" != "x" ; then \ for file in $$files ; do \ test -f $(abs_srcdir)/$$file && \ cp -pu $(abs_srcdir)/$$file $(abs_builddir)/$$file || true; \ done; \ fi; \ test -d $(abs_srcdir)/tmpl && \ { cp -rp $(abs_srcdir)/tmpl $(abs_builddir)/; \ chmod -R u+w $(abs_builddir)/tmpl; } \ fi $(AM_V_at)touch setup-build.stamp scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB) $(GTK_DOC_V_SCAN)_source_dir='' ; \ for i in $(DOC_SOURCE_DIR) ; do \ _source_dir="$${_source_dir} --source-dir=$$i" ; \ done ; \ gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES) $(GTK_DOC_V_INTROSPECT)if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null 2>&1 ; then \ scanobj_options=""; \ gtkdoc-scangobj 2>&1 --help | grep >/dev/null "\-\-verbose"; \ if test "$(?)" = "0"; then \ if test "x$(V)" = "x1"; then \ scanobj_options="--verbose"; \ fi; \ fi; \ CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \ gtkdoc-scangobj $(SCANGOBJ_OPTIONS) $$scanobj_options --module=$(DOC_MODULE); \ else \ for i in $(SCANOBJ_FILES) ; do \ test -f $$i || touch $$i ; \ done \ fi $(AM_V_at)touch scan-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp @true tmpl-build.stamp: setup-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt $(GTK_DOC_V_TMPL)gtkdoc-mktmpl --module=$(DOC_MODULE) $(MKTMPL_OPTIONS) $(AM_V_at)if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ if test -w $(abs_srcdir) ; then \ cp -rp $(abs_builddir)/tmpl $(abs_srcdir)/; \ fi \ fi $(AM_V_at)touch tmpl-build.stamp tmpl.stamp: tmpl-build.stamp @true $(srcdir)/tmpl/*.sgml: @true sgml-build.stamp: tmpl.stamp $(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml $(expand_content_files) $(GTK_DOC_V_XML)-chmod -R u+w $(srcdir) && _source_dir='' ; \ for i in $(DOC_SOURCE_DIR) ; do \ _source_dir="$${_source_dir} --source-dir=$$i" ; \ done ; \ gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $${_source_dir} $(MKDB_OPTIONS) $(AM_V_at)touch sgml-build.stamp sgml.stamp: sgml-build.stamp @true html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) $(GTK_DOC_V_HTML)rm -rf html && mkdir html && \ mkhtml_options=""; \ gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-verbose"; \ if test "$(?)" = "0"; then \ if test "x$(V)" = "x1"; then \ mkhtml_options="$$mkhtml_options --verbose"; \ fi; \ fi; \ gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \ if test "$(?)" = "0"; then \ mkhtml_options="$$mkhtml_options --path=\"$(abs_srcdir)\""; \ fi; \ cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) -@test "x$(HTML_IMAGES)" = "x" || \ for file in $(HTML_IMAGES) ; do \ if test -f $(abs_srcdir)/$$file ; then \ cp $(abs_srcdir)/$$file $(abs_builddir)/html; \ fi; \ if test -f $(abs_builddir)/$$file ; then \ cp $(abs_builddir)/$$file $(abs_builddir)/html; \ fi; \ done; $(GTK_DOC_V_XREF)gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) $(AM_V_at)touch html-build.stamp pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) $(GTK_DOC_V_PDF)rm -f $(DOC_MODULE).pdf && \ mkpdf_options=""; \ gtkdoc-mkpdf 2>&1 --help | grep >/dev/null "\-\-verbose"; \ if test "$(?)" = "0"; then \ if test "x$(V)" = "x1"; then \ mkpdf_options="$$mkpdf_options --verbose"; \ fi; \ fi; \ if test "x$(HTML_IMAGES)" != "x"; then \ for img in $(HTML_IMAGES); do \ part=`dirname $$img`; \ echo $$mkpdf_options | grep >/dev/null "\-\-imgdir=$$part "; \ if test $$? != 0; then \ mkpdf_options="$$mkpdf_options --imgdir=$$part"; \ fi; \ done; \ fi; \ gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_options $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS) $(AM_V_at)touch pdf-build.stamp ############## clean-local: @rm -f *~ *.bak @rm -rf .libs distclean-local: @rm -rf xml html $(REPORT_FILES) $(DOC_MODULE).pdf \ $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ rm -f $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types; \ rm -rf tmpl; \ fi maintainer-clean-local: @rm -rf xml html install-data-local: @installfiles=`echo $(builddir)/html/*`; \ if test "$$installfiles" = '$(builddir)/html/*'; \ then echo 1>&2 'Nothing to install' ; \ else \ if test -n "$(DOC_MODULE_VERSION)"; then \ installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ else \ installdir="$(DESTDIR)$(TARGET_DIR)"; \ fi; \ $(mkinstalldirs) $${installdir} ; \ for i in $$installfiles; do \ echo ' $(INSTALL_DATA) '$$i ; \ $(INSTALL_DATA) $$i $${installdir}; \ done; \ if test -n "$(DOC_MODULE_VERSION)"; then \ mv -f $${installdir}/$(DOC_MODULE).devhelp2 \ $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \ fi; \ $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir}; \ fi uninstall-local: @if test -n "$(DOC_MODULE_VERSION)"; then \ installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ else \ installdir="$(DESTDIR)$(TARGET_DIR)"; \ fi; \ rm -rf $${installdir} # # Require gtk-doc when making dist # @ENABLE_GTK_DOC_TRUE@dist-check-gtkdoc: docs @ENABLE_GTK_DOC_FALSE@dist-check-gtkdoc: @ENABLE_GTK_DOC_FALSE@ @echo "*** gtk-doc must be installed and enabled in order to make dist" @ENABLE_GTK_DOC_FALSE@ @false dist-hook: dist-check-gtkdoc dist-hook-local @mkdir $(distdir)/tmpl @mkdir $(distdir)/html @-cp ./tmpl/*.sgml $(distdir)/tmpl @cp ./html/* $(distdir)/html @-cp ./$(DOC_MODULE).pdf $(distdir)/ @-cp ./$(DOC_MODULE).types $(distdir)/ @-cp ./$(DOC_MODULE)-sections.txt $(distdir)/ @cd $(distdir) && rm -f $(DISTCLEANFILES) @$(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html .PHONY : dist-hook-local docs # Comment this out if you want your docs-status tested during 'make check' #TESTS = $(GTKDOC_CHECK) # 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: libinfinity-0.5.5/docs/reference/libinftext/libinftext-0.5-overrides.txt0000644000175000017500000000000012264763732023233 00000000000000libinfinity-0.5.5/docs/reference/libinftext/tmpl/0000755000175000017500000000000012264766270017070 500000000000000libinfinity-0.5.5/docs/reference/libinftext/tmpl/inf-text-pword.sgml0000644000175000017500000000041112264766270022557 00000000000000 inf-text-pword libinfinity-0.5.5/docs/reference/libinftext/tmpl/inf-text-move-operation.sgml0000644000175000017500000000223112264766270024372 00000000000000 InfTextMoveOperation @position: @length: @Returns: @operation: @Returns: @operation: @Returns: @insert_position: @insert_length: @move_position: @move_length: @left_gravity: @delete_position: @delete_length: @move_position: @move_length: libinfinity-0.5.5/docs/reference/libinftext/tmpl/inf-text-default-insert-operation.sgml0000644000175000017500000000141712264766270026357 00000000000000 InfTextDefaultInsertOperation @pos: @chunk: @Returns: @operation: @Returns: libinfinity-0.5.5/docs/reference/libinftext/tmpl/inf-text-default-delete-operation.sgml0000644000175000017500000000142412264766270026313 00000000000000 InfTextDefaultDeleteOperation @position: @chunk: @Returns: @operation: @Returns: libinfinity-0.5.5/docs/reference/libinftext/tmpl/inf-text-undo-grouping.sgml0000644000175000017500000000072412264766270024230 00000000000000 InfTextUndoGrouping @void: @Returns: libinfinity-0.5.5/docs/reference/libinftext/tmpl/inf-text-default-buffer.sgml0000644000175000017500000000104312264766270024321 00000000000000 InfTextDefaultBuffer @encoding: @Returns: libinfinity-0.5.5/docs/reference/libinftext/tmpl/libinftext-0.6-unused.sgml0000644000175000017500000000541712264766270023655 00000000000000 inf-text-operations inf-text-pword @inftextbuffer: the object which received the signal. @arg1: @arg2: @arg3: @inftextbuffer: the object which received the signal. @arg1: @arg2: @arg3: @buffer: @Returns: @xml: @encoding: @error: @Returns: @self: @iter: @Returns: @self: @xml: @op: @against: @Returns: @op: @against: @Returns: @operation: @Returns: @first: @second: @Returns: @pword: @Returns: @pword: @pword: @Returns: @pword: @Returns: @pword: @Returns: @initial: @Returns: @pword: @next: @Returns: libinfinity-0.5.5/docs/reference/libinftext/tmpl/inf-text-operations.sgml0000644000175000017500000000067512264766270023623 00000000000000 inf-text-operations libinfinity-0.5.5/docs/reference/libinftext/tmpl/inf-text-delete-operation.sgml0000644000175000017500000000231012264766270024664 00000000000000 inf-text-delete-operation @parent: @get_position: @get_length: @transform_position: @transform_overlap: @transform_split: @operation: @Returns: @operation: @Returns: @op: @against: @Returns: @op: @against: @Returns: @operation: @against: @cid: @Returns: @operation: @against: @cid: @Returns: libinfinity-0.5.5/docs/reference/libinftext/tmpl/inf-text-remote-delete-operation.sgml0000644000175000017500000000123412264766270026161 00000000000000 InfTextRemoteDeleteOperation @position: @length: @Returns: libinfinity-0.5.5/docs/reference/libinftext/tmpl/inf-text-chunk.sgml0000644000175000017500000000425512264766270022546 00000000000000 inf-text-chunk @chunk: @first: @second: @encoding: @Returns: @self: @Returns: @self: @self: @Returns: @self: @Returns: @self: @begin: @length: @Returns: @self: @offset: @text: @bytes: @length: @author: @self: @offset: @text: @self: @begin: @length: @self: @length: @Returns: @self: @other: @Returns: @self: @iter: @Returns: @iter: @Returns: @iter: @Returns: @iter: @Returns: @iter: @Returns: @iter: @Returns: @iter: @Returns: libinfinity-0.5.5/docs/reference/libinftext/tmpl/inf-text-user.sgml0000644000175000017500000000232212264766270022405 00000000000000 InfTextUser @inftextuser: the object which received the signal. @arg1: @arg2: @Param4: @id: @name: @vector: @hue: @Returns: @user: @Returns: @user: @Returns: @user: @position: @length: @by_request: @user: @Returns: libinfinity-0.5.5/docs/reference/libinftext/tmpl/inf-text-insert-operation.sgml0000644000175000017500000000224012264766270024730 00000000000000 inf-text-insert-operation @parent: @get_position: @get_length: @transform_position: @operation: @Returns: @operation: @Returns: @op: @against: @Returns: @op: @against: @Returns: @operation: @against: @cid: @Returns: @operation: @against: @cid: @Returns: libinfinity-0.5.5/docs/reference/libinftext/tmpl/libinftext-0.3-unused.sgml0000644000175000017500000000255612264766270023653 00000000000000 inf-text-pword @operation: @Returns: @first: @second: @Returns: @pword: @Returns: @pword: @pword: @Returns: @pword: @Returns: @pword: @Returns: @initial: @Returns: @pword: @next: @Returns: libinfinity-0.5.5/docs/reference/libinftext/tmpl/libinftext-0.5-unused.sgml0000644000175000017500000000617712264766270023660 00000000000000 inf-text-pword @inftextbuffer: the object which received the signal. @arg1: @arg2: @arg3: @inftextbuffer: the object which received the signal. @arg1: @arg2: @arg3: @parent_class: @parent_class: @parent_class: @parent_class: @parent_class: @parent_class: @parent_class: @selection_changed: @buffer: @Returns: @buffer: @Returns: @xml: @encoding: @error: @Returns: @self: @iter: @Returns: @self: @iter: @Returns: @self: @xml: @operation: @Returns: @first: @second: @Returns: @pword: @Returns: @pword: @pword: @Returns: @pword: @Returns: @pword: @Returns: @initial: @Returns: @pword: @next: @Returns: @proxy: @name: @status: @hue: @caret_position: @selection_length: @func: @user_data: @Returns: libinfinity-0.5.5/docs/reference/libinftext/tmpl/inf-text-session.sgml0000644000175000017500000000214512264766270023115 00000000000000 InfTextSession @INF_TEXT_SESSION_ERROR_INVALID_HUE: @INF_TEXT_SESSION_ERROR_FAILED: @manager: @buffer: @io: @status: @sync_group: @sync_connection: @Returns: @manager: @buffer: @io: @user_table: @status: @sync_group: @sync_connection: @Returns: @session: @user: @hue: @session: @user: libinfinity-0.5.5/docs/reference/libinftext/tmpl/inf-text-buffer.sgml0000644000175000017500000000530312264766270022702 00000000000000 inf-text-buffer @inftextbuffer: the object which received the signal. @arg1: @arg2: @arg3: @inftextbuffer: the object which received the signal. @arg1: @arg2: @arg3: @parent: @get_encoding: @get_length: @get_slice: @insert_text: @erase_text: @create_iter: @destroy_iter: @iter_next: @iter_prev: @iter_get_text: @iter_get_length: @iter_get_bytes: @iter_get_author: @text_inserted: @text_erased: @buffer: @Returns: @buffer: @Returns: @buffer: @pos: @len: @Returns: @buffer: @pos: @text: @bytes: @len: @user: @buffer: @pos: @chunk: @user: @buffer: @pos: @len: @user: @buffer: @Returns: @buffer: @iter: @buffer: @iter: @Returns: @buffer: @iter: @Returns: @buffer: @iter: @Returns: @buffer: @iter: @Returns: @buffer: @iter: @Returns: @buffer: @iter: @Returns: @buffer: @pos: @chunk: @user: @buffer: @pos: @chunk: @user: libinfinity-0.5.5/docs/reference/libinftext/tmpl/libinftext-unused.sgml0000644000175000017500000000255612264766270023355 00000000000000 inf-text-pword @operation: @Returns: @first: @second: @Returns: @pword: @Returns: @pword: @pword: @Returns: @pword: @Returns: @pword: @Returns: @initial: @Returns: @pword: @next: @Returns: libinfinity-0.5.5/docs/reference/libinftext/tmpl/libinftext-0.4-unused.sgml0000644000175000017500000000425412264766270023651 00000000000000 inf-text-pword @inftextbuffer: the object which received the signal. @arg1: @arg2: @arg3: @inftextbuffer: the object which received the signal. @arg1: @arg2: @arg3: @buffer: @pos: @chunk: @user: @buffer: @pos: @chunk: @user: @xml: @encoding: @error: @Returns: @self: @xml: @operation: @Returns: @first: @second: @Returns: @pword: @Returns: @pword: @pword: @Returns: @pword: @Returns: @pword: @Returns: @initial: @Returns: @pword: @next: @Returns: @id: @name: @vector: @hue: @Returns: libinfinity-0.5.5/docs/reference/Makefile.in0000644000175000017500000005052212264766065015737 00000000000000# Makefile.in generated by automake 1.13.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = docs/reference DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/mkinstalldirs $(srcdir)/version.xml.in.in \ $(srcdir)/api_version.xml.in.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/libinfinity/inf-config.h CONFIG_CLEAN_FILES = version.xml.in api_version.xml.in CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DATA = $(nodist_noinst_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBINFINITY_API_VERSION = @LIBINFINITY_API_VERSION@ LIBINFINITY_LIBTOOL_VERSION = @LIBINFINITY_LIBTOOL_VERSION@ LIBINFINITY_VERSION = @LIBINFINITY_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ avahi_CFLAGS = @avahi_CFLAGS@ avahi_LIBS = @avahi_LIBS@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gtk_requirement = @gtk_requirement@ gtk_version = @gtk_version@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infgtk_CFLAGS = @infgtk_CFLAGS@ infgtk_LIBS = @infgtk_LIBS@ infinity_CFLAGS = @infinity_CFLAGS@ infinity_LIBS = @infinity_LIBS@ infinoted_CFLAGS = @infinoted_CFLAGS@ infinoted_LIBS = @infinoted_LIBS@ infodir = @infodir@ inftext_CFLAGS = @inftext_CFLAGS@ inftext_LIBS = @inftext_LIBS@ inftextgtk_CFLAGS = @inftextgtk_CFLAGS@ inftextgtk_LIBS = @inftextgtk_LIBS@ install_sh = @install_sh@ libdaemon_CFLAGS = @libdaemon_CFLAGS@ libdaemon_LIBS = @libdaemon_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = . libinfinity libinftext libinfgtk libinftextgtk # Note that nodist doesn't work here actually because gtk-doc pulls them # in anyway (see content_files in a subdirectory's Makefile.am) nodist_noinst_DATA = version.xml api_version.xml CLEANFILES = version.xml api_version.xml DISTCLEANFILES = version.xml.in api_version.xml.in all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu docs/reference/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu docs/reference/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): version.xml.in: $(top_builddir)/config.status $(srcdir)/version.xml.in.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ api_version.xml.in: $(top_builddir)/config.status $(srcdir)/api_version.xml.in.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(DATA) installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -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) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am # Remove the trailing newline of the version files, to have the entities # in the docbook XML substituted without it. version.xml: version.xml.in echo -n `cat version.xml.in` > version.xml api_version.xml: api_version.xml.in echo -n `cat api_version.xml.in` > api_version.xml # 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: libinfinity-0.5.5/docs/reference/libinfgtk/0000755000175000017500000000000012264766271015716 500000000000000libinfinity-0.5.5/docs/reference/libinfgtk/Makefile.am0000644000175000017500000000640412264763732017675 00000000000000## Process this file with automake to produce Makefile.in # We require automake 1.6 at least. AUTOMAKE_OPTIONS = 1.6 # This is a blank Makefile.am for using gtk-doc. # Copy this to your project's API docs directory and modify the variables to # suit your project. See the GTK+ Makefiles in gtk+/docs/reference for examples # of using the various options. # The name of the module, e.g. 'glib'. DOC_MODULE=libinfgtk-$(LIBINFINITY_API_VERSION) # The top-level SGML file. You can change this if you want to. DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml # The directory containing the source code. Relative to $(srcdir). # gtk-doc will search all .c & .h files beneath here for inline comments # documenting the functions and macros. # e.g. DOC_SOURCE_DIR=../../../gtk DOC_SOURCE_DIR=$(top_srcdir)/libinfgtk # Extra options to pass to gtkdoc-scangobj. Not normally needed. SCANGOBJ_OPTIONS= # Extra options to supply to gtkdoc-scan. # e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED" SCAN_OPTIONS=--rebuild-types # Extra options to supply to gtkdoc-mkdb. # e.g. MKDB_OPTIONS=--sgml-mode --output-format=xml MKDB_OPTIONS=--sgml-mode --output-format=xml # Extra options to supply to gtkdoc-mktmpl # e.g. MKTMPL_OPTIONS=--only-section-tmpl MKTMPL_OPTIONS= # Extra options to supply to gtkdoc-fixref. Not normally needed. # e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html FIXXREF_OPTIONS= \ --extra-dir=../libinfinity/html # Used for dependencies. The docs will be rebuilt if any of these change. # e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h # e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c HFILE_GLOB = \ $(top_srcdir)/libinfgtk/*.h CFILE_GLOB = \ $(top_srcdir)/libinfgtk/*.c # Header files to ignore when scanning. # e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h IGNORE_HFILES = # Images to copy into HTML directory. # e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png HTML_IMAGES= # Extra SGML files that are included by $(DOC_MAIN_SGML_FILE). # e.g. content_files=running.sgml building.sgml changes-2.0.sgml content_files = \ ../version.xml # SGML files where gtk-doc abbrevations (#GtkWidget) are expanded # These files must be listed here *and* in content_files # e.g. expand_content_files=running.sgml expand_content_files= # CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library. # Only needed if you are using gtkdoc-scangobj to dynamically query widget # signals and properties. # e.g. INCLUDES=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS) # e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib) #INCLUDES=$(infgtk_CFLAGS) AM_CPPFLAGS=$(infgtk_CFLAGS) GTKDOC_LIBS = \ $(infgtk_LIBS) \ $(top_builddir)/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ $(top_builddir)/libinfgtk/libinfgtk-$(LIBINFINITY_API_VERSION).la # This includes the standard gtk-doc make rules, copied by gtkdocize. include $(top_srcdir)/gtk-doc.make # Other files to distribute # e.g. EXTRA_DIST += version.xml.in EXTRA_DIST += # Files not to distribute # for --rebuild-types in $(SCAN_OPTIONS), e.g. $(DOC_MODULE).types # for --rebuild-sections in $(SCAN_OPTIONS) e.g. $(DOC_MODULE)-sections.txt DISTCLEANFILES=libinfgtk-$(LIBINFINITY_API_VERSION).types version.xml # Comment this out if you want your docs-status tested during 'make check' #TESTS = $(GTKDOC_CHECK) libinfinity-0.5.5/docs/reference/libinfgtk/libinfgtk-0.5-overrides.txt0000644000175000017500000000000012264763732022635 00000000000000libinfinity-0.5.5/docs/reference/libinfgtk/html/0000755000175000017500000000000012264766271016662 500000000000000libinfinity-0.5.5/docs/reference/libinfgtk/html/InfGtkBrowserView.html0000644000175000017500000004204612264766271023057 00000000000000 InfGtkBrowserView

InfGtkBrowserView

InfGtkBrowserView

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----GtkObject
               +----GtkWidget
                     +----GtkContainer
                           +----GtkTreeView
                                 +----InfGtkBrowserView

Implemented Interfaces

InfGtkBrowserView implements AtkImplementorIface and GtkBuildable.

Description

Details

InfGtkBrowserView

typedef struct _InfGtkBrowserView InfGtkBrowserView;


inf_gtk_browser_view_new ()

GtkWidget *         inf_gtk_browser_view_new            (void);

Creates a new InfGtkBrowserView.

Returns :

A new InfGtkBrowserView.

inf_gtk_browser_view_new_with_model ()

GtkWidget *         inf_gtk_browser_view_new_with_model (InfGtkBrowserModel *model);

Creates a new InfGtkBrowserView showing model.

model :

A InfGtkBrowserModel.

Returns :

A new InfGtkBrowserView.

inf_gtk_browser_view_get_selected ()

gboolean            inf_gtk_browser_view_get_selected   (InfGtkBrowserView *view,
                                                         GtkTreeIter *iter);

Sets iter to point to the currently selected row in the browser view. If no row is selected, iter is left untouched and FALSE is returned.

view :

A InfGtkBrowserView.

iter :

An uninitialized GtkTreeIter.

Returns :

Whether iter was set.

inf_gtk_browser_view_set_selected ()

void                inf_gtk_browser_view_set_selected   (InfGtkBrowserView *view,
                                                         GtkTreeIter *iter);

Sets the currently selected row to be iter. If necessary, rows will be expanded so that iter is visible.

view :

A InfGtkBrowserView.

iter :

A GtkTreeIter pointing to a row in view.

Signal Details

The "activate" signal

void                user_function                      (InfGtkBrowserView *infgtkbrowserview,
                                                        GtkTreeIter       *arg1,
                                                        gpointer           user_data)              : Run Last

infgtkbrowserview :

the object which received the signal.

user_data :

user data set when the signal handler was connected.

The "populate-popup" signal

void                user_function                      (InfGtkBrowserView *infgtkbrowserview,
                                                        GtkMenu           *arg1,
                                                        gpointer           user_data)              : Run Last

infgtkbrowserview :

the object which received the signal.

user_data :

user data set when the signal handler was connected.

The "selection-changed" signal

void                user_function                      (InfGtkBrowserView *infgtkbrowserview,
                                                        GtkTreeIter       *arg1,
                                                        gpointer           user_data)              : Run Last

infgtkbrowserview :

the object which received the signal.

user_data :

user data set when the signal handler was connected.
libinfinity-0.5.5/docs/reference/libinfgtk/html/left.png0000644000175000017500000000055612264766271020250 00000000000000‰PNG  IHDRשÍÊ~PLTEÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ(((;;;@@@€€€ƒƒƒ§§§×××ßßßãããçççëëëóóóûûûÿÿÿv:òütRNS $04 libinfinity-0.5.5/docs/reference/libinfgtk/html/ch01.html0000644000175000017500000000572512264766271020234 00000000000000 libinfgtk API libinfinity-0.5.5/docs/reference/libinfgtk/html/InfGtkBrowserModelFilter.html0000644000175000017500000001367012264766271024354 00000000000000 InfGtkBrowserModelFilter

InfGtkBrowserModelFilter

InfGtkBrowserModelFilter

Object Hierarchy

  GObject
   +----GtkTreeModelFilter
         +----InfGtkBrowserModelFilter

Implemented Interfaces

InfGtkBrowserModelFilter implements GtkTreeModel, GtkTreeDragSource and InfGtkBrowserModel.

Description

Details

InfGtkBrowserModelFilter

typedef struct _InfGtkBrowserModelFilter InfGtkBrowserModelFilter;


inf_gtk_browser_model_filter_new ()

InfGtkBrowserModelFilter * inf_gtk_browser_model_filter_new
                                                        (InfGtkBrowserModel *child_model);

Creates a new InfGtkBrowserModelFilter, filtering child_model.

child_model :

A InfGtkBrowserModel.

Returns :

A new InfGtkBrowserModelFilter.
libinfinity-0.5.5/docs/reference/libinfgtk/html/InfGtkCertificateView.html0000644000175000017500000002677012264766271023664 00000000000000 InfGtkCertificateView

InfGtkCertificateView

InfGtkCertificateView

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----GtkObject
               +----GtkWidget
                     +----GtkContainer
                           +----GtkNotebook
                                 +----InfGtkCertificateView

Implemented Interfaces

InfGtkCertificateView implements AtkImplementorIface and GtkBuildable.

Properties

  "certificate"              gpointer              : Read / Write

Description

Details

InfGtkCertificateView

typedef struct _InfGtkCertificateView InfGtkCertificateView;


inf_gtk_certificate_view_new ()

GtkWidget *         inf_gtk_certificate_view_new        (void);

Creates a new InfGtkCertificateView. To show a certificate, use inf_gtk_certificate_view_set_certificate() on the returned widget.

Returns :

A new InfGtkCertificateView.

inf_gtk_certificate_view_new_with_certificate ()

GtkWidget *         inf_gtk_certificate_view_new_with_certificate
                                                        (gnutls_x509_crt_t cert);

Creates a new InfGtkCertificateView showing the given certificate. This is the same as creating a new certificate view and calling inf_gtk_certificate_view_set_certificate() afterwards.

cert must not be freed as long as the certificate view is showing it. You can make the view not showing it anymore by calling inf_gtk_certificate_view_set_certificate() with NULL as certificate.

cert :

The certificate to show.

Returns :

A new InfGtkCertificateView.

inf_gtk_certificate_view_set_certificate ()

void                inf_gtk_certificate_view_set_certificate
                                                        (InfGtkCertificateView *view,
                                                         gnutls_x509_crt_t cert);

Shows the given certificate in view.

cert must not be freed as long as the certificate view is showing it. You can make the view not showing it anymore by calling inf_gtk_certificate_view_set_certificate() with NULL as certificate.

view :

A InfGtkCertificateView.

cert :

The certificate to show.

Property Details

The "certificate" property

  "certificate"              gpointer              : Read / Write

The certificate to show.

libinfinity-0.5.5/docs/reference/libinfgtk/html/home.png0000644000175000017500000000107512264766271020243 00000000000000‰PNG  IHDRשÍÊðPLTEÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  $$$(((,,,000888<<<@@@OOOPPP[[[___```lll{{{€€€‹‹‹£££¯¯¯¿¿¿ÃÃÃÇÇÇÏÏÏÓÓÓÛÛÛßßßãããëëëïïïóóó÷÷÷ÿÿÿÕ?“*tRNS  $(,4@GKSghkotw‡‹›Ÿ«·»¿ÃËÏÓÛßçïó÷ûa7™ÞÒIDATx­Í[7†@Æñ^EÈù ”b'…qˆ!DŒdÿocD™Y±– ¿ËçñÀŒÌÎÃ&}¢Ðž°,sTÓa}y&èC`+ûÂþ CLn9¿ÁP;«ô˜ aÆsûÚ.Ýà'Aç2t·7غª» o/ð;ÎÉén5iI+Ì4·ºøž–a£Š±¯ô`í-;Å#®`ȲWÌrRäXÐÞÀ`§vGAÚìþ?¤\qÒ†õ*BMôä5aŽD¡y¦%h8[¾f{р߽C‰VF3‹ÔIEND®B`‚libinfinity-0.5.5/docs/reference/libinfgtk/html/style.css0000644000175000017500000001210012264766271020446 00000000000000.synopsis, .classsynopsis { /* tango:aluminium 1/2 */ background: #eeeeec; border: solid 1px #d3d7cf; padding: 0.5em; } .programlisting { /* tango:sky blue 0/1 */ background: #e6f3ff; border: solid 1px #729fcf; padding: 0.5em; } .variablelist { padding: 4px; margin-left: 3em; } .variablelist td:first-child { vertical-align: top; } @media screen { sup a.footnote { position: relative; top: 0em ! important; } /* this is needed so that the local anchors are displayed below the naviagtion */ div.footnote a[name], div.refnamediv a[name], div.refsect1 a[name], div.refsect2 a[name], div.index a[name], div.glossary a[name], div.sect1 a[name] { display: inline-block; position: relative; top:-5em; } /* this seems to be a bug in the xsl style sheets when generating indexes */ div.index div.index { top: 0em; } /* make space for the fixed navigation bar and add space at the bottom so that * link targets appear somewhat close to top */ body { padding-top: 3.2em; padding-bottom: 20em; } /* style and size the navigation bar */ table.navigation#top { position: fixed; /* tango:scarlet red 0/1 */ background: #ffe6e6; border: solid 1px #ef2929; margin-top: 0; margin-bottom: 0; top: 0; left: 0; height: 3em; z-index: 10; } .navigation a, .navigation a:visited { /* tango:scarlet red 3 */ color: #a40000; } .navigation a:hover { /* tango:scarlet red 1 */ color: #ef2929; } td.shortcuts { /* tango:scarlet red 1 */ color: #ef2929; font-size: 80%; white-space: nowrap; } } @media print { table.navigation { visibility: collapse; display: none; } div.titlepage table.navigation { visibility: visible; display: table; /* tango:scarlet red 0/1 */ background: #ffe6e6; border: solid 1px #ef2929; margin-top: 0; margin-bottom: 0; top: 0; left: 0; height: 3em; } } .navigation .title { font-size: 200%; } div.gallery-float { float: left; padding: 10px; } div.gallery-float img { border-style: none; } div.gallery-spacer { clear: both; } a, a:visited { text-decoration: none; /* tango:sky blue 2 */ color: #3465a4; } a:hover { text-decoration: underline; /* tango:sky blue 1 */ color: #729fcf; } div.table table { border-collapse: collapse; border-spacing: 0px; /* tango:aluminium 3 */ border: solid 1px #babdb6; } div.table table td, div.table table th { /* tango:aluminium 3 */ border: solid 1px #babdb6; padding: 3px; vertical-align: top; } div.table table th { /* tango:aluminium 2 */ background-color: #d3d7cf; } hr { /* tango:aluminium 3 */ color: #babdb6; background: #babdb6; border: none 0px; height: 1px; clear: both; } .footer { padding-top: 3.5em; /* tango:aluminium 3 */ color: #babdb6; text-align: center; font-size: 80%; } .warning { /* tango:orange 0/1 */ background: #ffeed9; border-color: #ffb04f; } .note { /* tango:chameleon 0/0.5 */ background: #d8ffb2; border-color: #abf562; } .note, .warning { padding: 0.5em; border-width: 1px; border-style: solid; } .note h3, .warning h3 { margin-top: 0.0em } .note p, .warning p { margin-bottom: 0.0em } /* blob links */ h2 .extralinks, h3 .extralinks { float: right; /* tango:aluminium 3 */ color: #babdb6; font-size: 80%; font-weight: normal; } .annotation { /* tango:aluminium 5 */ color: #555753; font-size: 80%; font-weight: normal; } /* code listings */ .listing_code .programlisting .cbracket { color: #a40000; } /* tango: scarlet red 3 */ .listing_code .programlisting .comment { color: #a1a39d; } /* tango: aluminium 4 */ .listing_code .programlisting .function { color: #000000; font-weight: bold; } .listing_code .programlisting .function a { color: #11326b; font-weight: bold; } /* tango: sky blue 4 */ .listing_code .programlisting .keyword { color: #4e9a06; } /* tango: chameleon 3 */ .listing_code .programlisting .linenum { color: #babdb6; } /* tango: aluminium 3 */ .listing_code .programlisting .normal { color: #000000; } .listing_code .programlisting .number { color: #75507b; } /* tango: plum 2 */ .listing_code .programlisting .preproc { color: #204a87; } /* tango: sky blue 3 */ .listing_code .programlisting .string { color: #c17d11; } /* tango: chocolate 2 */ .listing_code .programlisting .type { color: #000000; } .listing_code .programlisting .type a { color: #11326b; } /* tango: sky blue 4 */ .listing_code .programlisting .symbol { color: #ce5c00; } /* tango: orange 3 */ .listing_frame { /* tango:sky blue 1 */ border: solid 1px #729fcf; padding: 0px; } .listing_lines, .listing_code { margin-top: 0px; margin-bottom: 0px; padding: 0.5em; } .listing_lines { /* tango:sky blue 0.5 */ background: #a6c5e3; /* tango:aluminium 6 */ color: #2e3436; } .listing_code { /* tango:sky blue 0 */ background: #e6f3ff; } .listing_code .programlisting { /* override from previous */ border: none 0px; padding: 0px; } .listing_lines pre, .listing_code pre { margin: 0px; } libinfinity-0.5.5/docs/reference/libinfgtk/html/InfGtkCertificateDialog.html0000644000175000017500000003406112264766271024141 00000000000000 InfGtkCertificateDialog

InfGtkCertificateDialog

InfGtkCertificateDialog

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----GtkObject
               +----GtkWidget
                     +----GtkContainer
                           +----GtkBin
                                 +----GtkWindow
                                       +----GtkDialog
                                             +----InfGtkCertificateDialog

Implemented Interfaces

InfGtkCertificateDialog implements AtkImplementorIface and GtkBuildable.

Properties

  "certificate-chain"        InfCertificateChain*  : Read / Write
  "certificate-flags"        InfCertificateDialogFlags  : Read / Write
  "hostname"                 gchar*                : Read / Write

Description

Details

InfGtkCertificateDialog

typedef struct _InfGtkCertificateDialog InfGtkCertificateDialog;


enum InfGtkCertificateDialogFlags

typedef enum {
  INF_GTK_CERTIFICATE_DIALOG_CERT_NOT_ACTIVATED      = 1 << 0,
  INF_GTK_CERTIFICATE_DIALOG_CERT_EXPIRED            = 1 << 1,
  INF_GTK_CERTIFICATE_DIALOG_CERT_HOSTNAME_MISMATCH  = 1 << 2,
  INF_GTK_CERTIFICATE_DIALOG_CERT_INVALID            = 1 << 3,
  INF_GTK_CERTIFICATE_DIALOG_CERT_ISSUER_NOT_TRUSTED = 1 << 4,
  INF_GTK_CERTIFICATE_DIALOG_CERT_CHANGED            = 1 << 5,
  /* only valid when CERT_CHANGED is also set */
  INF_GTK_CERTIFICATE_DIALOG_CERT_OLD_EXPIRED        = 1 << 6
} InfGtkCertificateDialogFlags;

INF_GTK_CERTIFICATE_DIALOG_CERT_NOT_ACTIVATED

INF_GTK_CERTIFICATE_DIALOG_CERT_EXPIRED

INF_GTK_CERTIFICATE_DIALOG_CERT_HOSTNAME_MISMATCH

INF_GTK_CERTIFICATE_DIALOG_CERT_INVALID

INF_GTK_CERTIFICATE_DIALOG_CERT_ISSUER_NOT_TRUSTED

INF_GTK_CERTIFICATE_DIALOG_CERT_CHANGED

INF_GTK_CERTIFICATE_DIALOG_CERT_OLD_EXPIRED


inf_gtk_certificate_dialog_new ()

InfGtkCertificateDialog * inf_gtk_certificate_dialog_new
                                                        (GtkWindow *parent,
                                                         GtkDialogFlags dialog_flags,
                                                         InfGtkCertificateDialogFlags certificate_flags,
                                                         const gchar *hostname,
                                                         InfCertificateChain *certificate_chain);

Creates a new InfGtkCertificateDialog. A InfGtkCertificateDialog shows warnings about a server's certificate to a user, for example when the issuer is not trusted or the certificate is expired.

parent :

Parent GtkWindow of the dialog.

dialog_flags :

Flags for the dialog, see GtkDialogFlags.

certificate_flags :

What certificate warnings to show, see InfGtkCertificateDialogFlags.

hostname :

The host name of the server that provides the certificate.

certificate_chain :

The certificate chain provided by the server.

Returns :

A New InfGtkCertificateDialog.

Property Details

The "certificate-chain" property

  "certificate-chain"        InfCertificateChain*  : Read / Write

The certificate chain to show in the dialog.


The "certificate-flags" property

  "certificate-flags"        InfCertificateDialogFlags  : Read / Write

What warnings about the certificate to display.


The "hostname" property

  "hostname"                 gchar*                : Read / Write

Host name of the server from which the certificate is.

Default value: NULL

libinfinity-0.5.5/docs/reference/libinfgtk/html/InfGtkBrowserModelSort.html0000644000175000017500000001353112264766271024052 00000000000000 InfGtkBrowserModelSort

InfGtkBrowserModelSort

InfGtkBrowserModelSort

Object Hierarchy

  GObject
   +----GtkTreeModelSort
         +----InfGtkBrowserModelSort

Implemented Interfaces

InfGtkBrowserModelSort implements GtkTreeModel, GtkTreeSortable, GtkTreeDragSource and InfGtkBrowserModel.

Description

Details

InfGtkBrowserModelSort

typedef struct _InfGtkBrowserModelSort InfGtkBrowserModelSort;


inf_gtk_browser_model_sort_new ()

InfGtkBrowserModelSort * inf_gtk_browser_model_sort_new (InfGtkBrowserModel *child_model);

Creates a new InfGtkBrowserModelSort, sorting child_model.

child_model :

A InfGtkBrowserModel.

Returns :

A new InfGtkBrowserModelSort.
libinfinity-0.5.5/docs/reference/libinfgtk/html/right.png0000644000175000017500000000057412264766271020433 00000000000000‰PNG  IHDRשÍÊ{PLTEÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ###+++@@@«««¿¿¿ÃÃÃÇÇÇÏÏÏïïïÿÿÿçWôtRNS (48@GX[«·¿ÃÏÓ×ßãçï÷yþ±t–IDATxÚ…ÐÉÂ0 PS–@XZ -%”­eþÿ Iä‰ÁÜ<ï`ÙeAÙ¬Zìç9(ñÆ1'n/îÊ"Á¤²ÜU!‡DЉhŒwÎÅ$¢ñ4QX$°Ô AlþXRü^>8ŽMzšãmtúºü¾Ä>äk¸Ð7â½ œïOŠ$ôÙž³=mVQ.JO£é9 »ñ• IEND®B`‚libinfinity-0.5.5/docs/reference/libinfgtk/html/InfGtkBrowserStore.html0000644000175000017500000004757312264766271023253 00000000000000 InfGtkBrowserStore

InfGtkBrowserStore

InfGtkBrowserStore

Object Hierarchy

  GObject
   +----InfGtkBrowserStore

Implemented Interfaces

InfGtkBrowserStore implements GtkTreeModel and InfGtkBrowserModel.

Properties

  "communication-manager"    InfCommunicationManager*  : Read / Write / Construct Only
  "io"                       InfIo*                : Read / Write / Construct Only

Description

Details

InfGtkBrowserStore

typedef struct _InfGtkBrowserStore InfGtkBrowserStore;


inf_gtk_browser_store_new ()

InfGtkBrowserStore * inf_gtk_browser_store_new          (InfIo *io,
                                                         InfCommunicationManager *comm_manager);

Creates a new InfGtkBrowserStore.

io :

A InfIo object for the created InfcBrowser to schedule timeouts.

comm_manager :

The InfCommunicationManager with which to explore remote directories.

Returns :

A new InfGtkBrowserStore.

inf_gtk_browser_store_add_discovery ()

void                inf_gtk_browser_store_add_discovery (InfGtkBrowserStore *store,
                                                         InfDiscovery *discovery);

Adds discovery to model. The model will then show up discovered servers.

store :

A InfGtkBrowserStore.

discovery :

A InfDiscovery not yet added to model.

inf_gtk_browser_store_add_connection ()

void                inf_gtk_browser_store_add_connection
                                                        (InfGtkBrowserStore *store,
                                                         InfXmlConnection *connection,
                                                         const gchar *name);

This function adds a connection to the store. store will show up an item for the connection if there is not already one. This allows to browse the explored parts of the directory of the remote site. If name is NULL, then the "remote-id" of the connection will be used.

store :

A InfGtkBrowserStore.

connection :

A InfXmlConnection.

name :

Name for the item, or NULL.

inf_gtk_browser_store_remove_connection ()

void                inf_gtk_browser_store_remove_connection
                                                        (InfGtkBrowserStore *store,
                                                         InfXmlConnection *connection);

This function removes the entry for the given connection from store.

store :

A InfGtkBrowserStore.

connection :

A InfXmlConnection contained in store.

inf_gtk_browser_store_clear_connection_error ()

void                inf_gtk_browser_store_clear_connection_error
                                                        (InfGtkBrowserStore *store,
                                                         InfXmlConnection *connection);

This function clears the error for the entry which belongs to the given connection.

store :

A InfGtkBrowserStore.

connection :

A InfXmlConnection contained in store.

inf_gtk_browser_store_set_connection_name ()

void                inf_gtk_browser_store_set_connection_name
                                                        (InfGtkBrowserStore *store,
                                                         InfXmlConnection *connection,
                                                         const gchar *name);

This function sets the name of connection.

store :

A InfGtkBrowserStore.

connection :

A InfXmlConnection contained in store.

name :

The new name to set for the connection.

Property Details

The "communication-manager" property

  "communication-manager"    InfCommunicationManager*  : Read / Write / Construct Only

The communication manager used for browsing remote directories.


The "io" property

  "io"                       InfIo*                : Read / Write / Construct Only

The IO object used for the created browsers to schedule timeouts.

libinfinity-0.5.5/docs/reference/libinfgtk/html/InfGtkIo.html0000644000175000017500000001043112264766271021141 00000000000000 InfGtkIo

InfGtkIo

InfGtkIo

Synopsis

                    InfGtkIo;
InfGtkIo *          inf_gtk_io_new                      (void);

Object Hierarchy

  GObject
   +----InfGtkIo

Implemented Interfaces

InfGtkIo implements InfIo.

Description

Details

InfGtkIo

typedef struct _InfGtkIo InfGtkIo;


inf_gtk_io_new ()

InfGtkIo *          inf_gtk_io_new                      (void);

Creates a new InfGtkIo.

Returns :

A new InfGtkIo. Free with g_object_unref() when no longer needed.
libinfinity-0.5.5/docs/reference/libinfgtk/html/InfGtkChat.html0000644000175000017500000003531412264766271021460 00000000000000 InfGtkChat

InfGtkChat

InfGtkChat — Gtk interface to InfChatSession

Stability Level

Unstable, unless otherwise indicated

Synopsis

#include <libinfgtk/inf-gtk-chat.h>

                    InfGtkChat;
GtkWidget *         inf_gtk_chat_new                    (void);
void                inf_gtk_chat_set_session            (InfGtkChat *chat,
                                                         InfChatSession *session);
void                inf_gtk_chat_set_active_user        (InfGtkChat *chat,
                                                         InfUser *user);
GtkWidget *         inf_gtk_chat_get_entry              (InfGtkChat *chat);

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----GtkObject
               +----GtkWidget
                     +----GtkContainer
                           +----GtkBox
                                 +----GtkVBox
                                       +----InfGtkChat

Implemented Interfaces

InfGtkChat implements AtkImplementorIface, GtkBuildable and GtkOrientable.

Properties

  "active-user"              InfUser*              : Read / Write
  "session"                  InfChatSession*       : Read / Write

Description

InfGtkChat is a widget showing a InfChatSession conversation. Use inf_gtk_chat_set_session() to set the session whose conversation to show in the widget. If you have a local user in the session you can also call inf_gtk_chat_set_active_user(). In this case the input text entry is made available and messages are sent via that user.

Details

InfGtkChat

typedef struct _InfGtkChat InfGtkChat;

InfGtkChat is an opaque data type. You should only access it via the public API functions.


inf_gtk_chat_new ()

GtkWidget *         inf_gtk_chat_new                    (void);

Creates a new InfGtkChat. To show a chat conversation set a session to show via inf_gtk_chat_set_session().

Returns :

A new InfGtkChat.

inf_gtk_chat_set_session ()

void                inf_gtk_chat_set_session            (InfGtkChat *chat,
                                                         InfChatSession *session);

Sets the chat session to show in the chat widget. If there is a previous session set the chat view will be cleared before showing the new session. If the previous session had an active user set it will be unset. If session is NULL this function just clears the chat view and unsets the active user, if any.

chat :

A InfGtkChat.

session :

The InfChatSession to set.

inf_gtk_chat_set_active_user ()

void                inf_gtk_chat_set_active_user        (InfGtkChat *chat,
                                                         InfUser *user);

Sets the active user for the chat. This must be a user in the chat's session's user table and it must have the INF_USER_LOCAL flag set, i.e. you need to have it joined before using infc_session_proxy_join_user() or infd_session_proxy_add_user().

If an active user is set the chat's text entry is made sensitive and the user can type chat messages. They are sent to the session as originated by user. If user's status changes to INF_USER_UNAVAILABLE or the INF_USER_LOCAL flag is removed the active user will be unset automatically.

This cannot be called when the chat has no session set yet. Use inf_gtk_chat_set_session() first.

chat :

A InfGtkChat.

user :

A local InfUser which joined chat's session.

inf_gtk_chat_get_entry ()

GtkWidget *         inf_gtk_chat_get_entry              (InfGtkChat *chat);

Returns the chat's text input entry.

chat :

A InfGtkChat.

Returns :

The chat's GtkEntry. This is owned by the chat, so you don't need to free it.

Property Details

The "active-user" property

  "active-user"              InfUser*              : Read / Write

The user outgoing messages come from.


The "session" property

  "session"                  InfChatSession*       : Read / Write

The chat session this widget is displaying.

libinfinity-0.5.5/docs/reference/libinfgtk/html/index.html0000644000175000017500000000541112264766271020600 00000000000000 libinfgtk-0.5 Reference Manual libinfinity-0.5.5/docs/reference/libinfgtk/html/libinfgtk-0.5.devhelp20000644000175000017500000002755112264766271022520 00000000000000 libinfinity-0.5.5/docs/reference/libinfgtk/html/InfGtkCertificateManager.html0000644000175000017500000002651412264766271024320 00000000000000 InfGtkCertificateManager

InfGtkCertificateManager

InfGtkCertificateManager

Synopsis

                    InfGtkCertificateManager;
InfGtkCertificateManager * inf_gtk_certificate_manager_new
                                                        (GtkWindow *parent_window,
                                                         InfXmppManager *xmpp_manager,
                                                         const gchar *trust_file,
                                                         const gchar *known_hosts_file);

Object Hierarchy

  GObject
   +----InfGtkCertificateManager

Properties

  "known-hosts-file"         gchar*                : Read / Write
  "parent-window"            GtkWindow*            : Read / Write / Construct Only
  "trust-file"               gchar*                : Read / Write
  "xmpp-manager"             InfXmppManager*       : Read / Write / Construct Only

Description

Details

InfGtkCertificateManager

typedef struct _InfGtkCertificateManager InfGtkCertificateManager;


inf_gtk_certificate_manager_new ()

InfGtkCertificateManager * inf_gtk_certificate_manager_new
                                                        (GtkWindow *parent_window,
                                                         InfXmppManager *xmpp_manager,
                                                         const gchar *trust_file,
                                                         const gchar *known_hosts_file);

Creates a new InfGtkCertificateManager. For each new client-side InfXmppConnection in xmpp_manager, the certificate manager will verify the server's certificate.

If the root CA of that certificate is contained in trust_file, or the server certificate itself is known already (meaning it is contained in known_hosts_file), then the certificate is accepted automatically. Otherwise, the user is asked for approval. If the user approves the certificate, then it is inserted into the known_hosts_file.

parent_window :

The GtkWindow to which to make certificate approval dialogs transient to.

xmpp_manager :

The InfXmppManager whose InfXmppConnections to manage the certificates for.

trust_file :

Path pointing to a file that contains trusted root CAs, or NULL.

known_hosts_file :

Path pointing to a file that contains certificates of known hosts, or NULL.

Returns :

A new InfGtkCertificateManager.

Property Details

The "known-hosts-file" property

  "known-hosts-file"         gchar*                : Read / Write

File containing certificates of known hosts.

Default value: NULL


The "parent-window" property

  "parent-window"            GtkWindow*            : Read / Write / Construct Only

The parent window for certificate approval dialogs.


The "trust-file" property

  "trust-file"               gchar*                : Read / Write

File containing trusted root CAs.

Default value: NULL


The "xmpp-manager" property

  "xmpp-manager"             InfXmppManager*       : Read / Write / Construct Only

The XMPP manager of registered connections.

libinfinity-0.5.5/docs/reference/libinfgtk/html/libinfgtk-0.5-inf-gtk-browser-model.html0000644000175000017500000005675312264766271026075 00000000000000 inf-gtk-browser-model

inf-gtk-browser-model

inf-gtk-browser-model

Object Hierarchy

  GInterface
   +----InfGtkBrowserModel
  GEnum
   +----InfGtkBrowserModelStatus

Prerequisites

InfGtkBrowserModel requires GtkTreeModel and GObject.

Known Implementations

InfGtkBrowserModel is implemented by InfGtkBrowserModelFilter, InfGtkBrowserModelSort and InfGtkBrowserStore.

Signals

  "set-browser"                                    : Run Last

Description

Details

INF_GTK_TYPE_BROWSER_MODEL_STATUS

#define INF_GTK_TYPE_BROWSER_MODEL_STATUS          (inf_gtk_browser_model_status_get_type())


InfGtkBrowserModel

typedef struct _InfGtkBrowserModel InfGtkBrowserModel;


enum InfGtkBrowserModelStatus

typedef enum {
  INF_GTK_BROWSER_MODEL_INVALID,
  INF_GTK_BROWSER_MODEL_DISCOVERED,
  INF_GTK_BROWSER_MODEL_RESOLVING,
  INF_GTK_BROWSER_MODEL_DISCONNECTED,
  INF_GTK_BROWSER_MODEL_CONNECTING,
  INF_GTK_BROWSER_MODEL_CONNECTED,
  INF_GTK_BROWSER_MODEL_ERROR
} InfGtkBrowserModelStatus;

INF_GTK_BROWSER_MODEL_INVALID

INF_GTK_BROWSER_MODEL_DISCOVERED

INF_GTK_BROWSER_MODEL_RESOLVING

INF_GTK_BROWSER_MODEL_DISCONNECTED

INF_GTK_BROWSER_MODEL_CONNECTING

INF_GTK_BROWSER_MODEL_CONNECTED

INF_GTK_BROWSER_MODEL_ERROR


enum InfGtkBrowserModelColumn

typedef enum {
  INF_GTK_BROWSER_MODEL_COL_DISCOVERY_INFO,
  INF_GTK_BROWSER_MODEL_COL_DISCOVERY,
  INF_GTK_BROWSER_MODEL_COL_BROWSER,
  INF_GTK_BROWSER_MODEL_COL_STATUS, /* only toplevel */
  INF_GTK_BROWSER_MODEL_COL_NAME,
  INF_GTK_BROWSER_MODEL_COL_ERROR,
  INF_GTK_BROWSER_MODEL_COL_NODE,

  INF_GTK_BROWSER_MODEL_NUM_COLS
} InfGtkBrowserModelColumn;

INF_GTK_BROWSER_MODEL_COL_DISCOVERY_INFO

INF_GTK_BROWSER_MODEL_COL_DISCOVERY

INF_GTK_BROWSER_MODEL_COL_BROWSER

INF_GTK_BROWSER_MODEL_COL_STATUS

INF_GTK_BROWSER_MODEL_COL_NAME

INF_GTK_BROWSER_MODEL_COL_ERROR

INF_GTK_BROWSER_MODEL_COL_NODE

INF_GTK_BROWSER_MODEL_NUM_COLS


inf_gtk_browser_model_set_browser ()

void                inf_gtk_browser_model_set_browser   (InfGtkBrowserModel *model,
                                                         GtkTreePath *path,
                                                         GtkTreeIter *iter,
                                                         InfcBrowser *browser);

Emits the "set-browser" signal. This is supposed to only be called by implementations of InfGtkBrowserModel whenever they set or unset a browser on a row.

model :

A InfGtkBrowserModel.

path :

A GtkTreePath to a top-level row.

iter :

A GtkTreeIter pointing to the same row.

browser :

The new InfcBrowser to set.

inf_gtk_browser_model_resolve ()

void                inf_gtk_browser_model_resolve       (InfGtkBrowserModel *model,
                                                         InfDiscovery *discovery,
                                                         InfDiscoveryInfo *info);

Resolves info and adds the resulting connection to the model. If that connection is already contained, the original (newly resolved) entry is removed in favor of the existing entry whose browser might already have explored (parts of) the server's directory.

model :

A InfGtkBrowserModel.

discovery :

A InfDiscovery added to store.

info :

A InfDiscoveryInfo discovered by discovery.

inf_gtk_browser_model_browser_iter_to_tree_iter ()

gboolean            inf_gtk_browser_model_browser_iter_to_tree_iter
                                                        (InfGtkBrowserModel *model,
                                                         InfcBrowser *browser,
                                                         InfcBrowserIter *browser_iter,
                                                         GtkTreeIter *tree_iter);

Sets tree_iter to point to the same node browser_iter refers to within the model. If browser is not known to model, i.e. its connection was never added to model, then the function returns FALSE and tree_iter is left untouched.

model :

A InfGtkBrowserModel.

browser :

A InfcBrowser.

browser_iter :

A InfcBrowserIter pointing into browser.

tree_iter :

A GtkTreeIter that will be set by this function.

Returns :

Whether tree_iter was set.

Signal Details

The "set-browser" signal

void                user_function                      (InfGtkBrowserModel *model,
                                                        GtkTreePath        *path,
                                                        GtkTreeIter        *iter,
                                                        InfcBrowser        *browser,
                                                        gpointer            user_data)      : Run Last

This signal is emitted every time a new browser is inserted to the model. This means either that a completely new item was inserted, or that an item providing only a discovery has been resolved (see inf_gtk_browser_model_resolve()).

model :

The InfGtkBrowserModel emitting the signal.

path :

A GtkTreePath pointing to the newly created browser.

iter :

A GtkTreeIter pointing to the newly created browser.

browser :

The newly created InfcBrowser.

user_data :

user data set when the signal handler was connected.
libinfinity-0.5.5/docs/reference/libinfgtk/html/up.png0000644000175000017500000000044212264766271017734 00000000000000‰PNG  IHDRàw=øéIDATxí•!‚@† Ä ‘H0ˆîÀô(4À6Œ£Á` l$n$ áùpæÍl]åáHðŸùʆï›yà ެ+$þ†ØGö턈)å꺭5E.™LEAUUY" yÿŒX"|¹5•3"n9#ÂÛ"|¹;²0’#7#eYRD!~/_"Ð4 ÉY!@)E‘„Îs‡¥i:( ÃÌi­Ÿ´mKO1(CnÌ€¹Ù¹>Ùóm•ý³ RBžç/)Š‚×1 éà½mÆþtÖÈÖAâýrt¾)_&›IEND®B`‚libinfinity-0.5.5/docs/reference/libinfgtk/Makefile.in0000644000175000017500000006501412264766065017712 00000000000000# Makefile.in generated by automake 1.13.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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@ # -*- mode: makefile -*- #################################### # Everything below here is generic # #################################### VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(top_srcdir)/gtk-doc.make $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am $(top_srcdir)/mkinstalldirs subdir = docs/reference/libinfgtk ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/libinfinity/inf-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBINFINITY_API_VERSION = @LIBINFINITY_API_VERSION@ LIBINFINITY_LIBTOOL_VERSION = @LIBINFINITY_LIBTOOL_VERSION@ LIBINFINITY_VERSION = @LIBINFINITY_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ avahi_CFLAGS = @avahi_CFLAGS@ avahi_LIBS = @avahi_LIBS@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gtk_requirement = @gtk_requirement@ gtk_version = @gtk_version@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infgtk_CFLAGS = @infgtk_CFLAGS@ infgtk_LIBS = @infgtk_LIBS@ infinity_CFLAGS = @infinity_CFLAGS@ infinity_LIBS = @infinity_LIBS@ infinoted_CFLAGS = @infinoted_CFLAGS@ infinoted_LIBS = @infinoted_LIBS@ infodir = @infodir@ inftext_CFLAGS = @inftext_CFLAGS@ inftext_LIBS = @inftext_LIBS@ inftextgtk_CFLAGS = @inftextgtk_CFLAGS@ inftextgtk_LIBS = @inftextgtk_LIBS@ install_sh = @install_sh@ libdaemon_CFLAGS = @libdaemon_CFLAGS@ libdaemon_LIBS = @libdaemon_LIBS@ 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@ # We require automake 1.6 at least. AUTOMAKE_OPTIONS = 1.6 # This is a blank Makefile.am for using gtk-doc. # Copy this to your project's API docs directory and modify the variables to # suit your project. See the GTK+ Makefiles in gtk+/docs/reference for examples # of using the various options. # The name of the module, e.g. 'glib'. DOC_MODULE = libinfgtk-$(LIBINFINITY_API_VERSION) # The top-level SGML file. You can change this if you want to. DOC_MAIN_SGML_FILE = $(DOC_MODULE)-docs.sgml # The directory containing the source code. Relative to $(srcdir). # gtk-doc will search all .c & .h files beneath here for inline comments # documenting the functions and macros. # e.g. DOC_SOURCE_DIR=../../../gtk DOC_SOURCE_DIR = $(top_srcdir)/libinfgtk # Extra options to pass to gtkdoc-scangobj. Not normally needed. SCANGOBJ_OPTIONS = # Extra options to supply to gtkdoc-scan. # e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED" SCAN_OPTIONS = --rebuild-types # Extra options to supply to gtkdoc-mkdb. # e.g. MKDB_OPTIONS=--sgml-mode --output-format=xml MKDB_OPTIONS = --sgml-mode --output-format=xml # Extra options to supply to gtkdoc-mktmpl # e.g. MKTMPL_OPTIONS=--only-section-tmpl MKTMPL_OPTIONS = # Extra options to supply to gtkdoc-fixref. Not normally needed. # e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html FIXXREF_OPTIONS = \ --extra-dir=../libinfinity/html # Used for dependencies. The docs will be rebuilt if any of these change. # e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h # e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c HFILE_GLOB = \ $(top_srcdir)/libinfgtk/*.h CFILE_GLOB = \ $(top_srcdir)/libinfgtk/*.c # Header files to ignore when scanning. # e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h IGNORE_HFILES = # Images to copy into HTML directory. # e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png HTML_IMAGES = # Extra SGML files that are included by $(DOC_MAIN_SGML_FILE). # e.g. content_files=running.sgml building.sgml changes-2.0.sgml content_files = \ ../version.xml # SGML files where gtk-doc abbrevations (#GtkWidget) are expanded # These files must be listed here *and* in content_files # e.g. expand_content_files=running.sgml expand_content_files = # CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library. # Only needed if you are using gtkdoc-scangobj to dynamically query widget # signals and properties. # e.g. INCLUDES=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS) # e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib) #INCLUDES=$(infgtk_CFLAGS) AM_CPPFLAGS = $(infgtk_CFLAGS) GTKDOC_LIBS = \ $(infgtk_LIBS) \ $(top_builddir)/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ $(top_builddir)/libinfgtk/libinfgtk-$(LIBINFINITY_API_VERSION).la @GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_CC = $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_LD = $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) @GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) @GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_RUN = @GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_RUN = $(LIBTOOL) --mode=execute # We set GPATH here; this gives us semantics for GNU make # which are more like other make's VPATH, when it comes to # whether a source that is a target of one rule is then # searched for in VPATH/GPATH. # GPATH = $(srcdir) TARGET_DIR = $(HTML_DIR)/$(DOC_MODULE) SETUP_FILES = \ $(content_files) \ $(DOC_MAIN_SGML_FILE) \ $(DOC_MODULE)-sections.txt \ $(DOC_MODULE)-overrides.txt # This includes the standard gtk-doc make rules, copied by gtkdocize. # Other files to distribute # e.g. EXTRA_DIST += version.xml.in EXTRA_DIST = $(HTML_IMAGES) $(SETUP_FILES) DOC_STAMPS = setup-build.stamp scan-build.stamp tmpl-build.stamp sgml-build.stamp \ html-build.stamp pdf-build.stamp \ tmpl.stamp sgml.stamp html.stamp pdf.stamp SCANOBJ_FILES = \ $(DOC_MODULE).args \ $(DOC_MODULE).hierarchy \ $(DOC_MODULE).interfaces \ $(DOC_MODULE).prerequisites \ $(DOC_MODULE).signals REPORT_FILES = \ $(DOC_MODULE)-undocumented.txt \ $(DOC_MODULE)-undeclared.txt \ $(DOC_MODULE)-unused.txt CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) @ENABLE_GTK_DOC_TRUE@@GTK_DOC_BUILD_HTML_FALSE@HTML_BUILD_STAMP = @ENABLE_GTK_DOC_TRUE@@GTK_DOC_BUILD_HTML_TRUE@HTML_BUILD_STAMP = html-build.stamp @ENABLE_GTK_DOC_TRUE@@GTK_DOC_BUILD_PDF_FALSE@PDF_BUILD_STAMP = @ENABLE_GTK_DOC_TRUE@@GTK_DOC_BUILD_PDF_TRUE@PDF_BUILD_STAMP = pdf-build.stamp #### setup #### GTK_DOC_V_SETUP = $(GTK_DOC_V_SETUP_$(V)) GTK_DOC_V_SETUP_ = $(GTK_DOC_V_SETUP_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_SETUP_0 = @echo " DOC Preparing build"; #### scan #### GTK_DOC_V_SCAN = $(GTK_DOC_V_SCAN_$(V)) GTK_DOC_V_SCAN_ = $(GTK_DOC_V_SCAN_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_SCAN_0 = @echo " DOC Scanning header files"; GTK_DOC_V_INTROSPECT = $(GTK_DOC_V_INTROSPECT_$(V)) GTK_DOC_V_INTROSPECT_ = $(GTK_DOC_V_INTROSPECT_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_INTROSPECT_0 = @echo " DOC Introspecting gobjects"; #### templates #### GTK_DOC_V_TMPL = $(GTK_DOC_V_TMPL_$(V)) GTK_DOC_V_TMPL_ = $(GTK_DOC_V_TMPL_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_TMPL_0 = @echo " DOC Rebuilding template files"; #### xml #### GTK_DOC_V_XML = $(GTK_DOC_V_XML_$(V)) GTK_DOC_V_XML_ = $(GTK_DOC_V_XML_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_XML_0 = @echo " DOC Building XML"; #### html #### GTK_DOC_V_HTML = $(GTK_DOC_V_HTML_$(V)) GTK_DOC_V_HTML_ = $(GTK_DOC_V_HTML_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_HTML_0 = @echo " DOC Building HTML"; GTK_DOC_V_XREF = $(GTK_DOC_V_XREF_$(V)) GTK_DOC_V_XREF_ = $(GTK_DOC_V_XREF_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_XREF_0 = @echo " DOC Fixing cross-references"; #### pdf #### GTK_DOC_V_PDF = $(GTK_DOC_V_PDF_$(V)) GTK_DOC_V_PDF_ = $(GTK_DOC_V_PDF_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_PDF_0 = @echo " DOC Building PDF"; # Files not to distribute # for --rebuild-types in $(SCAN_OPTIONS), e.g. $(DOC_MODULE).types # for --rebuild-sections in $(SCAN_OPTIONS) e.g. $(DOC_MODULE)-sections.txt DISTCLEANFILES = libinfgtk-$(LIBINFINITY_API_VERSION).types version.xml all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/gtk-doc.make $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu docs/reference/libinfgtk/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu docs/reference/libinfgtk/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_srcdir)/gtk-doc.make: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook check-am: all-am check: check-am all-am: Makefile all-local installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -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) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-local mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-local dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-data-local install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic \ maintainer-clean-local mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-local .MAKE: install-am install-strip .PHONY: all all-am all-local check check-am clean clean-generic \ clean-libtool clean-local cscopelist-am ctags-am dist-hook \ distclean distclean-generic distclean-libtool distclean-local \ distdir dvi dvi-am html html-am info info-am install \ install-am install-data install-data-am install-data-local \ install-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ maintainer-clean-local mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-local @ENABLE_GTK_DOC_TRUE@all-local: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) @ENABLE_GTK_DOC_FALSE@all-local: docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) $(REPORT_FILES): sgml-build.stamp setup-build.stamp: -$(GTK_DOC_V_SETUP)if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ files=`echo $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types`; \ if test "x$$files" != "x" ; then \ for file in $$files ; do \ test -f $(abs_srcdir)/$$file && \ cp -pu $(abs_srcdir)/$$file $(abs_builddir)/$$file || true; \ done; \ fi; \ test -d $(abs_srcdir)/tmpl && \ { cp -rp $(abs_srcdir)/tmpl $(abs_builddir)/; \ chmod -R u+w $(abs_builddir)/tmpl; } \ fi $(AM_V_at)touch setup-build.stamp scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB) $(GTK_DOC_V_SCAN)_source_dir='' ; \ for i in $(DOC_SOURCE_DIR) ; do \ _source_dir="$${_source_dir} --source-dir=$$i" ; \ done ; \ gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES) $(GTK_DOC_V_INTROSPECT)if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null 2>&1 ; then \ scanobj_options=""; \ gtkdoc-scangobj 2>&1 --help | grep >/dev/null "\-\-verbose"; \ if test "$(?)" = "0"; then \ if test "x$(V)" = "x1"; then \ scanobj_options="--verbose"; \ fi; \ fi; \ CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \ gtkdoc-scangobj $(SCANGOBJ_OPTIONS) $$scanobj_options --module=$(DOC_MODULE); \ else \ for i in $(SCANOBJ_FILES) ; do \ test -f $$i || touch $$i ; \ done \ fi $(AM_V_at)touch scan-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp @true tmpl-build.stamp: setup-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt $(GTK_DOC_V_TMPL)gtkdoc-mktmpl --module=$(DOC_MODULE) $(MKTMPL_OPTIONS) $(AM_V_at)if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ if test -w $(abs_srcdir) ; then \ cp -rp $(abs_builddir)/tmpl $(abs_srcdir)/; \ fi \ fi $(AM_V_at)touch tmpl-build.stamp tmpl.stamp: tmpl-build.stamp @true $(srcdir)/tmpl/*.sgml: @true sgml-build.stamp: tmpl.stamp $(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml $(expand_content_files) $(GTK_DOC_V_XML)-chmod -R u+w $(srcdir) && _source_dir='' ; \ for i in $(DOC_SOURCE_DIR) ; do \ _source_dir="$${_source_dir} --source-dir=$$i" ; \ done ; \ gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $${_source_dir} $(MKDB_OPTIONS) $(AM_V_at)touch sgml-build.stamp sgml.stamp: sgml-build.stamp @true html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) $(GTK_DOC_V_HTML)rm -rf html && mkdir html && \ mkhtml_options=""; \ gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-verbose"; \ if test "$(?)" = "0"; then \ if test "x$(V)" = "x1"; then \ mkhtml_options="$$mkhtml_options --verbose"; \ fi; \ fi; \ gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \ if test "$(?)" = "0"; then \ mkhtml_options="$$mkhtml_options --path=\"$(abs_srcdir)\""; \ fi; \ cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) -@test "x$(HTML_IMAGES)" = "x" || \ for file in $(HTML_IMAGES) ; do \ if test -f $(abs_srcdir)/$$file ; then \ cp $(abs_srcdir)/$$file $(abs_builddir)/html; \ fi; \ if test -f $(abs_builddir)/$$file ; then \ cp $(abs_builddir)/$$file $(abs_builddir)/html; \ fi; \ done; $(GTK_DOC_V_XREF)gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) $(AM_V_at)touch html-build.stamp pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) $(GTK_DOC_V_PDF)rm -f $(DOC_MODULE).pdf && \ mkpdf_options=""; \ gtkdoc-mkpdf 2>&1 --help | grep >/dev/null "\-\-verbose"; \ if test "$(?)" = "0"; then \ if test "x$(V)" = "x1"; then \ mkpdf_options="$$mkpdf_options --verbose"; \ fi; \ fi; \ if test "x$(HTML_IMAGES)" != "x"; then \ for img in $(HTML_IMAGES); do \ part=`dirname $$img`; \ echo $$mkpdf_options | grep >/dev/null "\-\-imgdir=$$part "; \ if test $$? != 0; then \ mkpdf_options="$$mkpdf_options --imgdir=$$part"; \ fi; \ done; \ fi; \ gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_options $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS) $(AM_V_at)touch pdf-build.stamp ############## clean-local: @rm -f *~ *.bak @rm -rf .libs distclean-local: @rm -rf xml html $(REPORT_FILES) $(DOC_MODULE).pdf \ $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ rm -f $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types; \ rm -rf tmpl; \ fi maintainer-clean-local: @rm -rf xml html install-data-local: @installfiles=`echo $(builddir)/html/*`; \ if test "$$installfiles" = '$(builddir)/html/*'; \ then echo 1>&2 'Nothing to install' ; \ else \ if test -n "$(DOC_MODULE_VERSION)"; then \ installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ else \ installdir="$(DESTDIR)$(TARGET_DIR)"; \ fi; \ $(mkinstalldirs) $${installdir} ; \ for i in $$installfiles; do \ echo ' $(INSTALL_DATA) '$$i ; \ $(INSTALL_DATA) $$i $${installdir}; \ done; \ if test -n "$(DOC_MODULE_VERSION)"; then \ mv -f $${installdir}/$(DOC_MODULE).devhelp2 \ $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \ fi; \ $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir}; \ fi uninstall-local: @if test -n "$(DOC_MODULE_VERSION)"; then \ installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ else \ installdir="$(DESTDIR)$(TARGET_DIR)"; \ fi; \ rm -rf $${installdir} # # Require gtk-doc when making dist # @ENABLE_GTK_DOC_TRUE@dist-check-gtkdoc: docs @ENABLE_GTK_DOC_FALSE@dist-check-gtkdoc: @ENABLE_GTK_DOC_FALSE@ @echo "*** gtk-doc must be installed and enabled in order to make dist" @ENABLE_GTK_DOC_FALSE@ @false dist-hook: dist-check-gtkdoc dist-hook-local @mkdir $(distdir)/tmpl @mkdir $(distdir)/html @-cp ./tmpl/*.sgml $(distdir)/tmpl @cp ./html/* $(distdir)/html @-cp ./$(DOC_MODULE).pdf $(distdir)/ @-cp ./$(DOC_MODULE).types $(distdir)/ @-cp ./$(DOC_MODULE)-sections.txt $(distdir)/ @cd $(distdir) && rm -f $(DISTCLEANFILES) @$(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html .PHONY : dist-hook-local docs # Comment this out if you want your docs-status tested during 'make check' #TESTS = $(GTKDOC_CHECK) # 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: libinfinity-0.5.5/docs/reference/libinfgtk/libinfgtk-0.5-sections.txt0000644000175000017500000001102712264766271022476 00000000000000
inf-gtk-browser-store InfGtkBrowserStore InfGtkBrowserStore inf_gtk_browser_store_new inf_gtk_browser_store_add_discovery inf_gtk_browser_store_add_connection inf_gtk_browser_store_remove_connection inf_gtk_browser_store_clear_connection_error inf_gtk_browser_store_set_connection_name InfGtkBrowserStoreClass INF_GTK_BROWSER_STORE INF_GTK_IS_BROWSER_STORE INF_GTK_TYPE_BROWSER_STORE inf_gtk_browser_store_get_type INF_GTK_BROWSER_STORE_CLASS INF_GTK_IS_BROWSER_STORE_CLASS INF_GTK_BROWSER_STORE_GET_CLASS
inf-gtk-browser-model-filter InfGtkBrowserModelFilter InfGtkBrowserModelFilter inf_gtk_browser_model_filter_new InfGtkBrowserModelFilterClass INF_GTK_BROWSER_MODEL_FILTER INF_GTK_IS_BROWSER_MODEL_FILTER INF_GTK_TYPE_BROWSER_MODEL_FILTER inf_gtk_browser_model_filter_get_type INF_GTK_BROWSER_MODEL_FILTER_CLASS INF_GTK_IS_BROWSER_MODEL_FILTER_CLASS INF_GTK_BROWSER_MODEL_FILTER_GET_CLASS
inf-gtk-browser-model INF_GTK_TYPE_BROWSER_MODEL_STATUS InfGtkBrowserModel InfGtkBrowserModelStatus InfGtkBrowserModelColumn inf_gtk_browser_model_set_browser inf_gtk_browser_model_resolve inf_gtk_browser_model_browser_iter_to_tree_iter InfGtkBrowserModelIface inf_gtk_browser_model_get_type INF_GTK_BROWSER_MODEL INF_GTK_IS_BROWSER_MODEL INF_GTK_TYPE_BROWSER_MODEL inf_gtk_browser_model_status_get_type INF_GTK_BROWSER_MODEL_GET_IFACE
inf-gtk-browser-model-sort InfGtkBrowserModelSort InfGtkBrowserModelSort inf_gtk_browser_model_sort_new InfGtkBrowserModelSortClass INF_GTK_BROWSER_MODEL_SORT INF_GTK_IS_BROWSER_MODEL_SORT INF_GTK_TYPE_BROWSER_MODEL_SORT inf_gtk_browser_model_sort_get_type INF_GTK_BROWSER_MODEL_SORT_CLASS INF_GTK_IS_BROWSER_MODEL_SORT_CLASS INF_GTK_BROWSER_MODEL_SORT_GET_CLASS
inf-gtk-browser-view InfGtkBrowserView InfGtkBrowserView inf_gtk_browser_view_new inf_gtk_browser_view_new_with_model inf_gtk_browser_view_get_model inf_gtk_browser_view_get_selected inf_gtk_browser_view_set_selected InfGtkBrowserViewClass INF_GTK_BROWSER_VIEW INF_GTK_IS_BROWSER_VIEW INF_GTK_TYPE_BROWSER_VIEW inf_gtk_browser_view_get_type INF_GTK_BROWSER_VIEW_CLASS INF_GTK_IS_BROWSER_VIEW_CLASS INF_GTK_BROWSER_VIEW_GET_CLASS INF_GTK_TYPE_BROWSER_VIEW_STATUS
inf-gtk-io InfGtkIo InfGtkIo inf_gtk_io_new InfGtkIoClass INF_GTK_IO INF_GTK_IS_IO INF_GTK_TYPE_IO inf_gtk_io_get_type INF_GTK_IO_CLASS INF_GTK_IS_IO_CLASS INF_GTK_IO_GET_CLASS
inf-gtk-certificate-dialog InfGtkCertificateDialog InfGtkCertificateDialog InfGtkCertificateDialogFlags inf_gtk_certificate_dialog_new InfGtkCertificateDialogClass INF_GTK_CERTIFICATE_DIALOG INF_GTK_CERTIFICATE_DIALOG_CLASS INF_GTK_CERTIFICATE_DIALOG_GET_CLASS INF_GTK_IS_CERTIFICATE_DIALOG INF_GTK_IS_CERTIFICATE_DIALOG_CLASS INF_GTK_TYPE_CERTIFICATE_DIALOG INF_GTK_TYPE_CERTIFICATE_DIALOG_FLAGS inf_gtk_certificate_dialog_flags_get_type inf_gtk_certificate_dialog_get_type
inf-gtk-certificate-manager InfGtkCertificateManager InfGtkCertificateManager inf_gtk_certificate_manager_new InfGtkCertificateManagerClass INF_GTK_CERTIFICATE_MANAGER INF_GTK_CERTIFICATE_MANAGER_CLASS INF_GTK_CERTIFICATE_MANAGER_GET_CLASS INF_GTK_IS_CERTIFICATE_MANAGER INF_GTK_IS_CERTIFICATE_MANAGER_CLASS INF_GTK_TYPE_CERTIFICATE_MANAGER inf_gtk_certificate_manager_get_type
inf-gtk-certificate-view InfGtkCertificateView InfGtkCertificateView inf_gtk_certificate_view_new inf_gtk_certificate_view_new_with_certificate inf_gtk_certificate_view_set_certificate InfGtkCertificateViewClass INF_GTK_CERTIFICATE_VIEW INF_GTK_CERTIFICATE_VIEW_CLASS INF_GTK_CERTIFICATE_VIEW_GET_CLASS INF_GTK_IS_CERTIFICATE_VIEW INF_GTK_IS_CERTIFICATE_VIEW_CLASS INF_GTK_TYPE_CERTIFICATE_VIEW INF_GTK_TYPE_CERTIFICATE_VIEW_FLAGS inf_gtk_certificate_view_get_type
inf-gtk-chat InfGtkChat InfGtkChat inf_gtk_chat_new inf_gtk_chat_set_session inf_gtk_chat_set_active_user inf_gtk_chat_get_entry InfGtkChatClass INF_GTK_CHAT INF_GTK_IS_CHAT INF_GTK_TYPE_CHAT inf_gtk_chat_get_type INF_GTK_CHAT_CLASS INF_GTK_IS_CHAT_CLASS INF_GTK_CHAT_GET_CLASS
libinfinity-0.5.5/docs/reference/libinfgtk/libinfgtk-0.5-docs.sgml0000644000175000017500000000246412264763732021726 00000000000000 ]> libinfgtk-&api_version; Reference Manual for libinfgtk &version;. The latest version of this documentation can be found on-line at http://infinote.0x539.de/libinfinity/API/libinfgtk/. libinfgtk API libinfinity-0.5.5/docs/reference/libinfgtk/tmpl/0000755000175000017500000000000012264766271016672 500000000000000libinfinity-0.5.5/docs/reference/libinfgtk/tmpl/libinfgtk-0.3-unused.sgml0000644000175000017500000000023612264766271023247 00000000000000 libinfinity-0.5.5/docs/reference/libinfgtk/tmpl/inf-gtk-certificate-manager.sgml0000644000175000017500000000154112264766271024726 00000000000000 InfGtkCertificateManager @parent_window: @xmpp_manager: @trust_file: @known_hosts_file: @Returns: libinfinity-0.5.5/docs/reference/libinfgtk/tmpl/libinfgtk-0.6-unused.sgml0000644000175000017500000000106412264766271023252 00000000000000 @infgtkbrowserview: the object which received the signal. @arg1: @arg2: @view: @Returns: libinfinity-0.5.5/docs/reference/libinfgtk/tmpl/inf-gtk-certificate-view.sgml0000644000175000017500000000140212264766271024262 00000000000000 InfGtkCertificateView @void: @Returns: @cert: @Returns: @view: @cert: libinfinity-0.5.5/docs/reference/libinfgtk/tmpl/libinfgtk-0.5-unused.sgml0000644000175000017500000001106512264766271023253 00000000000000 InfGtkAclSheetView InfGtkPermissionsDialog @infgtkaclsheetview: the object which received the signal. @sheet_changed: @parent_class: @set_browser: @resolve: @browser_iter_to_tree_iter: @parent_class: @parent_class: @infgtkbrowserview: the object which received the signal. @arg1: @arg2: @parent_class: @activate: @selection_changed: @populate_popup: @set_scroll_adjustments: @parent_class: @parent_class: @parent_class: @view: @Returns: @view: @Returns: @view: @Returns: @view: @Returns: @void: @Returns: @view: @editable: @view: @mask: @view: @sheet: @view: @show: @view: @Returns: @chat: @Returns: @parent: @dialog_flags: @browser: @iter: @Returns: @dialog: @browser: @iter: libinfinity-0.5.5/docs/reference/libinfgtk/tmpl/inf-gtk-chat.sgml0000644000175000017500000000151412264766271021753 00000000000000 InfGtkChat @void: @Returns: @chat: @session: @chat: @user: @chat: @Returns: libinfinity-0.5.5/docs/reference/libinfgtk/tmpl/inf-gtk-browser-view.sgml0000644000175000017500000000227312264766271023472 00000000000000 InfGtkBrowserView @infgtkbrowserview: the object which received the signal. @arg1: @infgtkbrowserview: the object which received the signal. @arg1: @infgtkbrowserview: the object which received the signal. @arg1: @void: @Returns: @model: @Returns: @view: @iter: @Returns: @view: @iter: libinfinity-0.5.5/docs/reference/libinfgtk/tmpl/inf-gtk-browser-model-filter.sgml0000644000175000017500000000075312264766271025104 00000000000000 InfGtkBrowserModelFilter @child_model: @Returns: libinfinity-0.5.5/docs/reference/libinfgtk/tmpl/inf-gtk-io.sgml0000644000175000017500000000066212264766271021446 00000000000000 InfGtkIo @void: @Returns: libinfinity-0.5.5/docs/reference/libinfgtk/tmpl/inf-gtk-browser-model-sort.sgml0000644000175000017500000000074512264766271024607 00000000000000 InfGtkBrowserModelSort @child_model: @Returns: libinfinity-0.5.5/docs/reference/libinfgtk/tmpl/inf-gtk-certificate-dialog.sgml0000644000175000017500000000226012264766271024552 00000000000000 InfGtkCertificateDialog @INF_GTK_CERTIFICATE_DIALOG_CERT_NOT_ACTIVATED: @INF_GTK_CERTIFICATE_DIALOG_CERT_EXPIRED: @INF_GTK_CERTIFICATE_DIALOG_CERT_HOSTNAME_MISMATCH: @INF_GTK_CERTIFICATE_DIALOG_CERT_INVALID: @INF_GTK_CERTIFICATE_DIALOG_CERT_ISSUER_NOT_TRUSTED: @INF_GTK_CERTIFICATE_DIALOG_CERT_CHANGED: @INF_GTK_CERTIFICATE_DIALOG_CERT_OLD_EXPIRED: @parent: @dialog_flags: @certificate_flags: @hostname: @certificate_chain: @Returns: libinfinity-0.5.5/docs/reference/libinfgtk/tmpl/inf-gtk-permissions-dialog.sgml0000644000175000017500000000153312264766271024645 00000000000000 InfGtkPermissionsDialog @parent: @dialog_flags: @browser: @iter: @Returns: @dialog: @browser: @iter: libinfinity-0.5.5/docs/reference/libinfgtk/tmpl/libinfgtk-0.4-unused.sgml0000644000175000017500000000023612264766271023250 00000000000000 libinfinity-0.5.5/docs/reference/libinfgtk/tmpl/libinfgtk-unused.sgml0000644000175000017500000000023612264766271022751 00000000000000 libinfinity-0.5.5/docs/reference/libinfgtk/tmpl/inf-gtk-acl-sheet-view.sgml0000644000175000017500000000343512264766271023655 00000000000000 InfGtkAclSheetView @infgtkaclsheetview: the object which received the signal. @sheet_changed: @void: @Returns: @view: @sheet: @view: @Returns: @view: @editable: @view: @Returns: @view: @show: @view: @Returns: @view: @mask: @view: @Returns: libinfinity-0.5.5/docs/reference/libinfgtk/tmpl/inf-gtk-browser-store.sgml0000644000175000017500000000226112264766271023651 00000000000000 InfGtkBrowserStore @io: @comm_manager: @Returns: @store: @discovery: @store: @connection: @name: @store: @connection: @store: @connection: @store: @connection: @name: libinfinity-0.5.5/docs/reference/libinfgtk/tmpl/inf-gtk-browser-model.sgml0000644000175000017500000000321312264766271023613 00000000000000 inf-gtk-browser-model @infgtkbrowsermodel: the object which received the signal. @arg1: @arg2: @arg3: @INF_GTK_BROWSER_MODEL_INVALID: @INF_GTK_BROWSER_MODEL_DISCOVERED: @INF_GTK_BROWSER_MODEL_RESOLVING: @INF_GTK_BROWSER_MODEL_DISCONNECTED: @INF_GTK_BROWSER_MODEL_CONNECTING: @INF_GTK_BROWSER_MODEL_CONNECTED: @INF_GTK_BROWSER_MODEL_ERROR: @INF_GTK_BROWSER_MODEL_COL_DISCOVERY_INFO: @INF_GTK_BROWSER_MODEL_COL_DISCOVERY: @INF_GTK_BROWSER_MODEL_COL_BROWSER: @INF_GTK_BROWSER_MODEL_COL_STATUS: @INF_GTK_BROWSER_MODEL_COL_NAME: @INF_GTK_BROWSER_MODEL_COL_ERROR: @INF_GTK_BROWSER_MODEL_COL_NODE: @INF_GTK_BROWSER_MODEL_NUM_COLS: @model: @path: @iter: @browser: @model: @discovery: @info: @model: @browser: @browser_iter: @tree_iter: @Returns: libinfinity-0.5.5/docs/reference/libinftextgtk/0000755000175000017500000000000012264766271016623 500000000000000libinfinity-0.5.5/docs/reference/libinftextgtk/Makefile.am0000644000175000017500000000677612264763732020616 00000000000000## Process this file with automake to produce Makefile.in # We require automake 1.6 at least. AUTOMAKE_OPTIONS = 1.6 # This is a blank Makefile.am for using gtk-doc. # Copy this to your project's API docs directory and modify the variables to # suit your project. See the GTK+ Makefiles in gtk+/docs/reference for examples # of using the various options. # The name of the module, e.g. 'glib'. DOC_MODULE=libinftextgtk-$(LIBINFINITY_API_VERSION) # The top-level SGML file. You can change this if you want to. DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml # The directory containing the source code. Relative to $(srcdir). # gtk-doc will search all .c & .h files beneath here for inline comments # documenting the functions and macros. # e.g. DOC_SOURCE_DIR=../../../gtk DOC_SOURCE_DIR=$(top_srcdir)/libinftextgtk # Extra options to pass to gtkdoc-scangobj. Not normally needed. SCANGOBJ_OPTIONS= # Extra options to supply to gtkdoc-scan. # e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED" SCAN_OPTIONS=--rebuild-types # Extra options to supply to gtkdoc-mkdb. # e.g. MKDB_OPTIONS=--sgml-mode --output-format=xml MKDB_OPTIONS=--sgml-mode --output-format=xml # Extra options to supply to gtkdoc-mktmpl # e.g. MKTMPL_OPTIONS=--only-section-tmpl MKTMPL_OPTIONS= # Extra options to supply to gtkdoc-fixref. Not normally needed. # e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html FIXXREF_OPTIONS = \ --extra-dir=../libinfinity/html \ --extra-dir=../libinftext/html \ --extra-dir=../libinfgtk/html # Used for dependencies. The docs will be rebuilt if any of these change. # e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h # e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c HFILE_GLOB = \ $(top_srcdir)/libinftextgtk/*.h CFILE_GLOB = \ $(top_srcdir)/libinftextgtk/*.c # Header files to ignore when scanning. # e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h IGNORE_HFILES = # Images to copy into HTML directory. # e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png HTML_IMAGES= # Extra SGML files that are included by $(DOC_MAIN_SGML_FILE). # e.g. content_files=running.sgml building.sgml changes-2.0.sgml content_files = \ ../version.xml # SGML files where gtk-doc abbrevations (#GtkWidget) are expanded # These files must be listed here *and* in content_files # e.g. expand_content_files=running.sgml expand_content_files= # CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library. # Only needed if you are using gtkdoc-scangobj to dynamically query widget # signals and properties. # e.g. INCLUDES=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS) # e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib) #INCLUDES=$(inftextgtk_CFLAGS) AM_CPPFLAGS=$(inftextgtk_CFLAGS) GTKDOC_LIBS = \ $(inftextgtk_LIBS) \ $(top_builddir)/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ $(top_builddir)/libinftext/libinftext-$(LIBINFINITY_API_VERSION).la \ $(top_builddir)/libinfgtk/libinfgtk-$(LIBINFINITY_API_VERSION).la \ $(top_builddir)/libinftextgtk/libinftextgtk-$(LIBINFINITY_API_VERSION).la # This includes the standard gtk-doc make rules, copied by gtkdocize. include $(top_srcdir)/gtk-doc.make # Other files to distribute # e.g. EXTRA_DIST += version.xml.in EXTRA_DIST += # Files not to distribute # for --rebuild-types in $(SCAN_OPTIONS), e.g. $(DOC_MODULE).types # for --rebuild-sections in $(SCAN_OPTIONS) e.g. $(DOC_MODULE)-sections.txt DISTCLEANFILES = libinftextgtk-$(LIBINFINITY_API_VERSION).types version.xml # Comment this out if you want your docs-status tested during 'make check' #TESTS = $(GTKDOC_CHECK) libinfinity-0.5.5/docs/reference/libinftextgtk/libinftextgtk-0.5-overrides.txt0000644000175000017500000000000012264763732024447 00000000000000libinfinity-0.5.5/docs/reference/libinftextgtk/html/0000755000175000017500000000000012264766271017567 500000000000000libinfinity-0.5.5/docs/reference/libinftextgtk/html/left.png0000644000175000017500000000055612264766271021155 00000000000000‰PNG  IHDRשÍÊ~PLTEÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ(((;;;@@@€€€ƒƒƒ§§§×××ßßßãããçççëëëóóóûûûÿÿÿv:òütRNS $04 libinfinity-0.5.5/docs/reference/libinftextgtk/html/ch01.html0000644000175000017500000000414112264766271021130 00000000000000 libinftextgtk API libinfinity-0.5.5/docs/reference/libinftextgtk/html/InfTextGtkBuffer.html0000644000175000017500000017101412264766271023562 00000000000000 InfTextGtkBuffer

InfTextGtkBuffer

InfTextGtkBuffer

Synopsis

                    InfTextGtkBuffer;
InfTextGtkBuffer *  inf_text_gtk_buffer_new             (GtkTextBuffer *buffer,
                                                         InfUserTable *user_table);
GtkTextBuffer *     inf_text_gtk_buffer_get_text_buffer (InfTextGtkBuffer *buffer);
void                inf_text_gtk_buffer_set_active_user (InfTextGtkBuffer *buffer,
                                                         InfTextUser *user);
InfTextUser *       inf_text_gtk_buffer_get_active_user (InfTextGtkBuffer *buffer);
InfTextUser *       inf_text_gtk_buffer_get_author      (InfTextGtkBuffer *buffer,
                                                         GtkTextIter *location);
InfTextUser *       inf_text_gtk_buffer_get_user_for_tag
                                                        (InfTextGtkBuffer *buffer,
                                                         GtkTextTag *tag);
gboolean            inf_text_gtk_buffer_is_author_toggle
                                                        (InfTextGtkBuffer *buffer,
                                                         const GtkTextIter *iter,
                                                         InfTextUser **user_on,
                                                         InfTextUser **user_off);
gboolean            inf_text_gtk_buffer_forward_to_author_toggle
                                                        (InfTextGtkBuffer *buffer,
                                                         GtkTextIter *iter,
                                                         InfTextUser **user_on,
                                                         InfTextUser **user_off);
gboolean            inf_text_gtk_buffer_backward_to_author_toggle
                                                        (InfTextGtkBuffer *buffer,
                                                         GtkTextIter *iter,
                                                         InfTextUser **user_on,
                                                         InfTextUser **user_off);
void                inf_text_gtk_buffer_set_wake_on_cursor_movement
                                                        (InfTextGtkBuffer *buffer,
                                                         gboolean wake);
gboolean            inf_text_gtk_buffer_get_wake_on_cursor_movement
                                                        (InfTextGtkBuffer *buffer);
void                inf_text_gtk_buffer_ensure_author_tags_priority
                                                        (InfTextGtkBuffer *buffer);
void                inf_text_gtk_buffer_set_saturation_value
                                                        (InfTextGtkBuffer *buffer,
                                                         gdouble saturation,
                                                         gdouble value);
gdouble             inf_text_gtk_buffer_get_saturation  (InfTextGtkBuffer *buffer);
gdouble             inf_text_gtk_buffer_get_value       (InfTextGtkBuffer *buffer);
void                inf_text_gtk_buffer_set_show_user_colors
                                                        (InfTextGtkBuffer *buffer,
                                                         gboolean show);
gboolean            inf_text_gtk_buffer_get_show_user_colors
                                                        (InfTextGtkBuffer *buffer);
void                inf_text_gtk_buffer_show_user_colors
                                                        (InfTextGtkBuffer *buffer,
                                                         gboolean show,
                                                         GtkTextIter *start,
                                                         GtkTextIter *end);

Object Hierarchy

  GObject
   +----InfTextGtkBuffer

Implemented Interfaces

InfTextGtkBuffer implements InfBuffer and InfTextBuffer.

Properties

  "active-user"              InfTextUser*          : Read / Write
  "buffer"                   GtkTextBuffer*        : Read / Write / Construct Only
  "saturation"               gdouble               : Read / Write
  "show-user-colors"         gboolean              : Read / Write
  "user-table"               InfUserTable*         : Read / Write / Construct Only
  "value"                    gdouble               : Read / Write
  "wake-on-cursor-movement"  gboolean              : Read / Write

Description

Details

InfTextGtkBuffer

typedef struct _InfTextGtkBuffer InfTextGtkBuffer;


inf_text_gtk_buffer_new ()

InfTextGtkBuffer *  inf_text_gtk_buffer_new             (GtkTextBuffer *buffer,
                                                         InfUserTable *user_table);

Creates a new InfTextGtkBuffer wrapping buffer. It implements the InfTextBuffer interface by using buffer to store the text. User colors are read from the users from user_table.

buffer :

The underlaying GtkTextBuffer.

user_table :

The InfUserTable containing the participating users.

Returns :

A InfTextGtkBuffer.

inf_text_gtk_buffer_get_text_buffer ()

GtkTextBuffer *     inf_text_gtk_buffer_get_text_buffer (InfTextGtkBuffer *buffer);

Returns the underlaying GtkTextBuffer.

buffer :

A InfTextGtkBuffer.

Returns :

A GtkTextBuffer.

inf_text_gtk_buffer_set_active_user ()

void                inf_text_gtk_buffer_set_active_user (InfTextGtkBuffer *buffer,
                                                         InfTextUser *user);

Sets the active user for buffer. The active user is the user by which edits not issued through the InfTextBuffer interface are performed (for example, edits by the user when the underlaying buffer is displayed in a GtkTextView).

Note that such modifications should not be performed when no active user is set. Note also the active user must be available and have the INF_USER_LOCAL flag set.

buffer :

A InfTextGtkBuffer.

user :

A InfTextUser, or NULL.

inf_text_gtk_buffer_get_active_user ()

InfTextUser *       inf_text_gtk_buffer_get_active_user (InfTextGtkBuffer *buffer);

Returns the current active user for buffer.

buffer :

A InfTextGtkBuffer.

Returns :

A InfTextUser.

inf_text_gtk_buffer_get_author ()

InfTextUser *       inf_text_gtk_buffer_get_author      (InfTextGtkBuffer *buffer,
                                                         GtkTextIter *location);

Returns the InfTextUser which wrote the character at location. If there is no such user, then NULL is returned.

buffer :

A InfTextGtkBuffer.

location :

A GtkTextIter which is not the end iterator.

Returns :

A InfTextUser, or NULL.

inf_text_gtk_buffer_get_user_for_tag ()

InfTextUser *       inf_text_gtk_buffer_get_user_for_tag
                                                        (InfTextGtkBuffer *buffer,
                                                         GtkTextTag *tag);

If tag is an author tag, i.e. used by buffer to mark text that a certain user has written, then this function returns the InfTextUser whose text is marked by tag. If tag is not an author tag then the function returns NULL.

buffer :

A InfTextGtkBuffer.

tag :

A GtkTextTag from buffer's underlying GtkTextBuffer's tag table.

Returns :

A InfTextUser, or NULL.

inf_text_gtk_buffer_is_author_toggle ()

gboolean            inf_text_gtk_buffer_is_author_toggle
                                                        (InfTextGtkBuffer *buffer,
                                                         const GtkTextIter *iter,
                                                         InfTextUser **user_on,
                                                         InfTextUser **user_off);

This function returns TRUE if the author of the text in buffer changes at iter, or FALSE otherwise. If it returns TRUE, then the user who authored the text to the right hand side of iter is stored in user_on (if non-NULL) and the author of the text to the left hand side of iter is stored in user_off (if non-NULL). Both can also be set to NULL if there is unowned text in the buffer or if iter is at the start or end of the buffer.

buffer :

A InfTextGtkBuffer.

iter :

A GtkTextIter pointing into buffer's underlying GtkTextBuffer.

user_on :

A location to store a InfTextUser, or NULL.

user_off :

Another location to store a InfTextUser, or NULL.

Returns :

Whether text attribution changes at iter.

inf_text_gtk_buffer_forward_to_author_toggle ()

gboolean            inf_text_gtk_buffer_forward_to_author_toggle
                                                        (InfTextGtkBuffer *buffer,
                                                         GtkTextIter *iter,
                                                         InfTextUser **user_on,
                                                         InfTextUser **user_off);

Moves iter to the next point in buffer's underlying GtkTextBuffer where the text has been written by another user. If iter points to the end of the buffer, then the function does nothing and returns FALSE. Otherwise it returns TRUE and sets user_on to the user which has written the text on the right hand side of the location iter has been moved to (if non-NULL) and user_off to the user which has written the left hand side of the location iter has been moved to.

buffer :

A InfTextGtkBuffer.

iter :

A GtkTextIter pointing into buffer's underlying GtkTextBuffer.

user_on :

A location to store a InfTextUser, or NULL.

user_off :

Another location to store a InfTextUser, or NULL.

Returns :

TRUE if iter was moved, or FALSE otherwise.

inf_text_gtk_buffer_backward_to_author_toggle ()

gboolean            inf_text_gtk_buffer_backward_to_author_toggle
                                                        (InfTextGtkBuffer *buffer,
                                                         GtkTextIter *iter,
                                                         InfTextUser **user_on,
                                                         InfTextUser **user_off);

Moves iter to the previous point in buffer's underlying GtkTextBuffer where the text has been written by another user. If iter points to the beginning of the buffer, then the function does nothing and returns FALSE. Otherwise it returns TRUE and sets user_on to the user which has written the text on the right hand side of the location iter has been moved to (if non-NULL) and user_off to the user which has written the left hand side of the location iter has been moved to.

buffer :

A InfTextGtkBuffer.

iter :

A GtkTextIter pointing into buffer's underlying GtkTextBuffer.

user_on :

A location to store a InfTextUser, or NULL.

user_off :

Another location to store a InfTextUser, or NULL.

Returns :

TRUE if iter was moved, or FALSE otherwise.

inf_text_gtk_buffer_set_wake_on_cursor_movement ()

void                inf_text_gtk_buffer_set_wake_on_cursor_movement
                                                        (InfTextGtkBuffer *buffer,
                                                         gboolean wake);

This function spcecifies whether movement of the insertion point or selection bound of the underlying text buffer causes the active user (see inf_text_gtk_buffer_set_active_user()) to become active when its status is INF_USER_STATUS_INACTIVE.

If wake is TRUE, then the user status changes to INF_USER_STATUS_ACTIVE in that case. If wake is FALSE, then the user status stays INF_USER_STATUS_INACTIVE, and its caret-position and selection-length properties will be no longer be synchronized to the buffer marks until the user is set active again.

buffer :

A InfTextGtkBuffer.

wake :

Whether to make inactive users active on cursor movement.

inf_text_gtk_buffer_get_wake_on_cursor_movement ()

gboolean            inf_text_gtk_buffer_get_wake_on_cursor_movement
                                                        (InfTextGtkBuffer *buffer);

Returns whether movement of the insertion point or selection bound of the underlying text buffer causes whether the active user (see inf_text_gtk_buffer_set_active_user()) to become active when its status is INF_USER_STATUS_INACTIVE. See also inf_text_gtk_buffer_set_wake_on_cursor_movement().

buffer :

A InfTextGtkBuffer.

Returns :

Whether to make inactive users active when the insertion mark is moved.

inf_text_gtk_buffer_ensure_author_tags_priority ()

void                inf_text_gtk_buffer_ensure_author_tags_priority
                                                        (InfTextGtkBuffer *buffer);

Ensures that all author tags have the lowest priority of all tags in the underlying GtkTextBuffer's tag table. Normally you do not need to use this function if you do not set the priority for your tags explicitely. However, if you do (or are forced to do, because you are using a library that does this, such as GtkSourceView), then you can call this function afterwards to make sure all the user tags have the lowest priority.

buffer :

A InfTextGtkBuffer.

inf_text_gtk_buffer_set_saturation_value ()

void                inf_text_gtk_buffer_set_saturation_value
                                                        (InfTextGtkBuffer *buffer,
                                                         gdouble saturation,
                                                         gdouble value);

Sets the saturation and value to use for user colors in a HSV color model. The hue is defined by each user's individual color. The reason why S and V are set locally the same for all users is that they can be adjusted depending on one's theme: Dark themes want dark user colors, bright themes want bright ones.

buffer :

A InfTextGtkBuffer.

saturation :

Saturation to use for user colors.

value :

Value to use for user colors.

inf_text_gtk_buffer_get_saturation ()

gdouble             inf_text_gtk_buffer_get_saturation  (InfTextGtkBuffer *buffer);

Returns the saturation part of the HSV user color.

buffer :

A InfTextGtkBuffer.

Returns :

The saturation used for user colors.

inf_text_gtk_buffer_get_value ()

gdouble             inf_text_gtk_buffer_get_value       (InfTextGtkBuffer *buffer);

Returns the value part of the HSV user color.

buffer :

A InfTextGtkBuffer.

Returns :

The value used for user colors.

inf_text_gtk_buffer_set_show_user_colors ()

void                inf_text_gtk_buffer_set_show_user_colors
                                                        (InfTextGtkBuffer *buffer,
                                                         gboolean show);

If show is TRUE (the default), then the user color is used as background for newly written text by that user. Otherwise, newly written text has no background color.

Note that this setting is for newly written text only. If you want to show or hide user colors for existing text use inf_text_gtk_buffer_show_user_colors().

buffer :

A InfTextGtkBuffer.

show :

Whether to show user colors or not.

inf_text_gtk_buffer_get_show_user_colors ()

gboolean            inf_text_gtk_buffer_get_show_user_colors
                                                        (InfTextGtkBuffer *buffer);

Returns whether newly written text is attributed with the author's user color or not.

buffer :

A InfTextGtkBuffer.

Returns :

TRUE if user color is applied to newly written text, or FALSE otherwise.

inf_text_gtk_buffer_show_user_colors ()

void                inf_text_gtk_buffer_show_user_colors
                                                        (InfTextGtkBuffer *buffer,
                                                         gboolean show,
                                                         GtkTextIter *start,
                                                         GtkTextIter *end);

If show is FALSE, then don't show user colors (which user wrote what text) as the background of the text, in the range from start to end. If show is TRUE, show user colors if they have previously been hidden via a call to this function with show being FALSE.

buffer :

A InfTextGtkBuffer.

show :

Whether to show or hide user colors.

start :

Beginning of the range for which to show or hide user colors.

end :

End of the range for which to show or hide user colors.

Property Details

The "active-user" property

  "active-user"              InfTextUser*          : Read / Write

The user currently inserting text locally.


The "buffer" property

  "buffer"                   GtkTextBuffer*        : Read / Write / Construct Only

The underlaying GtkTextBuffer.


The "saturation" property

  "saturation"               gdouble               : Read / Write

Saturation of user colors in a HSV color model.

Allowed values: [0,1]

Default value: 0.35


The "show-user-colors" property

  "show-user-colors"         gboolean              : Read / Write

Whether to show user colors initially for newly written text.

Default value: TRUE


The "user-table" property

  "user-table"               InfUserTable*         : Read / Write / Construct Only

A user table of the participating users.


The "value" property

  "value"                    gdouble               : Read / Write

Value of user colors in a HSV color model.

Allowed values: [0,1]

Default value: 1


The "wake-on-cursor-movement" property

  "wake-on-cursor-movement"  gboolean              : Read / Write

Whether to make inactive users active when the insertion mark in the TextBuffer moves.

Default value: FALSE

libinfinity-0.5.5/docs/reference/libinftextgtk/html/InfTextGtkView.html0000644000175000017500000006454312264766271023273 00000000000000 InfTextGtkView

InfTextGtkView

InfTextGtkView

Object Hierarchy

  GObject
   +----InfTextGtkView

Properties

  "active-user"              InfTextUser*          : Read / Write
  "io"                       InfIo*                : Read / Write / Construct Only
  "show-remote-current-lines" gboolean              : Read / Write
  "show-remote-cursors"      gboolean              : Read / Write
  "show-remote-selections"   gboolean              : Read / Write
  "user-table"               InfUserTable*         : Read / Write / Construct Only
  "view"                     GtkTextView*          : Read / Write / Construct Only

Description

Details

InfTextGtkView

typedef struct _InfTextGtkView InfTextGtkView;


inf_text_gtk_view_new ()

InfTextGtkView *    inf_text_gtk_view_new               (InfIo *io,
                                                         GtkTextView *view,
                                                         InfUserTable *user_table);

Creates a new InfTextGtkView for view. This draws remote user's cursors and selections into the text view.

io :

A InfIo.

view :

A GtkTextView.

user_table :

The InfUserTable for the text session displayed in view.

Returns :

A new InfTextGtkView.

inf_text_gtk_view_get_text_view ()

GtkTextView *       inf_text_gtk_view_get_text_view     (InfTextGtkView *view);

Returns the underlying GtkTextView.

view :

A InfTextGtkView.

Returns :

The InfTextGtkView's GtkTextView.

inf_text_gtk_view_get_user_table ()

InfUserTable *      inf_text_gtk_view_get_user_table    (InfTextGtkView *view);

Returns the InfUserTable containing the users of the session the InfTextGtkView's GtkTextView is displaying.

view :

A InfTextGtkView.

Returns :

The InfGtkTextView's InfUserTable.

inf_text_gtk_view_set_active_user ()

void                inf_text_gtk_view_set_active_user   (InfTextGtkView *view,
                                                         InfTextUser *user);

Sets the user for which perspective to draw the view. The selection and cursor position is not drawn for this user since it is assumed that the view's buffer cursor position and selection match the active user ones (which is automatically the case if the buffer is managed by a InfTextGtkBuffer).

view :

A InfTextGtkView.

user :

A user from view's user table, or NULL.

inf_text_gtk_view_get_active_user ()

InfTextUser *       inf_text_gtk_view_get_active_user   (InfTextGtkView *view);

Returns the active user of view. See inf_text_gtk_view_set_active_user().

view :

A InfTextGtkView.

Returns :

The active user of view.

inf_text_gtk_view_set_show_remote_cursors ()

void                inf_text_gtk_view_set_show_remote_cursors
                                                        (InfTextGtkView *view,
                                                         gboolean show);

If show is TRUE then view draws a cursor for each non-local user in INF_USER_ACTIVE status in that user's color into its underlying GtkTextView. If it is FALSE then remote cursors are not drawn.

view :

A InfTextGtkView.

show :

Whether to show cursors of non-local users.

inf_text_gtk_view_set_show_remote_selections ()

void                inf_text_gtk_view_set_show_remote_selections
                                                        (InfTextGtkView *view,
                                                         gboolean show);

If show is TRUE then view draws the selection ranges for each non-local user in INF_USER_ACTIVE status. The selection range is drawn shaded in that user's color on top of the author color which indicates who wrote the selected text. If more than one user has a given piece of text selected then an alternating stripe pattern with each of the user's colors is drawn. If show is FALES then selection ranges of remote users are not drawn.

view :

A InfTextGtkView.

show :

Whether to show selections of non-local users.

inf_text_gtk_view_set_show_remote_current_lines ()

void                inf_text_gtk_view_set_show_remote_current_lines
                                                        (InfTextGtkView *view,
                                                         gboolean show);

If show is TRUE then all lines in which the cursor of a non-local user in INF_USER_ACTIVE status is is highlighted with that user's color, similar to GtkSourceView's "highlight current line" functionality. If it is FALSE then the current line of non-local users is not be highlighted.

view :

A InfTextGtkView.

show :

Whether to highlight the current line of non-local users.

Property Details

The "active-user" property

  "active-user"              InfTextUser*          : Read / Write

The user for which to show the view.


The "io" property

  "io"                       InfIo*                : Read / Write / Construct Only

The IO object to schedule timeouts.


The "show-remote-current-lines" property

  "show-remote-current-lines" gboolean              : Read / Write

Whether to highlight the line in which the cursor of non-local users is.

Default value: TRUE


The "show-remote-cursors" property

  "show-remote-cursors"      gboolean              : Read / Write

Whether to show cursors of non-local users.

Default value: TRUE


The "show-remote-selections" property

  "show-remote-selections"   gboolean              : Read / Write

Whether to highlight text selected by non-local users.

Default value: TRUE


The "user-table" property

  "user-table"               InfUserTable*         : Read / Write / Construct Only

The user table containing the users of the session shown in the view.


The "view" property

  "view"                     GtkTextView*          : Read / Write / Construct Only

The underlying GtkTextView.

libinfinity-0.5.5/docs/reference/libinftextgtk/html/home.png0000644000175000017500000000107512264766271021150 00000000000000‰PNG  IHDRשÍÊðPLTEÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  $$$(((,,,000888<<<@@@OOOPPP[[[___```lll{{{€€€‹‹‹£££¯¯¯¿¿¿ÃÃÃÇÇÇÏÏÏÓÓÓÛÛÛßßßãããëëëïïïóóó÷÷÷ÿÿÿÕ?“*tRNS  $(,4@GKSghkotw‡‹›Ÿ«·»¿ÃËÏÓÛßçïó÷ûa7™ÞÒIDATx­Í[7†@Æñ^EÈù ”b'…qˆ!DŒdÿocD™Y±– ¿ËçñÀŒÌÎÃ&}¢Ðž°,sTÓa}y&èC`+ûÂþ CLn9¿ÁP;«ô˜ aÆsûÚ.Ýà'Aç2t·7غª» o/ð;ÎÉén5iI+Ì4·ºøž–a£Š±¯ô`í-;Å#®`ȲWÌrRäXÐÞÀ`§vGAÚìþ?¤\qÒ†õ*BMôä5aŽD¡y¦%h8[¾f{р߽C‰VF3‹ÔIEND®B`‚libinfinity-0.5.5/docs/reference/libinftextgtk/html/style.css0000644000175000017500000001210012264766271021353 00000000000000.synopsis, .classsynopsis { /* tango:aluminium 1/2 */ background: #eeeeec; border: solid 1px #d3d7cf; padding: 0.5em; } .programlisting { /* tango:sky blue 0/1 */ background: #e6f3ff; border: solid 1px #729fcf; padding: 0.5em; } .variablelist { padding: 4px; margin-left: 3em; } .variablelist td:first-child { vertical-align: top; } @media screen { sup a.footnote { position: relative; top: 0em ! important; } /* this is needed so that the local anchors are displayed below the naviagtion */ div.footnote a[name], div.refnamediv a[name], div.refsect1 a[name], div.refsect2 a[name], div.index a[name], div.glossary a[name], div.sect1 a[name] { display: inline-block; position: relative; top:-5em; } /* this seems to be a bug in the xsl style sheets when generating indexes */ div.index div.index { top: 0em; } /* make space for the fixed navigation bar and add space at the bottom so that * link targets appear somewhat close to top */ body { padding-top: 3.2em; padding-bottom: 20em; } /* style and size the navigation bar */ table.navigation#top { position: fixed; /* tango:scarlet red 0/1 */ background: #ffe6e6; border: solid 1px #ef2929; margin-top: 0; margin-bottom: 0; top: 0; left: 0; height: 3em; z-index: 10; } .navigation a, .navigation a:visited { /* tango:scarlet red 3 */ color: #a40000; } .navigation a:hover { /* tango:scarlet red 1 */ color: #ef2929; } td.shortcuts { /* tango:scarlet red 1 */ color: #ef2929; font-size: 80%; white-space: nowrap; } } @media print { table.navigation { visibility: collapse; display: none; } div.titlepage table.navigation { visibility: visible; display: table; /* tango:scarlet red 0/1 */ background: #ffe6e6; border: solid 1px #ef2929; margin-top: 0; margin-bottom: 0; top: 0; left: 0; height: 3em; } } .navigation .title { font-size: 200%; } div.gallery-float { float: left; padding: 10px; } div.gallery-float img { border-style: none; } div.gallery-spacer { clear: both; } a, a:visited { text-decoration: none; /* tango:sky blue 2 */ color: #3465a4; } a:hover { text-decoration: underline; /* tango:sky blue 1 */ color: #729fcf; } div.table table { border-collapse: collapse; border-spacing: 0px; /* tango:aluminium 3 */ border: solid 1px #babdb6; } div.table table td, div.table table th { /* tango:aluminium 3 */ border: solid 1px #babdb6; padding: 3px; vertical-align: top; } div.table table th { /* tango:aluminium 2 */ background-color: #d3d7cf; } hr { /* tango:aluminium 3 */ color: #babdb6; background: #babdb6; border: none 0px; height: 1px; clear: both; } .footer { padding-top: 3.5em; /* tango:aluminium 3 */ color: #babdb6; text-align: center; font-size: 80%; } .warning { /* tango:orange 0/1 */ background: #ffeed9; border-color: #ffb04f; } .note { /* tango:chameleon 0/0.5 */ background: #d8ffb2; border-color: #abf562; } .note, .warning { padding: 0.5em; border-width: 1px; border-style: solid; } .note h3, .warning h3 { margin-top: 0.0em } .note p, .warning p { margin-bottom: 0.0em } /* blob links */ h2 .extralinks, h3 .extralinks { float: right; /* tango:aluminium 3 */ color: #babdb6; font-size: 80%; font-weight: normal; } .annotation { /* tango:aluminium 5 */ color: #555753; font-size: 80%; font-weight: normal; } /* code listings */ .listing_code .programlisting .cbracket { color: #a40000; } /* tango: scarlet red 3 */ .listing_code .programlisting .comment { color: #a1a39d; } /* tango: aluminium 4 */ .listing_code .programlisting .function { color: #000000; font-weight: bold; } .listing_code .programlisting .function a { color: #11326b; font-weight: bold; } /* tango: sky blue 4 */ .listing_code .programlisting .keyword { color: #4e9a06; } /* tango: chameleon 3 */ .listing_code .programlisting .linenum { color: #babdb6; } /* tango: aluminium 3 */ .listing_code .programlisting .normal { color: #000000; } .listing_code .programlisting .number { color: #75507b; } /* tango: plum 2 */ .listing_code .programlisting .preproc { color: #204a87; } /* tango: sky blue 3 */ .listing_code .programlisting .string { color: #c17d11; } /* tango: chocolate 2 */ .listing_code .programlisting .type { color: #000000; } .listing_code .programlisting .type a { color: #11326b; } /* tango: sky blue 4 */ .listing_code .programlisting .symbol { color: #ce5c00; } /* tango: orange 3 */ .listing_frame { /* tango:sky blue 1 */ border: solid 1px #729fcf; padding: 0px; } .listing_lines, .listing_code { margin-top: 0px; margin-bottom: 0px; padding: 0.5em; } .listing_lines { /* tango:sky blue 0.5 */ background: #a6c5e3; /* tango:aluminium 6 */ color: #2e3436; } .listing_code { /* tango:sky blue 0 */ background: #e6f3ff; } .listing_code .programlisting { /* override from previous */ border: none 0px; padding: 0px; } .listing_lines pre, .listing_code pre { margin: 0px; } libinfinity-0.5.5/docs/reference/libinftextgtk/html/right.png0000644000175000017500000000057412264766271021340 00000000000000‰PNG  IHDRשÍÊ{PLTEÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ###+++@@@«««¿¿¿ÃÃÃÇÇÇÏÏÏïïïÿÿÿçWôtRNS (48@GX[«·¿ÃÏÓ×ßãçï÷yþ±t–IDATxÚ…ÐÉÂ0 PS–@XZ -%”­eþÿ Iä‰ÁÜ<ï`ÙeAÙ¬Zìç9(ñÆ1'n/îÊ"Á¤²ÜU!‡DЉhŒwÎÅ$¢ñ4QX$°Ô AlþXRü^>8ŽMzšãmtúºü¾Ä>äk¸Ð7â½ œïOŠ$ôÙž³=mVQ.JO£é9 »ñ• IEND®B`‚libinfinity-0.5.5/docs/reference/libinftextgtk/html/index.html0000644000175000017500000000364012264766271021507 00000000000000 libinftextgtk-0.5 Reference Manual

for libinftextgtk 0.5.5. The latest version of this documentation can be found on-line at http://infinote.0x539.de/libinfinity/API/libinftextgtk/.


libinfinity-0.5.5/docs/reference/libinftextgtk/html/InfTextGtkHueChooser.html0000644000175000017500000003645212264766271024423 00000000000000 InfTextGtkHueChooser

InfTextGtkHueChooser

InfTextGtkHueChooser

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----GtkObject
               +----GtkWidget
                     +----InfTextGtkHueChooser

Implemented Interfaces

InfTextGtkHueChooser implements AtkImplementorIface and GtkBuildable.

Properties

  "hue"                      gdouble               : Read / Write / Construct

Signals

  "hue-change"                                     : Run Last
  "move"                                           : Action

Description

Details

InfTextGtkHueChooser

typedef struct _InfTextGtkHueChooser InfTextGtkHueChooser;


inf_text_gtk_hue_chooser_new ()

GtkWidget *         inf_text_gtk_hue_chooser_new        (void);

Creates a new InfTextGtkHueChooser widget with the initial hue set to 0.0 (red).

Returns :

A newly created InfTextGtkHueChooser.

inf_text_gtk_hue_chooser_new_with_hue ()

GtkWidget *         inf_text_gtk_hue_chooser_new_with_hue
                                                        (gdouble hue);

Creates a new InfTextGtkHueChooser widget with the given hue as initial value. hue must be between 0.0 and 1.0.

hue :

Initial hue value

Returns :

A newly created InfTextGtkHueChooser.

inf_text_gtk_hue_chooser_set_hue ()

void                inf_text_gtk_hue_chooser_set_hue    (InfTextGtkHueChooser *chooser,
                                                         gdouble hue);

Sets the current hue value of chooser to hue. hue must be between 0.0 and 1.0.

chooser :

A InfTextGtkHueChooser.

hue :

New hue value.

inf_text_gtk_hue_chooser_get_hue ()

gdouble             inf_text_gtk_hue_chooser_get_hue    (InfTextGtkHueChooser *chooser);

Returns the currently selected hue value of chooser.

chooser :

A InfTextGtkHueChooser.

Returns :

The current hue value, a number between 0.0 and 1.0.

Property Details

The "hue" property

  "hue"                      gdouble               : Read / Write / Construct

The current hue value.

Allowed values: [0,1]

Default value: 0

Signal Details

The "hue-change" signal

void                user_function                      (InfTextGtkHueChooser *inftextgtkhuechooser,
                                                        gdouble               arg1,
                                                        gpointer              user_data)                 : Run Last

inftextgtkhuechooser :

the object which received the signal.

user_data :

user data set when the signal handler was connected.

The "move" signal

void                user_function                      (InfTextGtkHueChooser *inftextgtkhuechooser,
                                                        GtkDirectionType      arg1,
                                                        gpointer              user_data)                 : Action

inftextgtkhuechooser :

the object which received the signal.

user_data :

user data set when the signal handler was connected.
libinfinity-0.5.5/docs/reference/libinftextgtk/html/InfTextGtkViewport.html0000644000175000017500000004666212264766271024202 00000000000000 InfTextGtkViewport

InfTextGtkViewport

InfTextGtkViewport

Object Hierarchy

  GObject
   +----InfTextGtkViewport

Properties

  "active-user"              InfTextUser*          : Read / Write
  "scrolled-window"          GtkScrolledWindow*    : Read / Write / Construct Only
  "show-user-markers"        gboolean              : Read / Write
  "user-table"               InfUserTable*         : Read / Write / Construct Only

Description

Details

InfTextGtkViewport

typedef struct _InfTextGtkViewport InfTextGtkViewport;


inf_text_gtk_viewport_new ()

InfTextGtkViewport * inf_text_gtk_viewport_new          (GtkScrolledWindow *scroll,
                                                         InfUserTable *user_table);

Creates a new InfTextGtkViewport for scroll. This draws the position of remote user's cursors into the scrollbars of scroll.

scroll :

A GtkScrolledWindow.

user_table :

The InfUserTable for the text session displayed in viewport.

Returns :

A new InfTextGtkViewport.

inf_text_gtk_viewport_get_scrolled_window ()

GtkScrolledWindow * inf_text_gtk_viewport_get_scrolled_window
                                                        (InfTextGtkViewport *viewport);

Returns the underlying GtkScrolledWindow.

viewport :

A InfTextGtkViewport.

Returns :

The InfTextGtkViewport's GtkScrolledWindow.

inf_text_gtk_viewport_get_user_table ()

InfUserTable *      inf_text_gtk_viewport_get_user_table
                                                        (InfTextGtkViewport *viewport);

Returns the InfUserTable containing the users of the session the InfTextGtkViewport's GtkScrolledWindow is displaying.

viewport :

A InfTextGtkViewport.

Returns :

The InfGtkTextViewport's InfUserTable.

inf_text_gtk_viewport_set_active_user ()

void                inf_text_gtk_viewport_set_active_user
                                                        (InfTextGtkViewport *viewport,
                                                         InfTextUser *user);

Sets the user for which perspective to draw the viewport. The cursor position for teh active user is not draws since it is assumed that the viewport's "real" scrollbars match the active user's position.

viewport :

A InfTextGtkViewport.

user :

A user from viewport's user table, or NULL.

inf_text_gtk_viewport_get_active_user ()

InfTextUser *       inf_text_gtk_viewport_get_active_user
                                                        (InfTextGtkViewport *viewport);

Returns the active user of viewport. See inf_text_gtk_viewport_set_active_user().

viewport :

A InfTextGtkViewport.

Returns :

The active user of viewport.

inf_text_gtk_viewport_set_show_user_markers ()

void                inf_text_gtk_viewport_set_show_user_markers
                                                        (InfTextGtkViewport *viewport,
                                                         gboolean show);

If show is TRUE then draw a marker indicating the cursor position of all non-local users with status INF_USER_ACTIVE in the scrollbar of the scrolled window. If show is FALSE then do not draw user markers into the scrollbar.

viewport :

A InfTextGtkViewport.

show :

Whether to show the position of non-local users.

Property Details

The "active-user" property

  "active-user"              InfTextUser*          : Read / Write

The user for which to show the viewport.


The "scrolled-window" property

  "scrolled-window"          GtkScrolledWindow*    : Read / Write / Construct Only

The underlying GtkScrolledWindow.


The "show-user-markers" property

  "show-user-markers"        gboolean              : Read / Write

Whether to indicate the position of non-local user's cursors in the scrollbar.

Default value: TRUE


The "user-table" property

  "user-table"               InfUserTable*         : Read / Write / Construct Only

The user table containing the users of the session shown in the viewport.

libinfinity-0.5.5/docs/reference/libinftextgtk/html/libinftextgtk-0.5.devhelp20000644000175000017500000002174112264766271024325 00000000000000 libinfinity-0.5.5/docs/reference/libinftextgtk/html/up.png0000644000175000017500000000044212264766271020641 00000000000000‰PNG  IHDRàw=øéIDATxí•!‚@† Ä ‘H0ˆîÀô(4À6Œ£Á` l$n$ áùpæÍl]åáHðŸùʆï›yà ެ+$þ†ØGö턈)å꺭5E.™LEAUUY" yÿŒX"|¹5•3"n9#ÂÛ"|¹;²0’#7#eYRD!~/_"Ð4 ÉY!@)E‘„Îs‡¥i:( ÃÌi­Ÿ´mKO1(CnÌ€¹Ù¹>Ùóm•ý³ RBžç/)Š‚×1 éà½mÆþtÖÈÖAâýrt¾)_&›IEND®B`‚libinfinity-0.5.5/docs/reference/libinftextgtk/Makefile.in0000644000175000017500000006541712264766065020626 00000000000000# Makefile.in generated by automake 1.13.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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@ # -*- mode: makefile -*- #################################### # Everything below here is generic # #################################### VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(top_srcdir)/gtk-doc.make $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am $(top_srcdir)/mkinstalldirs subdir = docs/reference/libinftextgtk ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/libinfinity/inf-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBINFINITY_API_VERSION = @LIBINFINITY_API_VERSION@ LIBINFINITY_LIBTOOL_VERSION = @LIBINFINITY_LIBTOOL_VERSION@ LIBINFINITY_VERSION = @LIBINFINITY_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ avahi_CFLAGS = @avahi_CFLAGS@ avahi_LIBS = @avahi_LIBS@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gtk_requirement = @gtk_requirement@ gtk_version = @gtk_version@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infgtk_CFLAGS = @infgtk_CFLAGS@ infgtk_LIBS = @infgtk_LIBS@ infinity_CFLAGS = @infinity_CFLAGS@ infinity_LIBS = @infinity_LIBS@ infinoted_CFLAGS = @infinoted_CFLAGS@ infinoted_LIBS = @infinoted_LIBS@ infodir = @infodir@ inftext_CFLAGS = @inftext_CFLAGS@ inftext_LIBS = @inftext_LIBS@ inftextgtk_CFLAGS = @inftextgtk_CFLAGS@ inftextgtk_LIBS = @inftextgtk_LIBS@ install_sh = @install_sh@ libdaemon_CFLAGS = @libdaemon_CFLAGS@ libdaemon_LIBS = @libdaemon_LIBS@ 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@ # We require automake 1.6 at least. AUTOMAKE_OPTIONS = 1.6 # This is a blank Makefile.am for using gtk-doc. # Copy this to your project's API docs directory and modify the variables to # suit your project. See the GTK+ Makefiles in gtk+/docs/reference for examples # of using the various options. # The name of the module, e.g. 'glib'. DOC_MODULE = libinftextgtk-$(LIBINFINITY_API_VERSION) # The top-level SGML file. You can change this if you want to. DOC_MAIN_SGML_FILE = $(DOC_MODULE)-docs.sgml # The directory containing the source code. Relative to $(srcdir). # gtk-doc will search all .c & .h files beneath here for inline comments # documenting the functions and macros. # e.g. DOC_SOURCE_DIR=../../../gtk DOC_SOURCE_DIR = $(top_srcdir)/libinftextgtk # Extra options to pass to gtkdoc-scangobj. Not normally needed. SCANGOBJ_OPTIONS = # Extra options to supply to gtkdoc-scan. # e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED" SCAN_OPTIONS = --rebuild-types # Extra options to supply to gtkdoc-mkdb. # e.g. MKDB_OPTIONS=--sgml-mode --output-format=xml MKDB_OPTIONS = --sgml-mode --output-format=xml # Extra options to supply to gtkdoc-mktmpl # e.g. MKTMPL_OPTIONS=--only-section-tmpl MKTMPL_OPTIONS = # Extra options to supply to gtkdoc-fixref. Not normally needed. # e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html FIXXREF_OPTIONS = \ --extra-dir=../libinfinity/html \ --extra-dir=../libinftext/html \ --extra-dir=../libinfgtk/html # Used for dependencies. The docs will be rebuilt if any of these change. # e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h # e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c HFILE_GLOB = \ $(top_srcdir)/libinftextgtk/*.h CFILE_GLOB = \ $(top_srcdir)/libinftextgtk/*.c # Header files to ignore when scanning. # e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h IGNORE_HFILES = # Images to copy into HTML directory. # e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png HTML_IMAGES = # Extra SGML files that are included by $(DOC_MAIN_SGML_FILE). # e.g. content_files=running.sgml building.sgml changes-2.0.sgml content_files = \ ../version.xml # SGML files where gtk-doc abbrevations (#GtkWidget) are expanded # These files must be listed here *and* in content_files # e.g. expand_content_files=running.sgml expand_content_files = # CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library. # Only needed if you are using gtkdoc-scangobj to dynamically query widget # signals and properties. # e.g. INCLUDES=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS) # e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib) #INCLUDES=$(inftextgtk_CFLAGS) AM_CPPFLAGS = $(inftextgtk_CFLAGS) GTKDOC_LIBS = \ $(inftextgtk_LIBS) \ $(top_builddir)/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ $(top_builddir)/libinftext/libinftext-$(LIBINFINITY_API_VERSION).la \ $(top_builddir)/libinfgtk/libinfgtk-$(LIBINFINITY_API_VERSION).la \ $(top_builddir)/libinftextgtk/libinftextgtk-$(LIBINFINITY_API_VERSION).la @GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_CC = $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_LD = $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) @GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) @GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_RUN = @GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_RUN = $(LIBTOOL) --mode=execute # We set GPATH here; this gives us semantics for GNU make # which are more like other make's VPATH, when it comes to # whether a source that is a target of one rule is then # searched for in VPATH/GPATH. # GPATH = $(srcdir) TARGET_DIR = $(HTML_DIR)/$(DOC_MODULE) SETUP_FILES = \ $(content_files) \ $(DOC_MAIN_SGML_FILE) \ $(DOC_MODULE)-sections.txt \ $(DOC_MODULE)-overrides.txt # This includes the standard gtk-doc make rules, copied by gtkdocize. # Other files to distribute # e.g. EXTRA_DIST += version.xml.in EXTRA_DIST = $(HTML_IMAGES) $(SETUP_FILES) DOC_STAMPS = setup-build.stamp scan-build.stamp tmpl-build.stamp sgml-build.stamp \ html-build.stamp pdf-build.stamp \ tmpl.stamp sgml.stamp html.stamp pdf.stamp SCANOBJ_FILES = \ $(DOC_MODULE).args \ $(DOC_MODULE).hierarchy \ $(DOC_MODULE).interfaces \ $(DOC_MODULE).prerequisites \ $(DOC_MODULE).signals REPORT_FILES = \ $(DOC_MODULE)-undocumented.txt \ $(DOC_MODULE)-undeclared.txt \ $(DOC_MODULE)-unused.txt CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) @ENABLE_GTK_DOC_TRUE@@GTK_DOC_BUILD_HTML_FALSE@HTML_BUILD_STAMP = @ENABLE_GTK_DOC_TRUE@@GTK_DOC_BUILD_HTML_TRUE@HTML_BUILD_STAMP = html-build.stamp @ENABLE_GTK_DOC_TRUE@@GTK_DOC_BUILD_PDF_FALSE@PDF_BUILD_STAMP = @ENABLE_GTK_DOC_TRUE@@GTK_DOC_BUILD_PDF_TRUE@PDF_BUILD_STAMP = pdf-build.stamp #### setup #### GTK_DOC_V_SETUP = $(GTK_DOC_V_SETUP_$(V)) GTK_DOC_V_SETUP_ = $(GTK_DOC_V_SETUP_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_SETUP_0 = @echo " DOC Preparing build"; #### scan #### GTK_DOC_V_SCAN = $(GTK_DOC_V_SCAN_$(V)) GTK_DOC_V_SCAN_ = $(GTK_DOC_V_SCAN_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_SCAN_0 = @echo " DOC Scanning header files"; GTK_DOC_V_INTROSPECT = $(GTK_DOC_V_INTROSPECT_$(V)) GTK_DOC_V_INTROSPECT_ = $(GTK_DOC_V_INTROSPECT_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_INTROSPECT_0 = @echo " DOC Introspecting gobjects"; #### templates #### GTK_DOC_V_TMPL = $(GTK_DOC_V_TMPL_$(V)) GTK_DOC_V_TMPL_ = $(GTK_DOC_V_TMPL_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_TMPL_0 = @echo " DOC Rebuilding template files"; #### xml #### GTK_DOC_V_XML = $(GTK_DOC_V_XML_$(V)) GTK_DOC_V_XML_ = $(GTK_DOC_V_XML_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_XML_0 = @echo " DOC Building XML"; #### html #### GTK_DOC_V_HTML = $(GTK_DOC_V_HTML_$(V)) GTK_DOC_V_HTML_ = $(GTK_DOC_V_HTML_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_HTML_0 = @echo " DOC Building HTML"; GTK_DOC_V_XREF = $(GTK_DOC_V_XREF_$(V)) GTK_DOC_V_XREF_ = $(GTK_DOC_V_XREF_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_XREF_0 = @echo " DOC Fixing cross-references"; #### pdf #### GTK_DOC_V_PDF = $(GTK_DOC_V_PDF_$(V)) GTK_DOC_V_PDF_ = $(GTK_DOC_V_PDF_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_PDF_0 = @echo " DOC Building PDF"; # Files not to distribute # for --rebuild-types in $(SCAN_OPTIONS), e.g. $(DOC_MODULE).types # for --rebuild-sections in $(SCAN_OPTIONS) e.g. $(DOC_MODULE)-sections.txt DISTCLEANFILES = libinftextgtk-$(LIBINFINITY_API_VERSION).types version.xml all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/gtk-doc.make $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu docs/reference/libinftextgtk/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu docs/reference/libinftextgtk/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_srcdir)/gtk-doc.make: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook check-am: all-am check: check-am all-am: Makefile all-local installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -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) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-local mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-local dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-data-local install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic \ maintainer-clean-local mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-local .MAKE: install-am install-strip .PHONY: all all-am all-local check check-am clean clean-generic \ clean-libtool clean-local cscopelist-am ctags-am dist-hook \ distclean distclean-generic distclean-libtool distclean-local \ distdir dvi dvi-am html html-am info info-am install \ install-am install-data install-data-am install-data-local \ install-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ maintainer-clean-local mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-local @ENABLE_GTK_DOC_TRUE@all-local: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) @ENABLE_GTK_DOC_FALSE@all-local: docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) $(REPORT_FILES): sgml-build.stamp setup-build.stamp: -$(GTK_DOC_V_SETUP)if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ files=`echo $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types`; \ if test "x$$files" != "x" ; then \ for file in $$files ; do \ test -f $(abs_srcdir)/$$file && \ cp -pu $(abs_srcdir)/$$file $(abs_builddir)/$$file || true; \ done; \ fi; \ test -d $(abs_srcdir)/tmpl && \ { cp -rp $(abs_srcdir)/tmpl $(abs_builddir)/; \ chmod -R u+w $(abs_builddir)/tmpl; } \ fi $(AM_V_at)touch setup-build.stamp scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB) $(GTK_DOC_V_SCAN)_source_dir='' ; \ for i in $(DOC_SOURCE_DIR) ; do \ _source_dir="$${_source_dir} --source-dir=$$i" ; \ done ; \ gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES) $(GTK_DOC_V_INTROSPECT)if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null 2>&1 ; then \ scanobj_options=""; \ gtkdoc-scangobj 2>&1 --help | grep >/dev/null "\-\-verbose"; \ if test "$(?)" = "0"; then \ if test "x$(V)" = "x1"; then \ scanobj_options="--verbose"; \ fi; \ fi; \ CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \ gtkdoc-scangobj $(SCANGOBJ_OPTIONS) $$scanobj_options --module=$(DOC_MODULE); \ else \ for i in $(SCANOBJ_FILES) ; do \ test -f $$i || touch $$i ; \ done \ fi $(AM_V_at)touch scan-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp @true tmpl-build.stamp: setup-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt $(GTK_DOC_V_TMPL)gtkdoc-mktmpl --module=$(DOC_MODULE) $(MKTMPL_OPTIONS) $(AM_V_at)if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ if test -w $(abs_srcdir) ; then \ cp -rp $(abs_builddir)/tmpl $(abs_srcdir)/; \ fi \ fi $(AM_V_at)touch tmpl-build.stamp tmpl.stamp: tmpl-build.stamp @true $(srcdir)/tmpl/*.sgml: @true sgml-build.stamp: tmpl.stamp $(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml $(expand_content_files) $(GTK_DOC_V_XML)-chmod -R u+w $(srcdir) && _source_dir='' ; \ for i in $(DOC_SOURCE_DIR) ; do \ _source_dir="$${_source_dir} --source-dir=$$i" ; \ done ; \ gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $${_source_dir} $(MKDB_OPTIONS) $(AM_V_at)touch sgml-build.stamp sgml.stamp: sgml-build.stamp @true html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) $(GTK_DOC_V_HTML)rm -rf html && mkdir html && \ mkhtml_options=""; \ gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-verbose"; \ if test "$(?)" = "0"; then \ if test "x$(V)" = "x1"; then \ mkhtml_options="$$mkhtml_options --verbose"; \ fi; \ fi; \ gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \ if test "$(?)" = "0"; then \ mkhtml_options="$$mkhtml_options --path=\"$(abs_srcdir)\""; \ fi; \ cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) -@test "x$(HTML_IMAGES)" = "x" || \ for file in $(HTML_IMAGES) ; do \ if test -f $(abs_srcdir)/$$file ; then \ cp $(abs_srcdir)/$$file $(abs_builddir)/html; \ fi; \ if test -f $(abs_builddir)/$$file ; then \ cp $(abs_builddir)/$$file $(abs_builddir)/html; \ fi; \ done; $(GTK_DOC_V_XREF)gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) $(AM_V_at)touch html-build.stamp pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) $(GTK_DOC_V_PDF)rm -f $(DOC_MODULE).pdf && \ mkpdf_options=""; \ gtkdoc-mkpdf 2>&1 --help | grep >/dev/null "\-\-verbose"; \ if test "$(?)" = "0"; then \ if test "x$(V)" = "x1"; then \ mkpdf_options="$$mkpdf_options --verbose"; \ fi; \ fi; \ if test "x$(HTML_IMAGES)" != "x"; then \ for img in $(HTML_IMAGES); do \ part=`dirname $$img`; \ echo $$mkpdf_options | grep >/dev/null "\-\-imgdir=$$part "; \ if test $$? != 0; then \ mkpdf_options="$$mkpdf_options --imgdir=$$part"; \ fi; \ done; \ fi; \ gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_options $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS) $(AM_V_at)touch pdf-build.stamp ############## clean-local: @rm -f *~ *.bak @rm -rf .libs distclean-local: @rm -rf xml html $(REPORT_FILES) $(DOC_MODULE).pdf \ $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ rm -f $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types; \ rm -rf tmpl; \ fi maintainer-clean-local: @rm -rf xml html install-data-local: @installfiles=`echo $(builddir)/html/*`; \ if test "$$installfiles" = '$(builddir)/html/*'; \ then echo 1>&2 'Nothing to install' ; \ else \ if test -n "$(DOC_MODULE_VERSION)"; then \ installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ else \ installdir="$(DESTDIR)$(TARGET_DIR)"; \ fi; \ $(mkinstalldirs) $${installdir} ; \ for i in $$installfiles; do \ echo ' $(INSTALL_DATA) '$$i ; \ $(INSTALL_DATA) $$i $${installdir}; \ done; \ if test -n "$(DOC_MODULE_VERSION)"; then \ mv -f $${installdir}/$(DOC_MODULE).devhelp2 \ $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \ fi; \ $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir}; \ fi uninstall-local: @if test -n "$(DOC_MODULE_VERSION)"; then \ installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ else \ installdir="$(DESTDIR)$(TARGET_DIR)"; \ fi; \ rm -rf $${installdir} # # Require gtk-doc when making dist # @ENABLE_GTK_DOC_TRUE@dist-check-gtkdoc: docs @ENABLE_GTK_DOC_FALSE@dist-check-gtkdoc: @ENABLE_GTK_DOC_FALSE@ @echo "*** gtk-doc must be installed and enabled in order to make dist" @ENABLE_GTK_DOC_FALSE@ @false dist-hook: dist-check-gtkdoc dist-hook-local @mkdir $(distdir)/tmpl @mkdir $(distdir)/html @-cp ./tmpl/*.sgml $(distdir)/tmpl @cp ./html/* $(distdir)/html @-cp ./$(DOC_MODULE).pdf $(distdir)/ @-cp ./$(DOC_MODULE).types $(distdir)/ @-cp ./$(DOC_MODULE)-sections.txt $(distdir)/ @cd $(distdir) && rm -f $(DISTCLEANFILES) @$(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html .PHONY : dist-hook-local docs # Comment this out if you want your docs-status tested during 'make check' #TESTS = $(GTKDOC_CHECK) # 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: libinfinity-0.5.5/docs/reference/libinftextgtk/libinftextgtk-0.5-docs.sgml0000644000175000017500000000176612264763732023544 00000000000000 ]> libinftextgtk-&api_version; Reference Manual for libinftextgtk &version;. The latest version of this documentation can be found on-line at http://infinote.0x539.de/libinfinity/API/libinftextgtk/. libinftextgtk API libinfinity-0.5.5/docs/reference/libinftextgtk/libinftextgtk-0.5-sections.txt0000644000175000017500000000523512264766271024314 00000000000000
inf-text-gtk-buffer InfTextGtkBuffer InfTextGtkBuffer inf_text_gtk_buffer_new inf_text_gtk_buffer_get_text_buffer inf_text_gtk_buffer_set_active_user inf_text_gtk_buffer_get_active_user inf_text_gtk_buffer_get_author inf_text_gtk_buffer_get_user_for_tag inf_text_gtk_buffer_is_author_toggle inf_text_gtk_buffer_forward_to_author_toggle inf_text_gtk_buffer_backward_to_author_toggle inf_text_gtk_buffer_set_wake_on_cursor_movement inf_text_gtk_buffer_get_wake_on_cursor_movement inf_text_gtk_buffer_ensure_author_tags_priority inf_text_gtk_buffer_set_saturation_value inf_text_gtk_buffer_get_saturation inf_text_gtk_buffer_get_value inf_text_gtk_buffer_set_show_user_colors inf_text_gtk_buffer_get_show_user_colors inf_text_gtk_buffer_show_user_colors InfTextGtkBufferClass INF_TEXT_GTK_BUFFER INF_TEXT_GTK_IS_BUFFER INF_TEXT_GTK_TYPE_BUFFER inf_text_gtk_buffer_get_type INF_TEXT_GTK_BUFFER_CLASS INF_TEXT_GTK_IS_BUFFER_CLASS INF_TEXT_GTK_BUFFER_GET_CLASS
inf-text-gtk-view InfTextGtkView InfTextGtkView inf_text_gtk_view_new inf_text_gtk_view_get_text_view inf_text_gtk_view_get_user_table inf_text_gtk_view_set_active_user inf_text_gtk_view_get_active_user inf_text_gtk_view_set_show_remote_cursors inf_text_gtk_view_set_show_remote_selections inf_text_gtk_view_set_show_remote_current_lines InfTextGtkViewClass INF_TEXT_GTK_VIEW INF_TEXT_GTK_IS_VIEW INF_TEXT_GTK_TYPE_VIEW inf_text_gtk_view_get_type INF_TEXT_GTK_VIEW_CLASS INF_TEXT_GTK_IS_VIEW_CLASS INF_TEXT_GTK_VIEW_GET_CLASS
inf-text-gtk-viewport InfTextGtkViewport InfTextGtkViewport inf_text_gtk_viewport_new inf_text_gtk_viewport_get_scrolled_window inf_text_gtk_viewport_get_user_table inf_text_gtk_viewport_set_active_user inf_text_gtk_viewport_get_active_user inf_text_gtk_viewport_set_show_user_markers InfTextGtkViewportClass INF_TEXT_GTK_VIEWPORT INF_TEXT_GTK_IS_VIEWPORT INF_TEXT_GTK_TYPE_VIEWPORT inf_text_gtk_viewport_get_type INF_TEXT_GTK_VIEWPORT_CLASS INF_TEXT_GTK_IS_VIEWPORT_CLASS INF_TEXT_GTK_VIEWPORT_GET_CLASS
inf-text-gtk-hue-chooser InfTextGtkHueChooser InfTextGtkHueChooser inf_text_gtk_hue_chooser_new inf_text_gtk_hue_chooser_new_with_hue inf_text_gtk_hue_chooser_set_hue inf_text_gtk_hue_chooser_get_hue InfTextGtkHueChooserClass INF_TEXT_GTK_HUE_CHOOSER INF_TEXT_GTK_IS_HUE_CHOOSER INF_TEXT_GTK_TYPE_HUE_CHOOSER inf_text_gtk_hue_chooser_get_type INF_TEXT_GTK_HUE_CHOOSER_CLASS INF_TEXT_GTK_IS_HUE_CHOOSER_CLASS INF_TEXT_GTK_HUE_CHOOSER_GET_CLASS
libinfinity-0.5.5/docs/reference/libinftextgtk/tmpl/0000755000175000017500000000000012264766271017577 500000000000000libinfinity-0.5.5/docs/reference/libinftextgtk/tmpl/inf-text-gtk-view.sgml0000644000175000017500000000325012264766271023674 00000000000000 InfTextGtkView @io: @view: @user_table: @Returns: @view: @Returns: @view: @Returns: @view: @user: @view: @Returns: @view: @show: @view: @show: @view: @show: libinfinity-0.5.5/docs/reference/libinftextgtk/tmpl/libinftextgtk-0.5-unused.sgml0000644000175000017500000000106112264766271025060 00000000000000 @parent_class: @hue_change: @move: @buffer: @alpha: @background: libinfinity-0.5.5/docs/reference/libinftextgtk/tmpl/inf-text-gtk-hue-chooser.sgml0000644000175000017500000000216212264766271025144 00000000000000 InfTextGtkHueChooser @inftextgtkhuechooser: the object which received the signal. @arg1: @inftextgtkhuechooser: the object which received the signal. @arg1: @void: @Returns: @hue: @Returns: @chooser: @hue: @chooser: @Returns: libinfinity-0.5.5/docs/reference/libinftextgtk/tmpl/libinftextgtk-0.6-unused.sgml0000644000175000017500000000000012264766271025051 00000000000000libinfinity-0.5.5/docs/reference/libinftextgtk/tmpl/inf-text-gtk-viewport.sgml0000644000175000017500000000246712264766271024612 00000000000000 InfTextGtkViewport @scroll: @user_table: @Returns: @viewport: @Returns: @viewport: @Returns: @viewport: @user: @viewport: @Returns: @viewport: @show: libinfinity-0.5.5/docs/reference/libinftextgtk/tmpl/libinftextgtk-unused.sgml0000644000175000017500000000000012264766271024550 00000000000000libinfinity-0.5.5/docs/reference/libinftextgtk/tmpl/inf-text-gtk-buffer.sgml0000644000175000017500000000561412264766271024201 00000000000000 InfTextGtkBuffer @buffer: @user_table: @Returns: @buffer: @Returns: @buffer: @user: @buffer: @Returns: @buffer: @location: @Returns: @buffer: @tag: @Returns: @buffer: @iter: @user_on: @user_off: @Returns: @buffer: @iter: @user_on: @user_off: @Returns: @buffer: @iter: @user_on: @user_off: @Returns: @buffer: @wake: @buffer: @Returns: @buffer: @buffer: @saturation: @value: @buffer: @Returns: @buffer: @Returns: @buffer: @show: @buffer: @Returns: @buffer: @show: @start: @end: libinfinity-0.5.5/docs/reference/libinftextgtk/tmpl/libinftextgtk-0.3-unused.sgml0000644000175000017500000000000012264766271025046 00000000000000libinfinity-0.5.5/docs/reference/libinftextgtk/tmpl/libinftextgtk-0.4-unused.sgml0000644000175000017500000000673112264766271025070 00000000000000 InfTextGtkView InfTextGtkViewport @buffer: @tag: @Returns: @view: @Returns: @view: @Returns: @view: @Returns: @io: @view: @user_table: @Returns: @view: @user: @view: @show: @view: @show: @view: @show: @viewport: @Returns: @viewport: @Returns: @viewport: @Returns: @scroll: @user_table: @Returns: @viewport: @user: @viewport: @show: libinfinity-0.5.5/docs/reference/libinfinity/0000755000175000017500000000000012264766270016264 500000000000000libinfinity-0.5.5/docs/reference/libinfinity/libinfinity-0.5-docs.sgml0000644000175000017500000001133312264763732022637 00000000000000 ]> libinfinity-&api_version; Reference Manual for libinfinity &version;. The latest version of this documentation can be found on-line at http://infinote.0x539.de/libinfinity/API/libinfinity/. About libinfinity Common libinfinity API Libinfinity's adOPTed implementation Libinfinity client side API Libinfinity server side API Network abstraction libinfinity-0.5.5/docs/reference/libinfinity/libinfinity-0.5-sections.txt0000644000175000017500000010517712264766270023425 00000000000000
inf-adopted-session InfAdoptedSession InfAdoptedSessionError InfAdoptedSession InfAdoptedSessionClass inf_adopted_session_get_io inf_adopted_session_get_algorithm inf_adopted_session_broadcast_request inf_adopted_session_undo inf_adopted_session_redo inf_adopted_session_read_request_info inf_adopted_session_write_request_info INF_ADOPTED_SESSION INF_ADOPTED_IS_SESSION INF_ADOPTED_TYPE_SESSION inf_adopted_session_get_type INF_ADOPTED_SESSION_CLASS INF_ADOPTED_IS_SESSION_CLASS INF_ADOPTED_SESSION_GET_CLASS
inf-adopted-undo-grouping InfAdoptedUndoGrouping InfAdoptedUndoGrouping InfAdoptedUndoGroupingClass inf_adopted_undo_grouping_new inf_adopted_undo_grouping_get_algorithm inf_adopted_undo_grouping_set_algorithm inf_adopted_undo_grouping_start_group inf_adopted_undo_grouping_end_group inf_adopted_undo_grouping_get_undo_size inf_adopted_undo_grouping_get_redo_size INF_ADOPTED_UNDO_GROUPING INF_ADOPTED_IS_UNDO_GROUPING INF_ADOPTED_TYPE_UNDO_GROUPING inf_adopted_undo_grouping_get_type INF_ADOPTED_UNDO_GROUPING_CLASS INF_ADOPTED_IS_UNDO_GROUPING_CLASS INF_ADOPTED_UNDO_GROUPING_GET_CLASS
inf-adopted-session-record InfAdoptedSessionRecord InfAdoptedSessionRecord InfAdoptedSessionRecordClass inf_adopted_session_record_new inf_adopted_session_record_start_recording inf_adopted_session_record_stop_recording inf_adopted_session_record_is_recording INF_ADOPTED_SESSION_RECORD INF_ADOPTED_IS_SESSION_RECORD INF_ADOPTED_TYPE_SESSION_RECORD inf_adopted_session_record_get_type INF_ADOPTED_SESSION_RECORD_CLASS INF_ADOPTED_IS_SESSION_RECORD_CLASS INF_ADOPTED_SESSION_RECORD_GET_CLASS
inf-adopted-session-replay InfAdoptedSessionReplay InfAdoptedSessionReplayError InfAdoptedSessionReplay InfAdoptedSessionReplayClass inf_adopted_session_replay_new inf_adopted_session_replay_set_record inf_adopted_session_replay_get_session inf_adopted_session_replay_play_next inf_adopted_session_replay_play_to_end INF_ADOPTED_SESSION_REPLAY INF_ADOPTED_IS_SESSION_REPLAY INF_ADOPTED_TYPE_SESSION_REPLAY inf_adopted_session_replay_get_type INF_ADOPTED_SESSION_REPLAY_CLASS INF_ADOPTED_IS_SESSION_REPLAY_CLASS INF_ADOPTED_SESSION_REPLAY_GET_CLASS
infc-browser InfcBrowser InfcBrowserStatus InfcBrowser InfcBrowserClass infc_browser_new infc_browser_get_communication_manager infc_browser_get_connection infc_browser_get_status infc_browser_add_plugin infc_browser_lookup_plugin infc_browser_iter_get_root infc_browser_iter_get_next infc_browser_iter_get_prev infc_browser_iter_get_parent infc_browser_iter_get_explored infc_browser_iter_get_child infc_browser_iter_explore infc_browser_iter_get_name infc_browser_iter_get_path infc_browser_iter_is_subdirectory infc_browser_add_subdirectory infc_browser_add_note infc_browser_add_note_with_content infc_browser_remove_node infc_browser_iter_get_note_type infc_browser_iter_get_plugin infc_browser_iter_subscribe_session infc_browser_iter_save_session infc_browser_iter_get_session infc_browser_iter_get_sync_in infc_browser_iter_get_subscribe_request infc_browser_iter_get_explore_request infc_browser_iter_get_sync_in_requests infc_browser_iter_from_node_request infc_browser_iter_from_explore_request infc_browser_iter_is_valid infc_browser_subscribe_chat infc_browser_get_subscribe_chat_request infc_browser_get_chat_session INFC_BROWSER INFC_IS_BROWSER INFC_TYPE_BROWSER infc_browser_get_type INFC_BROWSER_CLASS INFC_IS_BROWSER_CLASS INFC_BROWSER_GET_CLASS INFC_TYPE_BROWSER_STATUS infc_browser_status_get_type
infc-explore-request InfcExploreRequest InfcExploreRequest InfcExploreRequestClass infc_explore_request_get_node_id infc_explore_request_initiated infc_explore_request_progress infc_explore_request_finished infc_explore_request_get_initiated infc_explore_request_get_finished INFC_EXPLORE_REQUEST INFC_IS_EXPLORE_REQUEST INFC_TYPE_EXPLORE_REQUEST infc_explore_request_get_type INFC_EXPLORE_REQUEST_CLASS INFC_IS_EXPLORE_REQUEST_CLASS INFC_EXPLORE_REQUEST_GET_CLASS
infc-node-request InfcNodeRequest InfcNodeRequest InfcNodeRequestClass infc_node_request_finished INFC_NODE_REQUEST INFC_IS_NODE_REQUEST INFC_TYPE_NODE_REQUEST infc_node_request_get_type INFC_NODE_REQUEST_CLASS INFC_IS_NODE_REQUEST_CLASS INFC_NODE_REQUEST_GET_CLASS
infc-request-manager InfcRequestManager InfcRequestManagerForeachFunc InfcRequestManager InfcRequestManagerClass infc_request_manager_new infc_request_manager_add_request infc_request_manager_add_request_valist infc_request_manager_remove_request infc_request_manager_fail_request infc_request_manager_clear infc_request_manager_get_request_by_seq infc_request_manager_get_request_by_xml infc_request_manager_get_request_by_xml_required infc_request_manager_foreach_request infc_request_manager_foreach_named_request INFC_REQUEST_MANAGER INFC_IS_REQUEST_MANAGER INFC_TYPE_REQUEST_MANAGER infc_request_manager_get_type INFC_REQUEST_MANAGER_CLASS INFC_IS_REQUEST_MANAGER_CLASS INFC_REQUEST_MANAGER_GET_CLASS
infc-session-proxy InfcSessionProxy InfcSessionProxy InfcSessionProxyClass infc_session_proxy_set_connection infc_session_proxy_join_user infc_session_proxy_get_session infc_session_proxy_get_connection infc_session_proxy_get_subscription_group INFC_SESSION_PROXY INFC_IS_SESSION_PROXY INFC_TYPE_SESSION_PROXY infc_session_proxy_get_type INFC_SESSION_PROXY_CLASS INFC_IS_SESSION_PROXY_CLASS INFC_SESSION_PROXY_GET_CLASS
infc-request InfcRequest InfcRequest InfcRequestClass infc_request_get_seq infc_request_get_name infc_request_failed INFC_REQUEST INFC_IS_REQUEST INFC_TYPE_REQUEST infc_request_get_type INFC_REQUEST_CLASS INFC_IS_REQUEST_CLASS INFC_REQUEST_GET_CLASS
infc-user-request InfcUserRequest InfcUserRequest InfcUserRequestClass infc_user_request_finished INFC_USER_REQUEST INFC_IS_USER_REQUEST INFC_TYPE_USER_REQUEST infc_user_request_get_type INFC_USER_REQUEST_CLASS INFC_IS_USER_REQUEST_CLASS INFC_USER_REQUEST_GET_CLASS
inf-local-publisher InfLocalPublisher InfLocalPublisher InfLocalPublisherIface InfLocalPublisherItem inf_local_publisher_publish inf_local_publisher_unpublish INF_LOCAL_PUBLISHER INF_IS_LOCAL_PUBLISHER INF_TYPE_LOCAL_PUBLISHER inf_local_publisher_get_type INF_LOCAL_PUBLISHER_GET_IFACE
inf-tcp-connection InfTcpConnection InfTcpConnectionStatus InfTcpConnection InfTcpConnectionClass inf_tcp_connection_new inf_tcp_connection_new_and_open inf_tcp_connection_open inf_tcp_connection_close inf_tcp_connection_send inf_tcp_connection_get_remote_address inf_tcp_connection_get_remote_port INF_TCP_CONNECTION INF_IS_TCP_CONNECTION INF_TYPE_TCP_CONNECTION INF_TCP_CONNECTION_CLASS INF_IS_TCP_CONNECTION_CLASS INF_TCP_CONNECTION_GET_CLASS inf_tcp_connection_get_type inf_tcp_connection_status_get_type INF_TYPE_TCP_CONNECTION_STATUS
inf-buffer InfBuffer InfBuffer InfBufferIface inf_buffer_get_modified inf_buffer_set_modified INF_BUFFER INF_IS_BUFFER INF_TYPE_BUFFER inf_buffer_get_type INF_BUFFER_GET_IFACE
inf-standalone-io InfStandaloneIo InfStandaloneIo InfStandaloneIoClass inf_standalone_io_new inf_standalone_io_iteration inf_standalone_io_iteration_timeout inf_standalone_io_loop inf_standalone_io_loop_quit inf_standalone_io_loop_running INF_STANDALONE_IO INF_IS_STANDALONE_IO INF_TYPE_STANDALONE_IO inf_standalone_io_get_type INF_STANDALONE_IO_CLASS INF_IS_STANDALONE_IO_CLASS INF_STANDALONE_IO_GET_CLASS
inf-discovery-avahi InfDiscoveryAvahi InfDiscoveryAvahi InfDiscoveryAvahiClass inf_discovery_avahi_new inf_discovery_avahi_set_security_policy inf_discovery_avahi_get_security_policy INF_DISCOVERY_AVAHI INF_IS_DISCOVERY_AVAHI INF_TYPE_DISCOVERY_AVAHI inf_discovery_avahi_get_type INF_DISCOVERY_AVAHI_CLASS INF_IS_DISCOVERY_AVAHI_CLASS INF_DISCOVERY_AVAHI_GET_CLASS
inf-user InfUser InfUserStatus InfUserFlags InfUser InfUserClass inf_user_get_id inf_user_get_name inf_user_get_status inf_user_get_flags inf_user_get_connection inf_user_status_to_string inf_user_status_from_string INF_USER INF_IS_USER INF_TYPE_USER INF_USER_CLASS INF_IS_USER_CLASS INF_USER_GET_CLASS inf_user_status_get_type inf_user_flags_get_type inf_user_get_type INF_TYPE_USER_STATUS INF_TYPE_USER_FLAGS
inf-discovery InfDiscovery InfDiscovery InfDiscoveryIface InfDiscoveryInfo InfDiscoveryResolvCompleteFunc InfDiscoveryResolvErrorFunc inf_discovery_discover inf_discovery_get_discovered inf_discovery_resolve inf_discovery_info_get_service_name inf_discovery_info_get_service_type inf_discovery_discovered inf_discovery_undiscovered INF_DISCOVERY INF_IS_DISCOVERY INF_TYPE_DISCOVERY inf_discovery_get_type INF_DISCOVERY_GET_IFACE
inf-user-table InfUserTable InfUserTableForeachUserFunc InfUserTable InfUserTableClass inf_user_table_new inf_user_table_add_user inf_user_table_remove_user inf_user_table_lookup_user_by_id inf_user_table_lookup_user_by_name inf_user_table_foreach_user inf_user_table_foreach_local_user INF_USER_TABLE INF_IS_USER_TABLE INF_TYPE_USER_TABLE inf_user_table_get_type INF_USER_TABLE_CLASS INF_IS_USER_TABLE_CLASS INF_USER_TABLE_GET_CLASS
inf-io InfIo InfIo InfIoIface InfNativeSocket InfIoEvent InfIoWatch InfIoTimeout InfIoDispatch InfIoWatchFunc InfIoTimeoutFunc InfIoDispatchFunc inf_io_add_watch inf_io_update_watch inf_io_remove_watch inf_io_add_timeout inf_io_remove_timeout inf_io_add_dispatch inf_io_remove_dispatch INF_IO INF_IS_IO INF_TYPE_IO inf_io_event_get_type INF_IO_GET_IFACE inf_io_get_type INF_TYPE_IO_EVENT
inf-session InfSession InfSessionStatus InfSessionSyncStatus InfSessionSyncError InfSession InfSessionClass inf_session_lookup_user_property inf_session_get_user_property inf_session_user_to_xml inf_session_close inf_session_get_communication_manager inf_session_get_buffer inf_session_get_user_table inf_session_get_status inf_session_add_user inf_session_set_user_status inf_session_synchronize_from inf_session_synchronize_to inf_session_get_synchronization_status inf_session_get_synchronization_progress inf_session_has_synchronizations inf_session_get_subscription_group inf_session_set_subscription_group inf_session_send_to_subscriptions INF_SESSION INF_IS_SESSION INF_TYPE_SESSION inf_session_status_get_type INF_SESSION_CLASS INF_IS_SESSION_CLASS INF_SESSION_GET_CLASS inf_session_get_type INF_TYPE_SESSION_STATUS
inf-xmpp-manager InfXmppManager InfXmppManager InfXmppManagerClass inf_xmpp_manager_new inf_xmpp_manager_lookup_connection_by_address inf_xmpp_manager_contains_connection inf_xmpp_manager_add_connection inf_xmpp_manager_remove_connection INF_XMPP_MANAGER INF_IS_XMPP_MANAGER INF_TYPE_XMPP_MANAGER inf_xmpp_manager_get_type INF_XMPP_MANAGER_CLASS INF_IS_XMPP_MANAGER_CLASS INF_XMPP_MANAGER_GET_CLASS
inf-xmpp-connection InfXmppConnection InfXmppConnectionCrtCallback InfXmppConnectionSite InfXmppConnectionSecurityPolicy InfXmppConnectionError InfXmppConnectionStreamError InfXmppConnectionAuthError InfXmppConnection InfXmppConnectionClass inf_xmpp_connection_new inf_xmpp_connection_get_tls_enabled inf_xmpp_connection_set_certificate_callback inf_xmpp_connection_certificate_verify_continue inf_xmpp_connection_certificate_verify_cancel inf_xmpp_connection_reset_sasl_authentication inf_xmpp_connection_retry_sasl_authentication inf_xmpp_connection_set_sasl_error inf_xmpp_connection_get_sasl_error INF_XMPP_CONNECTION INF_IS_XMPP_CONNECTION INF_TYPE_XMPP_CONNECTION inf_xmpp_connection_site_get_type inf_xmpp_connection_security_policy_get_type INF_XMPP_CONNECTION_CLASS INF_IS_XMPP_CONNECTION_CLASS INF_XMPP_CONNECTION_GET_CLASS inf_xmpp_connection_get_type INF_TYPE_XMPP_CONNECTION_SITE INF_TYPE_XMPP_CONNECTION_SECURITY_POLICY
inf-xml-connection InfXmlConnection InfXmlConnection InfXmlConnectionIface InfXmlConnectionStatus inf_xml_connection_open inf_xml_connection_close inf_xml_connection_send inf_xml_connection_sent inf_xml_connection_received inf_xml_connection_error INF_XML_CONNECTION INF_IS_XML_CONNECTION INF_TYPE_XML_CONNECTION inf_xml_connection_status_get_type INF_XML_CONNECTION_GET_IFACE inf_xml_connection_get_type INF_TYPE_XML_CONNECTION_STATUS
inf-simulated-connection InfSimulatedConnection InfSimulatedConnection InfSimulatedConnectionClass InfSimulatedConnectionMode inf_simulated_connection_new inf_simulated_connection_new_with_io inf_simulated_connection_connect inf_simulated_connection_set_mode inf_simulated_connection_flush INF_SIMULATED_CONNECTION INF_IS_SIMULATED_CONNECTION INF_TYPE_SIMULATED_CONNECTION inf_simulated_connection_get_type INF_SIMULATED_CONNECTION_CLASS INF_IS_SIMULATED_CONNECTION_CLASS INF_SIMULATED_CONNECTION_GET_CLASS inf_simulated_connection_mode_get_type INF_TYPE_SIMULATED_CONNECTION_MODE
inf-adopted-operation InfAdoptedOperation InfAdoptedOperation InfAdoptedOperationIface InfAdoptedOperationFlags InfAdoptedConcurrencyId inf_adopted_operation_need_concurrency_id inf_adopted_operation_get_concurrency_id inf_adopted_operation_transform inf_adopted_operation_copy inf_adopted_operation_get_flags inf_adopted_operation_apply inf_adopted_operation_is_reversible inf_adopted_operation_revert inf_adopted_operation_make_reversible INF_ADOPTED_OPERATION INF_ADOPTED_IS_OPERATION INF_ADOPTED_TYPE_OPERATION inf_adopted_operation_flags_get_type INF_ADOPTED_OPERATION_GET_IFACE inf_adopted_operation_get_type INF_ADOPTED_TYPE_OPERATION_FLAGS inf_adopted_concurrency_id_get_type
inf-adopted-user InfAdoptedUser InfAdoptedUser InfAdoptedUserClass inf_adopted_user_get_component inf_adopted_user_get_vector inf_adopted_user_set_vector inf_adopted_user_get_request_log INF_ADOPTED_USER INF_ADOPTED_IS_USER INF_ADOPTED_TYPE_USER inf_adopted_user_get_type INF_ADOPTED_USER_CLASS INF_ADOPTED_IS_USER_CLASS INF_ADOPTED_USER_GET_CLASS
inf-adopted-request InfAdoptedRequest InfAdoptedRequestType InfAdoptedRequest InfAdoptedRequestClass inf_adopted_request_new_do inf_adopted_request_new_undo inf_adopted_request_new_redo inf_adopted_request_copy inf_adopted_request_get_request_type inf_adopted_request_get_vector inf_adopted_request_get_user_id inf_adopted_request_get_operation inf_adopted_request_get_index inf_adopted_request_need_concurrency_id inf_adopted_request_get_concurrency_id inf_adopted_request_transform inf_adopted_request_mirror inf_adopted_request_fold inf_adopted_request_affects_buffer INF_ADOPTED_REQUEST INF_ADOPTED_IS_REQUEST INF_ADOPTED_TYPE_REQUEST inf_adopted_request_type_get_type INF_ADOPTED_REQUEST_CLASS INF_ADOPTED_IS_REQUEST_CLASS INF_ADOPTED_REQUEST_GET_CLASS inf_adopted_request_get_type INF_ADOPTED_TYPE_REQUEST_TYPE
inf-adopted-algorithm InfAdoptedAlgorithm InfAdoptedAlgorithm InfAdoptedAlgorithmClass inf_adopted_algorithm_new inf_adopted_algorithm_new_full inf_adopted_algorithm_get_current inf_adopted_algorithm_generate_request_noexec inf_adopted_algorithm_generate_request inf_adopted_algorithm_generate_undo inf_adopted_algorithm_generate_redo inf_adopted_algorithm_translate_request inf_adopted_algorithm_receive_request inf_adopted_algorithm_can_undo inf_adopted_algorithm_can_redo INF_ADOPTED_ALGORITHM INF_ADOPTED_IS_ALGORITHM INF_ADOPTED_TYPE_ALGORITHM inf_adopted_algorithm_get_type INF_ADOPTED_ALGORITHM_CLASS INF_ADOPTED_IS_ALGORITHM_CLASS INF_ADOPTED_ALGORITHM_GET_CLASS
inf-adopted-split-operation InfAdoptedSplitOperation InfAdoptedSplitOperation InfAdoptedSplitOperationClass inf_adopted_split_operation_new inf_adopted_split_operation_unsplit inf_adopted_split_operation_transform_other INF_ADOPTED_SPLIT_OPERATION INF_ADOPTED_IS_SPLIT_OPERATION INF_ADOPTED_TYPE_SPLIT_OPERATION inf_adopted_split_operation_get_type INF_ADOPTED_SPLIT_OPERATION_CLASS INF_ADOPTED_IS_SPLIT_OPERATION_CLASS INF_ADOPTED_SPLIT_OPERATION_GET_CLASS
inf-adopted-no-operation InfAdoptedNoOperation InfAdoptedNoOperation InfAdoptedNoOperationClass inf_adopted_no_operation_new INF_ADOPTED_NO_OPERATION INF_ADOPTED_IS_NO_OPERATION INF_ADOPTED_TYPE_NO_OPERATION inf_adopted_no_operation_get_type INF_ADOPTED_NO_OPERATION_CLASS INF_ADOPTED_IS_NO_OPERATION_CLASS INF_ADOPTED_NO_OPERATION_GET_CLASS
inf-adopted-request-log InfAdoptedRequestLog InfAdoptedRequestLog InfAdoptedRequestLogClass inf_adopted_request_log_new inf_adopted_request_log_get_user_id inf_adopted_request_log_get_begin inf_adopted_request_log_get_end inf_adopted_request_log_is_empty inf_adopted_request_log_set_begin inf_adopted_request_log_get_request inf_adopted_request_log_add_request inf_adopted_request_log_remove_requests inf_adopted_request_log_next_associated inf_adopted_request_log_prev_associated inf_adopted_request_log_original_request inf_adopted_request_log_next_undo inf_adopted_request_log_next_redo inf_adopted_request_log_upper_related inf_adopted_request_log_lower_related INF_ADOPTED_REQUEST_LOG INF_ADOPTED_IS_REQUEST_LOG INF_ADOPTED_TYPE_REQUEST_LOG inf_adopted_request_log_get_type INF_ADOPTED_REQUEST_LOG_CLASS INF_ADOPTED_IS_REQUEST_LOG_CLASS INF_ADOPTED_REQUEST_LOG_GET_CLASS
infd-xmpp-server InfdXmppServer InfdXmppServer InfdXmppServerClass infd_xmpp_server_new infd_xmpp_server_set_security_policy infd_xmpp_server_get_security_policy INFD_XMPP_SERVER INFD_IS_XMPP_SERVER INFD_TYPE_XMPP_SERVER infd_xmpp_server_get_type INFD_XMPP_SERVER_CLASS INFD_IS_XMPP_SERVER_CLASS INFD_XMPP_SERVER_GET_CLASS
infd-server-pool InfdServerPool InfdServerPoolForeachServerFunc InfdServerPool InfdServerPoolClass infd_server_pool_new infd_server_pool_add_server infd_server_pool_add_local_publisher infd_server_pool_remove_server infd_server_pool_foreach_server INFD_SERVER_POOL INFD_IS_SERVER_POOL INFD_TYPE_SERVER_POOL infd_server_pool_get_type INFD_SERVER_POOL_CLASS INFD_IS_SERVER_POOL_CLASS INFD_SERVER_POOL_GET_CLASS
infd-directory InfdDirectory InfdDirectoryIter InfdDirectory InfdDirectoryClass InfdDirectoryForeachConnectionFunc infd_directory_iter_copy infd_directory_iter_free infd_directory_new infd_directory_get_io infd_directory_get_storage infd_directory_get_communication_manager infd_directory_add_plugin infd_directory_lookup_plugin infd_directory_add_connection infd_directory_foreach_connection infd_directory_iter_get_name infd_directory_iter_get_path infd_directory_iter_get_root infd_directory_iter_get_next infd_directory_iter_get_prev infd_directory_iter_get_parent infd_directory_iter_get_child infd_directory_iter_get_explored infd_directory_add_subdirectory infd_directory_add_note infd_directory_remove_node infd_directory_iter_get_node_type infd_directory_iter_get_plugin infd_directory_iter_get_session infd_directory_iter_peek_session infd_directory_iter_save_session infd_directory_enable_chat infd_directory_get_chat_session INFD_DIRECTORY INFD_IS_DIRECTORY INFD_TYPE_DIRECTORY infd_directory_iter_get_type INFD_DIRECTORY_CLASS INFD_IS_DIRECTORY_CLASS INFD_DIRECTORY_GET_CLASS INFD_TYPE_DIRECTORY_ITER infd_directory_get_type
infd-xml-server InfdXmlServer InfdXmlServer InfdXmlServerIface InfdXmlServerStatus infd_xml_server_close infd_xml_server_new_connection INFD_XML_SERVER INFD_IS_XML_SERVER INFD_TYPE_XML_SERVER infd_xml_server_status_get_type INFD_XML_SERVER_GET_IFACE infd_xml_server_get_type INFD_TYPE_XML_SERVER_STATUS
infd-tcp-server InfdTcpServer InfdTcpServerStatus InfdTcpServer InfdTcpServerClass infd_tcp_server_bind infd_tcp_server_open infd_tcp_server_close INFD_TCP_SERVER INFD_IS_TCP_SERVER INFD_TYPE_TCP_SERVER infd_tcp_server_status_get_type INFD_TCP_SERVER_CLASS INFD_IS_TCP_SERVER_CLASS INFD_TCP_SERVER_GET_CLASS infd_tcp_server_get_type INFD_TYPE_TCP_SERVER_STATUS
infd-storage InfdStorage InfdStorageIface InfdStorageNodeType InfdStorageNode infd_storage_node_new_subdirectory infd_storage_node_new_note infd_storage_node_copy infd_storage_node_free infd_storage_node_list_free infd_storage_read_subdirectory infd_storage_create_subdirectory infd_storage_remove_node INFD_STORAGE INFD_IS_STORAGE INFD_TYPE_STORAGE infd_storage_node_type_get_type INFD_STORAGE_GET_IFACE infd_storage_node_get_type infd_storage_get_type INFD_TYPE_STORAGE_NODE_TYPE INFD_TYPE_STORAGE_NODE
infd-session-proxy InfdSessionProxy InfdSessionProxy InfdSessionProxyClass infd_session_proxy_get_session infd_session_proxy_add_user infd_session_proxy_subscribe_to infd_session_proxy_has_subscriptions infd_session_proxy_is_subscribed infd_session_proxy_is_idle INFD_SESSION_PROXY INFD_IS_SESSION_PROXY INFD_TYPE_SESSION_PROXY infd_session_proxy_get_type INFD_SESSION_PROXY_CLASS INFD_IS_SESSION_PROXY_CLASS INFD_SESSION_PROXY_GET_CLASS
infd-filesystem-storage InfdFilesystemStorage InfdFilesystemStorageError InfdFilesystemStorage InfdFilesystemStorageClass infd_filesystem_storage_new infd_filesystem_storage_open INFD_FILESYSTEM_STORAGE INFD_IS_FILESYSTEM_STORAGE INFD_TYPE_FILESYSTEM_STORAGE infd_filesystem_storage_get_type INFD_FILESYSTEM_STORAGE_CLASS INFD_IS_FILESYSTEM_STORAGE_CLASS INFD_FILESYSTEM_STORAGE_GET_CLASS INFD_TYPE_FILESYSTEM_STORAGE_ITER
infc-note-plugin InfcNotePlugin InfcNotePlugin
infc-browser-iter InfcBrowserIter InfcBrowserIter infc_browser_iter_copy infc_browser_iter_free infc_browser_iter_get_type INFC_TYPE_BROWSER_ITER
inf-error InfError InfRequestError InfUserError InfDirectoryError InfAuthenticationDetailError inf_request_error_quark inf_request_strerror inf_user_error_quark inf_user_strerror inf_directory_error_quark inf_directory_strerror inf_authentication_detail_error_quark inf_authentication_detail_strerror inf_gnutls_error_quark inf_gnutls_set_error inf_gsasl_error_quark inf_gsasl_set_error
inf-protocol InfProtocol inf_protocol_get_version inf_protocol_parse_version inf_protocol_get_default_port
inf-ip-address InfIpAddress InfIpAddress InfIpAddressFamily inf_ip_address_new_raw4 inf_ip_address_new_loopback4 inf_ip_address_new_raw6 inf_ip_address_new_loopback6 inf_ip_address_new_from_string inf_ip_address_copy inf_ip_address_free inf_ip_address_get_family inf_ip_address_get_raw inf_ip_address_to_string inf_ip_address_collate inf_ip_address_family_get_type inf_ip_address_get_type INF_TYPE_IP_ADDRESS INF_TYPE_IP_ADDRESS_FAMILY
inf-certificate-chain InfCertificateChain InfCertificateChain inf_certificate_chain_new inf_certificate_chain_ref inf_certificate_chain_unref inf_certificate_chain_get_raw inf_certificate_chain_get_root_certificate inf_certificate_chain_get_own_certificate inf_certificate_chain_get_nth_certificate inf_certificate_chain_get_n_certificates inf_certificate_chain_get_type INF_TYPE_CERTIFICATE_CHAIN
inf-certificate-credentials InfCertificateCredentials InfCertificateCredentials inf_certificate_credentials_new inf_certificate_credentials_ref inf_certificate_credentials_unref inf_certificate_credentials_get inf_certificate_credentials_get_type INF_TYPE_CERTIFICATE_CREDENTIALS
inf-sasl-context InfSaslContext InfSaslContext InfSaslContextSession InfSaslContextCallbackFunc InfSaslContextSessionFeedFunc inf_sasl_context_new inf_sasl_context_ref inf_sasl_context_unref inf_sasl_context_set_callback inf_sasl_context_client_start_session inf_sasl_context_client_list_mechanisms inf_sasl_context_client_supports_mechanism inf_sasl_context_client_suggest_mechanism inf_sasl_context_server_start_session inf_sasl_context_server_list_mechanisms inf_sasl_context_server_supports_mechanism inf_sasl_context_stop_session inf_sasl_context_session_get_property inf_sasl_context_session_set_property inf_sasl_context_session_continue inf_sasl_context_session_feed inf_sasl_context_get_type INF_TYPE_SASL_CONTEXT
inf-cert-util InfCertUtil inf_cert_util_load_file inf_cert_util_save_file inf_cert_util_copy inf_cert_util_get_dn_by_oid inf_cert_util_get_issuer_dn_by_oid inf_cert_util_get_hostname inf_cert_util_get_activation_time inf_cert_util_get_expiration_time inf_cert_util_get_fingerprint inf_cert_util_get_serial_number
inf-init InfInit inf_init inf_deinit
inf-xml-util InfXmlUtil inf_xml_util_add_child_text inf_xml_util_get_child_text inf_xml_util_get_attribute inf_xml_util_get_attribute_required inf_xml_util_get_attribute_int inf_xml_util_get_attribute_int_required inf_xml_util_get_attribute_long inf_xml_util_get_attribute_long_required inf_xml_util_get_attribute_uint inf_xml_util_get_attribute_uint_required inf_xml_util_get_attribute_ulong inf_xml_util_get_attribute_ulong_required inf_xml_util_get_attribute_double inf_xml_util_get_attribute_double_required inf_xml_util_set_attribute inf_xml_util_set_attribute_int inf_xml_util_set_attribute_long inf_xml_util_set_attribute_uint inf_xml_util_set_attribute_ulong inf_xml_util_set_attribute_double inf_xml_util_new_error_from_node inf_xml_util_new_node_from_error
inf-adopted-state-vector InfAdoptedStateVector InfAdoptedStateVector InfAdoptedStateVectorError InfAdoptedStateVectorForeachFunc inf_adopted_state_vector_error_quark inf_adopted_state_vector_new inf_adopted_state_vector_copy inf_adopted_state_vector_free inf_adopted_state_vector_get inf_adopted_state_vector_set inf_adopted_state_vector_add inf_adopted_state_vector_foreach inf_adopted_state_vector_compare inf_adopted_state_vector_causally_before inf_adopted_state_vector_causally_before_inc inf_adopted_state_vector_vdiff inf_adopted_state_vector_to_string inf_adopted_state_vector_from_string inf_adopted_state_vector_to_string_diff inf_adopted_state_vector_from_string_diff INF_ADOPTED_TYPE_STATE_VECTOR inf_adopted_state_vector_get_type
infd-note-plugin InfdNotePlugin InfdNotePlugin
inf-communication-object InfCommunicationObject InfCommunicationScope InfCommunicationObject InfCommunicationObjectIface inf_communication_object_received inf_communication_object_enqueued inf_communication_object_sent INF_COMMUNICATION_TYPE_SCOPE inf_communication_scope_get_type INF_COMMUNICATION_OBJECT INF_COMMUNICATION_IS_OBJECT INF_COMMUNICATION_TYPE_OBJECT INF_COMMUNICATION_OBJECT_GET_IFACE inf_communication_object_get_type
inf-communication-manager InfCommunicationManager InfCommunicationManager InfCommunicationManagerClass inf_communication_manager_new inf_communication_manager_open_group inf_communication_manager_join_group inf_communication_manager_add_factory inf_communication_manager_get_factory_for INF_COMMUNICATION_MANAGER INF_COMMUNICATION_IS_MANAGER INF_COMMUNICATION_TYPE_MANAGER inf_communication_manager_get_type INF_COMMUNICATION_MANAGER_CLASS INF_COMMUNICATION_IS_MANAGER_CLASS INF_COMMUNICATION_MANAGER_GET_CLASS
inf-communication-group InfCommunicationGroup InfCommunicationGroup InfCommunicationGroupClass inf_communication_group_get_name inf_communication_group_get_target inf_communication_group_set_target inf_communication_group_is_member inf_communication_group_send_message inf_communication_group_send_group_message inf_communication_group_cancel_messages inf_communication_group_get_method_for_network inf_communication_group_get_method_for_connection inf_communication_group_get_publisher_id INF_COMMUNICATION_GROUP INF_COMMUNICATION_IS_GROUP INF_COMMUNICATION_TYPE_GROUP inf_communication_group_get_type INF_COMMUNICATION_GROUP_CLASS INF_COMMUNICATION_IS_GROUP_CLASS INF_COMMUNICATION_GROUP_GET_CLASS
inf-communication-hosted-group InfCommunicationHostedGroup InfCommunicationHostedGroup InfCommunicationHostedGroupClass inf_communication_hosted_group_add_method inf_communication_hosted_group_add_member inf_communication_hosted_group_remove_member INF_COMMUNICATION_HOSTED_GROUP INF_COMMUNICATION_IS_HOSTED_GROUP INF_COMMUNICATION_TYPE_HOSTED_GROUP inf_communication_hosted_group_get_type INF_COMMUNICATION_HOSTED_GROUP_CLASS INF_COMMUNICATION_IS_HOSTED_GROUP_CLASS INF_COMMUNICATION_HOSTED_GROUP_GET_CLASS
inf-communication-joined-group InfCommunicationJoinedGroup InfCommunicationJoinedGroup InfCommunicationJoinedGroupClass inf_communication_joined_group_remove_member inf_communication_joined_group_get_publisher INF_COMMUNICATION_JOINED_GROUP INF_COMMUNICATION_IS_JOINED_GROUP INF_COMMUNICATION_TYPE_JOINED_GROUP inf_communication_joined_group_get_type INF_COMMUNICATION_JOINED_GROUP_CLASS INF_COMMUNICATION_IS_JOINED_GROUP_CLASS INF_COMMUNICATION_JOINED_GROUP_GET_CLASS
inf-communication-registry InfCommunicationRegistry InfCommunicationRegistry InfCommunicationRegistryClass inf_communication_registry_register inf_communication_registry_unregister inf_communication_registry_is_registered inf_communication_registry_send inf_communication_registry_cancel_messages INF_COMMUNICATION_REGISTRY INF_COMMUNICATION_IS_REGISTRY INF_COMMUNICATION_TYPE_REGISTRY inf_communication_registry_get_type INF_COMMUNICATION_REGISTRY_CLASS INF_COMMUNICATION_IS_REGISTRY_CLASS INF_COMMUNICATION_REGISTRY_GET_CLASS
inf-communication-factory InfCommunicationFactory InfCommunicationFactory InfCommunicationFactoryIface inf_communication_factory_supports_method inf_communication_factory_instantiate INF_COMMUNICATION_FACTORY INF_COMMUNICATION_IS_FACTORY INF_COMMUNICATION_TYPE_FACTORY INF_COMMUNICATION_FACTORY_GET_IFACE inf_communication_factory_get_type
inf-communication-method InfCommunicationMethod InfCommunicationMethod InfCommunicationMethodIface inf_communication_method_add_member inf_communication_method_remove_member inf_communication_method_is_member inf_communication_method_send_single inf_communication_method_send_all inf_communication_method_cancel_messages inf_communication_method_received inf_communication_method_enqueued inf_communication_method_sent INF_COMMUNICATION_METHOD INF_COMMUNICATION_IS_METHOD INF_COMMUNICATION_TYPE_METHOD INF_COMMUNICATION_METHOD_GET_IFACE inf_communication_method_get_type
inf-communication-central-factory InfCommunicationCentralFactory InfCommunicationCentralFactory InfCommunicationCentralFactoryClass inf_communication_central_factory_get_default INF_COMMUNICATION_CENTRAL_FACTORY INF_COMMUNICATION_CENTRAL_FACTORY_CLASS INF_COMMUNICATION_CENTRAL_FACTORY_GET_CLASS INF_COMMUNICATION_IS_CENTRAL_FACTORY INF_COMMUNICATION_IS_CENTRAL_FACTORY_CLASS INF_COMMUNICATION_TYPE_CENTRAL_FACTORY inf_communication_central_factory_get_type
inf-communication-central-method InfCommunicationCentralMethod InfCommunicationCentralMethod InfCommunicationCentralMethodClass INF_COMMUNICATION_CENTRAL_METHOD INF_COMMUNICATION_CENTRAL_METHOD_CLASS INF_COMMUNICATION_CENTRAL_METHOD_GET_CLASS INF_COMMUNICATION_IS_CENTRAL_METHOD INF_COMMUNICATION_IS_CENTRAL_METHOD_CLASS INF_COMMUNICATION_TYPE_CENTRAL_METHOD inf_communication_central_method_get_type
inf-chat-session InfChatSession InfChatSession InfChatSessionClass InfChatSessionError inf_chat_session_new inf_chat_session_set_log_file INF_CHAT_SESSION INF_IS_CHAT_SESSION INF_CHAT_SESSION_CLASS INF_IS_CHAT_SESSION_CLASS INF_CHAT_SESSION_GET_CLASS inf_chat_session_get_type INF_TYPE_CHAT_SESSION
inf-chat-buffer InfChatBuffer InfChatBufferMessageType InfChatBufferMessageFlags InfChatBufferMessage InfChatBuffer InfChatBufferClass inf_chat_buffer_message_copy inf_chat_buffer_message_free inf_chat_buffer_new inf_chat_buffer_add_message inf_chat_buffer_add_emote_message inf_chat_buffer_add_userjoin_message inf_chat_buffer_add_userpart_message inf_chat_buffer_get_message inf_chat_buffer_get_n_messages inf_chat_buffer_get_size INF_CHAT_BUFFER INF_IS_CHAT_BUFFER inf_chat_buffer_message_type_get_type inf_chat_buffer_message_flags_get_type INF_TYPE_CHAT_BUFFER_MESSAGE_TYPE inf_chat_buffer_message_get_type INF_TYPE_CHAT_BUFFER_MESSAGE INF_CHAT_BUFFER_CLASS INF_IS_CHAT_BUFFER_CLASS INF_CHAT_BUFFER_GET_CLASS inf_chat_buffer_get_type INF_TYPE_CHAT_BUFFER
libinfinity-0.5.5/docs/reference/libinfinity/Makefile.am0000644000175000017500000000746512041011626020231 00000000000000## Process this file with automake to produce Makefile.in # We require automake 1.6 at least. AUTOMAKE_OPTIONS = 1.6 # This is a blank Makefile.am for using gtk-doc. # Copy this to your project's API docs directory and modify the variables to # suit your project. See the GTK+ Makefiles in gtk+/docs/reference for examples # of using the various options. # The name of the module, e.g. 'glib'. DOC_MODULE=libinfinity-$(LIBINFINITY_API_VERSION) # The top-level SGML file. You can change this if you want to. DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml # The directory containing the source code. Relative to $(srcdir). # gtk-doc will search all .c & .h files beneath here for inline comments # documenting the functions and macros. # e.g. DOC_SOURCE_DIR=../../../gtk DOC_SOURCE_DIR=$(top_srcdir)/libinfinity # Extra options to pass to gtkdoc-scangobj. Not normally needed. SCANGOBJ_OPTIONS= # Header files to ignore when scanning. # e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h if LIBINFINITY_HAVE_AVAHI IGNORE_HFILES="inf-marshal.h inf-i18n.h inf-signals.h inf-config.h" else IGNORE_HFILES="inf-marshal.h inf-i18n.h inf-signals.h inf-config.h inf-discovery-avahi.h" endif # Extra options to supply to gtkdoc-mkdb. # Extra options to supply to gtkdoc-scan. # e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED" SCAN_OPTIONS=--rebuild-types --ignore-headers=$(IGNORE_HFILES) # e.g. MKDB_OPTIONS=--sgml-mode --output-format=xml MKDB_OPTIONS=--sgml-mode --output-format=xml # Extra options to supply to gtkdoc-mktmpl # e.g. MKTMPL_OPTIONS=--only-section-tmpl MKTMPL_OPTIONS= # Extra options to supply to gtkdoc-fixref. Not normally needed. # e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html FIXXREF_OPTIONS= # Used for dependencies. The docs will be rebuilt if any of these change. # e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h # e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c HFILE_GLOB = \ $(top_srcdir)/libinfinity/communication/*.h \ $(top_srcdir)/libinfinity/common/*.h \ $(top_srcdir)/libinfinity/adopted/*.h \ $(top_srcdir)/libinfinity/client/*.h \ $(top_srcdir)/libinfinity/server/*.h CFILE_GLOB = \ $(top_srcdir)/libinfinity/communication/*.c \ $(top_srcdir)/libinfinity/common/*.c \ $(top_srcdir)/libinfinity/adopted/*.c \ $(top_srcdir)/libinfinity/client/*.c \ $(top_srcdir)/libinfinity/server/*.c # Images to copy into HTML directory. # e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png HTML_IMAGES= # Extra SGML files that are included by $(DOC_MAIN_SGML_FILE). # e.g. content_files=running.sgml building.sgml changes-2.0.sgml content_files = \ ../version.xml \ ../api_version.xml \ compiling.sgml # SGML files where gtk-doc abbrevations (#GtkWidget) are expanded # These files must be listed here *and* in content_files # e.g. expand_content_files=running.sgml expand_content_files= # CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library. # Only needed if you are using gtkdoc-scangobj to dynamically query widget # signals and properties. # e.g. INCLUDES=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS) # e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib) #INCLUDES=$(infinity_CFLAGS) AM_CPPFLAGS=$(infinity_CFLAGS) GTKDOC_LIBS = \ $(infinity_LIBS) \ $(top_builddir)/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la # This includes the standard gtk-doc make rules, copied by gtkdocize. include $(top_srcdir)/gtk-doc.make # Other files to distribute # e.g. EXTRA_DIST += version.xml.in EXTRA_DIST += # Files not to distribute # for --rebuild-types in $(SCAN_OPTIONS), e.g. $(DOC_MODULE).types # for --rebuild-sections in $(SCAN_OPTIONS) e.g. $(DOC_MODULE)-sections.txt DISTCLEANFILES = libinfinity-$(LIBINFINITY_API_VERSION).types version.xml api_version.xml # Comment this out if you want your docs-status tested during 'make check' #TESTS = $(GTKDOC_CHECK) libinfinity-0.5.5/docs/reference/libinfinity/compiling.sgml0000644000175000017500000001045411313224527021041 00000000000000 Compiling and Using libinfinity Compiling libinfinity This chapter explains how to compile libinfinity on a UNIX-like operating system such as Linux. On Windows, you can pretty much follow the same instructions once you have set up a MinGW/MSYS build environment and installed the necessary dependencies to the correct locations. This document does not cover how to do this but might in the future. It is also possible to build libinfinity using the Microsoft Compiler and Visual Studio IDE but there are no project files so far. The first thing to do is to check whether all dependencies of libinfinity are installed. The following list shows what packages are required to be present on your system prior to building libinfinity: libxml2 glib-2.0 >= 2.16 gnutls >= 1.7.2 gsasl >= 0.2.21 gtk+ >= 2.12 (optional) avahi-client (optional) libdaemon (optional) Most if not all of them are most likely available in the package manager of your operating system vendor. It is much more convenient to obtain them from there than building them on your own. The next step is to obtain the current source code for libinfinity. Point your web browser to http://releases.0x539.de/libinfinity and grab the latest .tar.gz file available, or exactly the version you want if you are looking for a specific one. Then unpack the tarball. On the command line this can be done using the following command: tar xvfz libinfinity-0.4.tar.gz After unpacking, descend into the newly created directory and run the configure script there. This performs several checks to adapt the build for your specific operating system and environment. The script can be passed several command-line arguments to alter the build. For example, the --prefix argument specifies the directory libinfinity will be installed into after the build. It defaults to /usr/local but you might want to install it to a different place, such as /opt/libinfinity. In that case run the following: ./configure --prefix=/opt/libinfinity To get a list of all possible arguments run configure with the --help argument. If you do not want to change the installation path simply omit the --prefix=/opt/libinfinity in the command above. When all dependencies are installed correctly the configure script will run smoothly and end up with a status summary of what parts of libinfinity will or will not be built. If there are errors you need to fix them (for examply by installing a missing dependency) and run configure again. After it ran it created a Makefile and you can build the package via: make This might take some time but it is not supposed to produce an error. If it does something might be wrong with your build setup that configure was unable to detect. When make finished install the package using: make install Depending on the installation directory you chose with the --prefix argument to configure you might need superuser privileges for this step. Compiling applications using libinfinity Environment variables libinfinity-0.5.5/docs/reference/libinfinity/html/0000755000175000017500000000000012264766270017230 500000000000000libinfinity-0.5.5/docs/reference/libinfinity/html/InfAdoptedUndoGrouping.html0000644000175000017500000007130312264766270024420 00000000000000 InfAdoptedUndoGrouping

InfAdoptedUndoGrouping

InfAdoptedUndoGrouping — Grouping of requests to be undone simultaneously

Stability Level

Unstable, unless otherwise indicated

Object Hierarchy

  GObject
   +----InfAdoptedUndoGrouping

Properties

  "algorithm"                InfAdoptedAlgorithm*  : Read / Write
  "user"                     InfAdoptedUser*       : Read / Write

Signals

  "group-requests"                                 : Run Last

Description

InfAdoptedUndoGrouping groups related requests together so that they can be undone at the same time. For example, Undo in a text editor is normally expected to operate on written words, not characters. Therefore, multiple requests need to be undone at once.

The undo grouping helps with this. Everytime it needs to decide whether two requests should be grouped it emits "group-requests". If the signal handler returns TRUE then the two requests will be undone at the same time, otherwise not.

It is also possible to explicitely group a bunch of requests that would not be grouped otherwise, by calling inf_adopted_undo_grouping_start_group() and inf_adopted_undo_grouping_end_group() before and after issuing the requests, respectively.

The default signal handler always returns FALSE. However, this behaviour can be changed in derived classes.

Details

InfAdoptedUndoGrouping

typedef struct _InfAdoptedUndoGrouping InfAdoptedUndoGrouping;

InfAdoptedUndoGrouping is an opaque data type. You should only access it via the public API functions.


struct InfAdoptedUndoGroupingClass

struct InfAdoptedUndoGroupingClass {
  gboolean (*group_requests)(InfAdoptedUndoGrouping* grouping,
                             InfAdoptedRequest* first,
                             InfAdoptedRequest* second);
};

This structure contains default signal handlers for InfAdoptedUndoGrouping.

group_requests ()

Default signal handler for the "group-requests" signal.

inf_adopted_undo_grouping_new ()

InfAdoptedUndoGrouping * inf_adopted_undo_grouping_new  (void);

Creates a new InfAdoptedUndoGrouping. To start grouping requests, set a user whose requests to group via inf_adopted_undo_grouping_set_algorithm(). Before doing so you might want to connect to "group-requests", so the user's initial requests can be grouped correctly.

Returns :

A new InfAdoptedUndoGrouping, to be freed via g_object_unref().

inf_adopted_undo_grouping_get_algorithm ()

InfAdoptedAlgorithm * inf_adopted_undo_grouping_get_algorithm
                                                        (InfAdoptedUndoGrouping *grouping);

Returns the InfAdoptedAlgorithm for grouping.

grouping :

A InfAdoptedUndoGrouping.

Returns :

grouping's algorithm.

inf_adopted_undo_grouping_set_algorithm ()

void                inf_adopted_undo_grouping_set_algorithm
                                                        (InfAdoptedUndoGrouping *grouping,
                                                         InfAdoptedAlgorithm *algorithm,
                                                         InfAdoptedUser *user);

Sets the algorithm and user to group requests for. This function will group all requests in user's request log, and also each new request that is added to it's log. Requests that cannot be undone anymore (because they are too old), will be correctly taken care off.

grouping :

A InfAdoptedUndoGrouping.

algorithm :

The InfAdoptedAlgorithm for the document to group requests, or NULL.

user :

The user for which to group requests, or NULL. Ignored if algorithm is NULL.

inf_adopted_undo_grouping_start_group ()

void                inf_adopted_undo_grouping_start_group
                                                        (InfAdoptedUndoGrouping *grouping,
                                                         gboolean allow_group_with_prev);

Makes all requests issued after this call belong into the same group, i.e. they will be undone at once. This can make sense for example when the user copy+pastes something into the document which causes multiple requests to be generated. A call to inf_adopted_undo_grouping_end_group() restores the normal behavior.

grouping :

A InfAdoptedUndoGrouping.

allow_group_with_prev :

Whether the new group can be part of the previous group if "group-requests" allows.

inf_adopted_undo_grouping_end_group ()

void                inf_adopted_undo_grouping_end_group (InfAdoptedUndoGrouping *grouping,
                                                         gboolean allow_group_with_next);

When inf_adopted_undo_grouping_start_group() was called before, then this function restores the normal behaviour of grouping requests.

grouping :

A InfAdoptedUndoGrouping.

allow_group_with_next :

Whether subsequent requests are allow to be part of this group if "group-requests" allows.

inf_adopted_undo_grouping_get_undo_size ()

guint               inf_adopted_undo_grouping_get_undo_size
                                                        (InfAdoptedUndoGrouping *grouping);

Returns the number of requests to undo so that a whole group is being undone. This takes into account that possibly not the whole group cannot be undone due to the "max-total-log-size" constraint.

grouping :

A InfAdoptedUndoGrouping.

Returns :

The number of requests in the current undo group.

inf_adopted_undo_grouping_get_redo_size ()

guint               inf_adopted_undo_grouping_get_redo_size
                                                        (InfAdoptedUndoGrouping *grouping);

Returns the number of requests to redo so that a whole group is being redone. This takes into account that possibly not the whole group cannot be undone due to the "max-total-log-size" constraint.

grouping :

A InfAdoptedUndoGrouping.

Returns :

The number of requests in the current redo group.

Property Details

The "algorithm" property

  "algorithm"                InfAdoptedAlgorithm*  : Read / Write

The algorithm for which to group requests.


The "user" property

  "user"                     InfAdoptedUser*       : Read / Write

The user for which to group requests.

Signal Details

The "group-requests" signal

gboolean            user_function                      (InfAdoptedUndoGrouping *grouping,
                                                        InfAdoptedRequest      *first,
                                                        InfAdoptedRequest      *second,
                                                        gpointer                user_data)      : Run Last

This signal is emitted whenever the InfAdoptedUndoGrouping needs to decide whether to put two requests into the same undo group or not. A signal handler should return TRUE if they belong into the same group or FALSE otherwise. Note however that the two requests may not immediately follow each other because other users may have issued requests inbetween. Check the vector times of the requests to find out, using inf_adopted_request_get_vector().

grouping :

The InfAdoptedUndoGrouping which is about to group a request.

first :

The previous request.

second :

The current request.

user_data :

user data set when the signal handler was connected.
libinfinity-0.5.5/docs/reference/libinfinity/html/InfcRequest.html0000644000175000017500000003421312264766270022271 00000000000000 InfcRequest

InfcRequest

InfcRequest — Requests sent to server

Stability Level

Unstable, unless otherwise indicated

Synopsis

#include <libinfinity/client/infc-request.h>

                    InfcRequest;
struct              InfcRequestClass;
guint               infc_request_get_seq                (InfcRequest *request);
const gchar *       infc_request_get_name               (InfcRequest *request);
void                infc_request_failed                 (InfcRequest *request,
                                                         GError *error);

Object Hierarchy

  GObject
   +----InfcRequest
         +----InfcExploreRequest
         +----InfcNodeRequest
         +----InfcUserRequest

Properties

  "name"                     gchar*                : Read / Write / Construct Only
  "seq"                      guint                 : Read / Write / Construct Only

Signals

  "failed"                                         : Run Last

Description

A InfcRequest represents a request that was sent to the server. It can be used to get information related to that request and to be notified when the request fails or finishes.

InfcRequest is the base class for other requests and only has the "failed" signal. Use signals from specific requests such as InfcNodeRequest to get further notification. Every request has a name and a sequence number. The sequence number is used in the server reply to refer to a specific request and normally of no use for developers using the infinote API.

Details

InfcRequest

typedef struct _InfcRequest InfcRequest;


struct InfcRequestClass

struct InfcRequestClass {
  GObjectClass parent_class;

  /* Signals */
  void (*failed)(InfcRequest* request, GError* error);

  void (*unused1)(void);
  void (*usused2)(void);
};


infc_request_get_seq ()

guint               infc_request_get_seq                (InfcRequest *request);

Returns the sequence identifier for this request.

request :

A InfcRequest.

Returns :

The sequence number for request.

infc_request_get_name ()

const gchar *       infc_request_get_name               (InfcRequest *request);

Returns the name of the request.

request :

A InfcRequest.

Returns :

The name of request.

infc_request_failed ()

void                infc_request_failed                 (InfcRequest *request,
                                                         GError *error);

Emits the "failed" signal on request.

request :

A InfcRequest.

error :

A GError.

Property Details

The "name" property

  "name"                     gchar*                : Read / Write / Construct Only

Name of the request.

Default value: NULL


The "seq" property

  "seq"                      guint                 : Read / Write / Construct Only

Identifier for this request.

Default value: 0

Signal Details

The "failed" signal

void                user_function                      (InfcRequest *request,
                                                        gpointer     error,
                                                        gpointer     user_data)      : Run Last

Emitted when the request could not be processed on the server side. error holds additional information on why the request failed.

request :

The failed InfcRequest.

error :

A pointer to a GError object with details on the error.

user_data :

user data set when the signal handler was connected.
libinfinity-0.5.5/docs/reference/libinfinity/html/InfAdoptedStateVector.html0000644000175000017500000013700612264766270024246 00000000000000 InfAdoptedStateVector

InfAdoptedStateVector

InfAdoptedStateVector — Represents a state in the interaction model

Stability Level

Unstable, unless otherwise indicated

Synopsis

#include <libinfinity/adopted/inf-adopted-state-vector.h>

                    InfAdoptedStateVector;
enum                InfAdoptedStateVectorError;
void                (*InfAdoptedStateVectorForeachFunc) (guint id,
                                                         guint value,
                                                         gpointer user_data);
GQuark              inf_adopted_state_vector_error_quark
                                                        (void);
InfAdoptedStateVector * inf_adopted_state_vector_new    (void);
InfAdoptedStateVector * inf_adopted_state_vector_copy   (InfAdoptedStateVector *vec);
void                inf_adopted_state_vector_free       (InfAdoptedStateVector *vec);
guint               inf_adopted_state_vector_get        (InfAdoptedStateVector *vec,
                                                         guint id);
void                inf_adopted_state_vector_set        (InfAdoptedStateVector *vec,
                                                         guint id,
                                                         guint value);
void                inf_adopted_state_vector_add        (InfAdoptedStateVector *vec,
                                                         guint id,
                                                         gint value);
void                inf_adopted_state_vector_foreach    (InfAdoptedStateVector *vec,
                                                         InfAdoptedStateVectorForeachFunc func,
                                                         gpointer user_data);
int                 inf_adopted_state_vector_compare    (InfAdoptedStateVector *first,
                                                         InfAdoptedStateVector *second);
gboolean            inf_adopted_state_vector_causally_before
                                                        (InfAdoptedStateVector *first,
                                                         InfAdoptedStateVector *second);
gboolean            inf_adopted_state_vector_causally_before_inc
                                                        (InfAdoptedStateVector *first,
                                                         InfAdoptedStateVector *second,
                                                         guint inc_component);
guint               inf_adopted_state_vector_vdiff      (InfAdoptedStateVector *first,
                                                         InfAdoptedStateVector *second);
gchar *             inf_adopted_state_vector_to_string  (InfAdoptedStateVector *vec);
InfAdoptedStateVector * inf_adopted_state_vector_from_string
                                                        (const gchar *str,
                                                         GError **error);
gchar *             inf_adopted_state_vector_to_string_diff
                                                        (InfAdoptedStateVector *vec,
                                                         InfAdoptedStateVector *orig);
InfAdoptedStateVector * inf_adopted_state_vector_from_string_diff
                                                        (const gchar *str,
                                                         InfAdoptedStateVector *orig,
                                                         GError **error);

Object Hierarchy

  GBoxed
   +----InfAdoptedStateVector

Description

The InfAdoptedStateVector represents a state in the current state space. It basically maps user IDs to operation counts and states how many operations of the corresponding user have already been performed.

Details

InfAdoptedStateVector

typedef struct _InfAdoptedStateVector InfAdoptedStateVector;

InfAdoptedStateVector is an opaque data type. You should only access it via the public API functions.


enum InfAdoptedStateVectorError

typedef enum {
  INF_ADOPTED_STATE_VECTOR_BAD_FORMAT,

  INF_ADOPTED_STATE_VECTOR_FAILED
} InfAdoptedStateVectorError;

Error codes for InfAdoptedStateVector.

INF_ADOPTED_STATE_VECTOR_BAD_FORMAT

A string representation of an InfAdoptedStateVector as required by inf_adopted_state_vector_from_string() or inf_adopted_state_vector_from_string_diff() is invalid.

INF_ADOPTED_STATE_VECTOR_FAILED

No further specified error code.

InfAdoptedStateVectorForeachFunc ()

void                (*InfAdoptedStateVectorForeachFunc) (guint id,
                                                         guint value,
                                                         gpointer user_data);

This function is called for every component in the state vector during the invocation of inf_adopted_state_vector_foreach().

id :

The ID of the entry.

value :

The value of the entry.

user_data :

The user data passed to inf_adopted_state_vector_foreach().

inf_adopted_state_vector_error_quark ()

GQuark              inf_adopted_state_vector_error_quark
                                                        (void);

The domain for InfAdoptedStateVectorError errors.

Returns :

A GQuark for that domain.

inf_adopted_state_vector_new ()

InfAdoptedStateVector * inf_adopted_state_vector_new    (void);

Returns a new state vector with all components set to zero.

Returns :

A new InfAdoptedStateVector.

inf_adopted_state_vector_copy ()

InfAdoptedStateVector * inf_adopted_state_vector_copy   (InfAdoptedStateVector *vec);

Returns a copy of vec.

vec :

The InfAdoptedStateVector to copy

Returns :

A copy of vec.

inf_adopted_state_vector_free ()

void                inf_adopted_state_vector_free       (InfAdoptedStateVector *vec);

Frees a state vector allocated by inf_adopted_state_vector_new() or inf_adopted_state_vector_copy().

vec :

A InfAdoptedStateVector.

inf_adopted_state_vector_get ()

guint               inf_adopted_state_vector_get        (InfAdoptedStateVector *vec,
                                                         guint id);

Returns the timestamp for the given component. Implicitely, all IDs that the vector does not contain are assigned the timestamp 0.

vec :

A InfAdoptedStateVector.

id :

The component whose timestamp to look for.

Returns :

The component'th entry in the vector.

inf_adopted_state_vector_set ()

void                inf_adopted_state_vector_set        (InfAdoptedStateVector *vec,
                                                         guint id,
                                                         guint value);

Sets the given component of vec to value.

vec :

A InfAdoptedStateVector.

id :

The component to change.

value :

The value to set the component to.

inf_adopted_state_vector_add ()

void                inf_adopted_state_vector_add        (InfAdoptedStateVector *vec,
                                                         guint id,
                                                         gint value);

Adds value to the current value of component. value may be negative in which case the current value is actually decreased. Make sure to not drop below zero this way.

vec :

A InfAdoptedStateVector.

id :

The component to change.

value :

The value by which to change the component.

inf_adopted_state_vector_foreach ()

void                inf_adopted_state_vector_foreach    (InfAdoptedStateVector *vec,
                                                         InfAdoptedStateVectorForeachFunc func,
                                                         gpointer user_data);

Calls func for each component in vec. Note that there may be users for which func will not be called if their timestamp is 0.

vec :

A InfAdoptedStateVector.

func :

The function to call.

user_data :

Additional data to pass to func.

inf_adopted_state_vector_compare ()

int                 inf_adopted_state_vector_compare    (InfAdoptedStateVector *first,
                                                         InfAdoptedStateVector *second);

Performs a comparison suited for strict-weak ordering so that state vectors can be sorted. This function returns -1 if first compares before second, 0 if they compare equal and 1 if first compares after second.

first :

A InfAdoptedStateVector.

second :

Another InfAdoptedStateVector.

Returns :

-1, 0 or 1.

inf_adopted_state_vector_causally_before ()

gboolean            inf_adopted_state_vector_causally_before
                                                        (InfAdoptedStateVector *first,
                                                         InfAdoptedStateVector *second);

Checks whether an event that occured at time second is causally dependant on an event that occured at time first, that is all components of first are less or equal to the corresponding component in second.

first :

A InfAdoptedStateVector.

second :

Another InfAdoptedStateVector.

Returns :

Whether second depends on first.

inf_adopted_state_vector_causally_before_inc ()

gboolean            inf_adopted_state_vector_causally_before_inc
                                                        (InfAdoptedStateVector *first,
                                                         InfAdoptedStateVector *second,
                                                         guint inc_component);

This function does the equivalent of

inf_adopted_state_vector_add(first, inc_component, 1);
gboolean result = inf_adopted_state_vector_causally_before(first, second);
inf_adopted_state_vector_add(first, inc_component, -1);
return result;

But it is more efficient.

first :

A InfAdoptedStateVector.

second :

Another InfAdoptedStateVector.

inc_component :

The component to increment before comparing.

Returns :

Whether second depends on first with the inc_componentth component increased by one.

inf_adopted_state_vector_vdiff ()

guint               inf_adopted_state_vector_vdiff      (InfAdoptedStateVector *first,
                                                         InfAdoptedStateVector *second);

This function returns the sum of the differences between each component of first and second. This function can only be called if inf_adopted_state_vector_causally_before() returns TRUE.

first :

A InfAdoptedStateVector.

second :

Another InfAdoptedStateVector.

Returns :

The sum of the differences between each component of first and second.

inf_adopted_state_vector_to_string ()

gchar *             inf_adopted_state_vector_to_string  (InfAdoptedStateVector *vec);

Returns a string representation of vec.

vec :

A InfAdoptedStateVector.

Returns :

A newly-allocated string to be freed by the caller.

inf_adopted_state_vector_from_string ()

InfAdoptedStateVector * inf_adopted_state_vector_from_string
                                                        (const gchar *str,
                                                         GError **error);

Recreates the InfAdoptedStateVector from its string representation. If an error occurs, the function returns NULL and error is set.

str :

A string representation of a InfAdoptedStateVector.

error :

Location to place an error, if any.

Returns :

A new InfAdoptedStateVector, or NULL.

inf_adopted_state_vector_to_string_diff ()

gchar *             inf_adopted_state_vector_to_string_diff
                                                        (InfAdoptedStateVector *vec,
                                                         InfAdoptedStateVector *orig);

Returns the string representation of a diff between orig and vec. This is possibly smaller than the representation created by inf_adopted_state_vector_to_string(), but the same orig vector is needed to recreate vec from the string representation. Additionally, inf_adopted_state_vector_causally_before(orig, vec) must hold.

vec :

A InfAdoptedStateVector.

orig :

Another InfAdoptedStateVector.

Returns :

A newly allocated string to be freed by the caller.

inf_adopted_state_vector_from_string_diff ()

InfAdoptedStateVector * inf_adopted_state_vector_from_string_diff
                                                        (const gchar *str,
                                                         InfAdoptedStateVector *orig,
                                                         GError **error);

Recreates a vector from its string representation diff and the original vector. If an error returns, the function returns NULL and error is set.

str :

A string representation of a diff between state vectors.

orig :

The state vector used to create str in inf_adopted_state_vector_to_string_diff().

error :

Location to place an error, if any.

Returns :

The created state vector, or NULL on error. Free with inf_adopted_state_vector_free() when no longer needed.
libinfinity-0.5.5/docs/reference/libinfinity/html/ch05.html0000644000175000017500000000544012264766270020600 00000000000000 Libinfinity server side API libinfinity-0.5.5/docs/reference/libinfinity/html/left.png0000644000175000017500000000055612264766270020616 00000000000000‰PNG  IHDRשÍÊ~PLTEÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ(((;;;@@@€€€ƒƒƒ§§§×××ßßßãããçççëëëóóóûûûÿÿÿv:òütRNS $04 libinfinity-0.5.5/docs/reference/libinfinity/html/ch01.html0000644000175000017500000000334412264766270020575 00000000000000 About libinfinity libinfinity-0.5.5/docs/reference/libinfinity/html/libinfinity-0.5.devhelp20000644000175000017500000040375512264766270023441 00000000000000 libinfinity-0.5.5/docs/reference/libinfinity/html/custom-compiling.html0000644000175000017500000001313312264766270023330 00000000000000 Compiling and Using libinfinity

Compiling libinfinity

This chapter explains how to compile libinfinity on a UNIX-like operating system such as Linux. On Windows, you can pretty much follow the same instructions once you have set up a MinGW/MSYS build environment and installed the necessary dependencies to the correct locations. This document does not cover how to do this but might in the future. It is also possible to build libinfinity using the Microsoft Compiler and Visual Studio IDE but there are no project files so far.

The first thing to do is to check whether all dependencies of libinfinity are installed. The following list shows what packages are required to be present on your system prior to building libinfinity:

  • libxml2

  • glib-2.0 >= 2.16

  • gnutls >= 1.7.2

  • gsasl >= 0.2.21

  • gtk+ >= 2.12 (optional)

  • avahi-client (optional)

  • libdaemon (optional)

Most if not all of them are most likely available in the package manager of your operating system vendor. It is much more convenient to obtain them from there than building them on your own.

The next step is to obtain the current source code for libinfinity. Point your web browser to http://releases.0x539.de/libinfinity and grab the latest .tar.gz file available, or exactly the version you want if you are looking for a specific one. Then unpack the tarball. On the command line this can be done using the following command:

tar xvfz libinfinity-0.4.tar.gz

After unpacking, descend into the newly created directory and run the configure script there. This performs several checks to adapt the build for your specific operating system and environment. The script can be passed several command-line arguments to alter the build. For example, the --prefix argument specifies the directory libinfinity will be installed into after the build. It defaults to /usr/local but you might want to install it to a different place, such as /opt/libinfinity. In that case run the following:

./configure --prefix=/opt/libinfinity

To get a list of all possible arguments run configure with the --help argument. If you do not want to change the installation path simply omit the --prefix=/opt/libinfinity in the command above.

When all dependencies are installed correctly the configure script will run smoothly and end up with a status summary of what parts of libinfinity will or will not be built. If there are errors you need to fix them (for examply by installing a missing dependency) and run configure again. After it ran it created a Makefile and you can build the package via:

make

This might take some time but it is not supposed to produce an error. If it does something might be wrong with your build setup that configure was unable to detect. When make finished install the package using:

make install

Depending on the installation directory you chose with the --prefix argument to configure you might need superuser privileges for this step.

Compiling applications using libinfinity

Environment variables

libinfinity-0.5.5/docs/reference/libinfinity/html/InfLocalPublisher.html0000644000175000017500000003107112264766270023405 00000000000000 InfLocalPublisher

InfLocalPublisher

InfLocalPublisher — Publish services on the local network

Synopsis

#include <libinfinity/common/inf-local-publisher.h>

                    InfLocalPublisher;
struct              InfLocalPublisherIface;
                    InfLocalPublisherItem;
InfLocalPublisherItem * inf_local_publisher_publish     (InfLocalPublisher *publisher,
                                                         const gchar *type,
                                                         const gchar *name,
                                                         guint port);
void                inf_local_publisher_unpublish       (InfLocalPublisher *publisher,
                                                         InfLocalPublisherItem *item);

Object Hierarchy

  GInterface
   +----InfLocalPublisher

Prerequisites

InfLocalPublisher requires GObject.

Known Implementations

InfLocalPublisher is implemented by InfDiscoveryAvahi.

Description

InfLocalPublisher provides a common interface to publish services on the local network.

Details

InfLocalPublisher

typedef struct _InfLocalPublisher InfLocalPublisher;

InfLocalPublisher is an opaque data type. You should only access it via the public API functions.


struct InfLocalPublisherIface

struct InfLocalPublisherIface {
  InfLocalPublisherItem* (*publish)(InfLocalPublisher* publisher,
                                    const gchar* type,
                                    const gchar* name,
                                    guint port);

  void (*unpublish)(InfLocalPublisher* publisher,
                    InfLocalPublisherItem* item);
};

Virtual functions for InfLocalPublisher.

publish ()

Virtual function to announce a service of the given type with the given name on the given port. The returned InfLocalPublisherItem is valid as long as the service is published and the InfLocalPublisher is alive. It can be used to unpublish the service again using the unpublish function.

unpublish ()

Virtual function to unpublish a previously published service.

InfLocalPublisherItem

typedef struct _InfLocalPublisherItem InfLocalPublisherItem;

InfLocalPublisherItem is an opaque data type. You should only access it via the public API functions.


inf_local_publisher_publish ()

InfLocalPublisherItem * inf_local_publisher_publish     (InfLocalPublisher *publisher,
                                                         const gchar *type,
                                                         const gchar *name,
                                                         guint port);

Publishes a service through publisher so that it can be discovered with an appropriate InfDiscovery.

publisher :

A InfLocalPublisher.

type :

The service type to publish, such as _http._tcp.

name :

The name of the service.

port :

The port the service is listening on.

Returns :

A InfLocalPublisherItem that can be used to unpublish the service again.

inf_local_publisher_unpublish ()

void                inf_local_publisher_unpublish       (InfLocalPublisher *publisher,
                                                         InfLocalPublisherItem *item);

Unpublishes item so that it can no longer be found in the network.

publisher :

A InfLocalPublisher.

item :

A published item obtained from inf_local_publisher_publish().
libinfinity-0.5.5/docs/reference/libinfinity/html/InfIpAddress.html0000644000175000017500000005156512264766270022365 00000000000000 InfIpAddress

InfIpAddress

InfIpAddress — IPv4 and IPv6 addresses

Stability Level

Unstable, unless otherwise indicated

Object Hierarchy

  GBoxed
   +----InfIpAddress
  GEnum
   +----InfIpAddressFamily

Description

A InfIpAddress represents an IPv4 or an IPv6 network address. Use inf_ip_address_get_family() to find out the type of a specific address.

Details

InfIpAddress

typedef struct _InfIpAddress InfIpAddress;

InfIpAddress is an opaque data type. You should only access it via the public API functions.


enum InfIpAddressFamily

typedef enum {
  INF_IP_ADDRESS_IPV4,
  INF_IP_ADDRESS_IPV6
} InfIpAddressFamily;

This enumeration specifies different types of IP addresses.

INF_IP_ADDRESS_IPV4

This specifies an IPv4 address.

INF_IP_ADDRESS_IPV6

This specifies an IPv6 address.

inf_ip_address_new_raw4 ()

InfIpAddress *      inf_ip_address_new_raw4             (guint32 address);

Creates a new IPv4 address.

address :

An IPv4 address in network byte order.

Returns :

A new InfIpAddress.

inf_ip_address_new_loopback4 ()

InfIpAddress *      inf_ip_address_new_loopback4        (void);

Creates a new IPv4 address that contains the local host's IP address ("127.0.0.1").

Returns :

A new InfIpAddress.

inf_ip_address_new_raw6 ()

InfIpAddress *      inf_ip_address_new_raw6             (const guint8 address[16]);

Creates a new IPv6 address.

address :

An IPv6 address in network bype order.

Returns :

A new InfIpAddress.

inf_ip_address_new_loopback6 ()

InfIpAddress *      inf_ip_address_new_loopback6        (void);

Creates a new IPv6 address that contains the local host's IP address ("::1").

Returns :

A new InfIpAddress.

inf_ip_address_new_from_string ()

InfIpAddress *      inf_ip_address_new_from_string      (const gchar *str);

Creates a new IP address (either IPv4 or IPv6) from the given string.

str :

A string containing an IPv4 or IPv6 address in standard dots notation.

Returns :

A new InfIpAddress, or NULL.

inf_ip_address_copy ()

InfIpAddress *      inf_ip_address_copy                 (const InfIpAddress *address);

Creates a new InfIpAddress that contains the same address as address.

address :

A InfIpAddress.

Returns :

A new InfIpAddress.

inf_ip_address_free ()

void                inf_ip_address_free                 (InfIpAddress *address);

Frees address.

address :

A InfIpAddress.

inf_ip_address_get_family ()

InfIpAddressFamily  inf_ip_address_get_family           (const InfIpAddress *address);

Returns the address family of address.

address :

A InfIpAddress.

Returns :

A InfIpAddressFamily.

inf_ip_address_get_raw ()

gconstpointer       inf_ip_address_get_raw              (const InfIpAddress *address);

Returns either 32 bit (IPv4) or 128 bit (IPv6) raw address data in host byte order of address.

address :

A InfIpAddress.

Returns :

The raw address.

inf_ip_address_to_string ()

gchar *             inf_ip_address_to_string            (const InfIpAddress *address);

Returns a string representation of address in standard dots format (like "192.168.0.1" or "::1").

address :

A InfIpAddress.

Returns :

A newly-allocated string. Free with g_free().

inf_ip_address_collate ()

int                 inf_ip_address_collate              (const InfIpAddress *address1,
                                                         const InfIpAddress *address2);

Compares the two addresses for sorting.

address1 :

First address.

address2 :

Second address.

Returns :

-1 if address1 compares before, 0 if it compares equal or 1 if it compares after address.

See Also

InfTcpConnection
libinfinity-0.5.5/docs/reference/libinfinity/html/libinfinity-0.5-InfdNotePlugin.html0000644000175000017500000000616112264766270025545 00000000000000 InfdNotePlugin

InfdNotePlugin

InfdNotePlugin

Synopsis

struct              InfdNotePlugin;

Description

Details

struct InfdNotePlugin

struct InfdNotePlugin {
  gpointer user_data;

  /* The typename of the storage backend this plugin can be used with, such
   * as InfdFilesystemStorage. */
  const gchar* storage_type;

  /* The note type this plugin handles, such as InfText */
  const gchar* note_type;

  InfdNotePluginSessionNew session_new;
  InfdNotePluginSessionRead session_read;
  InfdNotePluginSessionWrite session_write;
};

libinfinity-0.5.5/docs/reference/libinfinity/html/InfAdoptedSessionReplay.html0000644000175000017500000006335512264766270024610 00000000000000 InfAdoptedSessionReplay

InfAdoptedSessionReplay

InfAdoptedSessionReplay — Replay a record of a session

Stability Level

Unstable, unless otherwise indicated

Object Hierarchy

  GObject
   +----InfAdoptedSessionReplay

Properties

  "filename"                 gchar*                : Read
  "session"                  InfAdoptedSession*    : Read

Description

InfAdoptedSessionReplay can be used to replay a record created with InfAdoptedSessionRecord.

Use inf_adopted_session_replay_set_record() to specify the recording to replay, and then use inf_adopted_session_replay_get_session() to obtain the replayed session.

Details

enum InfAdoptedSessionReplayError

typedef enum {
  INF_ADOPTED_SESSION_REPLAY_ERROR_BAD_FILE,
  INF_ADOPTED_SESSION_REPLAY_ERROR_BAD_XML,
  INF_ADOPTED_SESSION_REPLAY_ERROR_BAD_DOCUMENT,
  INF_ADOPTED_SESSION_REPLAY_ERROR_BAD_SESSION_TYPE,
  INF_ADOPTED_SESSION_REPLAY_ERROR_BAD_FORMAT,
  INF_ADOPTED_SESSION_REPLAY_ERROR_UNEXPECTED_EOF
} InfAdoptedSessionReplayError;

Error codes for the INF_ADOPTED_SESSION_REPLAY_ERROR error domain. These can occur while loading or replaying a session with InfAdoptedSessionReplay.

INF_ADOPTED_SESSION_REPLAY_ERROR_BAD_FILE

The record file could not be opened for reading.

INF_ADOPTED_SESSION_REPLAY_ERROR_BAD_XML

The record file contains invalid XML.

INF_ADOPTED_SESSION_REPLAY_ERROR_BAD_DOCUMENT

The record file is not a session recording.

INF_ADOPTED_SESSION_REPLAY_ERROR_BAD_SESSION_TYPE

The record file is a session recording for a different type of session than the one provided.

INF_ADOPTED_SESSION_REPLAY_ERROR_BAD_FORMAT

The record file is invalid.

INF_ADOPTED_SESSION_REPLAY_ERROR_UNEXPECTED_EOF

More data was expected to be read from the record file, but the end of file was reached.

InfAdoptedSessionReplay

typedef struct _InfAdoptedSessionReplay InfAdoptedSessionReplay;

InfAdoptedSessionReplay is an opaque data type. You should only access it via the public API functions.


struct InfAdoptedSessionReplayClass

struct InfAdoptedSessionReplayClass {
};

This structure does not contain any public fields.


inf_adopted_session_replay_new ()

InfAdoptedSessionReplay * inf_adopted_session_replay_new
                                                        (void);

Creates a new InfAdoptedSessionReplay. Use inf_adopted_session_replay_set_record() to start the recording, and inf_adopted_session_replay_play_next() or inf_adopted_session_replay_play_to_end() to play it.

Returns :

A new InfAdoptedSessionReplay. Free with g_object_unref() when no longer in use.

inf_adopted_session_replay_set_record ()

gboolean            inf_adopted_session_replay_set_record
                                                        (InfAdoptedSessionReplay *replay,
                                                         const gchar *filename,
                                                         const InfcNotePlugin *plugin,
                                                         GError **error);

Set the record file for replay to play. It should have been created with InfAdoptedSessionRecord. plugin should match the type of the recorded session. If an error occurs, the function returns FALSE and error is set.

replay :

A InfAdoptedSessionReplay.

filename :

Path to the record file to play.

plugin :

A InfcNotePlugin for the note type of the recorded session.

error :

Location to store error information, if any.

Returns :

TRUE on success, or FALSE if the record file could not be set.

inf_adopted_session_replay_get_session ()

InfAdoptedSession * inf_adopted_session_replay_get_session
                                                        (InfAdoptedSessionReplay *replay);

Returns the played back session, or NULL if inf_adopted_session_replay_set_record() was not yet called.

replay :

A InfAdoptedSessionReplay.

Returns :

A InfAdoptedSessionReplay, or NULL.

inf_adopted_session_replay_play_next ()

gboolean            inf_adopted_session_replay_play_next
                                                        (InfAdoptedSessionReplay *replay,
                                                         GError **error);

Reads the next request from the record and passes it to the session. Note that this might do nothing if that request is not yet causally ready, meaning that it depends on another request that has not yet been played. In that case it will be executed as soon as it is ready, that is after some future inf_adopted_session_replay_play_next() call. Therefore, it is also possible that this function executes more than one request.

If an error occurs, then this function returns FALSE and error is set. If the end of the recording is reached, then it also returns FALSE, but error is left untouched. If the next request has been read, then it returns TRUE.

replay :

A InfAdoptedSessionReplay.

error :

Location to store error information, if any.

Returns :

TRUE if a request was read, otherwise FALSE.

inf_adopted_session_replay_play_to_end ()

gboolean            inf_adopted_session_replay_play_to_end
                                                        (InfAdoptedSessionReplay *replay,
                                                         GError **error);

Plays all requests that are contained in the recording, so that the replay's session has the same state as the recorded session when the recording was stopped.

Note that, depending on the size of the record, this function may take some time to finish.

If an error occurs during replay, then the function returns FALSE and error is set. Otherwise it returns TRUE.

replay :

A InfAdoptedSessionReplay.

error :

Location to store error information, if any.

Returns :

TRUE on success, or FALSE if an error occurs.

Property Details

The "filename" property

  "filename"                 gchar*                : Read

The filename of the record to play.

Default value: NULL


The "session" property

  "session"                  InfAdoptedSession*    : Read

The replayed session.

libinfinity-0.5.5/docs/reference/libinfinity/html/InfCommunicationFactory.html0000644000175000017500000004042112264766270024631 00000000000000 InfCommunicationFactory

InfCommunicationFactory

InfCommunicationFactory — Creation of communication methods

Stability Level

Unstable, unless otherwise indicated

Synopsis

#include <libinfinity/communication/inf-communication-factory.h>

                    InfCommunicationFactory;
struct              InfCommunicationFactoryIface;
gboolean            inf_communication_factory_supports_method
                                                        (InfCommunicationFactory *factory,
                                                         const gchar *network,
                                                         const gchar *method_name);
InfCommunicationMethod * inf_communication_factory_instantiate
                                                        (InfCommunicationFactory *factory,
                                                         const gchar *network,
                                                         const gchar *method_name,
                                                         InfCommunicationRegistry *registry,
                                                         InfCommunicationGroup *group);

Object Hierarchy

  GInterface
   +----InfCommunicationFactory

Prerequisites

InfCommunicationFactory requires GObject.

Known Implementations

InfCommunicationFactory is implemented by InfCommunicationCentralFactory.

Description

A InfCommunicationFactory is used by the communication manager to create InfCommunicationMethods. All a factory has to do is to tell whether it supports a specific network and method name combination, and create a corresponding InfCommunicationMethod if it does.

InfCommunicationFactorys are added to a communication manager via inf_communication_manager_add_factory(). The communication manager will automatically use the factory if it needs to create a method it supports.

Details

InfCommunicationFactory

typedef struct _InfCommunicationFactory InfCommunicationFactory;

InfCommunicationFactory is an opaque data type. You should only access it via the public API functions.


struct InfCommunicationFactoryIface

struct InfCommunicationFactoryIface {
  gboolean (*supports_method)(InfCommunicationFactory* factory,
                              const gchar* network,
                              const gchar* method_name);

  InfCommunicationMethod* (*instantiate)(InfCommunicationFactory* factory,
                                         const gchar* network,
                                         const gchar* method_name,
                                         InfCommunicationRegistry* registry,
                                         InfCommunicationGroup* group);
};

The virtual methods of InfCommunicationFactory. These handle instantiating a InfCommunicationMethod for a InfCommunicationGroup.

supports_method ()

Returns whether the given method_name is supported for the network in question by the factory.

instantiate ()

Instantiates a communication method for the given method name, handling communication for the passed group.

inf_communication_factory_supports_method ()

gboolean            inf_communication_factory_supports_method
                                                        (InfCommunicationFactory *factory,
                                                         const gchar *network,
                                                         const gchar *method_name);

Returns whether factory supports creating methods that implement method_name as communication method for connections on network (see "network").

factory :

A InfCommunicationFactory.

network :

A network specifier, such as "tcp/ip" or "jabber".

method_name :

A method identifier, such as "central" or "groupchat".

Returns :

Whether factory supports the given network and method name.

inf_communication_factory_instantiate ()

InfCommunicationMethod * inf_communication_factory_instantiate
                                                        (InfCommunicationFactory *factory,
                                                         const gchar *network,
                                                         const gchar *method_name,
                                                         InfCommunicationRegistry *registry,
                                                         InfCommunicationGroup *group);

Creates a new InfCommunicationMethod for network and method_name. The factory needs to support that method, see inf_communication_factory_supports_method().

factory :

A InfCommunicationFactory.

network :

A network specifier, such as "tcp/ip" or "jabber".

method_name :

A method identifier, such as "central" or "groupchat".

registry :

A InfCommunicationRegistry at which the created method can register connections.

group :

The InfCommunicationGroup for which to create the method.

Returns :

A new InfCommunicationMethod.
libinfinity-0.5.5/docs/reference/libinfinity/html/InfCommunicationObject.html0000644000175000017500000005147512264766270024443 00000000000000 InfCommunicationObject

InfCommunicationObject

InfCommunicationObject — Network message destinations

Stability Level

Unstable, unless otherwise indicated

Synopsis

#include <libinfinity/communication/inf-communication-object.h>

enum                InfCommunicationScope;
                    InfCommunicationObject;
struct              InfCommunicationObjectIface;
InfCommunicationScope inf_communication_object_received (InfCommunicationObject *object,
                                                         InfXmlConnection *conn,
                                                         xmlNodePtr node,
                                                         GError **error);
void                inf_communication_object_enqueued   (InfCommunicationObject *object,
                                                         InfXmlConnection *conn,
                                                         xmlNodePtr node);
void                inf_communication_object_sent       (InfCommunicationObject *object,
                                                         InfXmlConnection *conn,
                                                         xmlNodePtr node);

Object Hierarchy

  GEnum
   +----InfCommunicationScope
  GInterface
   +----InfCommunicationObject

Prerequisites

InfCommunicationObject requires GObject.

Known Implementations

InfCommunicationObject is implemented by InfAdoptedSession, InfChatSession, InfSession, InfcBrowser, InfcSessionProxy, InfdDirectory and InfdSessionProxy.

Description

A InfCommunicationObject is the destination of network messages sent through the InfCommunicationManager. Each InfCommunicationGroup is associated with InfCommunicationObject. Requests received by that group are reported to the InfCommunicationObject by calling inf_communication_object_received() on it. Messages sent to a member of that group (via inf_communication_group_send_message()) are also reported by calling inf_communication_object_sent().

Details

enum InfCommunicationScope

typedef enum {
  INF_COMMUNICATION_SCOPE_PTP,
  INF_COMMUNICATION_SCOPE_GROUP
} InfCommunicationScope;

InfCommunicationScope specifies to which hosts a message belongs.

INF_COMMUNICATION_SCOPE_PTP

The message is sent from one group member to another.

INF_COMMUNICATION_SCOPE_GROUP

The message is sent to all group members.

InfCommunicationObject

typedef struct _InfCommunicationObject InfCommunicationObject;

InfCommunicationObject is an opaque data type. You should only access it via the public API functions.


struct InfCommunicationObjectIface

struct InfCommunicationObjectIface {
  InfCommunicationScope (*received)(InfCommunicationObject* object,
                                    InfXmlConnection* conn,
                                    xmlNodePtr node,
                                    GError** error);

  void (*enqueued)(InfCommunicationObject* object,
                   InfXmlConnection* conn,
                   xmlNodePtr node);

  void (*sent)(InfCommunicationObject* object,
               InfXmlConnection* conn,
               xmlNodePtr node);
};

The virtual methods of InfCommunicationObject. These are called by the InfCommunicationMethod when appropriate.

received ()

Called when a message for the group related to this InfCommunicationObject was received.

enqueued ()

Called when a message to be sent to another group member has been enqueued, which means sending it can no longer be cancelled via inf_communication_group_cancel_messages().

sent ()

Called when a message has been sent to another group member of the group related no this InfCommunicationObject.

inf_communication_object_received ()

InfCommunicationScope inf_communication_object_received (InfCommunicationObject *object,
                                                         InfXmlConnection *conn,
                                                         xmlNodePtr node,
                                                         GError **error);

This function is called when a InfCommunicationManager received data from connection belonging to a group whose communication object is object. This function should process the incoming data. If it could not process it, then it should set error.

It should return INF_COMMUNICATION_SCOPE_GROUP if the message is allowed to be forwarded to other group members. Since recipients of forwarded messages don't see the original sender (but just the forwarding host), forwarding arbitrary messages could lead to a security problem in the worst case.

For example, if, in central mode, a client sends an (invalid) <add-node> request to the whole (InfDirectory) group, and the server forwarded this to all clients, those clients would try to create a new node although the server rejected the request. In decentral mode, this is not a problem since all clients see where the message comes from, and can themselves reject all messages not coming from the server.

object :

A InfCommunicationObject.

conn :

The InfXmlConnection data was received from.

node :

The received data.

error :

Location to store error information, if any.

Returns :

INF_COMMUNICATION_SCOPE_GROUP if the message is allowed to be forwarded, INF_COMMUNICATION_SCOPE_PTP if not.

inf_communication_object_enqueued ()

void                inf_communication_object_enqueued   (InfCommunicationObject *object,
                                                         InfXmlConnection *conn,
                                                         xmlNodePtr node);

This function is called, when an XML message scheduled to be sent via inf_communication_group_send_message() or inf_communication_group_send_group_message() cannot be cancelled anymore, because it was already passed to conn.

object :

A InfCommunicationObject.

conn :

A InfXmlConnection.

node :

The XML data.

inf_communication_object_sent ()

void                inf_communication_object_sent       (InfCommunicationObject *object,
                                                         InfXmlConnection *conn,
                                                         xmlNodePtr node);

This function is called when a XML message sent via inf_communication_group_send_message() or inf_communication_group_send_group_message() has actually been sent out.

object :

A InfCommunicationObject.

conn :

A InfXmlConnection.

node :

The sent data.
libinfinity-0.5.5/docs/reference/libinfinity/html/home.png0000644000175000017500000000107512264766270020611 00000000000000‰PNG  IHDRשÍÊðPLTEÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ  $$$(((,,,000888<<<@@@OOOPPP[[[___```lll{{{€€€‹‹‹£££¯¯¯¿¿¿ÃÃÃÇÇÇÏÏÏÓÓÓÛÛÛßßßãããëëëïïïóóó÷÷÷ÿÿÿÕ?“*tRNS  $(,4@GKSghkotw‡‹›Ÿ«·»¿ÃËÏÓÛßçïó÷ûa7™ÞÒIDATx­Í[7†@Æñ^EÈù ”b'…qˆ!DŒdÿocD™Y±– ¿ËçñÀŒÌÎÃ&}¢Ðž°,sTÓa}y&èC`+ûÂþ CLn9¿ÁP;«ô˜ aÆsûÚ.Ýà'Aç2t·7غª» o/ð;ÎÉén5iI+Ì4·ºøž–a£Š±¯ô`í-;Å#®`ȲWÌrRäXÐÞÀ`§vGAÚìþ?¤\qÒ†õ*BMôä5aŽD¡y¦%h8[¾f{р߽C‰VF3‹ÔIEND®B`‚libinfinity-0.5.5/docs/reference/libinfinity/html/style.css0000644000175000017500000001210012264766270021014 00000000000000.synopsis, .classsynopsis { /* tango:aluminium 1/2 */ background: #eeeeec; border: solid 1px #d3d7cf; padding: 0.5em; } .programlisting { /* tango:sky blue 0/1 */ background: #e6f3ff; border: solid 1px #729fcf; padding: 0.5em; } .variablelist { padding: 4px; margin-left: 3em; } .variablelist td:first-child { vertical-align: top; } @media screen { sup a.footnote { position: relative; top: 0em ! important; } /* this is needed so that the local anchors are displayed below the naviagtion */ div.footnote a[name], div.refnamediv a[name], div.refsect1 a[name], div.refsect2 a[name], div.index a[name], div.glossary a[name], div.sect1 a[name] { display: inline-block; position: relative; top:-5em; } /* this seems to be a bug in the xsl style sheets when generating indexes */ div.index div.index { top: 0em; } /* make space for the fixed navigation bar and add space at the bottom so that * link targets appear somewhat close to top */ body { padding-top: 3.2em; padding-bottom: 20em; } /* style and size the navigation bar */ table.navigation#top { position: fixed; /* tango:scarlet red 0/1 */ background: #ffe6e6; border: solid 1px #ef2929; margin-top: 0; margin-bottom: 0; top: 0; left: 0; height: 3em; z-index: 10; } .navigation a, .navigation a:visited { /* tango:scarlet red 3 */ color: #a40000; } .navigation a:hover { /* tango:scarlet red 1 */ color: #ef2929; } td.shortcuts { /* tango:scarlet red 1 */ color: #ef2929; font-size: 80%; white-space: nowrap; } } @media print { table.navigation { visibility: collapse; display: none; } div.titlepage table.navigation { visibility: visible; display: table; /* tango:scarlet red 0/1 */ background: #ffe6e6; border: solid 1px #ef2929; margin-top: 0; margin-bottom: 0; top: 0; left: 0; height: 3em; } } .navigation .title { font-size: 200%; } div.gallery-float { float: left; padding: 10px; } div.gallery-float img { border-style: none; } div.gallery-spacer { clear: both; } a, a:visited { text-decoration: none; /* tango:sky blue 2 */ color: #3465a4; } a:hover { text-decoration: underline; /* tango:sky blue 1 */ color: #729fcf; } div.table table { border-collapse: collapse; border-spacing: 0px; /* tango:aluminium 3 */ border: solid 1px #babdb6; } div.table table td, div.table table th { /* tango:aluminium 3 */ border: solid 1px #babdb6; padding: 3px; vertical-align: top; } div.table table th { /* tango:aluminium 2 */ background-color: #d3d7cf; } hr { /* tango:aluminium 3 */ color: #babdb6; background: #babdb6; border: none 0px; height: 1px; clear: both; } .footer { padding-top: 3.5em; /* tango:aluminium 3 */ color: #babdb6; text-align: center; font-size: 80%; } .warning { /* tango:orange 0/1 */ background: #ffeed9; border-color: #ffb04f; } .note { /* tango:chameleon 0/0.5 */ background: #d8ffb2; border-color: #abf562; } .note, .warning { padding: 0.5em; border-width: 1px; border-style: solid; } .note h3, .warning h3 { margin-top: 0.0em } .note p, .warning p { margin-bottom: 0.0em } /* blob links */ h2 .extralinks, h3 .extralinks { float: right; /* tango:aluminium 3 */ color: #babdb6; font-size: 80%; font-weight: normal; } .annotation { /* tango:aluminium 5 */ color: #555753; font-size: 80%; font-weight: normal; } /* code listings */ .listing_code .programlisting .cbracket { color: #a40000; } /* tango: scarlet red 3 */ .listing_code .programlisting .comment { color: #a1a39d; } /* tango: aluminium 4 */ .listing_code .programlisting .function { color: #000000; font-weight: bold; } .listing_code .programlisting .function a { color: #11326b; font-weight: bold; } /* tango: sky blue 4 */ .listing_code .programlisting .keyword { color: #4e9a06; } /* tango: chameleon 3 */ .listing_code .programlisting .linenum { color: #babdb6; } /* tango: aluminium 3 */ .listing_code .programlisting .normal { color: #000000; } .listing_code .programlisting .number { color: #75507b; } /* tango: plum 2 */ .listing_code .programlisting .preproc { color: #204a87; } /* tango: sky blue 3 */ .listing_code .programlisting .string { color: #c17d11; } /* tango: chocolate 2 */ .listing_code .programlisting .type { color: #000000; } .listing_code .programlisting .type a { color: #11326b; } /* tango: sky blue 4 */ .listing_code .programlisting .symbol { color: #ce5c00; } /* tango: orange 3 */ .listing_frame { /* tango:sky blue 1 */ border: solid 1px #729fcf; padding: 0px; } .listing_lines, .listing_code { margin-top: 0px; margin-bottom: 0px; padding: 0.5em; } .listing_lines { /* tango:sky blue 0.5 */ background: #a6c5e3; /* tango:aluminium 6 */ color: #2e3436; } .listing_code { /* tango:sky blue 0 */ background: #e6f3ff; } .listing_code .programlisting { /* override from previous */ border: none 0px; padding: 0px; } .listing_lines pre, .listing_code pre { margin: 0px; } libinfinity-0.5.5/docs/reference/libinfinity/html/ch04.html0000644000175000017500000000557012264766270020603 00000000000000 Libinfinity client side API

Libinfinity client side API

InfcBrowser — Browse remote directories
InfcBrowserIter — Iterating through browsed nodes
InfcNotePlugin
InfcSessionProxy
InfcExploreRequest — Watch progess of node exploration
InfcNodeRequest
InfcUserRequest
InfcRequest — Requests sent to server
InfcRequestManager
libinfinity-0.5.5/docs/reference/libinfinity/html/InfdSessionProxy.html0000644000175000017500000007276212264766270023342 00000000000000 InfdSessionProxy

InfdSessionProxy

InfdSessionProxy

Object Hierarchy

  GObject
   +----InfdSessionProxy

Implemented Interfaces

InfdSessionProxy implements InfCommunicationObject.

Properties

  "idle"                     gboolean              : Read
  "session"                  InfSession*           : Read / Write / Construct Only
  "subscription-group"       InfCommunicationHostedGroup*  : Read / Write / Construct Only

Description

Details

InfdSessionProxy

typedef struct _InfdSessionProxy InfdSessionProxy;


struct InfdSessionProxyClass

struct InfdSessionProxyClass {
  GObjectClass parent_class;

  /* Signals */
  void (*add_subscription)(InfdSessionProxy* proxy,
                           InfXmlConnection* connection,
                           guint seq_id);

  void (*remove_subscription)(InfdSessionProxy* proxy,
                              InfXmlConnection* connection);
};


infd_session_proxy_get_session ()

InfSession *        infd_session_proxy_get_session      (InfdSessionProxy *proxy);

Returns the session proxied by proxy. Returns NULL if the session was closed.

proxy :

A InfdSessionProxy.

Returns :

A InfSession, or NULL.

infd_session_proxy_add_user ()

InfUser *           infd_session_proxy_add_user         (InfdSessionProxy *proxy,
                                                         const GParameter *params,
                                                         guint n_params,
                                                         GError **error);

Adds a local user to proxy's session. params must not contain the 'id' property because it will be choosen by the proxy. Also, if the 'name' property is already in use by an existing, but unavailable user, this user will be re-used.

proxy :

A InfdSessionProxy.

params :

Construction properties for the InfUser (or derived) object.

n_params :

Number of parameters.

error :

Location to store error information.

Returns :

The InfUser that has been added, or NULL in case of an error.

infd_session_proxy_subscribe_to ()

void                infd_session_proxy_subscribe_to     (InfdSessionProxy *proxy,
                                                         InfXmlConnection *connection,
                                                         guint seq_id,
                                                         gboolean synchronize);

Subscribes connection to proxy's session. The first thing that will be done is a synchronization (see inf_session_synchronize_to()). Then, all changes to the session are propagated to connection.

seq_id should be a unique number for connection, and the same number must be passed on the client side to the InfcSessionProxy object. Normally InfdDirectory and InfcBrowser take care of choosing an appropriate sequence identifier.

Normally, you want to set synchronize to TRUE in which case the whole session state will be synchronized to connection (within the subscription group). However, if for whatever reason the remote site already has a copy of the session, then you may set synchronize to FALSE to skip synchronization. This happens for example for newly created documents, or when the remote site synchronized the local site and wants to be initially subscribed.

If proxy's session is not in INF_SESSION_RUNNING status, but in INF_SESSION_SYNCHRONIZING, then connection must be the connection that synchronizes the session and synchronize needs to be set to FALSE. This causes the synchronizing connection to initially be subscribed. This needs to be called directly after having created the session proxy (i.e. without returning to the main loop before) so that the synchronization connection is added to the subscription group for synchronization.

Otherwise a subscription can only be initiated if proxy's session is in state INF_SESSION_RUNNING.

proxy :

A InfdSessionProxy.

connection :

A InfXmlConnection that is not yet subscribed.

seq_id :

The sequence identifier for connection.

synchronize :

If TRUE, then synchronize the session to connection first.

infd_session_proxy_has_subscriptions ()

gboolean            infd_session_proxy_has_subscriptions
                                                        (InfdSessionProxy *proxy);

Returns whether there are subscribed connections to the session.

proxy :

A InfdSessionProxy.

Returns :

Whether there are subscribed connections.

infd_session_proxy_is_subscribed ()

gboolean            infd_session_proxy_is_subscribed    (InfdSessionProxy *proxy,
                                                         InfXmlConnection *connection);

Returns TRUE when connection is subscribed to the session and FALSE otherwise.

proxy :

A InfdSessionProxy.

connection :

The connection to check for being subscribed.

Returns :

Whether connection is subscribed.

infd_session_proxy_is_idle ()

gboolean            infd_session_proxy_is_idle          (InfdSessionProxy *proxy);

Returns whether the session is idle. The session is considered idle when there are no subscriptions and no synchronizations (in either direction).

proxy :

A InfdSessionProxy.

Returns :

Whether the session is idle.

Property Details

The "idle" property

  "idle"                     gboolean              : Read

The session is considered idle when are no subscriptions and no synchronizations.

Default value: TRUE


The "session" property

  "session"                  InfSession*           : Read / Write / Construct Only

The underlying session.


The "subscription-group" property

  "subscription-group"       InfCommunicationHostedGroup*  : Read / Write / Construct Only

The communication manager group of subscribed connections.

Signal Details

The "add-subscription" signal

void                user_function                      (InfdSessionProxy *proxy,
                                                        InfXmlConnection *connection,
                                                        guint             seq_id,
                                                        gpointer          user_data)       : Run Last

Emitted every time a connection is subscribed to the session.

proxy :

The InfdSessionProxy emitting the signal.

connection :

The subscribed InfXmlConnection.

seq_id :

The sequence identifier for connection as passed to infd_session_proxy_subscribe_to().

user_data :

user data set when the signal handler was connected.

The "remove-subscription" signal

void                user_function                      (InfdSessionProxy *proxy,
                                                        InfXmlConnection *connection,
                                                        gpointer          user_data)       : Run Last

Emitted every time a connection is unsubscribed to the session, or a subscription is removed because the session is closed.

proxy :

The InfdSessionProxy emitting the signal.

connection :

The unsubscribed InfXmlConnection.

user_data :

user data set when the signal handler was connected.
libinfinity-0.5.5/docs/reference/libinfinity/html/InfcUserRequest.html0000644000175000017500000001654012264766270023133 00000000000000 InfcUserRequest

InfcUserRequest

InfcUserRequest

Object Hierarchy

  GObject
   +----InfcRequest
         +----InfcUserRequest

Signals

  "finished"                                       : Run Last

Description

Details

InfcUserRequest

typedef struct _InfcUserRequest InfcUserRequest;


struct InfcUserRequestClass

struct InfcUserRequestClass {
  InfcRequestClass parent_class;

  /* Signals */
  void (*finished)(InfcUserRequest* request,
                   InfUser* user);
};


infc_user_request_finished ()

void                infc_user_request_finished          (InfcUserRequest *request,
                                                         InfUser *user);

Emits the "finished" signal on request.

request :

A InfcUserRequest.

user :

The InfUser affected by the request.

Signal Details

The "finished" signal

void                user_function                      (InfcUserRequest *infcuserrequest,
                                                        InfUser         *arg1,
                                                        gpointer         user_data)            : Run Last

infcuserrequest :

the object which received the signal.

user_data :

user data set when the signal handler was connected.
libinfinity-0.5.5/docs/reference/libinfinity/html/InfcRequestManager.html0000644000175000017500000012472112264766270023570 00000000000000 InfcRequestManager

InfcRequestManager

InfcRequestManager

Object Hierarchy

  GObject
   +----InfcRequestManager

Properties

  "sequence-id"              guint                 : Read / Write / Construct Only

Description

Details

InfcRequestManagerForeachFunc ()

void                (*InfcRequestManagerForeachFunc)    (InfcRequest *Param1,
                                                         gpointer Param2);


InfcRequestManager

typedef struct _InfcRequestManager InfcRequestManager;


struct InfcRequestManagerClass

struct InfcRequestManagerClass {
  GObjectClass parent_class;

  void (*request_add)(InfcRequestManager* manager,
                      InfcRequest* request);
  void (*request_remove)(InfcRequestManager* manager,
                         InfcRequest* request);
};


infc_request_manager_new ()

InfcRequestManager * infc_request_manager_new           (guint seq_id);

Creates a new InfcRequestManager.

seq_id :

The local sequence ID.

Returns :

A newly allocated InfcRequestManager.

infc_request_manager_add_request ()

InfcRequest *       infc_request_manager_add_request    (InfcRequestManager *manager,
                                                         GType request_type,
                                                         const gchar *request_name,
                                                         const gchar *first_property_name,
                                                         ...);

Adds a request to the request manager.

manager :

A InfcRequestManager.

request_type :

The type of request to add, such as INFC_TYPE_NODE_REQUEST.

request_name :

The name of the request, such as "explore-node" or "subscribe-session".

first_property_name :

The first property name apart from name and seq to set for the new request.

... :

The value of the first property, followed optionally by more name/value pairs, followed by NULL.

Returns :

The generated InfcRequest (actually of type request_type).

infc_request_manager_add_request_valist ()

InfcRequest *       infc_request_manager_add_request_valist
                                                        (InfcRequestManager *manager,
                                                         GType request_type,
                                                         const gchar *request_name,
                                                         const gchar *first_property_name,
                                                         va_list arglist);

Adds a request to the request manager.

manager :

A InfcRequestManager.

request_type :

The type of request to add, such as INFC_TYPE_NODE_REQUEST.

request_name :

The name of the request, such as "explore-node" or "subscribe-session"

first_property_name :

The first property name apart from name and seq to set for the new request.

arglist :

The value of the first property, followed optionally by more name/value pairs, followed by NULL.

Returns :

The generated InfcRequest (actually of type request_type).

infc_request_manager_remove_request ()

void                infc_request_manager_remove_request (InfcRequestManager *manager,
                                                         InfcRequest *request);

Removes a request from the request manager.

manager :

A InfcRequestManager.

request :

A InfcRequest that has previously been added to manager.

infc_request_manager_fail_request ()

void                infc_request_manager_fail_request   (InfcRequestManager *manager,
                                                         InfcRequest *request,
                                                         GError *error);

Emits the "failed" signal on request and then removes the request from the manager.

manager :

A InfcRequestManager.

request :

A InfcRequest that has previously been added to manager.

error :

Error information why the request failed.

infc_request_manager_clear ()

void                infc_request_manager_clear          (InfcRequestManager *manager);

Removes all the requests in manager.

manager :

A InfcRequestManager.

infc_request_manager_get_request_by_seq ()

InfcRequest *       infc_request_manager_get_request_by_seq
                                                        (InfcRequestManager *manager,
                                                         guint seq);

Returns a previously-added request that has the given seq.

manager :

A InfcRequestManager.

seq :

The sequence number to which the request should be retrieved.

Returns :

The request with the given seq, or NULL if there is no such request.

infc_request_manager_get_request_by_xml ()

InfcRequest *       infc_request_manager_get_request_by_xml
                                                        (InfcRequestManager *manager,
                                                         const gchar *name,
                                                         xmlNodePtr xml,
                                                         GError **error);

Looks whether there is a "seq" attribute in xml. If not, the function returns NULL (without setting error). Otherwise, it returns the request with the given seq and name, if the sequence ID matches. If the "seq" attribute is set but the actual request is not present (or has another name), the function returns NULL and error is set.

manager :

A InfcRequestManager.

name :

Name of the expected request. May be NULL to allow all requests.

xml :

XML node that is supposed to contain a "seq" attribute.

error :

Location to store error information.

Returns :

The resulting request, or NULL if the "seq" attribute was not present or an error occured.

infc_request_manager_get_request_by_xml_required ()

InfcRequest *       infc_request_manager_get_request_by_xml_required
                                                        (InfcRequestManager *manager,
                                                         const gchar *name,
                                                         xmlNodePtr xml,
                                                         GError **error);

Looks whether there is a "seq" attribute in xml. If so, it returns the request with the given seq and name, if the sequence ID matches. If the "seq" attribute is not set or the actual request is not present (or has another name), the function returns NULL and error is set.

manager :

A InfcRequestManager.

name :

Name of the expected request. May be NULL to allow all requests.

xml :

XML node that is supposed to contain a "seq" attribute.

error :

Location to store error information.

Returns :

The resulting request, or NULL if an error occured.

infc_request_manager_foreach_request ()

void                infc_request_manager_foreach_request
                                                        (InfcRequestManager *manager,
                                                         InfcRequestManagerForeachFunc func,
                                                         gpointer user_data);

Calls the given function for each request that has been added to the request manager.

manager :

A InfcRequestManager.

func :

The function to be called.

user_data :

Arbitrary data to be passed to func.

infc_request_manager_foreach_named_request ()

void                infc_request_manager_foreach_named_request
                                                        (InfcRequestManager *manager,
                                                         const gchar *name,
                                                         InfcRequestManagerForeachFunc func,
                                                         gpointer user_data);

Calls the given function for each request that has been added to the request manager that has the name name.

manager :

A InfcRequestManager.

name :

The name of the request to look for.

func :

The function to be called.

user_data :

Arbitrary data to be passed to func.

Property Details

The "sequence-id" property

  "sequence-id"              guint                 : Read / Write / Construct Only

The local sequence identifier.

Default value: 0

Signal Details

The "request-add" signal

void                user_function                      (InfcRequestManager *infcrequestmanager,
                                                        InfcRequest        *arg1,
                                                        gpointer            user_data)               : Run Last

infcrequestmanager :

the object which received the signal.

user_data :

user data set when the signal handler was connected.

The "request-remove" signal

void                user_function                      (InfcRequestManager *infcrequestmanager,
                                                        InfcRequest        *arg1,
                                                        gpointer            user_data)               : Run Last

infcrequestmanager :

the object which received the signal.

user_data :

user data set when the signal handler was connected.
libinfinity-0.5.5/docs/reference/libinfinity/html/InfStandaloneIo.html0000644000175000017500000003170512264766270023061 00000000000000 InfStandaloneIo

InfStandaloneIo

InfStandaloneIo

Object Hierarchy

  GObject
   +----InfStandaloneIo

Implemented Interfaces

InfStandaloneIo implements InfIo.

Description

Details

InfStandaloneIo

typedef struct _InfStandaloneIo InfStandaloneIo;


struct InfStandaloneIoClass

struct InfStandaloneIoClass {
  GObjectClass parent_class;
};


inf_standalone_io_new ()

InfStandaloneIo *   inf_standalone_io_new               (void);

Creates a new InfStandaloneIo.

Returns :

A new InfStandaloneIo. Free with g_object_unref() when no longer needed.

inf_standalone_io_iteration ()

void                inf_standalone_io_iteration         (InfStandaloneIo *io);

Performs a single iteration of io. The call will block until a first event has occured. Then, it will process that event and return.

io :

A InfStandaloneIo.

inf_standalone_io_iteration_timeout ()

void                inf_standalone_io_iteration_timeout (InfStandaloneIo *io,
                                                         guint timeout);

Performs a single iteration of io. The call will block until either an event occured or timeout milliseconds have elapsed. If an event occured, the event will be processed before returning.

io :

A InfStandaloneIo.

timeout :

Maximum number of milliseconds to block.

inf_standalone_io_loop ()

void                inf_standalone_io_loop              (InfStandaloneIo *io);

This call will cause io to wait for events and process them, but not return until inf_standalone_io_loop_quit() is called.

io :

A InfStandaloneIo.

inf_standalone_io_loop_quit ()

void                inf_standalone_io_loop_quit         (InfStandaloneIo *io);

Exits a loop in which io is running through a call to inf_standalone_io_loop().

io :

A InfStandaloneIo.

inf_standalone_io_loop_running ()

gboolean            inf_standalone_io_loop_running      (InfStandaloneIo *io);

Returns whether io runs currently in a loop initiated with inf_standalone_io_loop().

io :

A InfStandaloneIo.

Returns :

Whether io runs in a loop.
libinfinity-0.5.5/docs/reference/libinfinity/html/InfAdoptedOperation.html0000644000175000017500000011122112264766270023732 00000000000000 InfAdoptedOperation

InfAdoptedOperation

InfAdoptedOperation — Operation that can be processed by InfAdoptedAlgorithm.

Stability Level

Unstable, unless otherwise indicated

Object Hierarchy

  GInterface
   +----InfAdoptedOperation
  GFlags
   +----InfAdoptedOperationFlags
  GEnum
   +----InfAdoptedConcurrencyId

Prerequisites

InfAdoptedOperation requires GObject.

Known Implementations

InfAdoptedOperation is implemented by InfAdoptedNoOperation and InfAdoptedSplitOperation.

Description

The InfAdoptedOperation interface must be implemented by operations that are supposed to be used by InfAdoptedAlgorithm. They basically need to define transformation rules for transformation against other operations.

Details

InfAdoptedOperation

typedef struct _InfAdoptedOperation InfAdoptedOperation;

InfAdoptedOperation is an opaque data type. You should only access it via the public API functions.


struct InfAdoptedOperationIface

struct InfAdoptedOperationIface {
  gboolean (*need_concurrency_id)(InfAdoptedOperation* operation,
                                  InfAdoptedOperation* against);

  InfAdoptedConcurrencyId (*get_concurrency_id)(InfAdoptedOperation* op,
                                                InfAdoptedOperation* against);

  InfAdoptedOperation* (*transform)(InfAdoptedOperation* operation,
                                    InfAdoptedOperation* against,
                                    InfAdoptedConcurrencyId concurrency_id);

  InfAdoptedOperation* (*copy)(InfAdoptedOperation* operation);

  InfAdoptedOperationFlags (*get_flags)(InfAdoptedOperation* operation);

  void (*apply)(InfAdoptedOperation* operation,
                InfAdoptedUser* by,
                InfBuffer* buffer);

  InfAdoptedOperation* (*revert)(InfAdoptedOperation* operation);

  InfAdoptedOperation* (*make_reversible)(InfAdoptedOperation* operation,
                                          InfAdoptedOperation* with,
                                          InfBuffer* buffer);
};

need_concurrency_id ()

Virtual function to determine whether a concurrency ID is required to transform operation against against.

get_concurrency_id ()

Virtual function to obtain a concurrency ID for transforming op against against.

transform ()

Virtual function that transform operation against against and

copy ()

get_flags ()

apply ()

revert ()

make_reversible ()


enum InfAdoptedOperationFlags

typedef enum {
  INF_ADOPTED_OPERATION_AFFECTS_BUFFER = 1 << 0,
  INF_ADOPTED_OPERATION_REVERSIBLE = 1 << 1
} InfAdoptedOperationFlags;

Various flags for InfAdoptedOperation.

INF_ADOPTED_OPERATION_AFFECTS_BUFFER

The operation changes the content of the buffer.

INF_ADOPTED_OPERATION_REVERSIBLE

The operation is reversible, which means that inf_adopted_operation_revert() can be called to generate an operation that undoes the effect of the operation.

enum InfAdoptedConcurrencyId

typedef enum {
  INF_ADOPTED_CONCURRENCY_SELF = 1,
  INF_ADOPTED_CONCURRENCY_NONE = 0,
  INF_ADOPTED_CONCURRENCY_OTHER = -1
} InfAdoptedConcurrencyId;

A concurrency ID is used to determine which operation to transform in case two similar operations are transformed against each other.

INF_ADOPTED_CONCURRENCY_SELF

Transform the operation itself.

INF_ADOPTED_CONCURRENCY_NONE

Unspecified which operation to transform.

INF_ADOPTED_CONCURRENCY_OTHER

Transform the other operation.

inf_adopted_operation_need_concurrency_id ()

gboolean            inf_adopted_operation_need_concurrency_id
                                                        (InfAdoptedOperation *operation,
                                                         InfAdoptedOperation *against);

This function returns whether transforming operation against against is not defined unambiguously. In that case, transformation requires a so-called concurrency ID which determines which of the two operations is transformed.

operation :

The InfAdoptedOperation to transform.

against :

The operation to transform against.

Returns :

Whether transformation of operation against against requires a concurrency ID to be defined.

inf_adopted_operation_get_concurrency_id ()

InfAdoptedConcurrencyId inf_adopted_operation_get_concurrency_id
                                                        (InfAdoptedOperation *operation,
                                                         InfAdoptedOperation *against);

This function returns a concurrency ID for transformation of operation against against. It always returns INF_ADOPTED_CONCURRENCY_NONE when inf_adopted_operation_need_concurrency_id() returns TRUE for operation and against (but that's not necessarily true the other way around), since it is not possible to decide which operation to transform without any additional information.

However, the function can be called on the same operations in a previous state. In some cases, a decision can be made based on those previous operations. This can then be used as concurrency ID to call inf_adopted_operation_transform().

Note that the function is antisymmetric. If it returns INF_ADOPTED_CONCURRENCY_SELF, then it returns INF_ADOPTED_CONCURRENCY_OTHER for swapped arguments.

operation :

The InfAdoptedOperation to transform.

against :

The operation to transform against.

Returns :

A concurrency ID between operation and against. Can be INF_ADOPTED_CONCURRENCY_NONE in case no decision can be made.

inf_adopted_operation_transform ()

InfAdoptedOperation * inf_adopted_operation_transform   (InfAdoptedOperation *operation,
                                                         InfAdoptedOperation *against,
                                                         gint concurrency_id);

Performs an inclusion transformation of operation against against, meaning that the effect of against is included in operation.

If inf_adopted_operation_need_concurrency_id() returns TRUE for operation and against, then concurrency_id must not be INF_ADOPTED_CONCURRENCY_NONE. Otherwise, the parameter is ignored.

operation :

The InfAdoptedOperation to transform.

against :

The operation to transform against.

concurrency_id :

The concurrency ID for the transformation.

Returns :

The transformed InfAdoptedOperation, or NULL if the transformation failed.

inf_adopted_operation_copy ()

InfAdoptedOperation * inf_adopted_operation_copy        (InfAdoptedOperation *operation);

Returns a copy of operation.

operation :

The InfAdoptedOperation to copy.

Returns :

A copy of operation.

inf_adopted_operation_get_flags ()

InfAdoptedOperationFlags inf_adopted_operation_get_flags
                                                        (InfAdoptedOperation *operation);

Returns the flags for operation.

operation :

A InfAdoptedOperation.

Returns :

InfAdoptedOperationFlags for operation.

inf_adopted_operation_apply ()

void                inf_adopted_operation_apply         (InfAdoptedOperation *operation,
                                                         InfAdoptedUser *by,
                                                         InfBuffer *buffer);

Applies operation to buffer. The operation is considered to be applied by user by.

operation :

A InfAdoptedOperation.

by :

A InfAdoptedUser.

buffer :

The InfBuffer to apply the operation to.

inf_adopted_operation_is_reversible ()

gboolean            inf_adopted_operation_is_reversible (InfAdoptedOperation *operation);

Returns whether operation is reversible.

operation :

A InfAdoptedOperation.

Returns :

Whether operation is reversible.

inf_adopted_operation_revert ()

InfAdoptedOperation * inf_adopted_operation_revert      (InfAdoptedOperation *operation);

Returns a new InfAdoptedOperation that undoes the effect of operation. If operation and then its reverse operation are applied to a buffer (in that order), the buffer remains unchanged.

operation must be reversible for this function to be called (i.e. inf_adopted_operation_is_reversible() must return TRUE).

operation :

A InfAdoptedOperation.

Returns :

The reverse operation of operation.

inf_adopted_operation_make_reversible ()

InfAdoptedOperation * inf_adopted_operation_make_reversible
                                                        (InfAdoptedOperation *operation,
                                                         InfAdoptedOperation *with,
                                                         InfBuffer *buffer);

Some operations may not be reversible, but can be made reversible with some extra information such as another operation that collected enough information while being transformed, and the current buffer.

This function can only be called when operation is not yet reversible and returns a new operation that has the same effect as operation, but is reversible.

For example, an operation that deletes some range of text in a text editor is not reversible if it only stores the position and length of the range, but can be made reversible when it looks up what there is at that position in the buffer.

operation :

A InfAdoptedOperation.

with :

Another InfAdoptedOperation that emerged from operation by transforming it.

buffer :

A InfBuffer.

Returns :

A reversible InfAdoptedOperation, or NULL if operation cannot be made reversible with the given transformed operation with and buffer.
libinfinity-0.5.5/docs/reference/libinfinity/html/InfCommunicationJoinedGroup.html0000644000175000017500000003063012264766270025450 00000000000000 InfCommunicationJoinedGroup

InfCommunicationJoinedGroup

InfCommunicationJoinedGroup — Communication group opened by a remote host

Stability Level

Unstable, unless otherwise indicated

Object Hierarchy

  GObject
   +----InfCommunicationGroup
         +----InfCommunicationJoinedGroup

Properties

  "method"                   gchar*                : Read / Write / Construct Only
  "publisher"                InfXmlConnection*     : Read / Write / Construct Only

Description

InfCommunicationJoinedGroup represents membership of the local host on a InfCommunicationGroup opened on a remote host.

There is no API to add a member to a joined group. This is because new members can only join via the group's publisher. It is the job of the InfCommunicationMethod to tell the joined group about the new member in which case, the "member-added" signal will be emitted.

Details

InfCommunicationJoinedGroup

typedef struct _InfCommunicationJoinedGroup InfCommunicationJoinedGroup;

InfCommunicationJoinedGroup is an opaque data type. You should only access it via the public API functions.


struct InfCommunicationJoinedGroupClass

struct InfCommunicationJoinedGroupClass {
};

This structure does not contain any public fields.


inf_communication_joined_group_remove_member ()

void                inf_communication_joined_group_remove_member
                                                        (InfCommunicationJoinedGroup *grp,
                                                         InfXmlConnection *connection);

Removes connection as grp's member. On the remote site, the corresponding InfCommunicationGroup needs to be freed (which may be a InfCommunicationJoinedGroup or a InfCommunicationHostedGroup).

grp :

A InfCommunicationJoinedGroup.

connection :

A connection to a member of grp.

inf_communication_joined_group_get_publisher ()

InfXmlConnection *  inf_communication_joined_group_get_publisher
                                                        (InfCommunicationJoinedGroup *g);

Returns a InfXmlConnection to the group's publisher, or NULL if the publisher is no longer a group member.

g :

A InfCommunicationJoinedGroup.

Returns :

A InfXmlConnection, or NULL.

Property Details

The "method" property

  "method"                   gchar*                : Read / Write / Construct Only

The communication method to use for this group.

Default value: NULL


The "publisher" property

  "publisher"                InfXmlConnection*     : Read / Write / Construct Only

A connection to the group's publisher.

libinfinity-0.5.5/docs/reference/libinfinity/html/libinfinity-0.5-InfCertUtil.html0000644000175000017500000003475212264766270025057 00000000000000 InfCertUtil

InfCertUtil

InfCertUtil

Synopsis

GPtrArray *         inf_cert_util_load_file             (const gchar *filename,
                                                         GPtrArray *current,
                                                         GError **error);
gboolean            inf_cert_util_save_file             (gnutls_x509_crt_t *certs,
                                                         guint n_certs,
                                                         const gchar *file,
                                                         GError **error);
int                 inf_cert_util_copy                  (gnutls_x509_crt_t *dest,
                                                         gnutls_x509_crt_t src);
gchar *             inf_cert_util_get_dn_by_oid         (gnutls_x509_crt_t cert,
                                                         const char *oid,
                                                         unsigned int index);
gchar *             inf_cert_util_get_issuer_dn_by_oid  (gnutls_x509_crt_t crt,
                                                         const char *oid,
                                                         unsigned int index);
gchar *             inf_cert_util_get_hostname          (gnutls_x509_crt_t cert);
gchar *             inf_cert_util_get_activation_time   (gnutls_x509_crt_t cert);
gchar *             inf_cert_util_get_expiration_time   (gnutls_x509_crt_t cert);
gchar *             inf_cert_util_get_fingerprint       (gnutls_x509_crt_t cert,
                                                         gnutls_digest_algorithm_t algo);
gchar *             inf_cert_util_get_serial_number     (gnutls_x509_crt_t cert);

Description

Details

inf_cert_util_load_file ()

GPtrArray *         inf_cert_util_load_file             (const gchar *filename,
                                                         GPtrArray *current,
                                                         GError **error);


inf_cert_util_save_file ()

gboolean            inf_cert_util_save_file             (gnutls_x509_crt_t *certs,
                                                         guint n_certs,
                                                         const gchar *file,
                                                         GError **error);


inf_cert_util_copy ()

int                 inf_cert_util_copy                  (gnutls_x509_crt_t *dest,
                                                         gnutls_x509_crt_t src);


inf_cert_util_get_dn_by_oid ()

gchar *             inf_cert_util_get_dn_by_oid         (gnutls_x509_crt_t cert,
                                                         const char *oid,
                                                         unsigned int index);


inf_cert_util_get_issuer_dn_by_oid ()

gchar *             inf_cert_util_get_issuer_dn_by_oid  (gnutls_x509_crt_t crt,
                                                         const char *oid,
                                                         unsigned int index);


inf_cert_util_get_hostname ()

gchar *             inf_cert_util_get_hostname          (gnutls_x509_crt_t cert);


inf_cert_util_get_activation_time ()

gchar *             inf_cert_util_get_activation_time   (gnutls_x509_crt_t cert);


inf_cert_util_get_expiration_time ()

gchar *             inf_cert_util_get_expiration_time   (gnutls_x509_crt_t cert);


inf_cert_util_get_fingerprint ()

gchar *             inf_cert_util_get_fingerprint       (gnutls_x509_crt_t cert,
                                                         gnutls_digest_algorithm_t algo);


inf_cert_util_get_serial_number ()

gchar *             inf_cert_util_get_serial_number     (gnutls_x509_crt_t cert);

libinfinity-0.5.5/docs/reference/libinfinity/html/InfXmppManager.html0000644000175000017500000006007212264766270022717 00000000000000 InfXmppManager

InfXmppManager

InfXmppManager — Reuse existing connections

Stability Level

Unstable, unless otherwise indicated

Object Hierarchy

  GObject
   +----InfXmppManager

Description

InfXmppManager stores InfXmppConnection objects and allows to look them up by the IP address and port number of their underlaying InfTcpConnections. This can be used to reuse existing network connections instead of creating new ones.

Each object which needs to make connections should be passed a InfXmppManager. Then, when making a connection to a certain address/port pair, it should first look in the XMPP manager whether there is already an existing connection to the destination host, via inf_xmpp_manager_lookup_connection_by_address(). If there is, it should use it (maybe reopen it if it is closed). Otherwise, it should create a new connection and it to the XMPP manager via inf_xmpp_manager_add_connection() for others to use.

Details

InfXmppManager

typedef struct _InfXmppManager InfXmppManager;

InfXmppManager is an opaque data type. You should only access it via the public API functions.


struct InfXmppManagerClass

struct InfXmppManagerClass {
  void(*add_connection)(InfXmppManager* manager,
                        InfXmppConnection* connection);
  void(*remove_connection)(InfXmppManager* manager,
                           InfXmppConnection* connection);
};

This structure contains the default signal handlers for InfXmppManager.

add_connection ()

Default signal handler for the "add-connection" signal. It adds the connection to the manager's internal storage.

remove_connection ()

Default signal handler for the "remove-connection" signal. It removes the connection from the manager's internal storage.

inf_xmpp_manager_new ()

InfXmppManager *    inf_xmpp_manager_new                (void);

Creates a new xmpp manager.

Returns :

A new InfXmppManager.

inf_xmpp_manager_lookup_connection_by_address ()

InfXmppConnection * inf_xmpp_manager_lookup_connection_by_address
                                                        (InfXmppManager *manager,
                                                         InfIpAddress *address,
                                                         guint port);

Looks for a InfXmppConnection contained in manager whose underlaying InfTcpConnection has the given address and port set. Returns NULL if there is no such connection.

This function may also return a closed connection. You can then attempt to reopen it, or remove it from the manager using inf_xmpp_manager_remove_connection() when that fails.

manager :

A InfXmppManager.

address :

The remote InfIpAddress of the connection to look for.

port :

The remote port number of the connection to look for.

Returns :

A InfXmppConnection with the given address and port, or NULL on error.

inf_xmpp_manager_contains_connection ()

gboolean            inf_xmpp_manager_contains_connection
                                                        (InfXmppManager *manager,
                                                         InfXmppConnection *connection);

Returns whether connection is contained in manager.

manager :

A InfXmppManager.

connection :

A InfXmppConnection.

Returns :

TRUE if connection is contained in manager, FALSE otherwise.

inf_xmpp_manager_add_connection ()

void                inf_xmpp_manager_add_connection     (InfXmppManager *manager,
                                                         InfXmppConnection *connection);

Adds the given connection to manager so that it is found by inf_xmpp_manager_lookup_connection_by_address() and inf_xmpp_manager_contains_connection().

manager :

A InfXmppManager.

connection :

A InfXmppConnection not yet contained in manager.

inf_xmpp_manager_remove_connection ()

void                inf_xmpp_manager_remove_connection  (InfXmppManager *manager,
                                                         InfXmppConnection *connection);

Removes the given connection from manager.

manager :

A InfXmppManager.

connection :

A InfXmppConnection contained in manager.

Signal Details

The "add-connection" signal

void                user_function                      (InfXmppManager    *xmpp_manager,
                                                        InfXmppConnection *connection,
                                                        gpointer           user_data)         : Run Last

This signal is emitted whenever a new connection has been added to the InfXmppManager, via inf_xmpp_manager_add_connection().

xmpp_manager :

The InfXmppManager emitting the signal.

connection :

The InfXmppConnection that was added to xmpp_manager.

user_data :

user data set when the signal handler was connected.

The "remove-connection" signal

void                user_function                      (InfXmppManager    *xmpp_manager,
                                                        InfXmppConnection *connection,
                                                        gpointer           user_data)         : Run Last

This signal is emitted whenever a connection has been removed from the InfXmppManager, via inf_xmpp_manager_remove_connection().

xmpp_manager :

The InfXmppManager emitting the signal.

connection :

The InfXmppConnection that was removed from xmpp_manager.

user_data :

user data set when the signal handler was connected.
libinfinity-0.5.5/docs/reference/libinfinity/html/InfCommunicationGroup.html0000644000175000017500000012022312264766270024315 00000000000000 InfCommunicationGroup

InfCommunicationGroup

InfCommunicationGroup — Communication channel for mulitple connections

Stability Level

Unstable, unless otherwise indicated

Object Hierarchy

  GObject
   +----InfCommunicationGroup
         +----InfCommunicationHostedGroup
         +----InfCommunicationJoinedGroup

Properties

  "communication-manager"    InfCommunicationManager*  : Write / Construct Only
  "communication-registry"   InfCommunicationRegistry*  : Write / Construct Only
  "name"                     gchar*                : Read / Write / Construct Only
  "target"                   InfCommunicationObject*  : Read / Write

Description

InfCommunicationGroup represents a group of different hosts. The group supports sending messages between group members and to the whole group.

A communication group supports multiple networks. Each connection belongs to a network, identified by the "network" property. It is assumed that hosts on different networks can't directly communicate with each other. Examples for networks are "tcp/ip" or "jabber".

All communication for a given network is performed by a InfCommunicationMethod. The method defines how data is sent is sent to the group. For example, a method could choose to relay all data via a central server, or to send all data directly between the hosts, or in case of a jabber network, use jabber groupchat functionality.

Details

InfCommunicationGroup

typedef struct _InfCommunicationGroup InfCommunicationGroup;

InfCommunicationGroup is an opaque data type. You should only access it via the public API functions.


struct InfCommunicationGroupClass

struct InfCommunicationGroupClass {
  /* Signals */
  void (*member_added)(InfCommunicationGroup* group,
                       InfXmlConnection* connection);
  void (*member_removed)(InfCommunicationGroup* group,
                         InfXmlConnection* connection);

  /* Virtual functions */
  /* TODO: Should this be const gchar* const* get_methods? */
  const gchar* (*get_method)(InfCommunicationGroup* group,
                             unsigned int index);
  gchar* (*get_publisher_id)(InfCommunicationGroup* group,
                             InfXmlConnection* for_connection);
};

The virtual methods and default signal handlers of InfCommunicationGroup.

member_added ()

Default signal handler of the "member-added" signal.

member_removed ()

Default signal handler of the "member-removed" signal.

get_method ()

Virtual function to determine the methods to use for the group, in order of priority.

get_publisher_id ()

Virtual function to obtain the ID of the publishing host of this group.

inf_communication_group_get_name ()

const gchar *       inf_communication_group_get_name    (InfCommunicationGroup *group);

Returns the name of the group.

group :

A InfCommunicationGroup.

Returns :

The name of the group. The returned string is owned by the group, you don't need to free it.

inf_communication_group_get_target ()

InfCommunicationObject * inf_communication_group_get_target
                                                        (InfCommunicationGroup *group);

Returns the group's target. The target of a group is the InfCommunicationObject to which received and sent messages are reported.

group :

A InfCommunicationGroup.

Returns :

A InfCommunicationGroup, or NULL.

inf_communication_group_set_target ()

void                inf_communication_group_set_target  (InfCommunicationGroup *group,
                                                         InfCommunicationObject *target);

Sets the group's target. The target of a group is the InfCommunicationObject to which received and sent messages are reported. If target is NULL, then the target will be unset.

You can safely call this function with an object that holds a reference on the group since the InfCommunicationGroup only holds a weak reference to its target. This means that you need to keep a reference on target yourself.

group :

A InfCommunicationGroup.

target :

A InfCommunicationObject, or NULL.

inf_communication_group_is_member ()

gboolean            inf_communication_group_is_member   (InfCommunicationGroup *group,
                                                         InfXmlConnection *connection);

Returns whether connection is a member of group.

group :

A InfCommunicationGroup.

connection :

A InfXmlConnection.

Returns :

TRUE if connection is a member of group, FALSE otherwise.

inf_communication_group_send_message ()

void                inf_communication_group_send_message
                                                        (InfCommunicationGroup *group,
                                                         InfXmlConnection *connection,
                                                         xmlNodePtr xml);

Sends a message connection which must be a member of group. connection needs to be a member of this group. This function takes ownership of xml.

group :

A InfCommunicationGroup.

connection :

The InfXmlConnection to which to send the message.

xml :

The message to send.

inf_communication_group_send_group_message ()

void                inf_communication_group_send_group_message
                                                        (InfCommunicationGroup *group,
                                                         xmlNodePtr xml);

Sends a message to all members of group. This function takes ownership of xml.

group :

A InfCommunicationGroup.

xml :

The message to send.

inf_communication_group_cancel_messages ()

void                inf_communication_group_cancel_messages
                                                        (InfCommunicationGroup *group,
                                                         InfXmlConnection *connection);

Stops all messages scheduled to be sent to connection from being sent. Messages for which inf_communication_object_enqueued() has already been called cannot be cancelled anymore.

group :

A InfCommunicationGroup.

connection :

The InfXmlConnection for which to cancel messages.

inf_communication_group_get_method_for_network ()

const gchar *       inf_communication_group_get_method_for_network
                                                        (InfCommunicationGroup *group,
                                                         const gchar *network);

Returns the method name of the method used for communication on network within group.

group :

A InfCommunicationGroup.

network :

A network specifier, such as "tcp/ip" or "jabber".

Returns :

A method name. The string is owned by the group, you don't need to free it.

inf_communication_group_get_method_for_connection ()

const gchar *       inf_communication_group_get_method_for_connection
                                                        (InfCommunicationGroup *grp,
                                                         InfXmlConnection *conn);

Returns the method name of the method used for communication on conn's network within group. conn does not need to be a member of grp for this function to be called.

grp :

A InfCommunicationGroup.

conn :

The InfXmlConnection for which to retrieve the method.

Returns :

A method name. The string is owned by the group, you don't need to free it.

inf_communication_group_get_publisher_id ()

gchar *             inf_communication_group_get_publisher_id
                                                        (InfCommunicationGroup *group,
                                                         InfXmlConnection *for_connection);

Returns a host identifier for the group's publisher (see "local-id" and "remote-id"). If the local host is the publisher, then this will simply return for_connection's local ID, otherwise the remote ID of the connection to the publisher on for_connection's network is returned.

group :

A InfCommunicationGroup.

for_connection :

A InfXmlConnection.

Returns :

The publisher's host ID. Free with g_free().

Property Details

The "communication-manager" property

  "communication-manager"    InfCommunicationManager*  : Write / Construct Only

The communication manager used for sending requests.


The "communication-registry" property

  "communication-registry"   InfCommunicationRegistry*  : Write / Construct Only

The registry to register connections with.


The "name" property

  "name"                     gchar*                : Read / Write / Construct Only

The name of the group.

Default value: NULL


The "target" property

  "target"                   InfCommunicationObject*  : Read / Write

The communication object to call on received and sent data.

Signal Details

The "member-added" signal

void                user_function                      (InfCommunicationGroup *group,
                                                        InfXmlConnection      *connection,
                                                        gpointer               user_data)       : Run Last

This signal is emitted when a connection has been added to the group.

group :

The InfCommunicationGroup emitting the signal.

connection :

The newly joined connection.

user_data :

user data set when the signal handler was connected.

The "member-removed" signal

void                user_function                      (InfCommunicationGroup *group,
                                                        InfXmlConnection      *connection,
                                                        gpointer               user_data)       : Run Last

This signal is emitted when a connection has been removed from the group.

group :

The InfCommunicationGroup emitting the signal.

connection :

The connection that was removed

user_data :

user data set when the signal handler was connected.
libinfinity-0.5.5/docs/reference/libinfinity/html/InfcSessionProxy.html0000644000175000017500000005135512264766270023334 00000000000000 InfcSessionProxy

InfcSessionProxy

InfcSessionProxy

Object Hierarchy

  GObject
   +----InfcSessionProxy

Implemented Interfaces

InfcSessionProxy implements InfCommunicationObject.

Properties

  "connection"               InfXmlConnection*     : Read
  "session"                  InfSession*           : Read / Write / Construct Only
  "subscription-group"       InfCommunicationJoinedGroup*  : Read

Description

Details

InfcSessionProxy

typedef struct _InfcSessionProxy InfcSessionProxy;


struct InfcSessionProxyClass

struct InfcSessionProxyClass {
  GObjectClass parent_class;

  GError* (*translate_error)(InfcSessionProxy* session,
                             GQuark domain,
                             guint code);
};


infc_session_proxy_set_connection ()

void                infc_session_proxy_set_connection   (InfcSessionProxy *proxy,
                                                         InfCommunicationJoinedGroup *group,
                                                         InfXmlConnection *connection,
                                                         guint seq_id);

Sets the subscription connection for the given session. The subscription connection is the connection through which session requests are transmitted during subscription.

The subscription connection might be set even if the session is in SYNCHRONIZING state in which case the session is immediately subscribed after synchronization. Note that no attempt is made to tell the other end about the subscription.

seq_id should be a sequence identifier obtained from the server side. It must be the same number that is used on the corresponding InfdSessionProxy on the remote side, see infd_session_proxy_subscribe_to(). Normally InfdDirectory or InfcBrowser, respectively, take care of passing the correct sequence identifier.

When the subscription connection is being closed or replaced (by a subsequent call to this function), all pending requests are dropped and all users are set to be unavailable, but the session will not be closed, so it may be reused by setting another subscription connection. However, the session might not be synchronized again, but it is fully okay to close the session by hand (using inf_session_close) and create a new session that is synchronized.

proxy :

A InfcSessionProxy.

group :

A InfCommunicationJoinedGroup of subscribed connections. Ignored if connection is NULL.

connection :

A InfXmlConnection.

seq_id :

A sequence identifier for connection. Ignored if connection is NULL.

infc_session_proxy_join_user ()

InfcUserRequest *   infc_session_proxy_join_user        (InfcSessionProxy *proxy,
                                                         const GParameter *params,
                                                         guint n_params,
                                                         GError **error);

Requests a user join for a user with the given properties (which must not include "id" and "flags" since these are initially set by the server). The "status" property is optional and defaults to INF_USER_ACTIVE if not given. It must not be INF_USER_UNAVAILABLE.

proxy :

A InfcSessionProxy.

params :

Construction properties for the InfUser (or derived) object.

n_params :

Number of parameters.

error :

Location to store error information.

Returns :

A InfcUserRequest object that may be used to get notified when the request succeeds or fails.

infc_session_proxy_get_session ()

InfSession *        infc_session_proxy_get_session      (InfcSessionProxy *proxy);

Returns the session proxied by proxy, or NULL if the session has been closed.

proxy :

A InfcSessionProxy.

Returns :

A InfSession, or NULL.

infc_session_proxy_get_connection ()

InfXmlConnection *  infc_session_proxy_get_connection   (InfcSessionProxy *proxy);

Returns the connection that is used to transmit requests to the publisher of the session, or NULL if the session is not subscribed.

proxy :

A InfcSessionProxy.

Returns :

A InfXmlConnection, or NULL.

infc_session_proxy_get_subscription_group ()

InfCommunicationJoinedGroup * infc_session_proxy_get_subscription_group
                                                        (InfcSessionProxy *proxy);

Property Details

The "connection" property

  "connection"               InfXmlConnection*     : Read

The connection with which the session communicates with the server.


The "session" property

  "session"                  InfSession*           : Read / Write / Construct Only

The underlaying session object.


The "subscription-group" property

  "subscription-group"       InfCommunicationJoinedGroup*  : Read

The communication group of subscribed connections.

libinfinity-0.5.5/docs/reference/libinfinity/html/InfdTcpServer.html0000644000175000017500000004555512264766270022572 00000000000000 InfdTcpServer

InfdTcpServer

InfdTcpServer

Object Hierarchy

  GEnum
   +----InfdTcpServerStatus
  GObject
   +----InfdTcpServer

Properties

  "io"                       InfIo*                : Read / Write / Construct Only
  "local-address"            InfIpAddress*         : Read / Write
  "local-port"               guint                 : Read / Write
  "status"                   InfdTcpServerStatus   : Read

Description

Details

enum InfdTcpServerStatus

typedef enum {
  INFD_TCP_SERVER_CLOSED,
  INFD_TCP_SERVER_BOUND,
  INFD_TCP_SERVER_OPEN
} InfdTcpServerStatus;

INFD_TCP_SERVER_CLOSED

INFD_TCP_SERVER_BOUND

INFD_TCP_SERVER_OPEN


InfdTcpServer

typedef struct _InfdTcpServer InfdTcpServer;


struct InfdTcpServerClass

struct InfdTcpServerClass {
  GObjectClass parent_class;

  /* Signals */
  void (*new_connection)(InfdTcpServer* server,
                         InfTcpConnection* connection);

  void (*error)(InfdTcpServer* server,
                GError* error);
};


infd_tcp_server_bind ()

gboolean            infd_tcp_server_bind                (InfdTcpServer *server,
                                                         GError **error);

Binds the server to the address and port given by the "local-address" and "local-port" properties. If the former is NULL, it will bind on all interfaces on IPv4. If the latter is 0, a random available port will be assigned. If the function fails, FALSE is returned and an error is set.

server must be in INFD_TCP_SERVER_CLOSED state for this function to be called.

server :

A InfdTcpServer.

error :

Location to store error information, if any.

Returns :

TRUE on success, or FALSE if an error occured.

infd_tcp_server_open ()

gboolean            infd_tcp_server_open                (InfdTcpServer *server,
                                                         GError **error);

Attempts to open server. This means binding its local address and port if not already (see infd_tcp_server_bind()) and accepting incoming connections.

server needs to be in INFD_TCP_SERVER_CLOSED or INFD_TCP_SERVER_BOUND status for this function to be called. If server's status is INFD_TCP_SERVER_CLOSED, then infd_tcp_server_bind() is called before actually opening the server.

server :

A InfdTcpServer.

error :

Location to store error information.

Returns :

TRUE on success, or FALSE if an error occured.

infd_tcp_server_close ()

void                infd_tcp_server_close               (InfdTcpServer *server);

Closes a TCP server that is open or bound.

server :

A InfdTcpServer.

Property Details

The "io" property

  "io"                       InfIo*                : Read / Write / Construct Only

I/O handler.


The "local-address" property

  "local-address"            InfIpAddress*         : Read / Write

Address to bind to.


The "local-port" property

  "local-port"               guint                 : Read / Write

Port to bind to.

Allowed values: <= 65535

Default value: 0


The "status" property

  "status"                   InfdTcpServerStatus   : Read

Status of the TCP server.

Default value: INFD_TCP_SERVER_CLOSED

Signal Details

The "error" signal

void                user_function                      (InfdTcpServer *infdtcpserver,
                                                        gpointer       arg1,
                                                        gpointer       user_data)          : Run Last

infdtcpserver :

the object which received the signal.

user_data :

user data set when the signal handler was connected.

The "new-connection" signal

void                user_function                      (InfdTcpServer    *infdtcpserver,
                                                        InfTcpConnection *arg1,
                                                        gpointer          user_data)          : Run Last

infdtcpserver :

the object which received the signal.

user_data :

user data set when the signal handler was connected.
libinfinity-0.5.5/docs/reference/libinfinity/html/InfXmlConnection.html0000644000175000017500000006654312264766270023271 00000000000000 InfXmlConnection

InfXmlConnection

InfXmlConnection

Synopsis

                    InfXmlConnection;
struct              InfXmlConnectionIface;
enum                InfXmlConnectionStatus;
gboolean            inf_xml_connection_open             (InfXmlConnection *connection,
                                                         GError **error);
void                inf_xml_connection_close            (InfXmlConnection *connection);
void                inf_xml_connection_send             (InfXmlConnection *connection,
                                                         xmlNodePtr xml);
void                inf_xml_connection_sent             (InfXmlConnection *connection,
                                                         const xmlNodePtr xml);
void                inf_xml_connection_received         (InfXmlConnection *connection,
                                                         const xmlNodePtr xml);
void                inf_xml_connection_error            (InfXmlConnection *connection,
                                                         const GError *error);

Object Hierarchy

  GInterface
   +----InfXmlConnection
  GEnum
   +----InfXmlConnectionStatus

Prerequisites

InfXmlConnection requires GObject.

Known Implementations

InfXmlConnection is implemented by InfSimulatedConnection and InfXmppConnection.

Properties

  "local-id"                 gchar*                : Read
  "network"                  gchar*                : Read
  "remote-id"                gchar*                : Read
  "status"                   InfXmlConnectionStatus  : Read

Description

Details

InfXmlConnection

typedef struct _InfXmlConnection InfXmlConnection;


struct InfXmlConnectionIface

struct InfXmlConnectionIface {
  GTypeInterface parent;

  /* Virtual table */
  gboolean (*open)(InfXmlConnection* connection,
                   GError** error);
  void (*close)(InfXmlConnection* connection);
  void (*send)(InfXmlConnection* connection,
               xmlNodePtr xml);

  /* Signals */
  void (*sent)(InfXmlConnection* connection,
               const xmlNodePtr xml);
  void (*received)(InfXmlConnection* connection,
                   const xmlNodePtr xml);
  void (*error)(InfXmlConnection* connection,
                const GError* error);
};


enum InfXmlConnectionStatus

typedef enum {
  INF_XML_CONNECTION_CLOSED,
  INF_XML_CONNECTION_CLOSING,
  INF_XML_CONNECTION_OPEN,
  INF_XML_CONNECTION_OPENING
} InfXmlConnectionStatus;

INF_XML_CONNECTION_CLOSED

INF_XML_CONNECTION_CLOSING

INF_XML_CONNECTION_OPEN

INF_XML_CONNECTION_OPENING


inf_xml_connection_open ()

gboolean            inf_xml_connection_open             (InfXmlConnection *connection,
                                                         GError **error);

Attempts to open the given XML connection. If the process fails, error will be set. The connection needs to be in status INF_XML_CONNECTION_CLOSED for this function to be called. Even if this function succeeds, the connection process can fail later. In that case the status of connection will be reset to INF_XML_CONNECTION_CLOSED and the "error" signal will be emitted.

connection :

A infXmlConnection.

error :

Location to store error information, if any.

Returns :

TRUE on succes, or FALSE on error.

inf_xml_connection_close ()

void                inf_xml_connection_close            (InfXmlConnection *connection);

Closes the given connection.

connection :

A InfXmlConnection.

inf_xml_connection_send ()

void                inf_xml_connection_send             (InfXmlConnection *connection,
                                                         xmlNodePtr xml);

Sends the given XML message to the remote host.

connection :

A InfXmlConnection.

xml :

A XML message to send. The function takes ownership of the XML node.

inf_xml_connection_sent ()

void                inf_xml_connection_sent             (InfXmlConnection *connection,
                                                         const xmlNodePtr xml);

Emits the "sent" signal on connection. This will most likely only be useful to implementors.

connection :

A InfXmlConnection.

xml :

The XML message that has been sent.

inf_xml_connection_received ()

void                inf_xml_connection_received         (InfXmlConnection *connection,
                                                         const xmlNodePtr xml);

Emits the "received" signal on connection. This will most likely only be useful to implementors.

connection :

A InfXmlConnection.

xml :

The XML message that has been received.

inf_xml_connection_error ()

void                inf_xml_connection_error            (InfXmlConnection *connection,
                                                         const GError *error);

Emits the "error" signal on connection. This will most likely only be useful to implementors.

Note that the error may or may not be fatal for the connection. If it is fatal, then a status notify to INF_XML_CONNECTION_CLOSING or INF_XML_CONNECTION_CLOSED will follow. If you are implementing a custom class implementing InfXmlConnection, make sure to always emit the "error" signal before doing the status notify because many users of the connection will release their reference when the connection is no longer connected.

connection :

A InfXmlConnection.

error :

The error that occured.

Property Details

The "local-id" property

  "local-id"                 gchar*                : Read

A unique identification on the network for the local site.

Default value: NULL


The "network" property

  "network"                  gchar*                : Read

An identifier for the type of network this connection is on.

Default value: NULL


The "remote-id" property

  "remote-id"                gchar*                : Read

A unique identification on the network for the remote site.

Default value: NULL


The "status" property

  "status"                   InfXmlConnectionStatus  : Read

The status of the connection.

Default value: INF_XML_CONNECTION_CLOSED

Signal Details

The "error" signal

void                user_function                      (InfXmlConnection *connection,
                                                        gpointer          error,
                                                        gpointer          user_data)       : Run Last

connection :

The erroneous InfXmlConnection

error :

A pointer to a GError object with details on the error

user_data :

user data set when the signal handler was connected.

The "received" signal

void                user_function                      (InfXmlConnection *connection,
                                                        gpointer          node,
                                                        gpointer          user_data)       : Run Last

connection :

The InfXmlConnection through which node has been received

node :

An xmlNodePtr refering to the XML node that has been received

user_data :

user data set when the signal handler was connected.

The "sent" signal

void                user_function                      (InfXmlConnection *connection,
                                                        gpointer          node,
                                                        gpointer          user_data)       : Run Last

connection :

The InfXmlConnection through which node has been sent

node :

An xmlNodePtr refering to the XML node that has been sent

user_data :

user data set when the signal handler was connected.
libinfinity-0.5.5/docs/reference/libinfinity/html/InfCommunicationCentralFactory.html0000644000175000017500000001611612264766270026146 00000000000000 InfCommunicationCentralFactory

InfCommunicationCentralFactory

InfCommunicationCentralFactory — Factory for InfCommunicationCentralMethod methods

Stability Level

Unstable, unless otherwise indicated

Synopsis

#include <libinfinity/communication/inf-communication-central-factory.h>

                    InfCommunicationCentralFactory;
struct              InfCommunicationCentralFactoryClass;
InfCommunicationFactory * inf_communication_central_factory_get_default
                                                        (void);

Object Hierarchy

  GObject
   +----InfCommunicationCentralFactory

Implemented Interfaces

InfCommunicationCentralFactory implements InfCommunicationFactory.

Description

InfCommunicationCentralFactory implements InfCommunicationFactory. It supports the "central" method on all networks by instantiating InfCommunicationCentralMethod.

Details

InfCommunicationCentralFactory

typedef struct _InfCommunicationCentralFactory InfCommunicationCentralFactory;

InfCommunicationCentralFactory is an opaque data type. You should only access it * via the public API functions.


struct InfCommunicationCentralFactoryClass

struct InfCommunicationCentralFactoryClass {
};

This structure does not contain any public fields.


inf_communication_central_factory_get_default ()

InfCommunicationFactory * inf_communication_central_factory_get_default
                                                        (void);

Returns the default InfCommunicationCentralFactory.

Returns :

A InfCommunicationCentralFactory. It should not be unrefed or freed.
libinfinity-0.5.5/docs/reference/libinfinity/html/InfAdoptedRequestLog.html0000644000175000017500000014322512264766270024075 00000000000000 InfAdoptedRequestLog

InfAdoptedRequestLog

InfAdoptedRequestLog — History of requests

Stability Level

Unstable, unless otherwise indicated

Synopsis

#include <libinfinity/adopted/inf-adopted-request-log.h>

                    InfAdoptedRequestLog;
struct              InfAdoptedRequestLogClass;
InfAdoptedRequestLog * inf_adopted_request_log_new      (guint user_id);
guint               inf_adopted_request_log_get_user_id (InfAdoptedRequestLog *log);
guint               inf_adopted_request_log_get_begin   (InfAdoptedRequestLog *log);
guint               inf_adopted_request_log_get_end     (InfAdoptedRequestLog *log);
gboolean            inf_adopted_request_log_is_empty    (InfAdoptedRequestLog *log);
void                inf_adopted_request_log_set_begin   (InfAdoptedRequestLog *log,
                                                         guint n);
InfAdoptedRequest * inf_adopted_request_log_get_request (InfAdoptedRequestLog *log,
                                                         guint n);
void                inf_adopted_request_log_add_request (InfAdoptedRequestLog *log,
                                                         InfAdoptedRequest *request);
void                inf_adopted_request_log_remove_requests
                                                        (InfAdoptedRequestLog *log,
                                                         guint up_to);
InfAdoptedRequest * inf_adopted_request_log_next_associated
                                                        (InfAdoptedRequestLog *log,
                                                         InfAdoptedRequest *request);
InfAdoptedRequest * inf_adopted_request_log_prev_associated
                                                        (InfAdoptedRequestLog *log,
                                                         InfAdoptedRequest *request);
InfAdoptedRequest * inf_adopted_request_log_original_request
                                                        (InfAdoptedRequestLog *log,
                                                         InfAdoptedRequest *request);
InfAdoptedRequest * inf_adopted_request_log_next_undo   (InfAdoptedRequestLog *log);
InfAdoptedRequest * inf_adopted_request_log_next_redo   (InfAdoptedRequestLog *log);
InfAdoptedRequest * inf_adopted_request_log_upper_related
                                                        (InfAdoptedRequestLog *log,
                                                         guint n);
InfAdoptedRequest * inf_adopted_request_log_lower_related
                                                        (InfAdoptedRequestLog *log,
                                                         guint n);

Object Hierarchy

  GObject
   +----InfAdoptedRequestLog

Properties

  "begin"                    guint                 : Read / Write / Construct Only
  "end"                      guint                 : Read
  "next-redo"                InfAdoptedRequest*    : Read
  "next-undo"                InfAdoptedRequest*    : Read
  "user-id"                  guint                 : Read / Write / Construct Only

Signals

  "add-request"                                    : Run Last

Description

InfAdoptedRequestLog stores all requests by a particular user. These need to be looked up by InfAdoptedAlgorithm to perform transformations of older requests to the current state. It also adds relations between the requests so that is easy to find the request that an Undo request undoes, or the Undo request undoing a given request, if available.

When requests are no longer needed, then they can also be removed again from the log, however requests can only be removed so that remaining Undo or Redo requests do not refer to some request that is about to be removed.

Details

InfAdoptedRequestLog

typedef struct _InfAdoptedRequestLog InfAdoptedRequestLog;

InfAdoptedRequestLog is an opaque data type. You should only access it via the public API functions.


struct InfAdoptedRequestLogClass

struct InfAdoptedRequestLogClass {
  void(*add_request)(InfAdoptedRequestLog* request_log,
                     InfAdoptedRequest* request);
};

This structure contains the default signal handlers for InfAdoptedRequestLog.

add_request ()

Default signal handler for the "add-request" signal.

inf_adopted_request_log_new ()

InfAdoptedRequestLog * inf_adopted_request_log_new      (guint user_id);

user_id :

The ID of the InfAdoptedUser to create a request log for. The request log only contains requests of that particular user.

Returns :

A new InfAdoptedRequestLog.

inf_adopted_request_log_get_user_id ()

guint               inf_adopted_request_log_get_user_id (InfAdoptedRequestLog *log);

Returns the ID of the user whose requests log contains.

log :

A InfAdoptedRequestLog.

Returns :

The log's user ID.

inf_adopted_request_log_get_begin ()

guint               inf_adopted_request_log_get_begin   (InfAdoptedRequestLog *log);

Returns the first index (i.e. the index of the oldest request) in the log.

log :

A InfAdoptedRequestLog.

Returns :

The first index in the log.

inf_adopted_request_log_get_end ()

guint               inf_adopted_request_log_get_end     (InfAdoptedRequestLog *log);

Returns the index a newly inserted request would have (i.e. one past the index of the newest request in the log). This ensures that inf_adopted_request_log_get_end() - inf_adopted_request_log_get_begin() reveals the number of requests in the log.

log :

A InfAdoptedRequestLog.

Returns :

The index of the next request in the log.

inf_adopted_request_log_is_empty ()

gboolean            inf_adopted_request_log_is_empty    (InfAdoptedRequestLog *log);

Returns whether log is empty. A log is empty if it does not contain any requsets.

log :

A InfAdoptedRequestLog.

Returns :

Whether log is empty.

inf_adopted_request_log_set_begin ()

void                inf_adopted_request_log_set_begin   (InfAdoptedRequestLog *log,
                                                         guint n);

This function sets the index of the first log that will be added to log. For a new request log, this is set to 0. If you intend to insert a request sequence into log that does not start with 0, then you can call this function with the desired start index, so that inf_adopted_request_log_get_begin() and inf_adopted_request_log_get_end() return the correct value.

If you don't need inf_adopted_request_log_get_begin() or inf_adopted_request_log_get_end() before adding the first request to the log, then you don't need to call this function, since inf_adopted_request_log_add_request() will do it implicitely based on the request's vector time component for the request log's user.

This function can only be called if the request log is empty, see inf_adopted_request_log_is_empty().

log :

A InfAdoptedRequestLog.

n :

The index of the first request to be added to the log.

inf_adopted_request_log_get_request ()

InfAdoptedRequest * inf_adopted_request_log_get_request (InfAdoptedRequestLog *log,
                                                         guint n);

Returns the request with the given index. Such a request must exist in log.

log :

A InfAdoptedRequestLog.

n :

The index of a request contained in log.

Returns :

A InfAdoptedRequest. The request is owned by the request log, you do not need to free it.

inf_adopted_request_log_add_request ()

void                inf_adopted_request_log_add_request (InfAdoptedRequestLog *log,
                                                         InfAdoptedRequest *request);


inf_adopted_request_log_remove_requests ()

void                inf_adopted_request_log_remove_requests
                                                        (InfAdoptedRequestLog *log,
                                                         guint up_to);

Removes all requests with index lower than up_to. This function only works if the request before up_to is an "upper related" request. See inf_adopted_request_log_upper_related(). This condition guarantees that remaining requests do not refer to removed ones.

log :

A InfAdoptedRequestLog.

up_to :

The index of the first request not to remove.

inf_adopted_request_log_next_associated ()

InfAdoptedRequest * inf_adopted_request_log_next_associated
                                                        (InfAdoptedRequestLog *log,
                                                         InfAdoptedRequest *request);

If request is of type INF_ADOPTED_REQUEST_DO or INF_ADOPTED_REQUEST_REDO, this returns UNDO request that undoes this request, if any. If request is a INF_ADOPTED_REQUEST UNDO request, this returns a request that redoes request, if any.

log :

A InfAdoptedRequestLog.

request :

A InfAdoptedRequest contained in log.

Returns :

The next associated request of request, or NULL.

inf_adopted_request_log_prev_associated ()

InfAdoptedRequest * inf_adopted_request_log_prev_associated
                                                        (InfAdoptedRequestLog *log,
                                                         InfAdoptedRequest *request);

If request is of type INF_ADOPTED_REQUEST_REDO or, this returns the UNDO request that is redone by request, if request is a INF_ADOPTED_REQUEST_UNDO request, this returns the request that is undone by request.

request must either be contained in log or the vector time component of its own user must be equivalent to inf_adopted_request_log_get_end(), in which case request is treated as it if was the newest requset in log.

log :

A InfAdoptedRequestLog.

request :

A InfAdoptedRequest.

Returns :

The previous associated request of request, or NULL.

inf_adopted_request_log_original_request ()

InfAdoptedRequest * inf_adopted_request_log_original_request
                                                        (InfAdoptedRequestLog *log,
                                                         InfAdoptedRequest *request);

Returns the most previous associated request for request, that is, the INF_ADOPTED_REQUEST_DO request that request undoes or redoes, respectively. If request itself is a INF_ADOPTED_REQUEST_DO request, request itself is returned.

request must either be contained in log or the vector time component of its own user must be equivalent to inf_adopted_request_log_get_end(), in which case request is treated as it if was the newest request in log.

log :

A InfAdoptedRequestLog.

request :

A InfAdoptedRequest.

Returns :

The original request of request. This function never returns NULL.

inf_adopted_request_log_next_undo ()

InfAdoptedRequest * inf_adopted_request_log_next_undo   (InfAdoptedRequestLog *log);

Returns the request that would be undone if a undo request was added to the request log.

log :

A InfAdoptedRequestLog.

Returns :

The next request to be undone, or NULL.

inf_adopted_request_log_next_redo ()

InfAdoptedRequest * inf_adopted_request_log_next_redo   (InfAdoptedRequestLog *log);

Returns the request that would be redone if a redo request was added to the request log.

log :

A InfAdoptedRequestLog.

Returns :

The next request to be redone, or NULL.

inf_adopted_request_log_upper_related ()

InfAdoptedRequest * inf_adopted_request_log_upper_related
                                                        (InfAdoptedRequestLog *log,
                                                         guint n);

Returns the newest request in log that is related to nth request in log. requests are considered related when they are enclosed by a do/undo, an undo/redo or a redo/undo pair.

Note that the sets of related requests within a request log are disjoint.

log :

A InfAdoptedRequestLog.

n :

Index of a request in log.

Returns :

The newest request in log being related to the nth request.

inf_adopted_request_log_lower_related ()

InfAdoptedRequest * inf_adopted_request_log_lower_related
                                                        (InfAdoptedRequestLog *log,
                                                         guint n);

Returns the oldest request in log that is related to nth request in log. Requests are considered related when they are enclosed by a do/undo, an undo/redo or a redo/undo pair.

Note that the sets of related requests within a request log are disjoint.

log :

A InfAdoptedRequestLog.

n :

Index of a request in log.

Returns :

The oldest request in log being related to the nth request.

Property Details

The "begin" property

  "begin"                    guint                 : Read / Write / Construct Only

The first index contained in the log.

Default value: 0


The "end" property

  "end"                      guint                 : Read

The index of the next request that is inserted into the log.

Default value: 0


The "next-redo" property

  "next-redo"                InfAdoptedRequest*    : Read

The request that is redone when the user issues a redo request new.


The "next-undo" property

  "next-undo"                InfAdoptedRequest*    : Read

The request that is undone when the user issues an undo request now.


The "user-id" property

  "user-id"                  guint                 : Read / Write / Construct Only

The ID of the user whose requests the log contains.

Default value: 0

Signal Details

The "add-request" signal

void                user_function                      (InfAdoptedRequestLog *request_log,
                                                        InfAdoptedRequest    *request,
                                                        gpointer              user_data)        : Run Last

This signal is emitted whenever a new request is added to the request log via inf_adopted_request_log_add_request().

request_log :

The InfAdoptedRequestLog to which a new request is added.

request :

The new request being added.

user_data :

user data set when the signal handler was connected.
libinfinity-0.5.5/docs/reference/libinfinity/html/libinfinity-0.5-infd-storage.html0000644000175000017500000006045312264766270025246 00000000000000 infd-storage

infd-storage

infd-storage

Object Hierarchy

  GInterface
   +----InfdStorage
  GEnum
   +----InfdStorageNodeType
  GBoxed
   +----InfdStorageNode

Prerequisites

InfdStorage requires GObject.

Known Implementations

InfdStorage is implemented by InfdFilesystemStorage.

Description

Details

InfdStorage

typedef struct _InfdStorage InfdStorage;


struct InfdStorageIface

struct InfdStorageIface {
  GTypeInterface parent;

  /* All these calls are supposed to be synchronous, e.g. completly perform
   * the required task. Some day, we could implement asynchronous
   * behaviour in InfdDirectory (e.g. it caches operations and executes
   * them via the storage in the background). */

  /* Virtual Table */
  GSList* (*read_subdirectory)(InfdStorage* storage,
                               const gchar* path,
                               GError** error);

  gboolean (*create_subdirectory)(InfdStorage* storage,
                                  const gchar* path,
                                  GError** error);

  gboolean (*remove_node)(InfdStorage* storage,
                          const gchar* identifier,
                          const gchar* path,
                          GError** error);

  /* TODO: Add further methods to copy, move and expunge nodes */
  /* TODO: Notification? */
};


enum InfdStorageNodeType

typedef enum {
  INFD_STORAGE_NODE_SUBDIRECTORY,
  INFD_STORAGE_NODE_NOTE
} InfdStorageNodeType;

INFD_STORAGE_NODE_SUBDIRECTORY

INFD_STORAGE_NODE_NOTE


struct InfdStorageNode

struct InfdStorageNode {
  InfdStorageNodeType type;
  gchar* name;

  gchar* identifier; /* Only set when type == INFD_STORAGE_NODE_NOTE */
};


infd_storage_node_new_subdirectory ()

InfdStorageNode *   infd_storage_node_new_subdirectory  (const gchar *path);

Creates a new InfdStorageNode with type INFD_STORAGE_NODE_SUBDIRECTORY and the given path. This is most likely only going to be used by InfdStorage implementations.

path :

Path to the node.

Returns :

A new InfdStorageNode.

infd_storage_node_new_note ()

InfdStorageNode *   infd_storage_node_new_note          (const gchar *path,
                                                         const gchar *identifier);

Creates a new InfdStorageNode with type INFD_STORAGE_NODE_NOTE and the given path and identifier. This is most likely only going to be used by InfdStorage implementations.

path :

Path to the node.

identifier :

Identifier of the note type, for example 'InfText' for text notes.

Returns :

A new InfdStorageNode.

infd_storage_node_copy ()

InfdStorageNode *   infd_storage_node_copy              (InfdStorageNode *node);

Creates a copy of a InfdStorageNode object.

node :

Node from which to make a copy.

Returns :

A copy of node.

infd_storage_node_free ()

void                infd_storage_node_free              (InfdStorageNode *node);

Frees a InfdStorageNode allocated with infd_storage_node_new_subdirectory(), infd_storage_node_new_node() or infd_storage_node_copy().

node :

A InfdStorageNode.

infd_storage_node_list_free ()

void                infd_storage_node_list_free         (GSList *node_list);

Frees a singly-linked list of InfdStorageNode as returned by infd_storage_read_subdirectory().

node_list :

A list of InfdStorageNode objects.

infd_storage_read_subdirectory ()

GSList *            infd_storage_read_subdirectory      (InfdStorage *storage,
                                                         const gchar *path,
                                                         GError **error);


infd_storage_create_subdirectory ()

gboolean            infd_storage_create_subdirectory    (InfdStorage *storage,
                                                         const gchar *path,
                                                         GError **error);

Creates a new subdirectory at the given path that is initially empty.

storage :

A InfdStorage.

path :

A path pointing to non-existing node.

error :

Location to store error information.

Returns :

TRUE on success.

infd_storage_remove_node ()

gboolean            infd_storage_remove_node            (InfdStorage *storage,
                                                         const gchar *identifier,
                                                         const gchar *path,
                                                         GError **error);

Removes the node at path from storage. If it is a subdirectory node, all containing nodes and subdirectory nodes are removed recursively.

storage :

A InfdStorage

identifier :

The type of the node to remove, or NULL to remove a subdirectory (TODO: This shouldn't be necessary).

path :

A path pointing to an existing node.

error :

Location to store error information.

Returns :

TRUE on success.
libinfinity-0.5.5/docs/reference/libinfinity/html/libinfinity-0.5-InfcNotePlugin.html0000644000175000017500000000550612264766270025546 00000000000000 InfcNotePlugin

InfcNotePlugin

InfcNotePlugin

Synopsis

struct              InfcNotePlugin;

Description

Details

struct InfcNotePlugin

struct InfcNotePlugin {
  gpointer user_data;

  const gchar* note_type;

  InfcNotePluginSessionNew session_new;
};

libinfinity-0.5.5/docs/reference/libinfinity/html/InfdServerPool.html0000644000175000017500000003753412264766270022753 00000000000000 InfdServerPool

InfdServerPool

InfdServerPool

Object Hierarchy

  GObject
   +----InfdServerPool

Properties

  "directory"                InfdDirectory*        : Read / Write / Construct Only

Description

Details

InfdServerPoolForeachServerFunc ()

void                (*InfdServerPoolForeachServerFunc)  (InfdXmlServer *server,
                                                         gpointer user_data);


InfdServerPool

typedef struct _InfdServerPool InfdServerPool;


struct InfdServerPoolClass

struct InfdServerPoolClass {
  GObjectClass parent_class;
};


infd_server_pool_new ()

InfdServerPool *    infd_server_pool_new                (InfdDirectory *directory);

Creates a new InfdServerPool.

directory :

A InfdDirectory to which to add incoming connections.

Returns :

A new InfdServerPool.

infd_server_pool_add_server ()

void                infd_server_pool_add_server         (InfdServerPool *server_pool,
                                                         InfdXmlServer *server);

Adds server to server_pool. The server pool accepts incoming connections and gives them to its directory which processes incoming requests.

server_pool :

A InfdServerPool.

server :

A InfdXmlServer.

infd_server_pool_add_local_publisher ()

void                infd_server_pool_add_local_publisher
                                                        (InfdServerPool *server_pool,
                                                         InfdXmppServer *server,
                                                         InfLocalPublisher *publisher);


infd_server_pool_remove_server ()

void                infd_server_pool_remove_server      (InfdServerPool *server_pool,
                                                         InfdXmlServer *server);

Removed server from servor_pool. If server was published via some publishers then it will be unpublished automatically.

server_pool :

A InfdServerPool.

server :

A InfdXmlServer which was previously added to server_pool.

infd_server_pool_foreach_server ()

void                infd_server_pool_foreach_server     (InfdServerPool *server_pool,
                                                         InfdServerPoolForeachServerFunc func,
                                                         gpointer user_data);

Calls func for each server in pool registered with infd_server_pool_add_server().

server_pool :

A InfdServerPool.

func :

The function to be called for each server.

user_data :

Additional data to pass to func.

Property Details

The "directory" property

  "directory"                InfdDirectory*        : Read / Write / Construct Only

The directory to which to register incoming connections to.

libinfinity-0.5.5/docs/reference/libinfinity/html/InfcExploreRequest.html0000644000175000017500000007226012264766270023634 00000000000000 InfcExploreRequest

InfcExploreRequest

InfcExploreRequest — Watch progess of node exploration

Stability Level

Unstable, unless otherwise indicated

Object Hierarchy

  GObject
   +----InfcRequest
         +----InfcExploreRequest

Properties

  "current"                  guint                 : Read / Write
  "finished"                 gboolean              : Read
  "initiated"                gboolean              : Read
  "node-id"                  guint                 : Read / Write / Construct Only
  "total"                    guint                 : Read / Write

Description

When starting a node exploration using infc_browser_iter_explore() then it returns an InfcExploreRequest. This object can be used to get notified when there is progress in exploration (for example to show a progress bar in the GUI) or when the operation finished, that is all child nodes of the explored subdirectory are known to the browser.

When the exploration starts the "initiated" signal is emitted. Then, for each node being explored "progress" is emitted. Eventually, "finished" is emitted when the exploration has finished. Before each step the request can also fail, in which case "failed" is emitted. When this happens then none of the other signals will be emitted anymore.

Details

InfcExploreRequest

typedef struct _InfcExploreRequest InfcExploreRequest;

InfcExploreRequest is an opaque data type. You should only access it via the public API functions.


struct InfcExploreRequestClass

struct InfcExploreRequestClass {
  /* Signals */
  void (*initiated)(InfcExploreRequest *explore_request,
                    guint total);
  void (*progress)(InfcExploreRequest* explore_request,
                   guint current,
                   guint total);
  void (*finished)(InfcExploreRequest* explore_request);
};

This structure contains default signal handlers for InfcExploreRequest.

initiated ()

Default signal handler for the "initiated" signal.

progress ()

Default signal handler for the "progress" signal.

finished ()

Default signal handler for the "finished" signal.

infc_explore_request_get_node_id ()

guint               infc_explore_request_get_node_id    (InfcExploreRequest *request);

Returns the ID of the node to be explored.

request :

An InfcExploreRequest.

Returns :

ID of the node to be explored.

infc_explore_request_initiated ()

void                infc_explore_request_initiated      (InfcExploreRequest *request,
                                                         guint total);

Emits the "initiated" signal on request. An explore request is considered initiated as soon as the total amount of child nodes is known.

request :

An InfcExploreRequest.

total :

The total number of children of the node which is being explored.

infc_explore_request_progress ()

gboolean            infc_explore_request_progress       (InfcExploreRequest *request,
                                                         GError **error);

Emits the "progress" signal on request.

request :

A InfcExploreRequest.

error :

Location to store error information.

Returns :

TRUE when the signal was emitted, FALSE on error.

infc_explore_request_finished ()

gboolean            infc_explore_request_finished       (InfcExploreRequest *request,
                                                         GError **error);

Emits the "finished" signal on request.

request :

A InfcExploreRequest.

error :

Location to store error information.

Returns :

TRUE when the signal was emitted, FALSE on error.

infc_explore_request_get_initiated ()

gboolean            infc_explore_request_get_initiated  (InfcExploreRequest *request);

Returns whether the exploration process was already initiated, i.e. the total number of nodes to explore is known.

request :

A InfcExploreRequest.

Returns :

Whether the exploration was initiated.

infc_explore_request_get_finished ()

gboolean            infc_explore_request_get_finished   (InfcExploreRequest *request);

Returns whether the exploration process has finished, i.e. the "finished" signal was emitted.

request :

A InfcExploreRequest.

Returns :

Whether the exploration has finished.

Property Details

The "current" property

  "current"                  guint                 : Read / Write

Node that has just been explored.

Default value: 0


The "finished" property

  "finished"                 gboolean              : Read

Whether the exploration process has finished.

Default value: FALSE


The "initiated" property

  "initiated"                gboolean              : Read

Whether the exploration process was already initiated.

Default value: FALSE


The "node-id" property

  "node-id"                  guint                 : Read / Write / Construct Only

ID of the node to explore.

Default value: 0


The "total" property

  "total"                    guint                 : Read / Write

Total number of nodes that are explored.

Default value: 0

Signal Details

The "finished" signal

void                user_function                      (InfcExploreRequest *request,
                                                        gpointer            user_data)      : Run Last

This signal is emitted when the exploration finished successfully and all child nodes of the subdirectory being explored are known.

request :

The InfcExploreRequest which finished.

user_data :

user data set when the signal handler was connected.

The "initiated" signal

void                user_function                      (InfcExploreRequest *request,
                                                        guint               total,
                                                        gpointer            user_data)      : Run Last

This signal is emitted once the exploration has been initiated, that is when it is known how many child nodes are going to be explored. The number of nodes is provided in the total parameter.

request :

The InfcExploreRequest that is being initiated.

total :

Total number of the directory's child nodes.

user_data :

user data set when the signal handler was connected.

The "progress" signal

void                user_function                      (InfcExploreRequest *request,
                                                        guint               current,
                                                        guint               total,
                                                        gpointer            user_data)      : Run Last

This signal is emitted for each child node that is added to the subdirectory being explored. This can for example be used to update a progress bar in the GUI.

request :

The InfcExploreRequest that made progress.

current :

The number of child nodes retrieved so far.

total :

The total number of child nodes.

user_data :

user data set when the signal handler was connected.
libinfinity-0.5.5/docs/reference/libinfinity/html/libinfinity-0.5-InfInit.html0000644000175000017500000001163312264766270024220 00000000000000 InfInit

InfInit

InfInit

Synopsis

gboolean            inf_init                            (GError **error);
void                inf_deinit                          (void);

Description

Details

inf_init ()

gboolean            inf_init                            (GError **error);

This function initializes the libinfinity library and should be called before any other functions of the library. The function does nothing if it has already been called before.

error :

Location to store error information, if any.

Returns :

Whether the initialization was successful or not.

inf_deinit ()

void                inf_deinit                          (void);

This functions deinitializes the libinfinity library. Make sure that all objects the library provides have been freed before calling this function. If inf_init() has been called multiple times, then inf_deinit() needs to be called the same number of times to actually deinitialize the library.

libinfinity-0.5.5/docs/reference/libinfinity/html/right.png0000644000175000017500000000057412264766270021001 00000000000000‰PNG  IHDRשÍÊ{PLTEÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ###+++@@@«««¿¿¿ÃÃÃÇÇÇÏÏÏïïïÿÿÿçWôtRNS (48@GX[«·¿ÃÏÓ×ßãçï÷yþ±t–IDATxÚ…ÐÉÂ0 PS–@XZ -%”­eþÿ Iä‰ÁÜ<ï`ÙeAÙ¬Zìç9(ñÆ1'n/îÊ"Á¤²ÜU!‡DЉhŒwÎÅ$¢ñ4QX$°Ô AlþXRü^>8ŽMzšãmtúºü¾Ä>äk¸Ð7â½ œïOŠ$ôÙž³=mVQ.JO£é9 »ñ• IEND®B`‚libinfinity-0.5.5/docs/reference/libinfinity/html/InfUserTable.html0000644000175000017500000010654612264766270022375 00000000000000 InfUserTable

InfUserTable

InfUserTable — User information storage

Stability Level

Unstable, unless otherwise indicated

Synopsis

#include <libinfinity/common/inf-user-table.h>

void                (*InfUserTableForeachUserFunc)      (InfUser *user,
                                                         gpointer user_data);
                    InfUserTable;
struct              InfUserTableClass;
InfUserTable *      inf_user_table_new                  (void);
void                inf_user_table_add_user             (InfUserTable *user_table,
                                                         InfUser *user);
void                inf_user_table_remove_user          (InfUserTable *user_table,
                                                         InfUser *user);
InfUser *           inf_user_table_lookup_user_by_id    (InfUserTable *user_table,
                                                         guint id);
InfUser *           inf_user_table_lookup_user_by_name  (InfUserTable *user_table,
                                                         const gchar *name);
void                inf_user_table_foreach_user         (InfUserTable *user_table,
                                                         InfUserTableForeachUserFunc func,
                                                         gpointer user_data);
void                inf_user_table_foreach_local_user   (InfUserTable *user_table,
                                                         InfUserTableForeachUserFunc func,
                                                         gpointer user_data);

Object Hierarchy

  GObject
   +----InfUserTable

Description

InfUserTable manages multiple InfUser objects and provides an easy way to look up users by their ID and name. All users within a user table must have a unique ID and name. The user table is used by InfSession to store the users within the session.

Details

InfUserTableForeachUserFunc ()

void                (*InfUserTableForeachUserFunc)      (InfUser *user,
                                                         gpointer user_data);

This callback is called for every user iterated by inf_user_table_foreach_user() or inf_user_table_foreach_local_user().

user :

The InfUser for the current iteration.

user_data :

The user_data passed to inf_user_table_foreach_user() or inf_user_table_foreach_local_user().

InfUserTable

typedef struct _InfUserTable InfUserTable;

InfUserTable is an opaque data type. You should only access it via the public API functions.


struct InfUserTableClass

struct InfUserTableClass {
  void(*add_user)(InfUserTable* user_table,
                  InfUser* user);

  void(*remove_user)(InfUserTable* user_table,
                     InfUser* user);

  void(*add_local_user)(InfUserTable* user_table,
                        InfUser* user);

  void(*remove_local_user)(InfUserTable* user_table,
                           InfUser* user);
};

Signals for the InfUserTable class.

add_user ()

Default signal handler for the "add_user" signal.

remove_user ()

Default signal handler for the "remove_user" signal.

add_local_user ()

Default signal handler for the "add_local_user" signal.

remove_local_user ()

Default signal handler for the "remove_local_user" signal.

inf_user_table_new ()

InfUserTable *      inf_user_table_new                  (void);

Creates a new, empty user table.

Returns :

A InfUserTable.

inf_user_table_add_user ()

void                inf_user_table_add_user             (InfUserTable *user_table,
                                                         InfUser *user);

Inserts user into user_table.

user_table :

A InfUserTable.

user :

A InfUser not already contained in user_table.

inf_user_table_remove_user ()

void                inf_user_table_remove_user          (InfUserTable *user_table,
                                                         InfUser *user);

Removes user from uesr_table.

user_table :

A InfUserTable.

user :

A InfUser contained in table.

inf_user_table_lookup_user_by_id ()

InfUser *           inf_user_table_lookup_user_by_id    (InfUserTable *user_table,
                                                         guint id);

Returns the InfUser with the given User ID in user_table.

user_table :

A InfUserTable.

id :

User ID to lookup.

Returns :

A InfUser, or NULL.

inf_user_table_lookup_user_by_name ()

InfUser *           inf_user_table_lookup_user_by_name  (InfUserTable *user_table,
                                                         const gchar *name);

Returns an InfUser with the given name if there is one.

user_table :

A InfUserTable.

name :

User name to lookup.

Returns :

A InfUser, or NULL.

inf_user_table_foreach_user ()

void                inf_user_table_foreach_user         (InfUserTable *user_table,
                                                         InfUserTableForeachUserFunc func,
                                                         gpointer user_data);

Calls the given function for each user in the user_table. You should not add or remove users while this function is being executed.

user_table :

A InfUserTable.

func :

The function to call for each user.

user_data :

User data to pass to the function.

inf_user_table_foreach_local_user ()

void                inf_user_table_foreach_local_user   (InfUserTable *user_table,
                                                         InfUserTableForeachUserFunc func,
                                                         gpointer user_data);

Calls the given function for each local user in the user_table. A local user is a user that has the INF_USER_LOCAL flag set and that has not status INF_USER_UNAVAILABLE. You should not add or remove users while this function is being executed.

user_table :

A InfUserTable.

func :

The function to call for each user.

user_data :

User data to pass to the function.

Signal Details

The "add-local-user" signal

void                user_function                      (InfUserTable *user_table,
                                                        InfUser      *user,
                                                        gpointer      user_data)       : Run Last

This signal is emitted when a user is added to the user table and has the INF_USER_LOCAL flag set. In this case, "add-user" is emitted as well.

This signal is also emitted when an existing user receives the INF_USER_LOCAL flag. This occurs when a user rejoins locally after leaving the session (possibly having the INF_USER_LOCAL flag removed during their absence). "add-user" is not emitted in this case.

user_table :

The InfUserTable in which user has been set as local

user :

The InfUser that has set as local

user_data :

user data set when the signal handler was connected.

The "add-user" signal

void                user_function                      (InfUserTable *user_table,
                                                        InfUser      *user,
                                                        gpointer      user_data)       : Run Last

This signal is emitted when inf_user_table_add_user() is called. Note that this does not happen if user rejoins the session and has already been added to user_table previously.

"add-local-user" may also be emitted at this point if user has the INF_USER_LOCAL flag set.

user_table :

The InfUserTable into which user has been added

user :

The InfUser that has been added into user_table

user_data :

user data set when the signal handler was connected.

The "remove-local-user" signal

void                user_function                      (InfUserTable *user_table,
                                                        InfUser      *user,
                                                        gpointer      user_data)       : Run Last

This signal is emitted when a user is removed from the user table and had the INF_USER_LOCAL flag set. In this case, "remove-user" is emitted as well.

This signal is also emitted when user loses the INF_USER_LOCAL flag. This occurs when the local user leaves the session. "remove-user" is not emitted and the status of user is set to INF_USER_UNAVAILABLE.

user_table :

The InfUserTable in which user is no longer local

user :

The InfUser that is no longer local

user_data :

user data set when the signal handler was connected.

The "remove-user" signal

void                user_function                      (InfUserTable *user_table,
                                                        InfUser      *user,
                                                        gpointer      user_data)       : Run Last

This signal is emitted when inf_user_table_remove_user() is called. This does not usually happen, as users leaving a session do not get removed from the table.

"remove-local-user" may also be emitted at this point if user has the INF_USER_LOCAL flag set.

user_table :

The InfUserTable from which user has been remove

user :

The InfUser that has been removed from user_table

user_data :

user data set when the signal handler was connected.

See Also

InfUser, InfSession
libinfinity-0.5.5/docs/reference/libinfinity/html/libinfinity-0.5-InfProtocol.html0000644000175000017500000002245712264766270025124 00000000000000 InfProtocol

InfProtocol

InfProtocol — Infinote protocol parameters

Stability Level

Unstable, unless otherwise indicated

Synopsis

#include <libinfinity/common/inf-protocol.h>

const gchar *       inf_protocol_get_version            (void);
gboolean            inf_protocol_parse_version          (const gchar *version,
                                                         guint *major,
                                                         guint *minor,
                                                         GError **error);
guint               inf_protocol_get_default_port       (void);

Description

This section defines common protocol parameters used by libinfinity.

Details

inf_protocol_get_version ()

const gchar *       inf_protocol_get_version            (void);

Returns the version of the Infinote protocol implemented by this version of libinfinity.

Returns :

The supported infinote version.

inf_protocol_parse_version ()

gboolean            inf_protocol_parse_version          (const gchar *version,
                                                         guint *major,
                                                         guint *minor,
                                                         GError **error);

Splits the given version string into it's major and minor version number. If the string is badly formatted then the function returns FALSE, error is set and major and minor are left untouched.

It is guaranteed that, if version is inf_protocol_get_version(), the function does not fail.

version :

A version string, such as "1.0"

major :

A location to store the major version number to.

minor :

A location to store the minor version number to

error :

Location to store error information, if any.

Returns :

TRUE on success, or FALSE on error.

inf_protocol_get_default_port ()

guint               inf_protocol_get_default_port       (void);

Returns the default port on which the infinote daemon listens for new connections.

Returns :

The default port.

See Also

InfError
libinfinity-0.5.5/docs/reference/libinfinity/html/InfCommunicationCentralMethod.html0000644000175000017500000001561012264766270025755 00000000000000 InfCommunicationCentralMethod

InfCommunicationCentralMethod

InfCommunicationCentralMethod — Relying group messages via the publisher

Stability Level

Unstable, unless otherwise indicated

Synopsis

#include <libinfinity/communication/inf-communication-central-method.h>

                    InfCommunicationCentralMethod;
struct              InfCommunicationCentralMethodClass;

Object Hierarchy

  GObject
   +----InfCommunicationCentralMethod

Implemented Interfaces

InfCommunicationCentralMethod implements InfCommunicationMethod.

Properties

  "group"                    InfCommunicationGroup*  : Read / Write / Construct Only
  "registry"                 InfCommunicationRegistry*  : Read / Write / Construct Only

Description

InfCommunicationCentralMethod implements InfCommunicationMethod by relaying all messages via the group's publisher. If the connection to the publisher is lost, so is the connection to all other group members.

Details

InfCommunicationCentralMethod

typedef struct _InfCommunicationCentralMethod InfCommunicationCentralMethod;

InfCommunicationCentralMethod is an opaque data type. You should only access it * via the public API functions.


struct InfCommunicationCentralMethodClass

struct InfCommunicationCentralMethodClass {
};

This structure does not contain any public fields.

Property Details

The "group" property

  "group"                    InfCommunicationGroup*  : Read / Write / Construct Only

The communication group for which to handle messages.


The "registry" property

  "registry"                 InfCommunicationRegistry*  : Read / Write / Construct Only

The communication registry to register connections with.

libinfinity-0.5.5/docs/reference/libinfinity/html/InfAdoptedSplitOperation.html0000644000175000017500000003531512264766270024757 00000000000000 InfAdoptedSplitOperation

InfAdoptedSplitOperation

InfAdoptedSplitOperation — Operation wrapping two operations

Stability Level

Unstable, unless otherwise indicated

Object Hierarchy

  GObject
   +----InfAdoptedSplitOperation

Implemented Interfaces

InfAdoptedSplitOperation implements InfAdoptedOperation.

Properties

  "first"                    InfAdoptedOperation*  : Read / Write / Construct Only
  "second"                   InfAdoptedOperation*  : Read / Write / Construct Only

Description

InfAdoptedSplitOperation is a wrapper around that two InfAdoptedOperations. This is normally not required directly but may be a result of some transformation.

Details

InfAdoptedSplitOperation

typedef struct _InfAdoptedSplitOperation InfAdoptedSplitOperation;

InfAdoptedSplitOperation is an opaque data type. You should only access it via the public API functions.


struct InfAdoptedSplitOperationClass

struct InfAdoptedSplitOperationClass {
};

This structure does not contain any public fields.


inf_adopted_split_operation_new ()

InfAdoptedSplitOperation * inf_adopted_split_operation_new
                                                        (InfAdoptedOperation *first,
                                                         InfAdoptedOperation *second);

Creates a new InfAdoptedSplitOperation. A split operation is simply a wrapper around two operations (which may in turn be split operations).

first :

one of the InfAdoptedOperations to be wrapped

second :

the other InfAdoptedOperation to be wrapped

Returns :

A new InfAdoptedSplitOperation.

inf_adopted_split_operation_unsplit ()

GSList *            inf_adopted_split_operation_unsplit (InfAdoptedSplitOperation *operation);

Returns a list of the operations contained by the split operation. If the splitted operation are in turn split operations, they will also be unsplitted. The returned list is guarenteed to not contain a InfAdoptedSplitOperation.

operation :

A InfAdoptedSplitOperation.

Returns :

A list of operations. Free with g_slist_free() when done.

inf_adopted_split_operation_transform_other ()

InfAdoptedOperation * inf_adopted_split_operation_transform_other
                                                        (InfAdoptedSplitOperation *op,
                                                         InfAdoptedOperation *other,
                                                         gint concurrency_id);

Transforms other against op.

op :

A InfAdoptedSplitOperation.

other :

An arbitrary InfAdoptedOperation.

concurrency_id :

The concurrency id for the transformation of other against op.

Returns :

The transformed operation.

Property Details

The "first" property

  "first"                    InfAdoptedOperation*  : Read / Write / Construct Only

The first operation of the split operation.


The "second" property

  "second"                   InfAdoptedOperation*  : Read / Write / Construct Only

The second operation of the split operation.

libinfinity-0.5.5/docs/reference/libinfinity/html/index.html0000644000175000017500000003053712264766270021155 00000000000000 libinfinity-0.5 Reference Manual

for libinfinity 0.5.5. The latest version of this documentation can be found on-line at http://infinote.0x539.de/libinfinity/API/libinfinity/.


About libinfinity
Compiling and Using libinfinity
Common libinfinity API
InfInit
InfSession — Basic session object and synchronization
InfChatSession — Simple standalone chat
InfChatBuffer — A ring buffer for chat messages
InfUserTable — User information storage
InfUser
InfDiscovery — Discovery of remote services
InfLocalPublisher — Publish services on the local network
InfIpAddress — IPv4 and IPv6 addresses
InfTcpConnection
InfXmlConnection
InfXmppConnection
InfSimulatedConnection — Simulated network connection
InfDiscoveryAvahi — Service Discovery via Avahi
InfXmppManager — Reuse existing connections
InfIo — Event loop abstraction
InfStandaloneIo
InfCertificateChain — X.509 certificate chains
XML utility functions — Helper functions to read basic data types from XML
InfCertUtil
InfCertificateCredentialsReference-counted wrapper for gnutls_certificate_credentials_t
InfSaslContext — Asynchronous SASL processing
InfError — Common error codes
InfProtocol — Infinote protocol parameters
InfBuffer — Abstract document interface
Libinfinity's adOPTed implementation
InfAdoptedSession — Session handling concurrency control via the adOPTed algorithm.
InfAdoptedSessionRecord — Create a record of a session
InfAdoptedSessionReplay — Replay a record of a session
InfAdoptedUndoGrouping — Grouping of requests to be undone simultaneously
InfAdoptedAlgorithm — adOPTed implementation
InfAdoptedRequestLog — History of requests
InfAdoptedRequestRequest processed by InfAdoptedAlgorithm.
InfAdoptedOperationOperation that can be processed by InfAdoptedAlgorithm.
InfAdoptedNoOperation — An operation not doing anything.
InfAdoptedSplitOperation — Operation wrapping two operations
InfAdoptedUser
InfAdoptedStateVector — Represents a state in the interaction model
Libinfinity client side API
InfcBrowser — Browse remote directories
InfcBrowserIter — Iterating through browsed nodes
InfcNotePlugin
InfcSessionProxy
InfcExploreRequest — Watch progess of node exploration
InfcNodeRequest
InfcUserRequest
InfcRequest — Requests sent to server
InfcRequestManager
Libinfinity server side API
InfdDirectory — Directory of published documents
InfdNotePlugin
infd-storage
InfdFilesystemStorage
InfdSessionProxy
InfdTcpServer
InfdXmlServer
InfdXmppServer
InfdServerPool
Network abstraction
InfCommunicationManager — Handling multiple communication sessions
InfCommunicationObject — Network message destinations
InfCommunicationGroup — Communication channel for mulitple connections
InfCommunicationHostedGroup — Communication group opened by the local host
InfCommunicationJoinedGroup — Communication group opened by a remote host
InfCommunicationFactory — Creation of communication methods
InfCommunicationMethod — Network communication method
InfCommunicationRegistry — Sharing connections between multiple groups
InfCommunicationCentralFactoryFactory for InfCommunicationCentralMethod methods
InfCommunicationCentralMethod — Relying group messages via the publisher
libinfinity-0.5.5/docs/reference/libinfinity/html/InfAdoptedSessionRecord.html0000644000175000017500000004254112264766270024564 00000000000000 InfAdoptedSessionRecord

InfAdoptedSessionRecord

InfAdoptedSessionRecord — Create a record of a session

Stability Level

Unstable, unless otherwise indicated

Object Hierarchy

  GObject
   +----InfAdoptedSessionRecord

Properties

  "session"                  InfAdoptedSession*    : Read / Write / Construct Only

Description

InfAdoptedSessionRecord creates a record of a InfAdoptedSession. It records every modification made to the session from the beginning of its own lifetime to the end of its lifetime.

It does not record user status changes and thus the recorded session cannot reliably be replayed with all user information. It's main purpose is to make it easy to reproduce bugs in libinfinity. However, it might be extended in the future.

To replay a record, use InfAdoptedSessionReplay or the tool inf-test-text-replay in the infinote test suite.

Details

InfAdoptedSessionRecord

typedef struct _InfAdoptedSessionRecord InfAdoptedSessionRecord;

InfAdoptedSessionRecord is an opaque data type. You should only access it via the public API functions.


struct InfAdoptedSessionRecordClass

struct InfAdoptedSessionRecordClass {
};

This structure does not contain any public fields.


inf_adopted_session_record_new ()

InfAdoptedSessionRecord * inf_adopted_session_record_new
                                                        (InfAdoptedSession *session);

Creates a new InfAdoptedSessionRecord, recording session. To start recording, call inf_adopted_session_record_start_recording().

session :

A InfAdoptedSession.

Returns :

A new InfAdoptedSessionRecord.

inf_adopted_session_record_start_recording ()

gboolean            inf_adopted_session_record_start_recording
                                                        (InfAdoptedSessionRecord *record,
                                                         const gchar *filename,
                                                         GError **error);

Starts to record the session. Make sure the session is not already closed before calling this function. If an error occurs, such as if filename could not be opened, then the function returns FALSE and error is set.

record :

A InfAdoptedSessionRecord.

filename :

The file in which to store the record.

error :

Location to store error information, if any.

Returns :

TRUE if the session is started to be recorded, FALSE on error.

inf_adopted_session_record_stop_recording ()

gboolean            inf_adopted_session_record_stop_recording
                                                        (InfAdoptedSessionRecord *record,
                                                         GError **error);

Stops the recording of the current session, which must have been started previously via inf_adopted_session_record_start_recording(). If an error occurs, then the function returns FALSE and error is set. Note that even if an error occurs, then the recording is stopped as well. However, the file might not have been completely written to disk, so you should still show any errors during this function to the user.

record :

A InfAdoptedSessionRecord.

error :

Location to store error information, if any.

Returns :

TRUE if the recording has been stored successfully, FALSE otherwise.

inf_adopted_session_record_is_recording ()

gboolean            inf_adopted_session_record_is_recording
                                                        (InfAdoptedSessionRecord *record);

Returns whether record is currently recording a session.

record :

A InfAdoptedSessionRecord.

Returns :

Whether record currently records the session.

Property Details

The "session" property

  "session"                  InfAdoptedSession*    : Read / Write / Construct Only

The session to record.

libinfinity-0.5.5/docs/reference/libinfinity/html/InfAdoptedRequest.html0000644000175000017500000013615312264766270023435 00000000000000 InfAdoptedRequest

InfAdoptedRequest

InfAdoptedRequest — Request processed by InfAdoptedAlgorithm.

Stability Level

Unstable, unless otherwise indicated

Synopsis

#include <libinfinity/adopted/inf-adopted-request.h>

enum                InfAdoptedRequestType;
                    InfAdoptedRequest;
struct              InfAdoptedRequestClass;
InfAdoptedRequest * inf_adopted_request_new_do          (InfAdoptedStateVector *vector,
                                                         guint user_id,
                                                         InfAdoptedOperation *operation);
InfAdoptedRequest * inf_adopted_request_new_undo        (InfAdoptedStateVector *vector,
                                                         guint user_id);
InfAdoptedRequest * inf_adopted_request_new_redo        (InfAdoptedStateVector *vector,
                                                         guint user_id);
InfAdoptedRequest * inf_adopted_request_copy            (InfAdoptedRequest *request);
InfAdoptedRequestType inf_adopted_request_get_request_type
                                                        (InfAdoptedRequest *request);
InfAdoptedStateVector * inf_adopted_request_get_vector  (InfAdoptedRequest *request);
guint               inf_adopted_request_get_user_id     (InfAdoptedRequest *request);
InfAdoptedOperation * inf_adopted_request_get_operation (InfAdoptedRequest *request);
guint               inf_adopted_request_get_index       (InfAdoptedRequest *request);
gboolean            inf_adopted_request_need_concurrency_id
                                                        (InfAdoptedRequest *request,
                                                         InfAdoptedRequest *against);
InfAdoptedConcurrencyId inf_adopted_request_get_concurrency_id
                                                        (InfAdoptedRequest *request,
                                                         InfAdoptedRequest *against);
InfAdoptedRequest * inf_adopted_request_transform       (InfAdoptedRequest *request,
                                                         InfAdoptedRequest *against,
                                                         InfAdoptedConcurrencyId concurrency_id);
InfAdoptedRequest * inf_adopted_request_mirror          (InfAdoptedRequest *request,
                                                         guint by);
InfAdoptedRequest * inf_adopted_request_fold            (InfAdoptedRequest *request,
                                                         guint into,
                                                         guint by);
gboolean            inf_adopted_request_affects_buffer  (InfAdoptedRequest *request);

Object Hierarchy

  GEnum
   +----InfAdoptedRequestType
  GObject
   +----InfAdoptedRequest

Properties

  "operation"                InfAdoptedOperation*  : Read / Write / Construct Only
  "type"                     InfAdoptedRequestType  : Read / Write / Construct Only
  "user-id"                  guint                 : Read / Write / Construct Only
  "vector"                   InfAdoptedStateVector*  : Read / Write / Construct Only

Description

An InfAdoptedRequest is basically an InfAdoptedOperation with some metadata used by InfAdoptedAlgorithm to determine which operations to transform against each other. If the type of the request is INF_ADOPTED_REQUEST_DO, then it contains the operation to perform, otherwise it does not because the request does not know the operation, it is computed by InfAdoptedAlgorithm when required. A InfAdoptedRequest also contains the state in which the operation can be applied to the buffer and the user ID of the InfAdoptedUser having generated the request.

Details

enum InfAdoptedRequestType

typedef enum {
  INF_ADOPTED_REQUEST_DO,
  INF_ADOPTED_REQUEST_UNDO,
  INF_ADOPTED_REQUEST_REDO
} InfAdoptedRequestType;

Possible types for an InfAdoptedRequest.

INF_ADOPTED_REQUEST_DO

A request that performs an operation.

INF_ADOPTED_REQUEST_UNDO

A request that undoes a previously applied request.

INF_ADOPTED_REQUEST_REDO

A request that redoes a previously undone request.

InfAdoptedRequest

typedef struct _InfAdoptedRequest InfAdoptedRequest;

InfAdoptedRequest is an opaque data type. You should only access it via the public API functions.


struct InfAdoptedRequestClass

struct InfAdoptedRequestClass {
};

This structure does not contain any public fields.


inf_adopted_request_new_do ()

InfAdoptedRequest * inf_adopted_request_new_do          (InfAdoptedStateVector *vector,
                                                         guint user_id,
                                                         InfAdoptedOperation *operation);

Creates a new InfAdoptedRequest with type INF_ADOPTED_REQUEST_DO.

vector :

The vector time at which the request was made.

user_id :

The ID of the user that made the request.

operation :

The operation the user performed.

Returns :

A new DO request.

inf_adopted_request_new_undo ()

InfAdoptedRequest * inf_adopted_request_new_undo        (InfAdoptedStateVector *vector,
                                                         guint user_id);

Creates a new InfAdoptedRequest with type INF_ADOPTED_REQUEST_UNDO. The operation performed is implicitely defined by reverting the operation of the associated DO or REDO request, but must still be computed by InfAdoptedAlgorithm.

vector :

The vector time at which the request was made.

user_id :

The ID of the user that made the request.

Returns :

A new UNDO request.

inf_adopted_request_new_redo ()

InfAdoptedRequest * inf_adopted_request_new_redo        (InfAdoptedStateVector *vector,
                                                         guint user_id);

Creates a new InfAdoptedRequest with type INF_ADOPTED_REQUEST_REDO. The operation performed is implicitely defined by reverting the operation of the associated UNDO request, but must still be computed by InfAdoptedAlgorithm.

vector :

The vector time at which the request was made.

user_id :

The ID of the user that made the request.

Returns :

A new REDO request.

inf_adopted_request_copy ()

InfAdoptedRequest * inf_adopted_request_copy            (InfAdoptedRequest *request);

Creates a copy of request with an initial reference count of 1.

request :

The InfAdoptedRequest to copy.

Returns :

A new InfAdoptedRequest.

inf_adopted_request_get_request_type ()

InfAdoptedRequestType inf_adopted_request_get_request_type
                                                        (InfAdoptedRequest *request);

Returns the request type of request.

request :

A InfAdoptedRequest.

Returns :

The type of request.

inf_adopted_request_get_vector ()

InfAdoptedStateVector * inf_adopted_request_get_vector  (InfAdoptedRequest *request);

Returns the vector time the request was made i.e. its operation can be applied to the buffer.

request :

A InfAdoptedRequest.

Returns :

The state vector of request. The returned value should not be freed, it is owned by the InfAdoptedRequest.

inf_adopted_request_get_user_id ()

guint               inf_adopted_request_get_user_id     (InfAdoptedRequest *request);

Returns the user ID of the user that issued request.

request :

A InfAdoptedRequest.

Returns :

The request's user ID.

inf_adopted_request_get_operation ()

InfAdoptedOperation * inf_adopted_request_get_operation (InfAdoptedRequest *request);

Returns the operation carried by the request. This can only be called if the request's type is INF_ADOPTED_REQUEST_DO.

request :

A InfAdoptedRequest.

Returns :

The request's operation.

inf_adopted_request_get_index ()

guint               inf_adopted_request_get_index       (InfAdoptedRequest *request);

Returns the vector time component of the request's own users. This corresponds to the request index by that user.

request :

A InfAdoptedRequest.

Returns :

The vector time component of the request's own user.

inf_adopted_request_need_concurrency_id ()

gboolean            inf_adopted_request_need_concurrency_id
                                                        (InfAdoptedRequest *request,
                                                         InfAdoptedRequest *against);

returns TRUE if you don't have another possibility to find a concurrency ID in which case user IDs are used to determine which request to transform.

Both request need to be of type INF_ADOPTED_REQUEST_DO, and their state vectors must be the same.

request :

The request to transform.

against :

The request to transform against.

Returns :

Whether transformation of request against against requires a concurrency ID.

inf_adopted_request_get_concurrency_id ()

InfAdoptedConcurrencyId inf_adopted_request_get_concurrency_id
                                                        (InfAdoptedRequest *request,
                                                         InfAdoptedRequest *against);

Returns a concurrency ID for transformation of operation against against. It always returns INF_ADOPTED_CONCURRENCY_NONE when inf_adopted_request_need_concurrency_id() returns TRUE (but that's not necessarily true the other way around), since it is not possible to decide which operation to transform without any additional information.

However, the function can be called on the same requests in a previous state. In some cases, a decision can be made based on these previous requests. This can be used as a concurrency ID for a call to inf_adopted_request_transform(). If this does not yield a decision, it is still possible to call inf_adopted_request_transform() with INF_ADOPTED_CONCURRENCY_NONE as concurrency ID in which case an arbitrary request will be transformed, based on the user IDs of the requests.

Both requests must be of type INF_ADOPTED_REQUEST_DO, and their state vectors must be the same.

request :

The request to transform.

against :

The request to transform against.

Returns :

A concurrency ID between operation and against. Can be INF_ADOPTED_CONCURRENCY_NONE in case no decision can be made.

inf_adopted_request_transform ()

InfAdoptedRequest * inf_adopted_request_transform       (InfAdoptedRequest *request,
                                                         InfAdoptedRequest *against,
                                                         InfAdoptedConcurrencyId concurrency_id);

Transforms the operation of request against the operation of against. Both requests must be of type INF_ADOPTED_REQUEST_DO, and their state vectors must be the same.

concurrency_id can be INF_ADOPTED_CONCURRENCY_NONE even if the transformation requires a concurrency ID (see inf_adopted_request_need_concurrency_id()). In that case, it is assumed that it does not matter which operation to transform, and user IDs are used to determine a concurrency ID for the transformation.

request :

The request to transform.

against :

The request to transform against.

concurrency_id :

A concurrency ID for the transformation.

Returns :

A new InfAdoptedRequest, the result of the transformation.

inf_adopted_request_mirror ()

InfAdoptedRequest * inf_adopted_request_mirror          (InfAdoptedRequest *request,
                                                         guint by);

Mirrors request as described in "Reducing the Problems of Group Undo" by Matthias Ressel and Rul Gunzenhäuser (http://portal.acm.org/citation.cfm?doid=320297.320312).

Note that by is the total amount of requests between the original and mirrored request, and thus equivalent to 2j-1 in the paper's definition.

request must be of type INF_ADOPTED_REQUEST_DO and its operation must be reversible.

request :

A InfAdoptedRequest.

by :

The number of requests between the original and the mirrored operation.

Returns :

The mirrored request as a new InfAdoptedRequest.

inf_adopted_request_fold ()

InfAdoptedRequest * inf_adopted_request_fold            (InfAdoptedRequest *request,
                                                         guint into,
                                                         guint by);

Folds request as described in "Reducing the Problems of Group Undo" by Matthias Ressel and Rul Gunzenhäuser (http://portal.acm.org/citation.cfm?doid=320297.320312).

Note that by is the total amount of requests between the original and the fold request, and thus equivalent to 2j in the paper's definition.

into must not be the same user as the one that issued request.

request :

A InfAdoptedRequest.

into :

The direction into which to fold.

by :

The number of operations between the original and the fold request.

Returns :

The folded request as a new InfAdoptedRequest.

inf_adopted_request_affects_buffer ()

gboolean            inf_adopted_request_affects_buffer  (InfAdoptedRequest *request);

Returns whether this request, when applied, changes the content of the buffer. If this is a INF_ADOPTED_REQUEST_UNDO or INF_ADOPTED_REQUEST_REDO request, than it always affects the buffer, because only requests that affect the buffer can be undone or redone. If it is a INF_ADOPTED_REQUEST_DO request, than it returns whether its operation has the INF_ADOPTED_OPERATION_AFFECTS_BUFFER flag set.

request :

A InfAdoptedRequest.

Returns :

Whether request affects the session's buffer.

Property Details

The "operation" property

  "operation"                InfAdoptedOperation*  : Read / Write / Construct Only

The operation of the request.


The "type" property

  "type"                     InfAdoptedRequestType  : Read / Write / Construct Only

The type of the operation.

Default value: INF_ADOPTED_REQUEST_DO


The "user-id" property

  "user-id"                  guint                 : Read / Write / Construct Only

The ID of the user that made the request.

Default value: 0


The "vector" property

  "vector"                   InfAdoptedStateVector*  : Read / Write / Construct Only

The vector time at which the request was made.

libinfinity-0.5.5/docs/reference/libinfinity/html/ch02.html0000644000175000017500000001263112264766270020575 00000000000000 Common libinfinity API

Common libinfinity API

InfInit
InfSession — Basic session object and synchronization
InfChatSession — Simple standalone chat
InfChatBuffer — A ring buffer for chat messages
InfUserTable — User information storage
InfUser
InfDiscovery — Discovery of remote services
InfLocalPublisher — Publish services on the local network
InfIpAddress — IPv4 and IPv6 addresses
InfTcpConnection
InfXmlConnection
InfXmppConnection
InfSimulatedConnection — Simulated network connection
InfDiscoveryAvahi — Service Discovery via Avahi
InfXmppManager — Reuse existing connections
InfIo — Event loop abstraction
InfStandaloneIo
InfCertificateChain — X.509 certificate chains
XML utility functions — Helper functions to read basic data types from XML
InfCertUtil
InfCertificateCredentialsReference-counted wrapper for gnutls_certificate_credentials_t
InfSaslContext — Asynchronous SASL processing
InfError — Common error codes
InfProtocol — Infinote protocol parameters
InfBuffer — Abstract document interface
libinfinity-0.5.5/docs/reference/libinfinity/html/InfAdoptedSession.html0000644000175000017500000010661012264766270023423 00000000000000 InfAdoptedSession

InfAdoptedSession

InfAdoptedSession — Session handling concurrency control via the adOPTed algorithm.

Stability Level

Unstable, unless otherwise indicated

Object Hierarchy

  GObject
   +----InfSession
         +----InfAdoptedSession

Implemented Interfaces

InfAdoptedSession implements InfCommunicationObject.

Properties

  "algorithm"                InfAdoptedAlgorithm*  : Read
  "io"                       InfIo*                : Read / Write / Construct Only
  "max-total-log-size"       guint                 : Read / Write / Construct Only

Description

InfAdoptedSession handles concurrency control with an InfAdoptedAlgorithm on top of a InfSession. It takes care of sending all necessary information to joining users, receives requests from the network (passing them to InfAdoptedAlgorithm) and transfers local requests to the other users. It also makes sure to periodically send the state the local host is in to other uses even if the local users are idle (which is required for others to cleanup their request logs and request caches).

Details

enum InfAdoptedSessionError

typedef enum {
  INF_ADOPTED_SESSION_ERROR_NO_SUCH_USER,
  INF_ADOPTED_SESSION_ERROR_MISSING_OPERATION,
  INF_ADOPTED_SESSION_ERROR_INVALID_REQUEST,

  INF_ADOPTED_SESSION_ERROR_MISSING_STATE_VECTOR,
  
  INF_ADOPTED_SESSION_ERROR_FAILED
} InfAdoptedSessionError;

Error codes for InfAdoptedSession. These only occur when invalid requests are received from the network.

INF_ADOPTED_SESSION_ERROR_NO_SUCH_USER

The "user" field in a request message does not contain a valid user ID.

INF_ADOPTED_SESSION_ERROR_MISSING_OPERATION

A request message does not contain an operation.

INF_ADOPTED_SESSION_ERROR_INVALID_REQUEST

A request in a synchronized request log is invalid. Invalid means that it is not the request that was issued after the previous request in the log, or that it is an Undo or Redo request without a request to Undo or Redo, respectively.

INF_ADOPTED_SESSION_ERROR_MISSING_STATE_VECTOR

A synchronized user does not contain that the state that user currently is in.

INF_ADOPTED_SESSION_ERROR_FAILED

No further specified error code.

InfAdoptedSession

typedef struct _InfAdoptedSession InfAdoptedSession;

InfAdoptedSession is an opaque data type. You should only access it via the public API functions.


struct InfAdoptedSessionClass

struct InfAdoptedSessionClass {
  InfAdoptedRequest*(*xml_to_request)(InfAdoptedSession* session,
                                      xmlNodePtr xml,
                                      InfAdoptedStateVector* diff_vec,
                                      gboolean for_sync,
                                      GError** error);

  void(*request_to_xml)(InfAdoptedSession* session,
                        xmlNodePtr xml,
                        InfAdoptedRequest* request,
                        InfAdoptedStateVector* diff_vec,
                        gboolean for_sync);
};

Virtual functions for InfAdoptedSession.

xml_to_request ()

Virtual function to deserialize an InfAdoptedRequest from XML. The implementation of this function can use inf_adopted_session_read_request_info() to read the common info.

request_to_xml ()

Virtual function to serialize an InfAdoptedRequest to XML. This function should add properties and children to the given XML node. At might use inf_adopted_session_write_request_info() to write the common info.

inf_adopted_session_get_io ()

InfIo *             inf_adopted_session_get_io          (InfAdoptedSession *session);

Returns the InfIo object of session.

session :

A InfAdoptedSession.

Returns :

A InfIo.

inf_adopted_session_get_algorithm ()

InfAdoptedAlgorithm * inf_adopted_session_get_algorithm (InfAdoptedSession *session);

Returns the InfAdoptedAlgorithm object of session. Returns NULL if session has status INF_SESSION_PRESYNC or INF_SESSION_SYNCHRONIZING because there the algorithm object is not yet created before successful synchronization.

session :

A InfAdoptedSession.

Returns :

A InfAdoptedAlgorithm, or NULL.

inf_adopted_session_broadcast_request ()

void                inf_adopted_session_broadcast_request
                                                        (InfAdoptedSession *session,
                                                         InfAdoptedRequest *request);

Sends a request to all subscribed connections. The request should originate from a call to inf_adopted_algorithm_generate_request_noexec(), inf_adopted_algorithm_generate_request(), inf_adopted_algorithm_generate_undo() or inf_adopted_algorithm_generate_redo() with session's InfAdoptedAlgorithm.

session :

A InfAdoptedSession.

request :

A InfAdoptedRequest obtained from session's algorithm.

inf_adopted_session_undo ()

void                inf_adopted_session_undo            (InfAdoptedSession *session,
                                                         InfAdoptedUser *user,
                                                         guint n);

This is a shortcut for creating n undo requests and broadcasting them. If n > 1 then this is also more efficient.

session :

A InfAdoptedSession.

user :

A local InfAdoptedUser.

n :

The number of undo requests to issue.

inf_adopted_session_redo ()

void                inf_adopted_session_redo            (InfAdoptedSession *session,
                                                         InfAdoptedUser *user,
                                                         guint n);

This is a shortcut for creating n redo requests and broadcasting them. If n > 1 then this is also more efficient.

session :

A InfAdoptedSession.

user :

A local InfAdoptedUser.

n :

The number of redo requests to issue.

inf_adopted_session_read_request_info ()

gboolean            inf_adopted_session_read_request_info
                                                        (InfAdoptedSession *session,
                                                         xmlNodePtr xml,
                                                         InfAdoptedStateVector *diff_vec,
                                                         InfAdoptedUser **user,
                                                         InfAdoptedStateVector **time,
                                                         xmlNodePtr *operation,
                                                         GError **error);

This function reads common information such as the state vector the request was made and the user that made the request from XML. It is most likely to be used by implementations of the xml_to_request virtual function.

session :

A InfAdoptedSession.

xml :

The XML to read the data from.

diff_vec :

The reference vector of the time vector of the request, or NULL.

user :

Location to store the user of the request, or NULL.

time :

Location to store the state the request was made, or NULL.

operation :

Location to store the operation of the request, or NULL.

error :

Location to place an error, if any.

Returns :

TRUE if the data could be read successfully, FALSE if the XML request does not contain valid request data, in which case error is set.

inf_adopted_session_write_request_info ()

void                inf_adopted_session_write_request_info
                                                        (InfAdoptedSession *session,
                                                         InfAdoptedRequest *request,
                                                         InfAdoptedStateVector *diff_vec,
                                                         xmlNodePtr xml,
                                                         xmlNodePtr operation);

This function writes common data from request, such as the user that issued the request and the state in which the request was made into xml. If diff_vec is given, then the state is written as a diff to this vector, see inf_adopted_state_vector_to_string_diff(). Deserializing this data again (via inf_adopted_session_read_request_info()) requires the same diff_vec then.

This function is most likely to be used by implementations of the request_to_xml virtual function.

session :

A InfAdoptedSession.

request :

The InfAdoptedRequest whose info to write.

diff_vec :

A reference state vector, or NULL.

xml :

The XML node to write the data into.

operation :

An XML node representing the operation of the request, or NULL.

Property Details

The "algorithm" property

  "algorithm"                InfAdoptedAlgorithm*  : Read

The adOPTed algorithm used for translating incoming requests.


The "io" property

  "io"                       InfIo*                : Read / Write / Construct Only

The IO object used for timeouts.


The "max-total-log-size" property

  "max-total-log-size"       guint                 : Read / Write / Construct Only

The maximum number of requests to keep in all user's logs.

Default value: 2048

libinfinity-0.5.5/docs/reference/libinfinity/html/InfcBrowser.html0000644000175000017500000037716512264766270022304 00000000000000 InfcBrowser

InfcBrowser

InfcBrowser — Browse remote directories

Stability Level

Unstable, unless otherwise indicated

Synopsis

#include <libinfinity/client/infc-browser.h>

enum                InfcBrowserStatus;
                    InfcBrowser;
struct              InfcBrowserClass;
InfcBrowser *       infc_browser_new                    (InfIo *io,
                                                         InfCommunicationManager *comm_manager,
                                                         InfXmlConnection *connection);
InfCommunicationManager * infc_browser_get_communication_manager
                                                        (InfcBrowser *browser);
InfXmlConnection *  infc_browser_get_connection         (InfcBrowser *browser);
InfcBrowserStatus   infc_browser_get_status             (InfcBrowser *browser);
gboolean            infc_browser_add_plugin             (InfcBrowser *browser,
                                                         const InfcNotePlugin *plugin);
const InfcNotePlugin * infc_browser_lookup_plugin       (InfcBrowser *browser,
                                                         const gchar *note_type);
void                infc_browser_iter_get_root          (InfcBrowser *browser,
                                                         InfcBrowserIter *iter);
gboolean            infc_browser_iter_get_next          (InfcBrowser *browser,
                                                         InfcBrowserIter *iter);
gboolean            infc_browser_iter_get_prev          (InfcBrowser *browser,
                                                         InfcBrowserIter *iter);
gboolean            infc_browser_iter_get_parent        (InfcBrowser *browser,
                                                         InfcBrowserIter *iter);
gboolean            infc_browser_iter_get_explored      (InfcBrowser *browser,
                                                         const InfcBrowserIter *iter);
gboolean            infc_browser_iter_get_child         (InfcBrowser *browser,
                                                         InfcBrowserIter *iter);
InfcExploreRequest * infc_browser_iter_explore          (InfcBrowser *browser,
                                                         const InfcBrowserIter *iter);
const gchar *       infc_browser_iter_get_name          (InfcBrowser *browser,
                                                         const InfcBrowserIter *iter);
gchar *             infc_browser_iter_get_path          (InfcBrowser *browser,
                                                         const InfcBrowserIter *iter);
gboolean            infc_browser_iter_is_subdirectory   (InfcBrowser *browser,
                                                         const InfcBrowserIter *iter);
InfcNodeRequest *   infc_browser_add_subdirectory       (InfcBrowser *browser,
                                                         const InfcBrowserIter *parent,
                                                         const gchar *name);
InfcNodeRequest *   infc_browser_add_note               (InfcBrowser *browser,
                                                         const InfcBrowserIter *parent,
                                                         const gchar *name,
                                                         const InfcNotePlugin *plugin,
                                                         gboolean initial_subscribe);
InfcNodeRequest *   infc_browser_add_note_with_content  (InfcBrowser *browser,
                                                         const InfcBrowserIter *parent,
                                                         const gchar *name,
                                                         const InfcNotePlugin *plugin,
                                                         InfSession *session,
                                                         gboolean initial_subscribe);
InfcNodeRequest *   infc_browser_remove_node            (InfcBrowser *browser,
                                                         const InfcBrowserIter *iter);
const gchar *       infc_browser_iter_get_note_type     (InfcBrowser *browser,
                                                         const InfcBrowserIter *iter);
const InfcNotePlugin * infc_browser_iter_get_plugin     (InfcBrowser *browser,
                                                         const InfcBrowserIter *iter);
InfcNodeRequest *   infc_browser_iter_subscribe_session (InfcBrowser *browser,
                                                         const InfcBrowserIter *iter);
InfcNodeRequest *   infc_browser_iter_save_session      (InfcBrowser *browser,
                                                         const InfcBrowserIter *iter);
InfcSessionProxy *  infc_browser_iter_get_session       (InfcBrowser *browser,
                                                         const InfcBrowserIter *iter);
InfcSessionProxy *  infc_browser_iter_get_sync_in       (InfcBrowser *browser,
                                                         const InfcBrowserIter *iter);
InfcNodeRequest *   infc_browser_iter_get_subscribe_request
                                                        (InfcBrowser *browser,
                                                         const InfcBrowserIter *iter);
InfcExploreRequest * infc_browser_iter_get_explore_request
                                                        (InfcBrowser *browser,
                                                         const InfcBrowserIter *iter);
GSList *            infc_browser_iter_get_sync_in_requests
                                                        (InfcBrowser *browser,
                                                         const InfcBrowserIter *iter);
gboolean            infc_browser_iter_from_node_request (InfcBrowser *browser,
                                                         InfcNodeRequest *request,
                                                         InfcBrowserIter *iter);
gboolean            infc_browser_iter_from_explore_request
                                                        (InfcBrowser *browser,
                                                         InfcExploreRequest *request,
                                                         InfcBrowserIter *iter);
gboolean            infc_browser_iter_is_valid          (InfcBrowser *browser,
                                                         const InfcBrowserIter *iter);
InfcNodeRequest *   infc_browser_subscribe_chat         (InfcBrowser *browser);
InfcNodeRequest *   infc_browser_get_subscribe_chat_request
                                                        (InfcBrowser *browser);
InfcSessionProxy *  infc_browser_get_chat_session       (InfcBrowser *browser);

Object Hierarchy

  GEnum
   +----InfcBrowserStatus
  GObject
   +----InfcBrowser

Implemented Interfaces

InfcBrowser implements InfCommunicationObject.

Properties

  "chat-session"             InfcSessionProxy*     : Read
  "communication-manager"    InfCommunicationManager*  : Read / Write / Construct Only
  "connection"               InfXmlConnection*     : Read / Write / Construct Only
  "io"                       InfIo*                : Read / Write / Construct Only
  "status"                   InfcBrowserStatus     : Read

Description

The InfcBrowser is used to browse a remote directory and can be used to subscribe to sessions.

Details

enum InfcBrowserStatus

typedef enum {
  INFC_BROWSER_DISCONNECTED,
  INFC_BROWSER_CONNECTING,
  INFC_BROWSER_CONNECTED
} InfcBrowserStatus;

This enumeration contains possible connection status values for InfcBrowser. Several operations, such as exploring a node or subscribing to a session can only be performed when the browser is connected to a remote infinote server.

INFC_BROWSER_DISCONNECTED

The browser is currently not connected to a server.

INFC_BROWSER_CONNECTING

The browser is currently establishing a connection to a remote server, but the connection is not yet fully established.

INFC_BROWSER_CONNECTED

The browser is connected to a remote server.

InfcBrowser

typedef struct _InfcBrowser InfcBrowser;

InfcBrowser is an opaque data type. You should only access it via the public API functions.


struct InfcBrowserClass

struct InfcBrowserClass {
  void (*error)(InfcBrowser* browser,
                const GError* error);

  void (*node_added)(InfcBrowser* browser,
                     InfcBrowserIter* iter);

  void (*node_removed)(InfcBrowser* browser,
                       InfcBrowserIter* iter);

  void (*subscribe_session)(InfcBrowser* browser,
                            InfcBrowserIter* iter,
                            InfcSessionProxy* proxy);

  void (*begin_explore)(InfcBrowser* browser,
                        InfcBrowserIter* iter,
                        InfcExploreRequest* request);

  void (*begin_subscribe)(InfcBrowser* browser,
                          InfcBrowserIter* iter,
                          InfcNodeRequest* request);
};

Signals for the InfcBrowser class.

error ()

Default signal handler for the "error" signal.

node_added ()

Default signal handler for the "node_added" signal.

node_removed ()

Default signal handler for the "node_removed" signal.

subscribe_session ()

Default signal handler for the "subscribe_session" signal.

begin_explore ()

Default signal handler for the "begin_explore" signal.

begin_subscribe ()

Default signal handler for the "begin_subscribe" signal.

infc_browser_new ()

InfcBrowser *       infc_browser_new                    (InfIo *io,
                                                         InfCommunicationManager *comm_manager,
                                                         InfXmlConnection *connection);

Creates a new InfcBrowser.

io :

A InfIo object used to schedule timeouts.

comm_manager :

A InfCommunicationManager to register the server connection and which forwards incoming data to the browser or running sessions.

connection :

Connection to the server.

Returns :

A new InfcBrowser.

infc_browser_get_communication_manager ()

InfCommunicationManager * infc_browser_get_communication_manager
                                                        (InfcBrowser *browser);

Returns the communication manager of this browser.

browser :

A InfcBrowser.

Returns :

A InfCommunicationManager.

infc_browser_get_connection ()

InfXmlConnection *  infc_browser_get_connection         (InfcBrowser *browser);

Returns the connection to the server.

browser :

A InfcBrowser.

Returns :

A InfXmlConnection.

infc_browser_get_status ()

InfcBrowserStatus   infc_browser_get_status             (InfcBrowser *browser);

Returns the browser's status. Note that the browser status can be INFC_BROWSER_DISCONNECTED even if browser's connection is still open. This can happen if a fatal error on the browser layer happens, for example when it does not understand the server's messages.

browser :

A InfcBrowser.

Returns :

The browser's status.

infc_browser_add_plugin ()

gboolean            infc_browser_add_plugin             (InfcBrowser *browser,
                                                         const InfcNotePlugin *plugin);

Adds plugin to browser. This allows the browser to create sessions of the plugin's type. Only one plugin of each type can be added to the directory.

browser :

A InfcBrowser.

plugin :

A InfcNotePlugin.

Returns :

Whether the plugin was added successfully.

infc_browser_lookup_plugin ()

const InfcNotePlugin * infc_browser_lookup_plugin       (InfcBrowser *browser,
                                                         const gchar *note_type);

Returns a previously registered plugin (see infc_browser_add_plugin()) for the given note type, or NULL if there is no such plugin.

browser :

A InfcBrowser.

note_type :

A note type, such as "InfText".

Returns :

A InfcNotePlugin, or NULL.

infc_browser_iter_get_root ()

void                infc_browser_iter_get_root          (InfcBrowser *browser,
                                                         InfcBrowserIter *iter);

Sets iter to point to the root node of the browser tree.

browser :

A InfcBrowser.

iter :

An uninitialized InfcBrowserIter.

infc_browser_iter_get_next ()

gboolean            infc_browser_iter_get_next          (InfcBrowser *browser,
                                                         InfcBrowserIter *iter);

Sets iter to point to the next node within the same subdirectory. If iter already points to the last node, iter is left untouched and FALSE is returned.

browser :

A InfcBrowser

iter :

A InfcBrowserIter pointing to a node in browser.

Returns :

TRUE if iter was set, FALSE otherwise.

infc_browser_iter_get_prev ()

gboolean            infc_browser_iter_get_prev          (InfcBrowser *browser,
                                                         InfcBrowserIter *iter);

Sets iter to point to the provious node within the same subdirectory. If iter already points to the first node, iter is left untouched and FALSE is returned.

browser :

A InfcBrowser

iter :

A InfcBrowserIter pointing to a node in browser.

Returns :

TRUE if iter was set, FALSE otherwise.

infc_browser_iter_get_parent ()

gboolean            infc_browser_iter_get_parent        (InfcBrowser *browser,
                                                         InfcBrowserIter *iter);

Sets iter to point to the parent node. If iter already points to the root node, iter is left untouched and the function returns FALSE.

browser :

A InfcBrowser.

iter :

A InfcBrowserIter pointing to a node in browser.

Returns :

TRUE if iter was set, FALSE otherwise.

infc_browser_iter_get_explored ()

gboolean            infc_browser_iter_get_explored      (InfcBrowser *browser,
                                                         const InfcBrowserIter *iter);

Returns whether the subdirectory node iter points to has been explored.

browser :

A InfcBrowser.

iter :

A InfcBrowserIter pointing to a subdirectory node in browser.

Returns :

TRUE if the subdirectory has been explored and FALSE otherwise.

infc_browser_iter_get_child ()

gboolean            infc_browser_iter_get_child         (InfcBrowser *browser,
                                                         InfcBrowserIter *iter);

Sets iter to point to the first child of the subdirectory it is currently pointing to. The subdirectory must already have been explored. If the subdirectory has no children, iter is left untouched and FALSE is returned.

browser :

A InfcBrowser.

iter :

A InfcBrowserIter pointing to a subdirectory node in brwoser that has already been explored.

Returns :

TRUE if iter was set, FALSE otherwise.

infc_browser_iter_explore ()

InfcExploreRequest * infc_browser_iter_explore          (InfcBrowser *browser,
                                                         const InfcBrowserIter *iter);

Explores the given subdirectory node. The returned request may be used to get informed about exploration progress and completion. When the exploration has been initiated, infc_browser_iter_get_child() may be called to get the content that has been explored so far. When the request has finished, all content is available.

browser :

A InfcBrowser.

iter :

A InfcBrowserIter pointing to a subdirectory node in browser that has not yet been explored.

Returns :

A InfcExploreRequest to watch the exploration process.

infc_browser_iter_get_name ()

const gchar *       infc_browser_iter_get_name          (InfcBrowser *browser,
                                                         const InfcBrowserIter *iter);

Returns the name of the node iter points to.

browser :

A InfcBrowser.

iter :

A InfcBrowserIter pointing to a node in browser.

Returns :

The node's name. The returned string must not be freed.

infc_browser_iter_get_path ()

gchar *             infc_browser_iter_get_path          (InfcBrowser *browser,
                                                         const InfcBrowserIter *iter);

Returns the complete path to the node iter points to. The path to a node is the name of the node and the name of all parent nodes separated by '/', as a filesystem path on Unix.

browser :

A InfcBrowser.

iter :

A InfcBrowserIter pointing to a node in browser.

Returns :

The node's path. Free with g_free() when no longer in use.

infc_browser_iter_is_subdirectory ()

gboolean            infc_browser_iter_is_subdirectory   (InfcBrowser *browser,
                                                         const InfcBrowserIter *iter);

Returns whether iter points to a subdirectory node or not.

browser :

A InfcBrowser.

iter :

A InfcBrowserIter pointing to a node in browser.

Returns :

Whether the node iter points to is a subdirectory node.

infc_browser_add_subdirectory ()

InfcNodeRequest *   infc_browser_add_subdirectory       (InfcBrowser *browser,
                                                         const InfcBrowserIter *parent,
                                                         const gchar *name);

Creates a new request that asks the server to create a new subdirectory. Note that the parent subdirectory must already have been explored.

browser :

A InfcBrowser.

parent :

A InfcBrowserIter pointing to an explored subdirectory in which to create the new subdirectory.

name :

The name for the new subdirectory.

Returns :

A InfcNodeRequest to be notified when the request finishes or fails.

infc_browser_add_note ()

InfcNodeRequest *   infc_browser_add_note               (InfcBrowser *browser,
                                                         const InfcBrowserIter *parent,
                                                         const gchar *name,
                                                         const InfcNotePlugin *plugin,
                                                         gboolean initial_subscribe);

Asks the server to create a new note with the given type. The returned request may be used to be notified when the request finishes or fails.

If initial_subscribe is set, then, when the returned request finishes, you might call infc_browser_iter_get_session() on the resulting InfcBrowserIter. However, that function is not guaranteed to return non-NULL in this case since the node might have been created, but the subscription could have failed.

browser :

A InfcBrowser.

parent :

A InfcBrowserIter pointing to an explored subdirectory.

name :

Name for the new node.

plugin :

Type of the new node.

initial_subscribe :

Whether to automatically subscribe to the newly created node.

Returns :

A InfcNodeRequest.

infc_browser_add_note_with_content ()

InfcNodeRequest *   infc_browser_add_note_with_content  (InfcBrowser *browser,
                                                         const InfcBrowserIter *parent,
                                                         const gchar *name,
                                                         const InfcNotePlugin *plugin,
                                                         InfSession *session,
                                                         gboolean initial_subscribe);

Asks the server to create a new note with the given type. The returned request may be used to be notified when the request finishes or fails.

The returned request finishes as soon as the server acknowledges the creation of the node, which is before the content is transmitted. If, during transmission, an error occurs, then the node is removed again. To get notified when the transmission fails, finishes or changes in progress, you can connect to the InfSession::synchronization-failed, InfSession::synchronization-complete and InfSession::synchronization-progress signals. Note that a single session might be synchronized to multiple servers at the same time, you will have to check the connection parameter in the signal hander to find out to which server the session is synchronized.

You can safely unref session after having called this function. If the request or the synchronization fails, the session will be discarded in that case. When the returned request finishes, you can use infc_browser_iter_get_sync_in() to get the session again.

If initial_subscribe is set, then, when the returned request finishes, you might call infc_browser_iter_get_session() on the resulting InfcBrowserIter. However, that function is not guaranteed to return non-NULL in this case since the node might have been created, but the subscription could have failed.

browser :

A InfcBrowser.

parent :

A InfcBrowserIter pointing to an explored subdirectory.

name :

Name for the new node.

plugin :

Type of the new node.

session :

A session that is copied to the server and used as initial content for the new node.

initial_subscribe :

Whether to automatically subscribe to the newly created node.

Returns :

A InfcNodeRequest.

infc_browser_remove_node ()

InfcNodeRequest *   infc_browser_remove_node            (InfcBrowser *browser,
                                                         const InfcBrowserIter *iter);

Asks the server to remove the node iter points to.

browser :

A InfcBrowser.

iter :

A InfcBrowserIter pointing to a node in browser.

Returns :

A InfcNodeRequest that may be used to get notified when the request finishes or fails.

infc_browser_iter_get_note_type ()

const gchar *       infc_browser_iter_get_note_type     (InfcBrowser *browser,
                                                         const InfcBrowserIter *iter);

Returns the type of the note iter points to. This must not be a subdirectory node.

browser :

A InfcBrowser.

iter :

A InfcBrowserIter pointing to a note inside browser.

Returns :

The note's type.

infc_browser_iter_get_plugin ()

const InfcNotePlugin * infc_browser_iter_get_plugin     (InfcBrowser *browser,
                                                         const InfcBrowserIter *iter);

Returns the InfcNotePlugin that is used for subscriptions to the note iter points to, or NULL if no plugin for the note's type has been registered.

browser :

A InfcBrowser.

iter :

A InfcBrowserIter pointing to a note inside browser.

Returns :

A InfcNotePlugin, or NULL.

infc_browser_iter_subscribe_session ()

InfcNodeRequest *   infc_browser_iter_subscribe_session (InfcBrowser *browser,
                                                         const InfcBrowserIter *iter);

Subscribes to the given note. When the request has finished (which does not mean that the subscription has finished, but the server is ready to perform the subscription), infc_browser_iter_get_session() can be used to access the InfcSessionProxy object representing the subscription.

browser :

A InfcBrowser.

iter :

A InfcBrowserIter pointing to a note inside browser.

Returns :

A InfcNodeRequest that may be used to get notified when the request finishes or fails.

infc_browser_iter_save_session ()

InfcNodeRequest *   infc_browser_iter_save_session      (InfcBrowser *browser,
                                                         const InfcBrowserIter *iter);

Requests that the server saves the note pointed to by iter into its background storage. Normally, the server only does this when it is either shut down or when the there are no more subscriptions to the note. Note that this is merely a request and the server might decide not to save the session for whatever reason.

browser :

A InfcBrowser.

iter :

A InfcBrowserIter pointing to a note in browser.

Returns :

A InfcNodeRequest that may be used to get notified when the request finishes or fails.

infc_browser_iter_get_session ()

InfcSessionProxy *  infc_browser_iter_get_session       (InfcBrowser *browser,
                                                         const InfcBrowserIter *iter);

Returns the InfcSessionProxy representing the subscription to the given note, if the client is subscribed, and NULL otherwise.

browser :

A InfcBrowser.

iter :

A InfcBrowserIter pointing to a note in browser.

Returns :

A InfcSessionProxy, or NULL if not subscribed.

infc_browser_iter_get_sync_in ()

InfcSessionProxy *  infc_browser_iter_get_sync_in       (InfcBrowser *browser,
                                                         const InfcBrowserIter *iter);

Returns the InfcSessionProxy that is used to synchronize the note iter points to to the server. Such a node is created by infc_browser_add_note_with_content(). If the client is subscribed to this note, then this returns the same session as infc_browser_iter_get_session(). However, it is possible that we synchronize this node to the server without being subscribed to it. In this case, this function returns the session that does the synchronization, while infc_browser_iter_get_session() would return NULL.

browser :

A InfcBrowser.

iter :

A InfcBrowserIter pointing to a note in browser.

Returns :

A InfcSessionProxy, or NULL if we are currently not synchronizing this node to the server.

infc_browser_iter_get_subscribe_request ()

InfcNodeRequest *   infc_browser_iter_get_subscribe_request
                                                        (InfcBrowser *browser,
                                                         const InfcBrowserIter *iter);

Returns the InfcNodeRequest that represents the subscription request sent for the note iter points to. Returns NULL if we are already subscribed to that node, or no subscription request has been sent. In the former case infc_browser_iter_get_session() will return the InfcSessionProxy for the subscription.

browser :

A InfcBrowser.

iter :

A InfcBrowserIter pointing to a note in browser.

Returns :

A InfcNodeRequest, or NULL.

infc_browser_iter_get_explore_request ()

InfcExploreRequest * infc_browser_iter_get_explore_request
                                                        (InfcBrowser *browser,
                                                         const InfcBrowserIter *iter);

Returns the InfcExploreRequest with which the node iter points to is currenty explored. Returns NULL if that node is already explored or is not currently explored.

browser :

A InfcBrowser.

iter :

A InfcBrowserIter pointing to a subdirectory node in browser.

Returns :

A InfcExploreRequest, or NULL.

infc_browser_iter_get_sync_in_requests ()

GSList *            infc_browser_iter_get_sync_in_requests
                                                        (InfcBrowser *browser,
                                                         const InfcBrowserIter *iter);

Returns a list of all InfcNodeRequest created with infc_browser_add_note_with_content() with the node iter points to as parent. Such requests begin a synchronization to the server when they have finished.

browser :

A InfcBrowser.

iter :

A InfcBrowserIter pointing to a subdirectory node in browser.

Returns :

A list of InfcNodeRequests. Free with g_slist_free() when done.

infc_browser_iter_from_node_request ()

gboolean            infc_browser_iter_from_node_request (InfcBrowser *browser,
                                                         InfcNodeRequest *request,
                                                         InfcBrowserIter *iter);

Sets iter to point to the node request is related to. If there is no such node (someone could have deleted it while the request is still running), the function returns FALSE and iter is unchanged.

browser :

A InfcBrowser.

request :

A InfcNodeRequest issued by browser.

iter :

A InfcBrowserIter.

Returns :

TRUE if iter was set, FALSE otherwise.

infc_browser_iter_from_explore_request ()

gboolean            infc_browser_iter_from_explore_request
                                                        (InfcBrowser *browser,
                                                         InfcExploreRequest *request,
                                                         InfcBrowserIter *iter);

Sets iter to the node request is currently exploring. If there is no such node (someone could have deleted it while exploring), the function returns FALSE and lets iter untouched.

browser :

A InfcBrowser.

request :

A InfcExploreRequest exploring a node in browser.

iter :

A InfcBrowserIter.

Returns :

TRUE if iter was set, FALSE otherwise.

infc_browser_iter_is_valid ()

gboolean            infc_browser_iter_is_valid          (InfcBrowser *browser,
                                                         const InfcBrowserIter *iter);

Returns whether iter points to a valid node in browser. This is generally the case for any InfcBrowserIter returned by one of the InfcBrowser functions, it gets invalid however as soon as the node it points to is removed.

browser :

A InfcBrowser.

iter :

A InfcBrowserIter.

Returns :

Whether iter points to a node in browser.

infc_browser_subscribe_chat ()

InfcNodeRequest *   infc_browser_subscribe_chat         (InfcBrowser *browser);

Attempts to subscribe to the server's chat. When the operation finishes infc_browser_get_chat_session() will return a InfcSessionProxy representing the chat session. It can be used to read the chat's content. The request can fail in case the server chat is disabled.

browser :

A InfcBrowser.

Returns :

A InfcNodeRequest that may be used to get notified when the request finishes or fails.

infc_browser_get_subscribe_chat_request ()

InfcNodeRequest *   infc_browser_get_subscribe_chat_request
                                                        (InfcBrowser *browser);

Returns the InfcNodeRequest that represests the request sent to the server which attempts to subscribe to its chat. If there is no such request running, then the function returns NULL. After such a request finishes, call infc_browser_get_chat_session() to get the InfcSessionProxy for the chat session. To initiate the request, call infc_browser_subscribe_chat().

browser :

A InfcBrowser.

Returns :

A InfcNodeRequest, or NULL.

infc_browser_get_chat_session ()

InfcSessionProxy *  infc_browser_get_chat_session       (InfcBrowser *browser);

Returns the InfcSessionProxy representing the running chat session if the local client is subscribed to it, or NULL otherwise.

browser :

A InfcBrowser.

Returns :

A InfcSessionProxy for the chat, or NULL.

Property Details

The "chat-session" property

  "chat-session"             InfcSessionProxy*     : Read

Active chat session.


The "communication-manager" property

  "communication-manager"    InfCommunicationManager*  : Read / Write / Construct Only

The communication manager for the browser.


The "connection" property

  "connection"               InfXmlConnection*     : Read / Write / Construct Only

Connection to the server exposing the directory to browse.


The "io" property

  "io"                       InfIo*                : Read / Write / Construct Only

The InfIo to schedule timeouts.


The "status" property

  "status"                   InfcBrowserStatus     : Read

The current connectivity status of the browser.

Default value: INFC_BROWSER_DISCONNECTED

Signal Details

The "begin-explore" signal

void                user_function                      (InfcBrowser        *browser,
                                                        InfcBrowserIter    *iter,
                                                        InfcExploreRequest *request,
                                                        gpointer            user_data)      : Run Last

This signal is emitted when a subdirectory is started to be explored. request can be used to get notified when the exploration was finished.

browser :

The InfcBrowser emitting the siganl.

iter :

A InfcBrowserIter pointing to the node being explored.

request :

A InfcExploreRequest for the operation.

user_data :

user data set when the signal handler was connected.

The "begin-subscribe" signal

void                user_function                      (InfcBrowser     *browser,
                                                        InfcBrowserIter *iter,
                                                        InfcNodeRequest *request,
                                                        gpointer         user_data)      : Run Last

This signal is emitted whenever a subscription request for a (non-subdirectory) node is made. Note that the subscription may still fail (connect to "finished" and "failed" to be notified).

If iter is NULL the signal refers to the chat session, otherwise it points to the node to whose session the client requested a subscription.

browser :

The InfcBrowser emitting the signal.

iter :

A InfcBrowserIter pointing to the node to which the subscription starts, or NULL.

request :

A InfcNodeRequest for the operation.

user_data :

user data set when the signal handler was connected.

The "error" signal

void                user_function                      (InfcBrowser *browser,
                                                        gpointer     error,
                                                        gpointer     user_data)      : Run Last

This signal is emitted whenever an error occured. If the browser's underlying InfXmlConnection produces emits "error", then this signal will be emitted with the corresponding error as well. Also, if another error occurs on the browser level this signal is emitted. It may or may not be fatal. If it is fatal then the browser's status will change to INFC_BROWSER_DISCONNECTED.

browser :

The InfcBrowser emitting the signal.

error :

A GError* saying what's wrong.

user_data :

user data set when the signal handler was connected.

The "node-added" signal

void                user_function                      (InfcBrowser     *browser,
                                                        InfcBrowserIter *iter,
                                                        gpointer         user_data)      : Run Last

Emitted when a new node was added in the browser. This can happen either while exploring a subdirectory, or when a new node was added on the server. In the latter case the signal is only emitted when the parent directory of the newly created node is already explored.

browser :

The InfcBrowser emitting the siganl.

iter :

A InfcBrowserIter pointing to the created node.

user_data :

user data set when the signal handler was connected.

The "node-removed" signal

void                user_function                      (InfcBrowser     *browser,
                                                        InfcBrowserIter *iter,
                                                        gpointer         user_data)      : Run Last

This signal is emitted every time a node is removed from the browser. This happens when the corresponding node is removed at the server. The signal is emitted only when the parent directory of the removed node is already explored. The signal can also be emitted on non-empty subdirectory nodes in which case all children are also removed.

browser :

The InfcBrowser emitting the siganl.

iter :

A InfcBrowserIter pointing to the removed node.

user_data :

user data set when the signal handler was connected.

The "subscribe-session" signal

void                user_function                      (InfcBrowser      *browser,
                                                        InfcBrowserIter  *iter,
                                                        InfcSessionProxy *proxy,
                                                        gpointer          user_data)      : Run Last

Emitted when subscribed to a session. The subscription was successful, but the synchronization (the server sending the initial session state) might still fail. Use "synchronization-complete" and "synchronization-failed" to be notified.

If iter is NULL this is a subscription to the chat. This guarantees proxy's session to be a InfChatSession. If iter is non-NULL this is a subscription to the session of the node pointed to by iter.

browser :

The InfcBrowser emitting the siganl.

iter :

A InfcBrowserIter pointing to the subscribed node, or NULL.

proxy :

A InfcSessionProxy for the subscribed session.

user_data :

user data set when the signal handler was connected.

See Also

InfdDirectory
libinfinity-0.5.5/docs/reference/libinfinity/html/InfCommunicationRegistry.html0000644000175000017500000005771512264766270025050 00000000000000 InfCommunicationRegistry

InfCommunicationRegistry

InfCommunicationRegistry — Sharing connections between multiple groups

Stability Level

Unstable, unless otherwise indicated

Object Hierarchy

  GObject
   +----InfCommunicationRegistry

Description

InfCommunicationRegistry provides a way for InfCommunicationMethod implementations to share connections with other groups. Before using a connection, call inf_communication_registry_register(). Then, messages can be sent to the group via inf_communication_registry_send().

The InfCommunicationRegistry calls inf_communication_method_received() on your method when it received a message for the group, inf_communication_method_enqueued() when sending the message cannot be cancelled anymore via inf_communication_registry_cancel_messages() and inf_communication_method_sent() when the message has been sent.

Details

InfCommunicationRegistry

typedef struct _InfCommunicationRegistry InfCommunicationRegistry;

InfCommunicationRegistry is an opaque data type. You should only access it via the public API functions.


struct InfCommunicationRegistryClass

struct InfCommunicationRegistryClass {
};

This structure does not contain any public fields.


inf_communication_registry_register ()

void                inf_communication_registry_register (InfCommunicationRegistry *registry,
                                                         InfCommunicationGroup *group,
                                                         InfCommunicationMethod *method,
                                                         InfXmlConnection *connection);

Registers connection with group. This allows sending messages to connection via inf_communication_registry_send(). For received messages, inf_communication_method_received() is called on method.

connection must have status INF_XML_CONNECTION_OPEN.

registry :

A InfCommunicationRegistry.

group :

The group for which to register a connection.

method :

The InfCommunicationMethod used.

connection :

The connection to register.

inf_communication_registry_unregister ()

void                inf_communication_registry_unregister
                                                        (InfCommunicationRegistry *registry,
                                                         InfCommunicationGroup *group,
                                                         InfXmlConnection *connection);

Unregisters connection from group. Incoming messages are no longer reported to group's method, and inf_communication_registry_send() can no longer be called for connection.

registry :

A InfCommunicationRegistry.

group :

The group for which to unregister a connection.

connection :

The connection to unregister.

inf_communication_registry_is_registered ()

gboolean            inf_communication_registry_is_registered
                                                        (InfCommunicationRegistry *registry,
                                                         InfCommunicationGroup *group,
                                                         InfXmlConnection *connection);

Returns whether connection has been registered for group with inf_communication_registry_register().

registry :

A InfCommunicationRegistry.

group :

The group for which to check whether connection is registered.

connection :

The connection to check for registration.

Returns :

TRUE if connection has been registered, or FALSE otherwise.

inf_communication_registry_send ()

void                inf_communication_registry_send     (InfCommunicationRegistry *registry,
                                                         InfCommunicationGroup *group,
                                                         InfXmlConnection *connection,
                                                         xmlNodePtr xml);

Sends an XML message to connection. connection must have been registered with inf_communication_registry_register() before. If the message has been sent, inf_communication_method_sent() is called on the method the connection was registered with. inf_communication_method_enqueued() is called when sending the message can no longer be cancelled via inf_communication_registry_cancel_messages().

This function takes ownership of xml.

registry :

A InfCommunicationRegistry.

group :

The group for which to send the message InfCommunicationGroup.

connection :

A registered InfXmlConnection.

xml :

The message to send.

inf_communication_registry_cancel_messages ()

void                inf_communication_registry_cancel_messages
                                                        (InfCommunicationRegistry *registry,
                                                         InfCommunicationGroup *group,
                                                         InfXmlConnection *connection);

Stops all messages scheduled to be sent to connection in group from being sent.

registry :

A InfCommunicationRegistry.

group :

The group for which to cancel messages.

connection :

A registered InfXmlConnection.
libinfinity-0.5.5/docs/reference/libinfinity/html/InfXmppConnection.html0000644000175000017500000017226312264766270023452 00000000000000 InfXmppConnection

InfXmppConnection

InfXmppConnection

Object Hierarchy

  GEnum
   +----InfXmppConnectionSite
  GEnum
   +----InfXmppConnectionSecurityPolicy
  GObject
   +----InfXmppConnection

Implemented Interfaces

InfXmppConnection implements InfXmlConnection.

Properties

  "credentials"              InfCertificateCredentials*  : Read / Write / Construct Only
  "local-hostname"           gchar*                : Read / Write / Construct Only
  "remote-hostname"          gchar*                : Read / Write / Construct Only
  "sasl-context"             InfSaslContext*       : Read / Write / Construct Only
  "sasl-mechanisms"          gchar*                : Read / Write / Construct Only
  "security-policy"          InfXmppConnectionSecurityPolicy  : Read / Write / Construct Only
  "site"                     InfXmppConnectionSite  : Read / Write / Construct Only
  "tcp-connection"           InfTcpConnection*     : Read / Write / Construct Only
  "tls-enabled"              gboolean              : Read

Description

Details

InfXmppConnectionCrtCallback ()

void                (*InfXmppConnectionCrtCallback)     (InfXmppConnection *xmpp,
                                                         InfCertificateChain *chain,
                                                         gpointer user_data);


enum InfXmppConnectionSite

typedef enum {
  INF_XMPP_CONNECTION_SERVER,
  INF_XMPP_CONNECTION_CLIENT
} InfXmppConnectionSite;

INF_XMPP_CONNECTION_SERVER

INF_XMPP_CONNECTION_CLIENT


enum InfXmppConnectionSecurityPolicy

typedef enum {
  /* Server: Do not offer TLS.
   * Client: Only connect if TLS is not required. */
  INF_XMPP_CONNECTION_SECURITY_ONLY_UNSECURED,
  /* Server: Require TLS.
   * Client: Only connect if TLS is available. */
  INF_XMPP_CONNECTION_SECURITY_ONLY_TLS,
  /* Server: Offer both.
   * Client: Use unsecured communication unless TLS is required */
  INF_XMPP_CONNECTION_SECURITY_BOTH_PREFER_UNSECURED,
  /* Server: Offer both.
   * Client: Use TLS-secured communication unless TLS is not available. */
  INF_XMPP_CONNECTION_SECURITY_BOTH_PREFER_TLS
} InfXmppConnectionSecurityPolicy;

INF_XMPP_CONNECTION_SECURITY_ONLY_UNSECURED

INF_XMPP_CONNECTION_SECURITY_ONLY_TLS

INF_XMPP_CONNECTION_SECURITY_BOTH_PREFER_UNSECURED

INF_XMPP_CONNECTION_SECURITY_BOTH_PREFER_TLS


enum InfXmppConnectionError

typedef enum {
  /* Server does not support TLS */
  INF_XMPP_CONNECTION_ERROR_TLS_UNSUPPORTED,
  /* The server requires TLS, but we don't want TLS */
  INF_XMPP_CONNECTION_ERROR_TLS_REQUIRED,
  /* Got <failure> as response to <starttls> */
  INF_XMPP_CONNECTION_ERROR_TLS_FAILURE,
  /* The server did not provide a certificate */
  INF_XMPP_CONNECTION_ERROR_NO_CERTIFICATE_PROVIDED,
  /* The server certificate is not trusted */
  INF_XMPP_CONNECTION_ERROR_CERTIFICATE_NOT_TRUSTED,
  /* Server does not provide authentication mechanisms */
  INF_XMPP_CONNECTION_ERROR_AUTHENTICATION_UNSUPPORTED,
  /* Server does not offer a suitable machnism */
  INF_XMPP_CONNECTION_ERROR_NO_SUITABLE_MECHANISM,

  INF_XMPP_CONNECTION_ERROR_FAILED
} InfXmppConnectionError;

INF_XMPP_CONNECTION_ERROR_TLS_UNSUPPORTED

INF_XMPP_CONNECTION_ERROR_TLS_REQUIRED

INF_XMPP_CONNECTION_ERROR_TLS_FAILURE

INF_XMPP_CONNECTION_ERROR_NO_CERTIFICATE_PROVIDED

INF_XMPP_CONNECTION_ERROR_CERTIFICATE_NOT_TRUSTED

INF_XMPP_CONNECTION_ERROR_AUTHENTICATION_UNSUPPORTED

INF_XMPP_CONNECTION_ERROR_NO_SUITABLE_MECHANISM

INF_XMPP_CONNECTION_ERROR_FAILED


enum InfXmppConnectionStreamError

typedef enum {
  INF_XMPP_CONNECTION_STREAM_ERROR_BAD_FORMAT,
  INF_XMPP_CONNECTION_STREAM_ERROR_BAD_NAMESPACE_PREFIX,
  INF_XMPP_CONNECTION_STREAM_ERROR_CONFLICT,
  INF_XMPP_CONNECTION_STREAM_ERROR_CONNECTION_TIMEOUT,
  INF_XMPP_CONNECTION_STREAM_ERROR_HOST_GONE,
  INF_XMPP_CONNECTION_STREAM_ERROR_HOST_UNKNOWN,
  INF_XMPP_CONNECTION_STREAM_ERROR_IMPROPER_ADDRESSING,
  INF_XMPP_CONNECTION_STREAM_ERROR_INTERNAL_SERVER_ERROR,
  INF_XMPP_CONNECTION_STREAM_ERROR_INVALID_FROM,
  INF_XMPP_CONNECTION_STREAM_ERROR_INVALID_ID,
  INF_XMPP_CONNECTION_STREAM_ERROR_INVALID_NAMESPACE,
  INF_XMPP_CONNECTION_STREAM_ERROR_INVALID_XML,
  INF_XMPP_CONNECTION_STREAM_ERROR_NOT_AUTHORIZED,
  INF_XMPP_CONNECTION_STREAM_ERROR_POLICY_VIOLATION,
  INF_XMPP_CONNECTION_STREAM_ERROR_REMOTE_CONNECTION_FAILED,
  INF_XMPP_CONNECTION_STREAM_ERROR_RESOURCE_CONSTRAINT,
  INF_XMPP_CONNECTION_STREAM_ERROR_RESTRICTED_XML,
  INF_XMPP_CONNECTION_STREAM_ERROR_SEE_OTHER_HOST,
  INF_XMPP_CONNECTION_STREAM_ERROR_SYSTEM_SHUTDOWN,
  INF_XMPP_CONNECTION_STREAM_ERROR_UNDEFINED_CONDITION,
  INF_XMPP_CONNECTION_STREAM_ERROR_UNSUPPORTED_ENCODING,
  INF_XMPP_CONNECTION_STREAM_ERROR_UNSUPPORTED_STANZA_TYPE,
  INF_XMPP_CONNECTION_STREAM_ERROR_UNSUPPORTED_VERSION,
  INF_XMPP_CONNECTION_STREAM_ERROR_XML_NOT_WELL_FORMED,

  INF_XMPP_CONNECTION_STREAM_ERROR_FAILED
} InfXmppConnectionStreamError;

INF_XMPP_CONNECTION_STREAM_ERROR_BAD_FORMAT

INF_XMPP_CONNECTION_STREAM_ERROR_BAD_NAMESPACE_PREFIX

INF_XMPP_CONNECTION_STREAM_ERROR_CONFLICT

INF_XMPP_CONNECTION_STREAM_ERROR_CONNECTION_TIMEOUT

INF_XMPP_CONNECTION_STREAM_ERROR_HOST_GONE

INF_XMPP_CONNECTION_STREAM_ERROR_HOST_UNKNOWN

INF_XMPP_CONNECTION_STREAM_ERROR_IMPROPER_ADDRESSING

INF_XMPP_CONNECTION_STREAM_ERROR_INTERNAL_SERVER_ERROR

INF_XMPP_CONNECTION_STREAM_ERROR_INVALID_FROM

INF_XMPP_CONNECTION_STREAM_ERROR_INVALID_ID

INF_XMPP_CONNECTION_STREAM_ERROR_INVALID_NAMESPACE

INF_XMPP_CONNECTION_STREAM_ERROR_INVALID_XML

INF_XMPP_CONNECTION_STREAM_ERROR_NOT_AUTHORIZED

INF_XMPP_CONNECTION_STREAM_ERROR_POLICY_VIOLATION

INF_XMPP_CONNECTION_STREAM_ERROR_REMOTE_CONNECTION_FAILED

INF_XMPP_CONNECTION_STREAM_ERROR_RESOURCE_CONSTRAINT

INF_XMPP_CONNECTION_STREAM_ERROR_RESTRICTED_XML

INF_XMPP_CONNECTION_STREAM_ERROR_SEE_OTHER_HOST

INF_XMPP_CONNECTION_STREAM_ERROR_SYSTEM_SHUTDOWN

INF_XMPP_CONNECTION_STREAM_ERROR_UNDEFINED_CONDITION

INF_XMPP_CONNECTION_STREAM_ERROR_UNSUPPORTED_ENCODING

INF_XMPP_CONNECTION_STREAM_ERROR_UNSUPPORTED_STANZA_TYPE

INF_XMPP_CONNECTION_STREAM_ERROR_UNSUPPORTED_VERSION

INF_XMPP_CONNECTION_STREAM_ERROR_XML_NOT_WELL_FORMED

INF_XMPP_CONNECTION_STREAM_ERROR_FAILED


enum InfXmppConnectionAuthError

typedef enum {
  INF_XMPP_CONNECTION_AUTH_ERROR_ABORTED,
  INF_XMPP_CONNECTION_AUTH_ERROR_INCORRECT_ENCODING,
  INF_XMPP_CONNECTION_AUTH_ERROR_INVALID_AUTHZID,
  INF_XMPP_CONNECTION_AUTH_ERROR_INVALID_MECHANISM,
  INF_XMPP_CONNECTION_AUTH_ERROR_MECHANISM_TOO_WEAK,
  INF_XMPP_CONNECTION_AUTH_ERROR_NOT_AUTHORIZED,
  INF_XMPP_CONNECTION_AUTH_ERROR_TEMPORARY_AUTH_FAILURE,

  INF_XMPP_CONNECTION_AUTH_ERROR_FAILED
} InfXmppConnectionAuthError;

INF_XMPP_CONNECTION_AUTH_ERROR_ABORTED

INF_XMPP_CONNECTION_AUTH_ERROR_INCORRECT_ENCODING

INF_XMPP_CONNECTION_AUTH_ERROR_INVALID_AUTHZID

INF_XMPP_CONNECTION_AUTH_ERROR_INVALID_MECHANISM

INF_XMPP_CONNECTION_AUTH_ERROR_MECHANISM_TOO_WEAK

INF_XMPP_CONNECTION_AUTH_ERROR_NOT_AUTHORIZED

INF_XMPP_CONNECTION_AUTH_ERROR_TEMPORARY_AUTH_FAILURE

INF_XMPP_CONNECTION_AUTH_ERROR_FAILED


InfXmppConnection

typedef struct _InfXmppConnection InfXmppConnection;


struct InfXmppConnectionClass

struct InfXmppConnectionClass {
  GObjectClass parent_class;
};


inf_xmpp_connection_new ()

InfXmppConnection * inf_xmpp_connection_new             (InfTcpConnection *tcp,
                                                         InfXmppConnectionSite site,
                                                         const gchar *local_hostname,
                                                         const gchar *remote_hostname,
                                                         InfXmppConnectionSecurityPolicy security_policy,
                                                         InfCertificateCredentials *creds,
                                                         InfSaslContext *sasl_context,
                                                         const gchar *sasl_mechanisms);

Creates a new InfXmppConnection with tcp as communication channel. No attempt is being made to open tcp, if it is not already open. However, communication is initiated as soon as tcp gets into INF_TCP_CONNECTION_CONNECTED state, so you might still open it lateron yourself.

local_hostname specifies the hostname of the local host, and remote_hostname specifies the hostname of the remote host, as known to the caller. These can be a string representation of the IP address of tcp, or a DNS name such as "example.com". local_hostname can be NULL in which case the host name as reported by g_get_host_name() is used.

creds may be NULL in which case the connection creates the credentials as soon as they are required. However, this only works if site is INF_XMPP_CONNECTION_CLIENT or security_policy is INF_XMPP_CONNECTION_SECURITY_ONLY_UNSECURED (or both, of course). For server connections creds must contain a valid server certificate in case security_policy is not INF_XMPP_CONNECTION_SECURITY_ONLY_UNSECURED.

If sasl_context is NULL, InfXmppConnection uses a built-in context that only supports ANONYMOUS authentication. In sasl_context's callback function, the InfXmppConnection for which the authentication shall be performed can be accessed via the session_data parameter of InfSaslContextCallbackFunc.

If sasl_context is not NULL, then the sasl_mechanisms parameter defines what SASL mechanisms are used. On the server side, these are the mechanisms offered to the client, and on the client side, these are the accepted mechanisms (meaning that if a server does not offer any of these, the connection will be closed). If sasl_context is NULL, then this parameter is ignored. sasl_mechanisms can be NULL in which case all available mechanisms are accepted or offered, respectively.

tcp :

The underlaying TCP connection to use.

site :

Whether this is a XMPP client or server.

local_hostname :

The hostname of the local host, or NULL.

remote_hostname :

The hostname of the remote host.

security_policy :

Whether to use (or offer, as a server) TLS. See InfXmppConnectionSecurityPolicy for the meaning of this parameter.

creds :

Certificate credentials used to secure the communication.

sasl_context :

A SASL context used for authentication.

sasl_mechanisms :

A whitespace-separated list of SASL mechanisms to accept/offer, or NULL.

Returns :

A new InfXmppConnection.

inf_xmpp_connection_get_tls_enabled ()

gboolean            inf_xmpp_connection_get_tls_enabled (InfXmppConnection *xmpp);

Returns whether TLS encryption is enabled for xmpp. This returns TRUE as soon as the TLS handshake is completed but before the server certificate was verified (see inf_xmpp_connection_set_certificate_callback()).

xmpp :

A InfXmppConnection.

Returns :

TRUE if TLS is enabled and FALSE otherwise.

inf_xmpp_connection_set_certificate_callback ()

void                inf_xmpp_connection_set_certificate_callback
                                                        (InfXmppConnection *xmpp,
                                                         InfXmppConnectionCrtCallback cb,
                                                         gpointer user_data);

This function sets a callback that is called when the connection needs to verify the server's certificate. It does not need to respond immediately, but can, for example, show a dialog to a user and continue when the user finished with it.

When the certificate is trusted, then call inf_xmpp_connection_certificate_verify_continue(), otherwise inf_xmpp_connection_certificate_verify_cancel(). This can happen in the callback or some time later. The connection process is stopped until either of these functions is called.

If cb is NULL, or this function has not been called before a certificate needs to be verified, then the certificate is always trusted.

xmpp :

A InfXmppConnection.

cb :

Function to be called to verify the server certificate, or NULL.

user_data :

Additional data to pass to the callback function.

inf_xmpp_connection_certificate_verify_continue ()

void                inf_xmpp_connection_certificate_verify_continue
                                                        (InfXmppConnection *xmpp);

Call this function when your callback set in inf_xmpp_connection_set_certificate_callback() was called and you do trust the server's certificate. The connection process will then continue.

xmpp :

A InfXmppConnection.

inf_xmpp_connection_certificate_verify_cancel ()

void                inf_xmpp_connection_certificate_verify_cancel
                                                        (InfXmppConnection *xmpp);

Call this function when your callback set in inf_xmpp_connection_set_certificate_callback() was called and you do not trust the server's certificate. The connection will then be closed with a corresponding error.

xmpp :

A InfXmppConnection.

inf_xmpp_connection_reset_sasl_authentication ()

void                inf_xmpp_connection_reset_sasl_authentication
                                                        (InfXmppConnection *xmpp,
                                                         InfSaslContext *new_context,
                                                         const gchar *new_mechanisms);

Sets a new SASL context and mechanisms to use for authentication. This does not have any effect if authentication has already been performed. This can be useful if a server decides to use a stricter authentication policy and gets away with its previous SASL context. If new_context is NULL, then a built-in SASL context is used which only accepts anonymous authentication.

If the authentication is currently in progress then it is aborted. The server sends an INF_XMPP_CONNECTION_AUTH_ERROR_TEMPORARY_AUTH_FAILURE error to the client with INF_AUTHENTICATION_DETAIL_ERROR_TRY_AGAIN detail (see inf_xmpp_connection_get_sasl_error()).

On the client side, if authentication is in progress, a request to abort the authentication is sent to the server. The server will then reply with an INF_XMPP_CONNECTION_AUTH_ERROR_ABORTED error. In the signal handler of the "error" signal you should reinitiate the authentication with inf_xmpp_connection_retry_sasl_authentication() or the connection will be closed. It is also possible that the final authentication request has already been sent, and the server replies with successful authentication instead. In that case calling this function will have no effect apart from closing and reopening the connection will use the new context and mechanisms.

xmpp :

A InfXmppConnection.

new_context :

The new sasl context to set, or NULL.

new_mechanisms :

Allowed SASL mechanisms to use. Ignored if new_context is NULL.

inf_xmpp_connection_retry_sasl_authentication ()

gboolean            inf_xmpp_connection_retry_sasl_authentication
                                                        (InfXmppConnection *xmpp,
                                                         GError **error);

When SASL authentication failed then the "error" signal is emitted with an error from the INF_XMPP_CONNECTION_AUTH_ERROR domain. If the signal handler wants to retry authentication then it should call this function, possibly modifying the "sasl-mechanisms" property before. If this function is not called then the connection will terminate.

The function can fail if the server does not support any of the available mechanisms given in "sasl-mechanisms". If so, the function returns FALSE and error is set.

xmpp :

A InfXmppConnection.

error :

Location to store error information, if any.

Returns :

TRUE if auth retry is being performed, FALSE otherwise.

inf_xmpp_connection_set_sasl_error ()

void                inf_xmpp_connection_set_sasl_error  (InfXmppConnection *xmpp,
                                                         const GError *error);

Sets the SASL error of xmpp. The SASL error is an additional hint of what went wrong during authentication. It should be set on the server side in the gsasl callback checking the user authentication. If on the client side "error" is emitted with an error from the INF_XMPP_CONNECTION_AUTH_ERROR domain then inf_xmpp_connection_get_sasl_error() can be used to obtain more detailed error information.

xmpp :

A InfXmppConnection.

error :

The SASL error to set.

inf_xmpp_connection_get_sasl_error ()

const GError *      inf_xmpp_connection_get_sasl_error  (InfXmppConnection *xmpp);

Gets the SASL error of xmpp. See inf_xmpp_connection_set_sasl_error().

xmpp :

A InfXmppConnection.

Returns :

A pointer to a GError object owned by xmpp.

Property Details

The "credentials" property

  "credentials"              InfCertificateCredentials*  : Read / Write / Construct Only

The certificate credentials for GnuTLS.


The "local-hostname" property

  "local-hostname"           gchar*                : Read / Write / Construct Only

The hostname of the local host.

Default value: NULL


The "remote-hostname" property

  "remote-hostname"          gchar*                : Read / Write / Construct Only

The hostname of the remote host.

Default value: NULL


The "sasl-context" property

  "sasl-context"             InfSaslContext*       : Read / Write / Construct Only

The SASL context used for authentication.


The "sasl-mechanisms" property

  "sasl-mechanisms"          gchar*                : Read / Write / Construct Only

Whitespace separated list of SASL mechanisms to accept/offer.

Default value: NULL


The "security-policy" property

  "security-policy"          InfXmppConnectionSecurityPolicy  : Read / Write / Construct Only

How to choose whether to use (or offer, as a server) TLS.

Default value: INF_XMPP_CONNECTION_SECURITY_BOTH_PREFER_TLS


The "site" property

  "site"                     InfXmppConnectionSite  : Read / Write / Construct Only

Site of the connection (client or server).

Default value: INF_XMPP_CONNECTION_CLIENT


The "tcp-connection" property

  "tcp-connection"           InfTcpConnection*     : Read / Write / Construct Only

Underlaying TCP connection.


The "tls-enabled" property

  "tls-enabled"              gboolean              : Read

Whether TLS is enabled for the connection or not.

Default value: FALSE

libinfinity-0.5.5/docs/reference/libinfinity/html/InfdXmlServer.html0000644000175000017500000002656612264766270022605 00000000000000 InfdXmlServer

InfdXmlServer

InfdXmlServer

Object Hierarchy

  GInterface
   +----InfdXmlServer
  GEnum
   +----InfdXmlServerStatus

Prerequisites

InfdXmlServer requires GObject.

Known Implementations

InfdXmlServer is implemented by InfdXmppServer.

Properties

  "status"                   InfdXmlServerStatus   : Read

Signals

  "new-connection"                                 : Run Last

Description

Details

InfdXmlServer

typedef struct _InfdXmlServer InfdXmlServer;


struct InfdXmlServerIface

struct InfdXmlServerIface {
  GTypeInterface parent;

  /* Virtual Table */
  void (*close)(InfdXmlServer* server);

  /* Signals */
  void (*new_connection)(InfdXmlServer* server,
                         InfXmlConnection* connection);
};


enum InfdXmlServerStatus

typedef enum {
  INFD_XML_SERVER_CLOSED,
  INFD_XML_SERVER_CLOSING,
  INFD_XML_SERVER_OPEN,
  INFD_XML_SERVER_OPENING
} InfdXmlServerStatus;

INFD_XML_SERVER_CLOSED

INFD_XML_SERVER_CLOSING

INFD_XML_SERVER_OPEN

INFD_XML_SERVER_OPENING


infd_xml_server_close ()

void                infd_xml_server_close               (InfdXmlServer *server);

Closes server.

server :

A InfdXmlServer.

infd_xml_server_new_connection ()

void                infd_xml_server_new_connection      (InfdXmlServer *server,
                                                         InfXmlConnection *connection);

Emits the "new-connection" signal on server.

server :

A InfdXmlServer.

connection :

A InfXmlConnection.

Property Details

The "status" property

  "status"                   InfdXmlServerStatus   : Read

The status of the server.

Default value: INFD_XML_SERVER_CLOSED

Signal Details

The "new-connection" signal

void                user_function                      (InfdXmlServer    *infdxmlserver,
                                                        InfXmlConnection *arg1,
                                                        gpointer          user_data)          : Run Last

infdxmlserver :

the object which received the signal.

user_data :

user data set when the signal handler was connected.
libinfinity-0.5.5/docs/reference/libinfinity/html/InfCommunicationManager.html0000644000175000017500000005474212264766270024607 00000000000000 InfCommunicationManager

InfCommunicationManager

InfCommunicationManager — Handling multiple communication sessions

Stability Level

Unstable, unless otherwise indicated

Object Hierarchy

  GObject
   +----InfCommunicationManager

Description

InfCommunicationManager manages multiple communication sessions represented by InfCommunicationGroup. A InfCommunicationGroup provides an easy way to send messages between group members, possibly sharing connections with other groups handled by the same InfCommunicationManager.

Details

InfCommunicationManager

typedef struct _InfCommunicationManager InfCommunicationManager;

InfCommunicationManager is an opaque data type. You should only access it via the public API functions.


struct InfCommunicationManagerClass

struct InfCommunicationManagerClass {
};

This structure does not contain any public fields.


inf_communication_manager_new ()

InfCommunicationManager * inf_communication_manager_new (void);

Creates a new InfCommunicationManager.

Returns :

A new InfCommunicationManager.

inf_communication_manager_open_group ()

InfCommunicationHostedGroup * inf_communication_manager_open_group
                                                        (InfCommunicationManager *manager,
                                                         const gchar *group_name,
                                                         const gchar * const*methods);

Opens a new communication group published by the local host. group_name is an identifier for the group via which other hosts can join the group using inf_communication_manager_join_group(). It needs to be unique among all groups opened by the local host.

methods specifies what communication methods the group should use, in order of priority. If a method is not supported for a given network, then the next one in the array is tried. If none is supported, then the "central" method will be used, which is guaranteed to be supported for all networks.

manager :

A InfCommunicationManager.

group_name :

A name for the new group.

methods :

Methods to support, or NULL.

Returns :

A InfCommunicationHostedGroup. Free with g_object_unref() to leave the group.

inf_communication_manager_join_group ()

InfCommunicationJoinedGroup * inf_communication_manager_join_group
                                                        (InfCommunicationManager *manager,
                                                         const gchar *group_name,
                                                         InfXmlConnection *publisher_conn,
                                                         const gchar *method);

Joins a communication group published by a remote host. publisher_conn needs to be a to the publishing host with status INF_XML_CONNECTION_OPEN or INF_XML_CONNECTION_OPENING. group_name specifies the name of the group to join.

method specifies the communication method to use. It must match the communication method the publisher has chosen for publisher_conn's network (see inf_communication_group_get_method_for_network()). The function returns NULL if method is not supported (which means inf_communication_manager_get_factory_for() for publisher_conn's network and method returns NULL).

manager :

A InfCommunicationManager.

group_name :

The group to join.

publisher_conn :

A InfXmlConnection to the publishing host.

method :

The communication method to use.

Returns :

A new InfCommunicationJoinedGroup, or NULL. Free with g_object_unref() to leave the group.

inf_communication_manager_add_factory ()

void                inf_communication_manager_add_factory
                                                        (InfCommunicationManager *manager,
                                                         InfCommunicationFactory *factory);

Adds a new InfCommunicationFactory to manager. This makes manager support all method/network combinations that factory supports. If multiple added factories support the same combination, the one which was added first will be used to instantiate the InfCommunicationMethod.

manager :

A InfCommunicationManager.

factory :

The InfCommunicationFactory to add.

inf_communication_manager_get_factory_for ()

InfCommunicationFactory * inf_communication_manager_get_factory_for
                                                        (InfCommunicationManager *manager,
                                                         const gchar *network,
                                                         const gchar *method_name);

Returns the InfCommunicationFactory that manager will use to instantiate a InfCommunicationMethod for method_name on network, or NULL if the network/method combination is not supported.

manager :

A InfCommunicationManager.

network :

A network identifier.

method_name :

A method name.

Returns :

A InfCommunicationFactory, or NULL.
libinfinity-0.5.5/docs/reference/libinfinity/html/InfCertificateCredentials.html0000644000175000017500000002605212264766270025100 00000000000000 InfCertificateCredentials

InfCertificateCredentials

InfCertificateCredentials — Reference-counted wrapper for gnutls_certificate_credentials_t

Stability Level

Unstable, unless otherwise indicated

Object Hierarchy

  GBoxed
   +----InfCertificateCredentials

Description

This is a thin wrapper class for gnutls_certificate_credentials_t. It provides reference counting and a boxed GType for it.

Details

InfCertificateCredentials

typedef struct _InfCertificateCredentials InfCertificateCredentials;

InfCertificateCredentials is an opaque data type. You should only access it via the public API functions.


inf_certificate_credentials_new ()

InfCertificateCredentials * inf_certificate_credentials_new
                                                        (void);

Creates a new InfCertificateCredentials with an initial reference count of 1. Use inf_certificate_credentials_get() to access the underlying gnutls_certificate_credentials_t.

Returns :

A new InfCertificateCredentials. Free with inf_certificate_credentials_unref() when no longer needed.

inf_certificate_credentials_ref ()

InfCertificateCredentials * inf_certificate_credentials_ref
                                                        (InfCertificateCredentials *creds);

Increases the reference count of creds by 1.

creds :

A InfCertificateCredentials.

Returns :

The passed InfCertificateCredentials, creds.

inf_certificate_credentials_unref ()

void                inf_certificate_credentials_unref   (InfCertificateCredentials *creds);

Decreases the reference count of creds by 1. If its reference count reaches 0, then the InfCertificateCredentials will be freed.


inf_certificate_credentials_get ()

gnutls_certificate_credentials_t inf_certificate_credentials_get
                                                        (InfCertificateCredentials *creds);

Provides access to the creds' underlying gnutls_certificate_credentials_t.

creds :

A InfCertificateCredentials.

Returns :

creds' gnutls_certificate_credentials_t.
libinfinity-0.5.5/docs/reference/libinfinity/html/InfCommunicationMethod.html0000644000175000017500000011166612264766270024454 00000000000000 InfCommunicationMethod

InfCommunicationMethod

InfCommunicationMethod — Network communication method

Stability Level

Unstable, unless otherwise indicated

Object Hierarchy

  GInterface
   +----InfCommunicationMethod

Prerequisites

InfCommunicationMethod requires GObject.

Known Implementations

InfCommunicationMethod is implemented by InfCommunicationCentralMethod.

Description

A InfCommunicationMethod specifies how messages are transferred between group members on the same network. So one method handles all connections on a specific network for the group.

Details

InfCommunicationMethod

typedef struct _InfCommunicationMethod InfCommunicationMethod;

InfCommunicationMethod is an opaque data type. You should only access it via the public API functions.


struct InfCommunicationMethodIface

struct InfCommunicationMethodIface {
  /* Signals */
  void (*add_member)(InfCommunicationMethod* method,
                     InfXmlConnection* connection);
  void (*remove_member)(InfCommunicationMethod* method,
                        InfXmlConnection* connection);

  /* Virtual functions */
  gboolean (*is_member)(InfCommunicationMethod* method,
                        InfXmlConnection* connection);

  void (*send_single)(InfCommunicationMethod* method,
                      InfXmlConnection* connection,
                      xmlNodePtr xml);
  void (*send_all)(InfCommunicationMethod* method,
                   xmlNodePtr xml);
  void (*cancel_messages)(InfCommunicationMethod* method,
                          InfXmlConnection* connection);

  InfCommunicationScope (*received)(InfCommunicationMethod* method,
                                    InfXmlConnection* connection,
                                    xmlNodePtr xml);
  void (*enqueued)(InfCommunicationMethod* method,
                   InfXmlConnection* connection,
                   xmlNodePtr xml);
  void (*sent)(InfCommunicationMethod* method,
               InfXmlConnection* connection,
               xmlNodePtr xml);
};

The default signal handlers of virtual methods of InfCommunicationMethod. These implement communication within a InfCommunicationGroup.

add_member ()

Default signal handler of the "add-member" signal.

remove_member ()

Default signal handler of the "remove-member" signal.

is_member ()

Returns whether the given connection is a member of the group.

send_single ()

Sends a message to a single connection. Takes ownership of xml.

send_all ()

Sends a message to all group members, except except. Takes ownership of xml.

cancel_messages ()

Cancel sending messages that have not yet been sent to the given connection.

received ()

Handles reception of a message from a registered connection. This normally includes informing a group's NetObject and forwarding the message to other group members.

enqueued ()

Handles when a message has been enqueued to be sent on a registered connection.

sent ()

Handles when a message has been sent to a registered connection.

inf_communication_method_add_member ()

void                inf_communication_method_add_member (InfCommunicationMethod *method,
                                                         InfXmlConnection *connection);

Adds a new connection to the group. The network of connection must match the network the method is handling, and connection must not already be a member of the group (see inf_communication_method_is_member()).

method :

A InfCommunicationMethod.

connection :

The InfXmlConnection to add.

inf_communication_method_remove_member ()

void                inf_communication_method_remove_member
                                                        (InfCommunicationMethod *method,
                                                         InfXmlConnection *connection);

Removes a connection from the group. connection needs to be a member of the group (see inf_communication_method_is_member()).

method :

A InfCommunicationMethod.

connection :

The InfXmlConnection to remove.

inf_communication_method_is_member ()

gboolean            inf_communication_method_is_member  (InfCommunicationMethod *method,
                                                         InfXmlConnection *connection);

Returns whether connection was added to the group via inf_communication_method_add_member().

method :

A InfCommunicationMethod.

connection :

A InfXmlConnection.

Returns :

Whether connection is a member of the group.

inf_communication_method_send_single ()

void                inf_communication_method_send_single
                                                        (InfCommunicationMethod *method,
                                                         InfXmlConnection *connection,
                                                         xmlNodePtr xml);

Sends an XML message to connection. This function takes ownership of xml.

method :

A InfCommunicationMethod.

connection :

A InfXmlConnection that is a group member.

xml :

The message to send.

inf_communication_method_send_all ()

void                inf_communication_method_send_all   (InfCommunicationMethod *method,
                                                         xmlNodePtr xml);

Sends an XML message to all group members on this network. This function takes ownership of xml.

method :

A InfCommunicationMethod.

xml :

The message to send.

inf_communication_method_cancel_messages ()

void                inf_communication_method_cancel_messages
                                                        (InfCommunicationMethod *method,
                                                         InfXmlConnection *connection);

This function stops all messages to be sent to connection that have not yet been sent.

method :

A InfCommunicationMethod.

connection :

A InfXmlConnection that is a group member.

inf_communication_method_received ()

InfCommunicationScope inf_communication_method_received (InfCommunicationMethod *method,
                                                         InfXmlConnection *connection,
                                                         xmlNodePtr xml);

This function is called by the InfCommunicationRegistry if data has been received on registered connections (see inf_communication_registry_register()).

This function returns the scope of the message. If the scope is INF_COMMUNICATION_SCOPE_GROUP then the registry relays the message to other connections on different networks (if any).

method :

A InfCommunicationMethod.

connection :

A InfXmlConnection that is a group member.

xml :

The received message.

Returns :

The scope of the message.

inf_communication_method_enqueued ()

void                inf_communication_method_enqueued   (InfCommunicationMethod *method,
                                                         InfXmlConnection *connection,
                                                         xmlNodePtr xml);

This function is called by the InfCommunicationRegistry if data has been enqueued on registered connections (see inf_communication_registry_register()).

method :

A InfCommunicationMethod.

connection :

A InfXmlConnection.

xml :

The enqueued message.

inf_communication_method_sent ()

void                inf_communication_method_sent       (InfCommunicationMethod *method,
                                                         InfXmlConnection *connection,
                                                         xmlNodePtr xml);

This function is called by the InfCommunicationRegistry if data has been sent on registered connections (see inf_communication_registry_register()).

method :

A InfCommunicationMethod.

connection :

A InfXmlConnection.

xml :

The sent message.

Signal Details

The "add-member" signal

void                user_function                      (InfCommunicationMethod *method,
                                                        InfXmlConnection       *connection,
                                                        gpointer                user_data)       : Run Last

This signal is emitted whenever a new connection has been added to the group on the network this method handles.

method :

The InfCommunicationMethod emitting the signal.

connection :

The InfXmlConnection that was added.

user_data :

user data set when the signal handler was connected.

The "remove-member" signal

void                user_function                      (InfCommunicationMethod *method,
                                                        InfXmlConnection       *connection,
                                                        gpointer                user_data)       : Run Last

This signal is emitted whenever a connection has been removed from the group on the network this method handles.

method :

The InfCommunicationMethod emitting the signal.

connection :

The InfXmlConnection that was removed.

user_data :

user data set when the signal handler was connected.
libinfinity-0.5.5/docs/reference/libinfinity/html/InfSession.html0000644000175000017500000026572512264766270022137 00000000000000 InfSession

InfSession

InfSession — Basic session object and synchronization

Stability Level

Unstable, unless otherwise indicated

Synopsis

#include <libinfinity/common/inf-session.h>

enum                InfSessionStatus;
enum                InfSessionSyncStatus;
enum                InfSessionSyncError;
                    InfSession;
struct              InfSessionClass;
const GParameter *  inf_session_lookup_user_property    (const GParameter *params,
                                                         guint n_params,
                                                         const gchar *name);
GParameter *        inf_session_get_user_property       (GArray *array,
                                                         const gchar *name);
void                inf_session_user_to_xml             (InfSession *session,
                                                         InfUser *user,
                                                         xmlNodePtr xml);
void                inf_session_close                   (InfSession *session);
InfCommunicationManager * inf_session_get_communication_manager
                                                        (InfSession *session);
InfBuffer *         inf_session_get_buffer              (InfSession *session);
InfUserTable *      inf_session_get_user_table          (InfSession *session);
InfSessionStatus    inf_session_get_status              (InfSession *session);
InfUser *           inf_session_add_user                (InfSession *session,
                                                         const GParameter *params,
                                                         guint n_params,
                                                         GError **error);
void                inf_session_set_user_status         (InfSession *session,
                                                         InfUser *user,
                                                         InfUserStatus status);
void                inf_session_synchronize_from        (InfSession *session);
void                inf_session_synchronize_to          (InfSession *session,
                                                         InfCommunicationGroup *group,
                                                         InfXmlConnection *connection);
InfSessionSyncStatus inf_session_get_synchronization_status
                                                        (InfSession *session,
                                                         InfXmlConnection *connection);
gdouble             inf_session_get_synchronization_progress
                                                        (InfSession *session,
                                                         InfXmlConnection *connection);
gboolean            inf_session_has_synchronizations    (InfSession *session);
InfCommunicationGroup * inf_session_get_subscription_group
                                                        (InfSession *session);
void                inf_session_set_subscription_group  (InfSession *session,
                                                         InfCommunicationGroup *group);
void                inf_session_send_to_subscriptions   (InfSession *session,
                                                         xmlNodePtr xml);

Object Hierarchy

  GEnum
   +----InfSessionStatus
  GObject
   +----InfSession
         +----InfAdoptedSession
         +----InfChatSession

Implemented Interfaces

InfSession implements InfCommunicationObject.

Properties

  "buffer"                   InfBuffer*            : Read / Write / Construct Only
  "communication-manager"    InfCommunicationManager*  : Read / Write / Construct Only
  "status"                   InfSessionStatus      : Read / Write / Construct Only
  "subscription-group"       InfCommunicationGroup*  : Read / Write
  "sync-connection"          InfXmlConnection*     : Read / Write / Construct Only
  "sync-group"               InfCommunicationGroup*  : Read / Write / Construct Only
  "user-table"               InfUserTable*         : Read / Write / Construct Only

Description

InfSession represents an editing session. The actual type of document that is edited is not specified, so instantiating InfSession does not make any sense. You rather want to use a derived class such as InfTextSession. Normally, the InfcBrowser or InfdDirectory, respectively, already take care of instantiating the correct InfSession.

A session basically consists of the document being edited (also called buffer, see InfBuffer) and the users that are working on the document, see InfUserTable.

A session can either start in INF_SESSION_RUNNING state, in which it is created with the initial buffer and user table. It may also start in INF_SESSION_SYNCHRONIZING state. In this case, both buffer and user table are initially empty and are copied from another system over the network. When the copy is complete, the session enters INF_SESSION_RUNNING state.

To be notified about changes other users make to a session, you need to subscribe to the session (on client side), or wait for incoming subscriptions (on server side). This is normally done by infc_browser_iter_subscribe_session(). The first action that is performed upon subscription is a synchronization as described above. When the synchronization is complete, the "synchronization-complete" signal is emitted.

After subscription, one can observe modifications other users make, but it is not possible to make own modifications. Before doing so, a InfUser needs to be joined. This is done by client/server specific API such as infc_session_proxy_join_user() or infd_session_proxy_add_user(). The required parameters still depend on the actual note type, which is why most note implementations offer their own API to join a user.

Details

enum InfSessionStatus

typedef enum {
  INF_SESSION_PRESYNC,
  INF_SESSION_SYNCHRONIZING,
  INF_SESSION_RUNNING,
  INF_SESSION_CLOSED
} InfSessionStatus;

InfSessionStatus defines in what state a session is in.

INF_SESSION_PRESYNC

The session is scheduled to be synchronized from a remote host. This can be useful if the session is needed to be present before the actual synchronization begins. Use inf_session_synchronize_from() to switch to INF_SESSION_SYNCHRONIZING.

INF_SESSION_SYNCHRONIZING

The session is currently being synchronized from a remote host. When done synchronizing, it will enter into INF_SESSION_RUNNING state.

INF_SESSION_RUNNING

The session is running and ready to synchronize other hosts. If a subscription group is set (see inf_session_set_subscription_group()), then changes to the underlying buffer are transmitted to all subscribed connections.

INF_SESSION_CLOSED

The session is closed and can no longer be used. The session enters this state if the synchronization fails in INF_SESSION_SYNCHRONIZING state or inf_session_close() is called.

enum InfSessionSyncStatus

typedef enum {
  INF_SESSION_SYNC_NONE,
  INF_SESSION_SYNC_IN_PROGRESS,
  INF_SESSION_SYNC_AWAITING_ACK
} InfSessionSyncStatus;

InfSessionSyncStatus represents the status of a synchronization. It is used by inf_session_get_synchronization_status().

INF_SESSION_SYNC_NONE

No synchronization is ongoing.

INF_SESSION_SYNC_IN_PROGRESS

Synchronization is currently in progress.

INF_SESSION_SYNC_AWAITING_ACK

All synchronization data has been sent (progress is 1.0), but we are still waiting for an acknowledgment from the remote site. Synchronization can no longer be cancelled, but it can stiff fail.

enum InfSessionSyncError

typedef enum {
  INF_SESSION_SYNC_ERROR_GOT_MESSAGE_IN_PRESYNC,
  INF_SESSION_SYNC_ERROR_UNEXPECTED_NODE,
  INF_SESSION_SYNC_ERROR_ID_NOT_PRESENT,
  INF_SESSION_SYNC_ERROR_ID_IN_USE,
  INF_SESSION_SYNC_ERROR_NAME_NOT_PRESENT,
  INF_SESSION_SYNC_ERROR_NAME_IN_USE,
  INF_SESSION_SYNC_ERROR_CONNECTION_CLOSED,
  INF_SESSION_SYNC_ERROR_SENDER_CANCELLED,
  INF_SESSION_SYNC_ERROR_RECEIVER_CANCELLED,
  INF_SESSION_SYNC_ERROR_UNEXPECTED_BEGIN_OF_SYNC,
  INF_SESSION_SYNC_ERROR_NUM_MESSAGES_MISSING,
  INF_SESSION_SYNC_ERROR_UNEXPECTED_END_OF_SYNC,
  INF_SESSION_SYNC_ERROR_EXPECTED_BEGIN_OF_SYNC,
  INF_SESSION_SYNC_ERROR_EXPECTED_END_OF_SYNC,

  INF_SESSION_SYNC_ERROR_FAILED
} InfSessionSyncError;

These are errors that can occur during a synchronization of a session. Additional errors may occur depending on the session type.

INF_SESSION_SYNC_ERROR_GOT_MESSAGE_IN_PRESYNC

Received a message in state INF_SESSION_PRESYNC. It is not processed because inf_session_synchronize_from() was not yet called.

INF_SESSION_SYNC_ERROR_UNEXPECTED_NODE

A message has been received that was not understood.

INF_SESSION_SYNC_ERROR_ID_NOT_PRESENT

An ID was not provided for a user in the session.

INF_SESSION_SYNC_ERROR_ID_IN_USE

The ID of a user is already in use by another user.

INF_SESSION_SYNC_ERROR_NAME_NOT_PRESENT

A name was not provided for a user in the session.

INF_SESSION_SYNC_ERROR_NAME_IN_USE

The name of a user is already in use by another user.

INF_SESSION_SYNC_ERROR_CONNECTION_CLOSED

The synchronization connection has been closed.

INF_SESSION_SYNC_ERROR_SENDER_CANCELLED

The sender has cancelled the synchronization.

INF_SESSION_SYNC_ERROR_RECEIVER_CANCELLED

The receiver has cancelled the synchronization.

INF_SESSION_SYNC_ERROR_UNEXPECTED_BEGIN_OF_SYNC

Received <sync-begin/> not a the beginning of the synchronization.

INF_SESSION_SYNC_ERROR_NUM_MESSAGES_MISSING

The <sync-begin/> message does not contain the number of synchronization messages to expect.

INF_SESSION_SYNC_ERROR_UNEXPECTED_END_OF_SYNC

The <sync-end/> message was not received at the end of the synchronization.

INF_SESSION_SYNC_ERROR_EXPECTED_BEGIN_OF_SYNC

The <sync-begin/> message was not received at the beginning of the synchronization.

INF_SESSION_SYNC_ERROR_EXPECTED_END_OF_SYNC

The <sync-end/> message was not received at the end of the synchronization.

INF_SESSION_SYNC_ERROR_FAILED

Generic error code when no further reason of failure is known.

InfSession

typedef struct _InfSession InfSession;

InfSession is an opaque data type. You should only access it via the public API functions.


struct InfSessionClass

struct InfSessionClass {
  /* Virtual table */
  void(*to_xml_sync)(InfSession* session,
                     xmlNodePtr parent);

  gboolean(*process_xml_sync)(InfSession* session,
                              InfXmlConnection* connection,
                              xmlNodePtr xml,
                              GError** error);

  InfCommunicationScope(*process_xml_run)(InfSession* session,
                                          InfXmlConnection* connection,
                                          xmlNodePtr xml,
                                          GError** error);

  GArray*(*get_xml_user_props)(InfSession* session,
                               InfXmlConnection* conn,
                               xmlNodePtr xml);

  void (*set_xml_user_props)(InfSession* session,
                             const GParameter* params,
                             guint n_params,
                             xmlNodePtr xml);

  gboolean(*validate_user_props)(InfSession* session,
                                 const GParameter* params,
                                 guint n_params,
                                 InfUser* exclude,
                                 GError** error);

  InfUser*(*user_new)(InfSession* session,
                      GParameter* params,
                      guint n_params);

  /* Signals */
  void(*close)(InfSession* session);

  void(*synchronization_begin)(InfSession* session,
                               InfCommunicationGroup* group,
                               InfXmlConnection* connection);

  void(*synchronization_progress)(InfSession* session,
                                  InfXmlConnection* connection,
                                  gdouble percentage);

  void(*synchronization_complete)(InfSession* session,
                                  InfXmlConnection* connection);

  void(*synchronization_failed)(InfSession* session,
                                InfXmlConnection* connection,
                                const GError* error);
};

This structure contains the virtual functions and default signal handlers of InfSession.

to_xml_sync ()

Virtual function that saves the session within a XML document. parent is the root node of the document. It should create as much nodes as possible within that root node and not in sub-nodes because these are sent to a client and it is not allowed that other traffic is put in between those nodes. This way, communication through the same connection does not hang just because a large session is synchronized.

process_xml_sync ()

Virtual function that is called for every node in the XML document created by to_xml_sync. It is supposed to reconstruct the session content from the XML data.

process_xml_run ()

Virtual function that is called for every received message while the session is running. Return INF_COMMUNICATION_SCOPE_GROUP if the message is designated for all group members (see also inf_communication_object_received() on this topic).

get_xml_user_props ()

Virtual function that creates a list of GParameters for use with g_object_newv() from a XML node.

set_xml_user_props ()

Virtual function that writes the passed user properties into a XML node.

validate_user_props ()

Virtual function that checks whether the given user properties are valid for a user join. This prevents a user join if there is already a user with the same name. If exclude is not NULL, then the function does ignore it when validating.

user_new ()

Virtual function that creates a new user object with the given properties.

close ()

Default signal handler for the "close" signal. This cancels currently running synchronization in InfSession.

synchronization_begin ()

Default signal handler for the "synchronization-begin" signal. The default handler queues the synchronization messages.

synchronization_progress ()

Default signal handler for the "synchronization-progress" signal.

synchronization_complete ()

Default signal handler for the "synchronization-complete" signal. If the session itself got synchronized (and did not synchronize another session), then the default handler changes status to INF_SESSION_RUNNING.

synchronization_failed ()

Default signal handler for the "synchronization-failed" signal. If the session itself got synchronized (and did not synchronize another session), then the default handler changes status to INF_SESSION_CLOSED.

inf_session_lookup_user_property ()

const GParameter *  inf_session_lookup_user_property    (const GParameter *params,
                                                         guint n_params,
                                                         const gchar *name);

Looks up the parameter with the given name in array.

params :

A pointer to an array of containing GParameter values.

n_params :

The number of elements in the aforementioned array

name :

Name to look up.

Returns :

A GParameter, or NULL.

inf_session_get_user_property ()

GParameter *        inf_session_get_user_property       (GArray *array,
                                                         const gchar *name);

Looks up the paremeter with the given name in array. If there is no such parameter, a new one will be created.

array :

A GArray containing GParameter values.

name :

Name to look up.

Returns :

A GParameter.

inf_session_user_to_xml ()

void                inf_session_user_to_xml             (InfSession *session,
                                                         InfUser *user,
                                                         xmlNodePtr xml);

This is a convenience function that queries user's properties and calls set_xml_user_props with them. This adds the properties of user to xml.

An equivalent user object may be built by calling the get_xml_user_props vfunc on xml and then calling the user_new vfunc with the resulting properties.

session :

A InfSession.

user :

A InfUser contained in session.

xml :

An XML node to which to add user information.

inf_session_close ()

void                inf_session_close                   (InfSession *session);

Closes a running session. When a session is closed, it unrefs all connections and no longer handles requests.

session :

A InfSession.

inf_session_get_communication_manager ()

InfCommunicationManager * inf_session_get_communication_manager
                                                        (InfSession *session);

Returns the communication manager for session.

session :

A InfSession.

Returns :

A InfCommunicationManager.

inf_session_get_buffer ()

InfBuffer *         inf_session_get_buffer              (InfSession *session);

Returns the buffer used by session.

session :

A InfSession.

Returns :

A InfBuffer.

inf_session_get_user_table ()

InfUserTable *      inf_session_get_user_table          (InfSession *session);

Returns the user table used by session.

session :

A InfSession.

Returns :

A InfUserTable.

inf_session_get_status ()

InfSessionStatus    inf_session_get_status              (InfSession *session);

Returns the session's status.

session :

A InfSession.

Returns :

The status of session.

inf_session_add_user ()

InfUser *           inf_session_add_user                (InfSession *session,
                                                         const GParameter *params,
                                                         guint n_params,
                                                         GError **error);

Adds a user to session. The user object is constructed via the user_new vfunc of InfSessionClass. This will create a new InfUser object by default, but may be overridden by subclasses to create different kinds of users.

Note that this function does not tell the other participants that the user was added. To avoid conflicts, normally only the publisher of the session can add users and notifies others accordingly. This is handled by InfdSessionProxy or InfcSessionProxy, respectively.

You should not call this function unless you know what you are doing.

session :

A InfSession.

params :

Construction parameters for the InfUser (or derived) object.

n_params :

Number of parameters.

error :

Location to store error information.

Returns :

The new InfUser, or NULL in case of an error.

inf_session_set_user_status ()

void                inf_session_set_user_status         (InfSession *session,
                                                         InfUser *user,
                                                         InfUserStatus status);

Changes the status of the given user which needs to have the INF_USER_LOCAL flag set for this function to be called. If the status is changed to INF_USER_UNAVAILABLE, then the user leaves the session. To rejoin use infc_session_proxy_join_user() or infd_session_proxy_add_user(), respectively for a proxy proxying session.

session :

A InfSession.

user :

A local InfUser from session's user table.

status :

New status for user.

inf_session_synchronize_from ()

void                inf_session_synchronize_from        (InfSession *session);

Switches session's status to INF_SESSION_SYNCHRONIZING. In INF_SESSION_PRESYNC, all messages from incoming the synchronizing connection are ignored, and no cancellation request is sent to the remote site if the status changes to INF_SESSION_CLOSED. The rationale behind that status is that one can prepare a session for synchronization but start the actual synchronization later, after having made sure that the remote site is ready to perform the synchronization.

session :

A InfSession in status INF_SESSION_PRESYNC.

inf_session_synchronize_to ()

void                inf_session_synchronize_to          (InfSession *session,
                                                         InfCommunicationGroup *group,
                                                         InfXmlConnection *connection);

Initiates a synchronization to connection. On the other end of connection, a new session with the sync-connection and sync-group construction properties set should have been created. group is used as a group in the connection manager. It is allowed for group to have another InfCommunicationObject than session, however, you should forward the InfCommunicationObject messages your object receives to session then. Also, connection must already be present in group, and should not be removed until synchronization finished.

A synchronization can only be initiated if session is in state INF_SESSION_RUNNING.

session :

A InfSession in status INF_SESSION_RUNNING.

group :

A InfCommunicationGroup.

connection :

A InfConnection.

inf_session_get_synchronization_status ()

InfSessionSyncStatus inf_session_get_synchronization_status
                                                        (InfSession *session,
                                                         InfXmlConnection *connection);

If session is in status INF_SESSION_SYNCHRONIZING, this always returns INF_SESSION_SYNC_IN_PROGRESS if connection is the connection with which the session is synchronized, and INF_SESSION_SYNC_NONE otherwise.

If session is in status INF_SESSION_RUNNING, this returns the status of the synchronization to connection. INF_SESSION_SYNC_NONE is returned, when there is currently no synchronization ongoing to connection, INF_SESSION_SYNC_IN_PROGRESS is returned, if there is one, and INF_SESSION_SYNC_AWAITING_ACK if the synchronization is finished but we are waiting for the acknowledgement from the remote site that all synchronization data has been progressed successfully. The synchronization can still fail in this state but it can no longer by cancelled.

If session is in status $INF_SESSION_CLOSED, this always returns INF_SESSION_SYNC_NONE.

session :

A InfSession.

connection :

A InfXmlConnection.

Returns :

The synchronization status of connection.

inf_session_get_synchronization_progress ()

gdouble             inf_session_get_synchronization_progress
                                                        (InfSession *session,
                                                         InfXmlConnection *connection);

This function requires that the synchronization status of connection is INF_SESSION_SYNC_IN_PROGRESS or INF_SESSION_SYNC_AWAITING_ACK (see inf_session_get_synchronization_status()). Then, it returns a value between 0.0 and 1.0 specifying how much synchronization data has already been transferred to the remote site.

Note that if the session is in status INF_SESSION_RUNNING, it is possible that this function returns 1.0 (i.e. all data has been transmitted) but the synchronization is not yet complete, because the remote site must still acknowledge the synchronization. The synchronization then is in status INF_SESSION_SYNC_AWAITING_ACK.

session :

A InfSession.

connection :

A InfXmlConnection.

Returns :

A value between 0.0 and 1.0.

inf_session_has_synchronizations ()

gboolean            inf_session_has_synchronizations    (InfSession *session);

Returns whether there are currently ongoing synchronizations. If the session is in status INF_SESSION_SYNCHRONIZING, then this returns always TRUE, if it is in INF_SESSION_CLOSED, then it returns always FALSE. If the session is in status INF_SESSION_RUNNING, then it returns TRUE when the session is currently at least synchronized to one connection and FALSE otherwise.

session :

A InfSession.

Returns :

Whether there are ongoing synchronizations.

inf_session_get_subscription_group ()

InfCommunicationGroup * inf_session_get_subscription_group
                                                        (InfSession *session);

Returns the subscription group for session, if any.

session :

A InfSession.

Returns :

A InfCommunicationGroup, or NULL.

inf_session_set_subscription_group ()

void                inf_session_set_subscription_group  (InfSession *session,
                                                         InfCommunicationGroup *group);

Sets the subscription group for session. The subscription group is the group in which all connections subscribed to the session are a member of.

InfSession itself does not deal with subscriptions, so it is your job to keep group up-to-date (for example if you add non-local users to session). This is normally done by a so-called session proxy such as InfcSessionProxy or InfdSessionProxy, respectively.

session :

A InfSession.

group :

A InfCommunicationGroup.

inf_session_send_to_subscriptions ()

void                inf_session_send_to_subscriptions   (InfSession *session,
                                                         xmlNodePtr xml);

Sends a XML message to the all members of session's subscription group. This function can only be called if the subscription group is non-NULL. It takes ownership of xml.

session :

A InfSession.

xml :

The message to send.

Property Details

The "buffer" property

  "buffer"                   InfBuffer*            : Read / Write / Construct Only

The buffer in which the document content is stored.


The "communication-manager" property

  "communication-manager"    InfCommunicationManager*  : Read / Write / Construct Only

The communication manager used for sending requests.


The "status" property

  "status"                   InfSessionStatus      : Read / Write / Construct Only

Current status of the session.

Default value: INF_SESSION_RUNNING


The "subscription-group" property

  "subscription-group"       InfCommunicationGroup*  : Read / Write

Communication group of subscribed connections.


The "sync-connection" property

  "sync-connection"          InfXmlConnection*     : Read / Write / Construct Only

Connection which synchronizes the initial session state.


The "sync-group" property

  "sync-group"               InfCommunicationGroup*  : Read / Write / Construct Only

Communication group in which to perform synchronization.


The "user-table" property

  "user-table"               InfUserTable*         : Read / Write / Construct Only

User table containing the users of the session.

Signal Details

The "close" signal

void                user_function                      (InfSession *session,
                                                        gpointer    user_data)      : Run Last

This signal is emitted if the session is closed. Note that this signal is not called as a client if the connection to the sessions has merely been lost, only the relevant InfXmlConnection has its "status" property changed.

session :

The InfSession that is being closed

user_data :

user data set when the signal handler was connected.

The "synchronization-begin" signal

void                user_function                      (InfSession            *session,
                                                        InfCommunicationGroup *group,
                                                        InfXmlConnection      *connection,
                                                        gpointer               user_data)       : Run Last

This signal is emitted whenever the session is started to be synchronized to another connection. Note that, in contrast to "synchronization-progress", "synchronization-failed" and "synchronization-complete" it cannot happen that the signal is emitted when session is being synchronized itself, because that can happen at construction time only when no one had a chance to connect signal handlers anyway.

session :

The InfSession that is synchronizing.

group :

The InfCommunicationGroup used for synchronization.

connection :

The InfXmlConnection to which the session is synchronized.

user_data :

user data set when the signal handler was connected.

The "synchronization-complete" signal

void                user_function                      (InfSession       *session,
                                                        InfXmlConnection *connection,
                                                        gpointer          user_data)       : Run Last

This signal is emitted when synchronization has completed, in addition to "synchronization-progress" with a progress value of 1.0.

If a callback is connected before the default handler, it can find out whether the remote side is synchronizing the local side by comparing sessions's status with INF_SESSION_SYNCHRONIZING. The default signal handler sets the status to INF_SESSION_RUNNING, so checking afterwards is not too useful.

session :

The InfSession that has or was synchronized

connection :

The InfXmlConnection through which synchronization happened

user_data :

user data set when the signal handler was connected.

The "synchronization-failed" signal

void                user_function                      (InfSession       *session,
                                                        InfXmlConnection *connection,
                                                        gpointer          error,
                                                        gpointer          user_data)       : Run Last

This signal is emitted when synchronization has failed before its completion due to malformed data from the other side or network failure.

If this happens during initial synchronization, "close" is emitted as well at this point.

session :

The InfSession that failed to synchronize or be synchronized

connection :

The InfXmlConnection through which synchronization happened

error :

A pointer to a GError object with details on the error

user_data :

user data set when the signal handler was connected.

The "synchronization-progress" signal

void                user_function                      (InfSession       *session,
                                                        InfXmlConnection *connection,
                                                        gdouble           progress,
                                                        gpointer          user_data)       : Run Last

This signal is emitted whenever a new XML node has been sent or received over connection as part of a synchronization. The process is completed when progress reaches the value 1.0. At this point, "synchronization-complete" is also emitted.

If session's status is INF_SESSION_SYNCHRONIZING, the local side is being synchronized by the remote side. If the status is INF_SESSION_RUNNING, the local side is updating the remote side.

session :

The InfSession that is synchronizing or being synchronized

connection :

The InfXmlConnection through which progress is made

progress :

A gdouble value ranging from 0.0 to 1.0.

user_data :

user data set when the signal handler was connected.
libinfinity-0.5.5/docs/reference/libinfinity/html/InfUser.html0000644000175000017500000006211212264766270021413 00000000000000 InfUser

InfUser

InfUser

Object Hierarchy

  GEnum
   +----InfUserStatus
  GFlags
   +----InfUserFlags
  GObject
   +----InfUser
         +----InfAdoptedUser

Properties

  "connection"               InfXmlConnection*     : Read / Write
  "flags"                    InfUserFlags          : Read / Write
  "id"                       guint                 : Read / Write / Construct Only
  "name"                     gchar*                : Read / Write
  "status"                   InfUserStatus         : Read / Write

Signals

  "set-status"                                     : Run Last

Description

Details

enum InfUserStatus

typedef enum {
  INF_USER_ACTIVE,
  INF_USER_INACTIVE,
  INF_USER_UNAVAILABLE
} InfUserStatus;

INF_USER_ACTIVE

INF_USER_INACTIVE

INF_USER_UNAVAILABLE


enum InfUserFlags

typedef enum {
  INF_USER_LOCAL = 1 << 0
} InfUserFlags;

INF_USER_LOCAL


InfUser

typedef struct _InfUser InfUser;


struct InfUserClass

struct InfUserClass {
  GObjectClass parent_class;

  void (*set_status)(InfUser* user,
                     InfUserStatus status);
};


inf_user_get_id ()

guint               inf_user_get_id                     (InfUser *user);

Returns the ID of the given InfUser.

user :

A InfUser.

Returns :

A numerical User ID.

inf_user_get_name ()

const gchar *       inf_user_get_name                   (InfUser *user);

Returns the name of the given InfUser.

user :

A InfUser.

Returns :

The user's name.

inf_user_get_status ()

InfUserStatus       inf_user_get_status                 (InfUser *user);

Returns the status of the given InfUser.

user :

A InfUser.

Returns :

The user's status.

inf_user_get_flags ()

InfUserFlags        inf_user_get_flags                  (InfUser *user);

Returns the flags for the given InfUser.

user :

A InfUser.

Returns :

The user's flags.

inf_user_get_connection ()

InfXmlConnection *  inf_user_get_connection             (InfUser *user);

Returns a connection to the given InfUser, or NULL. If a non-NULL connection is returned, then this is the connection through which records from that user come from. This means that, when this connection is closed, then the user is no longer available. However, you cannot send something to this connection expecting the user will receive it. For example, in central messaging mode, this connection is always the publisher, because all records from the user are relayed via the publisher.

If this functions returns NULL, this either means user is a local user (INF_USER_LOCAL flag set) or it is not available (status is INF_USER_UNAVAILBALE).

user :

A InfUser.

Returns :

A InfXmlConnection, or NULL.

inf_user_status_to_string ()

const gchar *       inf_user_status_to_string           (InfUserStatus status);

Returns a non-localized string identifying the given status. This is not meant to be shown to a user, but rather to serialize a user status, for example to store it in XML.

status :

A value from the InfUserStatus enumeration.

Returns :

A static string representation of status.

inf_user_status_from_string ()

gboolean            inf_user_status_from_string         (const gchar *string,
                                                         InfUserStatus *status,
                                                         GError **error);

This function does the opposite of inf_user_status_to_string(). It turns the given string back to a InfUserStatus, storing the result in status if status is non-NULL. If string is invalid, then status is left untouched, error is set and FALSE is returned. Otherwise, the function returns TRUE.

string :

A string representation of a InfUserStatus.

status :

A pointer to a InfUserStatus value, or NULL.

error :

Location to store error information, if any.

Returns :

When an error occured during the conversion, FALSE is returned, and TRUE otherwise.

Property Details

The "connection" property

  "connection"               InfXmlConnection*     : Read / Write

Connection to the user.


The "flags" property

  "flags"                    InfUserFlags          : Read / Write

Flags the user currently has.


The "id" property

  "id"                       guint                 : Read / Write / Construct Only

A Unique User ID.

Default value: 0


The "name" property

  "name"                     gchar*                : Read / Write

The Name with which a user joined a session. Most servers ensure that it is unique.

Default value: ""


The "status" property

  "status"                   InfUserStatus         : Read / Write

Whether the user is currently available or not.

Default value: INF_USER_UNAVAILABLE

Signal Details

The "set-status" signal

void                user_function                      (InfUser      *user,
                                                        InfUserStatus status,
                                                        gpointer      user_data)      : Run Last

This signal is emitted whenever the user's status changes. This is basically the same as a notification for the "status" property, but it allows to access the previous user status when connecting before the default signal handler.

user :

The InfUser that changes status.

status :

The new user status.

user_data :

user data set when the signal handler was connected.
libinfinity-0.5.5/docs/reference/libinfinity/html/InfTcpConnection.html0000644000175000017500000010671112264766270023247 00000000000000 InfTcpConnection

InfTcpConnection

InfTcpConnection

Object Hierarchy

  GEnum
   +----InfTcpConnectionStatus
  GObject
   +----InfTcpConnection

Properties

  "device-index"             guint                 : Read / Write
  "device-name"              gchar*                : Read / Write
  "io"                       InfIo*                : Read / Write / Construct Only
  "local-address"            InfIpAddress*         : Read
  "local-port"               guint                 : Read
  "remote-address"           InfIpAddress*         : Read / Write
  "remote-port"              guint                 : Read / Write
  "status"                   InfTcpConnectionStatus  : Read

Description

Details

enum InfTcpConnectionStatus

typedef enum {
  INF_TCP_CONNECTION_CONNECTING,
  INF_TCP_CONNECTION_CONNECTED,
  INF_TCP_CONNECTION_CLOSED
} InfTcpConnectionStatus;

INF_TCP_CONNECTION_CONNECTING

INF_TCP_CONNECTION_CONNECTED

INF_TCP_CONNECTION_CLOSED


InfTcpConnection

typedef struct _InfTcpConnection InfTcpConnection;


struct InfTcpConnectionClass

struct InfTcpConnectionClass {
  GObjectClass parent_class;

  /* Signals */
  void (*sent)(InfTcpConnection* connection,
               gconstpointer data,
               guint len);

  void (*received)(InfTcpConnection* connection,
                   gconstpointer data,
                   guint len);

  void (*error)(InfTcpConnection* connection,
                GError* error);
};


inf_tcp_connection_new ()

InfTcpConnection *  inf_tcp_connection_new              (InfIo *io,
                                                         InfIpAddress *remote_addr,
                                                         guint remote_port);

Creates a new InfTcpConnection. The arguments are stored as properties for an eventual inf_tcp_connection_open() call, this function itself does not establish a connection.

io :

A InfIo object used to watch for activity.

remote_addr :

The address to eventually connect to.

remote_port :

The port to eventually connect to.

Returns :

A new InfTcpConnection. Free with g_object_unref().

inf_tcp_connection_new_and_open ()

InfTcpConnection *  inf_tcp_connection_new_and_open     (InfIo *io,
                                                         InfIpAddress *remote_addr,
                                                         guint remote_port,
                                                         GError **error);

Creates a new InfTcpConnection and connects it to the given TCP endpoint. Like inf_tcp_connection_new, but calls inf_tcp_connection_open().

io :

A InfIo object used to watch for activity.

remote_addr :

The address to connect to.

remote_port :

The port to connect to.

error :

Location to store error information.

Returns :

A new InfTcpConnection, or NULL on error. Free with g_object_unref().

inf_tcp_connection_open ()

gboolean            inf_tcp_connection_open             (InfTcpConnection *connection,
                                                         GError **error);

Attempts to open connection. Make sure to have set the "remote-address" and "remote-port" property before calling this function. If an error occurs, the function returns FALSE and error is set. Note however that the connection might not be fully open when the function returns (check the "status" property if you need to know). If an asynchronous error occurs while the connection is being opened, the "error" signal is emitted.

connection :

A InfTcpConnection.

error :

Location to store error information.

Returns :

FALSE if an error occured and TRUE otherwise.

inf_tcp_connection_close ()

void                inf_tcp_connection_close            (InfTcpConnection *connection);

Closes a TCP connection that is either open or currently connecting.

connection :

A InfTcpConnection.

inf_tcp_connection_send ()

void                inf_tcp_connection_send             (InfTcpConnection *connection,
                                                         gconstpointer data,
                                                         guint len);

Sends data through the TCP connection. The data is not sent immediately, but enqueued to a buffer and will be sent as soon as kernel space becomes available. The "sent" signal will be emitted when data has really been sent.

connection :

A InfTcpConnection with status INF_TCP_CONNECTION_CONNECTED.

data :

The data to send.

len :

Number of bytes to send.

inf_tcp_connection_get_remote_address ()

InfIpAddress *      inf_tcp_connection_get_remote_address
                                                        (InfTcpConnection *connection);

Returns the IP address of the remote site.

connection :

A InfTcpConnection.

Returns :

A InfIpAddress owned by connection. You do not need to free it, but need to make your own copy if you want to keep it longer than connection's lifetime.

inf_tcp_connection_get_remote_port ()

guint               inf_tcp_connection_get_remote_port  (InfTcpConnection *connection);

Returns the port of the remote site to which connection is (or was) connected or connecting.

connection :

A InfTcpConnection.

Returns :

The port of the remote site.

Property Details

The "device-index" property

  "device-index"             guint                 : Read / Write

The index of the device to use for the connection.

Default value: 0


The "device-name" property

  "device-name"              gchar*                : Read / Write

The name of the device to use for the connection, such as `eth0'.

Default value: NULL


The "io" property

  "io"                       InfIo*                : Read / Write / Construct Only

I/O handler.


The "local-address" property

  "local-address"            InfIpAddress*         : Read

The local address of the connection.


The "local-port" property

  "local-port"               guint                 : Read

The local port of the connection.

Allowed values: <= 65535

Default value: 0


The "remote-address" property

  "remote-address"           InfIpAddress*         : Read / Write

Address to connect to.


The "remote-port" property

  "remote-port"              guint                 : Read / Write

Port to connect to.

Allowed values: <= 65535

Default value: 0


The "status" property

  "status"                   InfTcpConnectionStatus  : Read

Status of the TCP connection.

Default value: INF_TCP_CONNECTION_CLOSED

Signal Details

The "error" signal

void                user_function                      (InfTcpConnection *connection,
                                                        gpointer          error,
                                                        gpointer          user_data)       : Run Last

connection :

The erroneous InfTcpConnection

error :

A pointer to a GError object with details on the error

user_data :

user data set when the signal handler was connected.

The "received" signal

void                user_function                      (InfTcpConnection *connection,
                                                        gpointer          data,
                                                        guint             length,
                                                        gpointer          user_data)       : Run Last

connection :

The InfTcpConnection through which the data has been received

data :

A gpointer refering to the data that has been received

length :

A guint holding the number of bytes that has been received

user_data :

user data set when the signal handler was connected.

The "sent" signal

void                user_function                      (InfTcpConnection *connection,
                                                        gpointer          data,
                                                        guint             length,
                                                        gpointer          user_data)       : Run Last

connection :

The InfTcpConnection through which the data has been sent

data :

A gpointer refering to the data that has been sent

length :

A guint holding the number of bytes that has been sent

user_data :

user data set when the signal handler was connected.
libinfinity-0.5.5/docs/reference/libinfinity/html/InfSaslContext.html0000644000175000017500000016450712264766270022757 00000000000000 InfSaslContext

InfSaslContext

InfSaslContext — Asynchronous SASL processing

Stability Level

Unstable, unless otherwise indicated

Synopsis

#include <libinfinity/common/inf-sasl-context.h>

                    InfSaslContext;
                    InfSaslContextSession;
void                (*InfSaslContextCallbackFunc)       (InfSaslContextSession *session,
                                                         Gsasl_property property,
                                                         gpointer session_data,
                                                         gpointer user_data);
void                (*InfSaslContextSessionFeedFunc)    (InfSaslContextSession *session,
                                                         const char *data,
                                                         gboolean needs_more,
                                                         const GError *error,
                                                         gpointer user_data);
InfSaslContext *    inf_sasl_context_new                (GError **error);
InfSaslContext *    inf_sasl_context_ref                (InfSaslContext *context);
void                inf_sasl_context_unref              (InfSaslContext *context);
void                inf_sasl_context_set_callback       (InfSaslContext *context,
                                                         InfSaslContextCallbackFunc callback,
                                                         gpointer user_data);
InfSaslContextSession * inf_sasl_context_client_start_session
                                                        (InfSaslContext *context,
                                                         InfIo *io,
                                                         const char *mech,
                                                         gpointer session_data,
                                                         GError **error);
char *              inf_sasl_context_client_list_mechanisms
                                                        (InfSaslContext *context,
                                                         GError **error);
gboolean            inf_sasl_context_client_supports_mechanism
                                                        (InfSaslContext *context,
                                                         const char *mech);
const char *        inf_sasl_context_client_suggest_mechanism
                                                        (InfSaslContext *context,
                                                         const char *mechanisms);
InfSaslContextSession * inf_sasl_context_server_start_session
                                                        (InfSaslContext *context,
                                                         InfIo *io,
                                                         const char *mech,
                                                         gpointer session_data,
                                                         GError **error);
char *              inf_sasl_context_server_list_mechanisms
                                                        (InfSaslContext *context,
                                                         GError **error);
gboolean            inf_sasl_context_server_supports_mechanism
                                                        (InfSaslContext *context,
                                                         const char *mech);
void                inf_sasl_context_stop_session       (InfSaslContext *context,
                                                         InfSaslContextSession *session);
const char *        inf_sasl_context_session_get_property
                                                        (InfSaslContextSession *session,
                                                         Gsasl_property prop);
void                inf_sasl_context_session_set_property
                                                        (InfSaslContextSession *session,
                                                         Gsasl_property prop,
                                                         const char *value);
void                inf_sasl_context_session_continue   (InfSaslContextSession *session,
                                                         int retval);
void                inf_sasl_context_session_feed       (InfSaslContextSession *session,
                                                         const char *data,
                                                         InfSaslContextSessionFeedFunc func,
                                                         gpointer user_data);

Object Hierarchy

  GBoxed
   +----InfSaslContext

Description

InfSaslContext is a wrapper for the Gsasl library. It basically adds functionality to provide properties asynchronously to Gsasl, so that for example a dialog can be shown to the user before continuing with the authentication process. With Gsasl, it is expected that the callback function sets the requested property before returning, which makes it hard to give control back to a main loop while waiting for user input.

This wrapper makes sure the callback is called in another thread so that it can block without affecting the rest of the program. Use inf_sasl_context_session_feed() as a replacement for gsasl_step64(). Instead of returning the result data directly, the function calls a callback once all properties requested have been provided.

All threading internals are hidden by the wrapper, so all callbacks are issued in the user thread. However, it requires an InfIo object to dispatch messages to it. Also, all InfSaslContext functions are fully thread-safe.

Details

InfSaslContext

typedef struct _InfSaslContext InfSaslContext;

InfSaslContext is an opaque data type. You should only access it via the public API functions.


InfSaslContextSession

typedef struct _InfSaslContextSession InfSaslContextSession;

InfSaslContextSession represents an ongoing authentication session. Create with inf_sasl_context_server_start_session() or inf_sasl_context_client_start_session().


InfSaslContextCallbackFunc ()

void                (*InfSaslContextCallbackFunc)       (InfSaslContextSession *session,
                                                         Gsasl_property property,
                                                         gpointer session_data,
                                                         gpointer user_data);

This callback is called whenever a property is required to proceed with authentication. For example, when a password is required, the callback is called with property set to GSASL_PASSCODE.

The function is then expected to set that property using inf_sasl_context_session_set_property() and, once it is done, call inf_sasl_context_session_continue(). This can happen fully asynchronously, that is it does not need to take place directly within the callback but the callback can, for example, open a dialog for the user to enter a password and then once the user closes the dialog call the two functions mentioned above.

session :

A InfSaslContextSession.

property :

The property requested.

session_data :

The session data for session specified in inf_sasl_context_server_start_session() or inf_sasl_context_client_start_session().

user_data :

The user data specified in inf_sasl_context_set_callback().

InfSaslContextSessionFeedFunc ()

void                (*InfSaslContextSessionFeedFunc)    (InfSaslContextSession *session,
                                                         const char *data,
                                                         gboolean needs_more,
                                                         const GError *error,
                                                         gpointer user_data);

This function is called in response to inf_sasl_context_session_feed(). When all required properties (if any) have been provided by the callback function then this function is called with the response to send to the remote site.

If an error occurred then error will be set and data will be NULL.

session :

A InfSaslContextSession.

data :

The response to the fed data, base64 encoded and null-terminated.

needs_more :

If TRUE then inf_sasl_context_session_feed() needs to be called again with more data, otherwise the authentication has finished.

error :

This is nonzero if an error occured while processing the input data.

user_data :

The user data specified in inf_sasl_context_session_feed().

inf_sasl_context_new ()

InfSaslContext *    inf_sasl_context_new                (GError **error);

Creates a new InfSaslContext with a reference count of 1. If the function fails it returns NULL and error is set.

error :

Location to store error information, if any.

Returns :

A new InfSaslContext, or NULL on error. Free with inf_sasl_context_unref() when no longer needed.

inf_sasl_context_ref ()

InfSaslContext *    inf_sasl_context_ref                (InfSaslContext *context);

Increases the reference count of context by one.

context :

A InfSaslContext.

Returns :

The passed in pointer, context.

inf_sasl_context_unref ()

void                inf_sasl_context_unref              (InfSaslContext *context);

Decreases the reference count of sasl by one. When the reference count reaches zero then the object is freed and may no longer be used. If that happens then also all sessions created with inf_sasl_context_client_start_session() or inf_sasl_context_server_start_session() are stopped automatically.

context :

A InfSaslContext.

inf_sasl_context_set_callback ()

void                inf_sasl_context_set_callback       (InfSaslContext *context,
                                                         InfSaslContextCallbackFunc callback,
                                                         gpointer user_data);

Sets the callback to call when, during authentication, a certain properties needs to be provided, such as a username or a password. The callback function is expected to set the requested property using inf_sasl_context_session_set_property() and then call inf_sasl_context_session_continue() with retval being GSASL_OK. If it cannot provide the property then it should only call inf_sasl_context_session_continue() with retval indicating the problem.

The callback function does not need to provide the property immediately. It is also allowed return and call inf_sasl_context_session_continue() later.

context :

A InfSaslContext.

callback :

A function to call to query properties for authentication.

user_data :

Additional context to pass to callback.

inf_sasl_context_client_start_session ()

InfSaslContextSession * inf_sasl_context_client_start_session
                                                        (InfSaslContext *context,
                                                         InfIo *io,
                                                         const char *mech,
                                                         gpointer session_data,
                                                         GError **error);

Starts a new client-side SASL session using mech for authentication. When the session finished, that is either when an error occurred or the authentication finished successfully, use inf_sasl_context_stop_session().

The callback function will be called in the thread that io runs in.

context :

A InfSaslContext.

io :

The InfIo main loop to which to dispatch callbacks.

mech :

The mechanism to use for the session.

session_data :

Session-specific data to provide to the InfSaslContextCallbackFunc.

error :

Location to store error information, if any.

Returns :

A InfSaslContextSession.

inf_sasl_context_client_list_mechanisms ()

char *              inf_sasl_context_client_list_mechanisms
                                                        (InfSaslContext *context,
                                                         GError **error);

Returns a newly allocated space-separated string containing SASL mechanisms that context supports for client sessions.

context :

A InfSaslContext.

error :

Location to store error information, if any.

Returns :

A newly allocated string. Free with gsasl_free() when no longer in use.

inf_sasl_context_client_supports_mechanism ()

gboolean            inf_sasl_context_client_supports_mechanism
                                                        (InfSaslContext *context,
                                                         const char *mech);

Checks whether context supports the mechanism with name mech for client sessions.

context :

A InfSaslContext.

mech :

The name of the mechanism to be tested.

Returns :

TRUE if mech is supported or FALSE otherwise.

inf_sasl_context_client_suggest_mechanism ()

const char *        inf_sasl_context_client_suggest_mechanism
                                                        (InfSaslContext *context,
                                                         const char *mechanisms);

Given a list of SASL mechanisms this function suggests the which is the "best" one to be used.

context :

A InfSaslContext.

mechanisms :

Space-separated list of SASL mechanism names.

Returns :

The name of the suggested mechanism.

inf_sasl_context_server_start_session ()

InfSaslContextSession * inf_sasl_context_server_start_session
                                                        (InfSaslContext *context,
                                                         InfIo *io,
                                                         const char *mech,
                                                         gpointer session_data,
                                                         GError **error);

Starts a new server-side SASL session using mech for authentication. When the session finished, that is either when an error occurred or the authentication finished successfully, use inf_sasl_context_stop_session().

The callback function will be called in the thread that io runs in.

context :

A InfSaslContext.

io :

The InfIo main loop to which to dispatch callbacks.

mech :

The mechanism to use for the session.

session_data :

Session-specific data to provide to the InfSaslContextCallbackFunc.

error :

Location to store error information, if any.

Returns :

A InfSaslContextSession.

inf_sasl_context_server_list_mechanisms ()

char *              inf_sasl_context_server_list_mechanisms
                                                        (InfSaslContext *context,
                                                         GError **error);

Returns a newly allocated space-separated string containing SASL mechanisms that context supports for server sessions.

context :

A InfSaslContext.

error :

Location to store error information, if any.

Returns :

A newly allocated string. Free with gsasl_free() when no longer in use.

inf_sasl_context_server_supports_mechanism ()

gboolean            inf_sasl_context_server_supports_mechanism
                                                        (InfSaslContext *context,
                                                         const char *mech);

Checks whether context supports the mechanism with name mech for server sessions.

context :

A InfSaslContext.

mech :

The name of the mechanism to be tested.

Returns :

TRUE if mech is supported or FALSE otherwise.

inf_sasl_context_stop_session ()

void                inf_sasl_context_stop_session       (InfSaslContext *context,
                                                         InfSaslContextSession *session);

Finishes session and frees all resources allocated to it. This can be used to cancel an authentication session, or to free it after it finished (either successfully or not).

session should no longer be used after this function was called.

context :

A InfSaslContext.

session :

A InfSaslContextSession created with context.

inf_sasl_context_session_get_property ()

const char *        inf_sasl_context_session_get_property
                                                        (InfSaslContextSession *session,
                                                         Gsasl_property prop);

Returns the value of the property prop in session. If the value does not yet exist then this function returns NULL. It does not invoke the InfSaslContextCallbackFunc to query it.

session :

A InfSaslContextSession.

prop :

A SASL property.

Returns :

The value of the property, or NULL. The value is owned by the session and must not be freed.

inf_sasl_context_session_set_property ()

void                inf_sasl_context_session_set_property
                                                        (InfSaslContextSession *session,
                                                         Gsasl_property prop,
                                                         const char *value);

Sets the property prop in session to value.

session :

A InfSaslContextSession.

prop :

A SASL property.

value :

The value to set the property to.

inf_sasl_context_session_continue ()

void                inf_sasl_context_session_continue   (InfSaslContextSession *session,
                                                         int retval);

When the callback function specified in inf_sasl_context_set_callback() is called then session waits for the user to call inf_sasl_context_session_continue(). It should do so once it provided the requested property using inf_sasl_context_session_set_property() with retval being GSASL_OK. If it decides that the property cannot be provided then it should still call this function with retval being a SASL error code specifying the problem.

session :

A InfSaslContextSession.

retval :

Error code of the operation requested.

inf_sasl_context_session_feed ()

void                inf_sasl_context_session_feed       (InfSaslContextSession *session,
                                                         const char *data,
                                                         InfSaslContextSessionFeedFunc func,
                                                         gpointer user_data);

This function feeds data from the session's remote counterpart to session. It should be base64 encoded. This function will, asynchronously, process the data and query for properties it requires to do so. Once it has finished, func is called with output data to send to the remote side to be fed to its session counterpart.

This function must not be called again before func was called.

session :

A InfSaslContextSession.

data :

The data to feed to the SASL session.

func :

The function to call when the data has been processed.

user_data :

Additional user data to pass to func.
libinfinity-0.5.5/docs/reference/libinfinity/html/libinfinity-0.5-InfError.html0000644000175000017500000011012112264766270024376 00000000000000 InfError

InfError

InfError — Common error codes

Stability Level

Unstable, unless otherwise indicated

Description

This section defines some common error codes that are used on both client and server side in infinote, and maps these to GErrors.

Details

enum InfRequestError

typedef enum {
  INF_REQUEST_ERROR_UNKNOWN_DOMAIN,
  INF_REQUEST_ERROR_REPLY_UNPROCESSED,
  INF_REQUEST_ERROR_INVALID_SEQ,
  INF_REQUEST_ERROR_NO_SUCH_ATTRIBUTE,
  INF_REQUEST_ERROR_INVALID_NUMBER,

  INF_REQUEST_ERROR_FAILED
} InfRequestError;

These are general request errors that all InfcRequests can fail with. Specific requests may also fail with more errors, such as InfDirectoryError.

INF_REQUEST_ERROR_UNKNOWN_DOMAIN

The server sent <request-failed/> with an unknown error domain.

INF_REQUEST_ERROR_REPLY_UNPROCESSED

An error occured while processing the server reply for a request.

INF_REQUEST_ERROR_INVALID_SEQ

The server sent an invalid sequence number in a reply to a request.

INF_REQUEST_ERROR_NO_SUCH_ATTRIBUTE

A request did not contain a XML attribute that is required to complete the request.

INF_REQUEST_ERROR_INVALID_NUMBER

A number in a request was invalid. Either it was not numerical, or it produced an underflow or an overflow.

INF_REQUEST_ERROR_FAILED

Generic error code when no further reason of failure is known.

enum InfUserError

typedef enum {
  INF_USER_ERROR_NAME_IN_USE,
  INF_USER_ERROR_ID_PROVIDED,
  INF_USER_ERROR_NO_SUCH_USER,
  INF_USER_ERROR_STATUS_UNAVAILABLE,
  INF_USER_ERROR_NOT_JOINED,
  INF_USER_ERROR_INVALID_STATUS,

  INF_USER_ERROR_FAILED
} InfUserError;

These are errors related to users. They may occur during user join or during processing a user-related message, such as a user status change message in an InfSession.

INF_USER_ERROR_NAME_IN_USE

The requested name is already in use by another user.

INF_USER_ERROR_ID_PROVIDED

The client provided a user ID field in a user join request, but it's the server's job to find an ID.

INF_USER_ERROR_NO_SUCH_USER

A request referred to a user ID that no user is associated with.

INF_USER_ERROR_STATUS_UNAVAILABLE

The initial user status was given as unavailable during user join or rejoin.

INF_USER_ERROR_NOT_JOINED

The user did not join from the connection the request comes from. For example, a user status change can only be requested from the same connection that joined the user.

INF_USER_ERROR_INVALID_STATUS

An invalid status was used in a XML request. Allowed status values are "unavailable", "inactive" or "active".

INF_USER_ERROR_FAILED

Generic error code when no further reason of failure is known.

enum InfDirectoryError

typedef enum {
  INF_DIRECTORY_ERROR_NO_WELCOME_MESSAGE,
  INF_DIRECTORY_ERROR_VERSION_MISMATCH,
  INF_DIRECTORY_ERROR_NODE_EXISTS,
  INF_DIRECTORY_ERROR_INVALID_NAME,
  INF_DIRECTORY_ERROR_NO_SUCH_NODE,
  INF_DIRECTORY_ERROR_NO_SUCH_SUBSCRIPTION_REQUEST,
  INF_DIRECTORY_ERROR_CHAT_DISABLED,
  INF_DIRECTORY_ERROR_NOT_A_SUBDIRECTORY,
  INF_DIRECTORY_ERROR_NOT_A_NOTE,
  INF_DIRECTORY_ERROR_ROOT_NODE_REMOVE_ATTEMPT,
  INF_DIRECTORY_ERROR_ALREADY_EXPLORED,
  INF_DIRECTORY_ERROR_TOO_MUCH_CHILDREN,
  INF_DIRECTORY_ERROR_TOO_FEW_CHILDREN,
  INF_DIRECTORY_ERROR_TYPE_UNKNOWN,
  INF_DIRECTORY_ERROR_ALREADY_SUBSCRIBED,
  INF_DIRECTORY_ERROR_UNSUBSCRIBED,
  INF_DIRECTORY_ERROR_NETWORK_UNSUPPORTED,
  INF_DIRECTORY_ERROR_METHOD_UNSUPPORTED,
  INF_DIRECTORY_ERROR_UNEXPECTED_SYNC_IN,
  INF_DIRECTORY_ERROR_UNEXPECTED_MESSAGE,
  INF_DIRECTORY_ERROR_NO_STORAGE,

  INF_DIRECTORY_ERROR_FAILED
} InfDirectoryError;

These are errors related to the directory of documents. These errors can be reason why requests created by InfcBrowser fail.

INF_DIRECTORY_ERROR_NO_WELCOME_MESSAGE

A client did not receive the directory's initial welcome message.

INF_DIRECTORY_ERROR_VERSION_MISMATCH

The server and client use different versions of the protocol.

INF_DIRECTORY_ERROR_NODE_EXISTS

A node with the given name exists already in that subdirectory (in response to node creation requests).

INF_DIRECTORY_ERROR_INVALID_NAME

A node with an invalid name was attempted to be created.

INF_DIRECTORY_ERROR_NO_SUCH_NODE

The node refered to in a request does not exist in the directory (anymore).

INF_DIRECTORY_ERROR_NO_SUCH_SUBSCRIPTION_REQUEST

A <subscribe-ack> or <subscribe-nack> has been received without a previous request.

INF_DIRECTORY_ERROR_CHAT_DISABLED

A client attempted to subscribe to a server's chat, but the chat is disabled on the server side.

INF_DIRECTORY_ERROR_NOT_A_SUBDIRECTORY

The node refered to in a request is not a subdirectory node, but the requested operation requires one.

INF_DIRECTORY_ERROR_NOT_A_NOTE

The node refered to in a request is not a note (non-subdirectory) node, but the requested operations requires one.

INF_DIRECTORY_ERROR_ROOT_NODE_REMOVE_ATTEMPT

A <remove-node> request attempted to remove a directory's root node, which is not allowed.

INF_DIRECTORY_ERROR_ALREADY_EXPLORED

The node given in an exploration request has already been explored earlier.

INF_DIRECTORY_ERROR_TOO_MUCH_CHILDREN

Exploration yields more children than announced at the beginning of the exploration.

INF_DIRECTORY_ERROR_TOO_FEW_CHILDREN

Exploration yields less children than announced at the beginning of the exploration.

INF_DIRECTORY_ERROR_TYPE_UNKNOWN

The type of a note is not known.

INF_DIRECTORY_ERROR_ALREADY_SUBSCRIBED

The connection already subscribed to the node refered to, but the requested operation requires it to be unsubscribed.

INF_DIRECTORY_ERROR_UNSUBSCRIBED

The connection is not subscribed to the node refered to, but the requested operation requires it to be subscribed.

INF_DIRECTORY_ERROR_NETWORK_UNSUPPORTED

The server does not support the network of the incoming connection for the requested operation. For example, subscribing to a session might require a network that has a peer-to-peer communication method, but there is no implementation of that method for the connection's network.

INF_DIRECTORY_ERROR_METHOD_UNSUPPORTED

The server requested a communaction method for subscription or synchronization that is not supported by the client.

INF_DIRECTORY_ERROR_UNEXPECTED_SYNC_IN

A client received a <sync-in/> without having requested one. The client has no data to sync to the server.

INF_DIRECTORY_ERROR_UNEXPECTED_MESSAGE

A message that is not understood was received.

INF_DIRECTORY_ERROR_NO_STORAGE

A node cannot be stored permanently on the server since it has no storage backend attached.

INF_DIRECTORY_ERROR_FAILED

Generic error code when no further reason of failure is known.

enum InfAuthenticationDetailError

typedef enum {
  INF_AUTHENTICATION_DETAIL_ERROR_AUTHENTICATION_FAILED,
  INF_AUTHENTICATION_DETAIL_ERROR_USER_NOT_AUTHORIZED,
  INF_AUTHENTICATION_DETAIL_ERROR_TRY_AGAIN,
  INF_AUTHENTICATION_DETAIL_ERROR_SERVER_ERROR
} InfAuthenticationDetailError;

INF_AUTHENTICATION_DETAIL_ERROR_AUTHENTICATION_FAILED

User did not provide valid credentials.

INF_AUTHENTICATION_DETAIL_ERROR_USER_NOT_AUTHORIZED

User is not permitted to connect to this server.

INF_AUTHENTICATION_DETAIL_ERROR_TRY_AGAIN

Authentication was temporarily interrupted on the server side.

INF_AUTHENTICATION_DETAIL_ERROR_SERVER_ERROR

An error occured while checking user permissions.

inf_request_error_quark ()

GQuark              inf_request_error_quark             (void);

Error domain for request errors. Errors in this domain will be from the InfRequestError enumeration. See GError for information on error domains.

Returns :

A GQuark.

inf_request_strerror ()

const gchar *       inf_request_strerror                (InfRequestError code);

Returns a human-readable string for the given error code.

code :

An error code from the InfRequestError enumeration.

Returns :

A static string that must not be freed.

inf_user_error_quark ()

GQuark              inf_user_error_quark                (void);

Error domain for user-related errors. Errors in this domain will be from the InfUserError enumeration. See GError for information on error domains.

Returns :

A GQuark.

inf_user_strerror ()

const gchar *       inf_user_strerror                   (InfUserError code);

Returns a human-readable string for the given error code.

code :

An error code from the InfUserError enumeration.

Returns :

A static string that must not be freed.

inf_directory_error_quark ()

GQuark              inf_directory_error_quark           (void);

Error domain for directory errors. Errors in this domain will be from the InfDirectoryError enumeration. See GError for information on error domains.

Returns :

A GQuark.

inf_directory_strerror ()

const gchar *       inf_directory_strerror              (InfDirectoryError code);

Returns a human-readable string for the given error code.

code :

An error code from the InfDirectoryError enumeration.

Returns :

A static string that must not be freed.

inf_authentication_detail_error_quark ()

GQuark              inf_authentication_detail_error_quark
                                                        (void);

Error domain for further information on authentication errors. Errors in this domain will be from the InfAuthenticationDetailError enumeration. See GError for information on error domains.

Returns :

A GQuark.

inf_authentication_detail_strerror ()

const gchar *       inf_authentication_detail_strerror  (InfAuthenticationDetailError code);

Returns a human-readable string for the given error code.

code :

An error code from the InfAuthenticationDetailError enumeration.

Returns :

A static string that must not be freed.

inf_gnutls_error_quark ()

GQuark              inf_gnutls_error_quark              (void);

Error domain for GnuTLS errors. Errors in this domain will be GnuTLS error codes. See GError for information on error domains.

Returns :

A GQuark.

inf_gnutls_set_error ()

void                inf_gnutls_set_error                (GError **error,
                                                         int error_code);

Sets a GError from a GnuTLS error code. If error is NULL, does nothing.

error :

Location to store the error, or NULL.

error_code :

A GnuTLS error code.

inf_gsasl_error_quark ()

GQuark              inf_gsasl_error_quark               (void);

Error domain for GNU SASL errors. Errors in this domain will be GNU SASL error codes. See GError for information on error domains.

Returns :

A GQuark.

inf_gsasl_set_error ()

void                inf_gsasl_set_error                 (GError **error,
                                                         int error_code);

Sets a GError from a GNU SASL error code. If error is NULL, does nothing.

error :

Location to store the error, or NULL.

error_code :

A GNU SASL error code.
libinfinity-0.5.5/docs/reference/libinfinity/html/InfChatBuffer.html0000644000175000017500000011506512264766270022514 00000000000000 InfChatBuffer

InfChatBuffer

InfChatBuffer — A ring buffer for chat messages

Stability Level

Unstable, unless otherwise indicated

Object Hierarchy

  GEnum
   +----InfChatBufferMessageType
  GFlags
   +----InfChatBufferMessageFlags
  GBoxed
   +----InfChatBufferMessage
  GObject
   +----InfChatBuffer

Implemented Interfaces

InfChatBuffer implements InfBuffer.

Properties

  "size"                     guint                 : Read / Write / Construct Only

Signals

  "add-message"                                    : Run Last

Description

InfChatBuffer contains the chat messages for a InfChatSession.

Details

enum InfChatBufferMessageType

typedef enum {
  INF_CHAT_BUFFER_MESSAGE_NORMAL,
  INF_CHAT_BUFFER_MESSAGE_EMOTE,
  INF_CHAT_BUFFER_MESSAGE_USERJOIN,
  INF_CHAT_BUFFER_MESSAGE_USERPART
} InfChatBufferMessageType;

Possible chat message types.

INF_CHAT_BUFFER_MESSAGE_NORMAL

A normal chat message.

INF_CHAT_BUFFER_MESSAGE_EMOTE

An emote chat message (/me is doing something).

INF_CHAT_BUFFER_MESSAGE_USERJOIN

A user join notification.

INF_CHAT_BUFFER_MESSAGE_USERPART

A user part notification.

enum InfChatBufferMessageFlags

typedef enum {
  INF_CHAT_BUFFER_MESSAGE_BACKLOG = 1 << 0
} InfChatBufferMessageFlags;

Possible chat message flags.

INF_CHAT_BUFFER_MESSAGE_BACKLOG

The message is a backlog message, i.e. it originated in a previous session.

struct InfChatBufferMessage

struct InfChatBufferMessage {
  InfChatBufferMessageType type;
  InfUser* user;
  gchar* text;
  gsize length;
  time_t time;
  InfChatBufferMessageFlags flags;
};

Represents a chat message.

InfChatBufferMessageType type;

The InfChatBufferMessageType of the message.

InfUser *user;

The InfUser that issued the message.

gchar *text;

The UTF-8 encoded text of the message.

gsize length;

The length of the message, in bytes.

time_t time;

The time at which the message was received.

InfChatBufferMessageFlags flags;

Additional flags for the message, see InfChatBufferMessageFlags.

InfChatBuffer

typedef struct _InfChatBuffer InfChatBuffer;

InfChatBuffer is an opaque data type. You should only access it via the public API functions.


struct InfChatBufferClass

struct InfChatBufferClass {
  void (*add_message)(InfChatBuffer* buffer,
                      const InfChatBufferMessage* message);
};

This structure contains default signal handlers for InfChatBuffer.

add_message ()

Default signal handler for the "add-message" signal.

inf_chat_buffer_message_copy ()

InfChatBufferMessage * inf_chat_buffer_message_copy     (const InfChatBufferMessage *message);

Creates a copy of the given message.

message :

The InfChatBufferMessage to copy.

Returns :

A new InfChatBufferMessage. Free with inf_chat_buffer_message_free() when no longer needed.

inf_chat_buffer_message_free ()

void                inf_chat_buffer_message_free        (InfChatBufferMessage *message);

Frees the given InfChatBufferMessage which must have been created with inf_chat_buffer_message_copy().

message :

A InfChatBufferMessage.

inf_chat_buffer_new ()

InfChatBuffer *     inf_chat_buffer_new                 (guint size);

Creates a new InfChatBuffer which contains no initial messages. size specifies how many messages to store before dropping old messages.

size :

The number of messages to store.

Returns :

A new InfChatBuffer.

inf_chat_buffer_add_message ()

void                inf_chat_buffer_add_message         (InfChatBuffer *buffer,
                                                         InfUser *by,
                                                         const gchar *message,
                                                         gsize length,
                                                         time_t time,
                                                         InfChatBufferMessageFlags flags);

Adds a new message to the chat buffer. If the buffer is full (meaning the number of messages in the buffer equals its size), then an old message will get discarded. If the message to be added is older than all other messages in the buffer, then it will not be added at all.

buffer :

A InfChatBuffer.

by :

A InfUser who wrote the message.

message :

The message text.

length :

The length of message, in bytes.

time :

The time at which the user has written the message.

flags :

Flags to set for the message to add.

inf_chat_buffer_add_emote_message ()

void                inf_chat_buffer_add_emote_message   (InfChatBuffer *buffer,
                                                         InfUser *by,
                                                         const gchar *message,
                                                         gsize length,
                                                         time_t time,
                                                         InfChatBufferMessageFlags flags);

Adds a new emote message to the chat buffer. If the buffer is full (meaning the number of messages in the buffer equals its size), then an old message will get discarded. If the message to be added is older than all other messages in the buffer, then it will not be added at all.

buffer :

A InfChatBuffer.

by :

A InfUser who wrote the message.

message :

The message text.

length :

The length of message, in bytes.

time :

The time at which the user has written the message.

flags :

Flags to set for the message to add.

inf_chat_buffer_add_userjoin_message ()

void                inf_chat_buffer_add_userjoin_message
                                                        (InfChatBuffer *buffer,
                                                         InfUser *user,
                                                         time_t time,
                                                         InfChatBufferMessageFlags flags);

Adds a new userjoin message to the chat buffer. If the buffer is full (meaning the number of messages in the buffer equals its size), then an old message will get discarded. If the message to be added is older than all other messages in the buffer, then it will not be added at all.

buffer :

A InfChatBuffer.

user :

A InfUser who wrote the message.

time :

The time at which the user has written the message.

flags :

Flags to set for the message to add.

inf_chat_buffer_add_userpart_message ()

void                inf_chat_buffer_add_userpart_message
                                                        (InfChatBuffer *buffer,
                                                         InfUser *user,
                                                         time_t time,
                                                         InfChatBufferMessageFlags flags);

Adds a new userpart message to the chat buffer. If the buffer is full (meaning the number of messages in the buffer equals its size), then an old message will get discarded. If the message to be added is older than all other messages in the buffer, then it will not be added at all.

buffer :

A InfChatBuffer.

user :

A InfUser who wrote the message.

time :

The time at which the user has written the message.

flags :

Flags to set for the message to add.

inf_chat_buffer_get_message ()

const InfChatBufferMessage * inf_chat_buffer_get_message
                                                        (InfChatBuffer *buffer,
                                                         guint n);

Returns the message with the given index from the buffer. The oldest message in the buffer has index 0, and the most recent one has index inf_chat_buffer_get_n_messages() - 1.

buffer :

A InfChatBuffer.

n :

The index of the message to obtain.

Returns :

The InfChatBufferMessage with the given index.

inf_chat_buffer_get_n_messages ()

guint               inf_chat_buffer_get_n_messages      (InfChatBuffer *buffer);

Returns the number of messages in the buffer.

buffer :

A InfChatBuffer.

Returns :

The number of messages in the buffer.

inf_chat_buffer_get_size ()

guint               inf_chat_buffer_get_size            (InfChatBuffer *buffer);

Returns the size of the chat buffer, which is the maximum number of messages that can be stored in the buffer.

buffer :

A InfChatBuffer.

Returns :

The number of messages in the chat buffer.

Property Details

The "size" property

  "size"                     guint                 : Read / Write / Construct Only

The maxmimum number of messages saved.

Default value: 256

Signal Details

The "add-message" signal

void                user_function                      (InfChatBuffer        *buffer,
                                                        InfChatBufferMessage *message,
                                                        gpointer              user_data)      : Run Last

This signal is emitted whenever a message has been added to buffer.

buffer :

The InfChatBuffer that is receiving a message.

message :

The InfChatBufferMessage that was received.

user_data :

user data set when the signal handler was connected.
libinfinity-0.5.5/docs/reference/libinfinity/html/InfChatSession.html0000644000175000017500000005632112264766270022725 00000000000000 InfChatSession

InfChatSession

InfChatSession — Simple standalone chat

Stability Level

Unstable, unless otherwise indicated

Synopsis

#include <libinfinity/common/inf-chat-session.h>

                    InfChatSession;
struct              InfChatSessionClass;
enum                InfChatSessionError;
InfChatSession *    inf_chat_session_new                (InfCommunicationManager *manager,
                                                         guint backlog_size,
                                                         InfSessionStatus status,
                                                         InfCommunicationGroup *sync_group,
                                                         InfXmlConnection *sync_connection);
gboolean            inf_chat_session_set_log_file       (InfChatSession *session,
                                                         const gchar *log_file,
                                                         GError **error);

Object Hierarchy

  GObject
   +----InfSession
         +----InfChatSession

Implemented Interfaces

InfChatSession implements InfCommunicationObject.

Properties

  "log-file"                 gchar*                : Read / Write

Description

InfChatSession represents a chat session. Normally, there is one chat session per server, and it can be enabled via infd_directory_enable_chat(). Clients can subscribe to the chat session via infc_browser_subscribe_chat().

Details

InfChatSession

typedef struct _InfChatSession InfChatSession;

InfChatSession is an opaque data type. You should only access it via the public API functions.


struct InfChatSessionClass

struct InfChatSessionClass {
  void (*receive_message)(InfChatSession* session,
                          const InfChatBufferMessage* message);
  void (*send_message)(InfChatSession* session,
                       const InfChatBufferMessage* message);
};

This structure contains default signal handlers for InfChatSession.

receive_message ()

Default signal handler for the "receive-message" signal.

send_message ()

Default signal handler for the "send-message" signal.

enum InfChatSessionError

typedef enum {
  INF_CHAT_SESSION_ERROR_TYPE_INVALID,
  INF_CHAT_SESSION_ERROR_NO_SUCH_USER,

  INF_CHAT_SESSION_ERROR_FAILED
} InfChatSessionError;

Errors that can occur with a chat session, especially in the process_xml_sync and process_xml_run vfunc implementations.

INF_CHAT_SESSION_ERROR_TYPE_INVALID

An invalid message type was sent.

INF_CHAT_SESSION_ERROR_NO_SUCH_USER

A message referred to a nonexisting user.

INF_CHAT_SESSION_ERROR_FAILED

Generic error code when no further reason of failure is known.

inf_chat_session_new ()

InfChatSession *    inf_chat_session_new                (InfCommunicationManager *manager,
                                                         guint backlog_size,
                                                         InfSessionStatus status,
                                                         InfCommunicationGroup *sync_group,
                                                         InfXmlConnection *sync_connection);

Creates a new InfChatSession with no initial messages. The communication manager is used to send and receive requests from subscription and synchronization.

backlog_size specifies how much messages to save before dropping old messages. This also limits how many old messages are transferred when synchronizing the session.

If status is INF_SESSION_PRESYNC or INF_SESSION_SYNCHRONIZING, then the session will initially be synchronized, meaning an initial backlog is retrieved from sync_connection (which must not be NULL in this case). If you are subscribed to the session, set the subscription group via inf_session_set_subscription_group().

manager :

A InfCommunicationManager.

backlog_size :

The number of messages to store.

status :

Initial status of the session. If this is INF_SESSION_SYNCHRONIZING or INF_SESSION_PRESYNC, then sync_group and sync_connection need to be set.

sync_group :

A group in which the session is synchronized. Ignored if status is INF_SESSION_RUNNING.

sync_connection :

A connection to synchronize the session from. Ignored if status is INF_SESSION_RUNNING.

Returns :

A new InfChatSession.

inf_chat_session_set_log_file ()

gboolean            inf_chat_session_set_log_file       (InfChatSession *session,
                                                         const gchar *log_file,
                                                         GError **error);

Sets a file onto which all received messages are appended. The file is created if it does not exist. If a previous log file was set, then it is closed before opening the new file.

Backlog messages received upon synchronization are not logged.

session :

A InfChatSession.

log_file :

A filename to store all received messages into.

error :

Location to store error information, if any.

Returns :

TRUE if the log file could be opened, FALSE otherwise (in which case error is set).

Property Details

The "log-file" property

  "log-file"                 gchar*                : Read / Write

The file into which to store all received messages.

Default value: NULL

Signal Details

The "receive-message" signal

void                user_function                      (InfChatSession       *session,
                                                        InfChatBufferMessage *message,
                                                        gpointer              user_data)      : Run Last

This signal is emitted whenever a message has been received. If the session is in INF_SESSION_SYNCHRONIZING state the received message was a backlog message.

session :

The InfChatSession that is receiving a message.

message :

The InfChatBufferMessage that was received.

user_data :

user data set when the signal handler was connected.

The "send-message" signal

void                user_function                      (InfChatSession       *session,
                                                        InfChatBufferMessage *message,
                                                        gpointer              user_data)      : Run Last

This signal is emitted whenever a message is sent. Messages can be sent by calling inf_chat_buffer_add_message() or inf_chat_buffer_add_emote_message() on the session's InfChatBuffer. Messages of type INF_CHAT_BUFFER_MESSAGE_USERJOIN or INF_CHAT_BUFFER_MESSAGE_USERPART can not be sent explicitely, so this signal will never be emitted for such messages.

session :

The InfChatSession that is sending a message.

message :

The InfChatBufferMessage that is sent.

user_data :

user data set when the signal handler was connected.
libinfinity-0.5.5/docs/reference/libinfinity/html/InfDiscoveryAvahi.html0000644000175000017500000005013612264766270023420 00000000000000 InfDiscoveryAvahi

InfDiscoveryAvahi

InfDiscoveryAvahi — Service Discovery via Avahi

Object Hierarchy

  GObject
   +----InfDiscoveryAvahi

Implemented Interfaces

InfDiscoveryAvahi implements InfDiscovery and InfLocalPublisher.

Properties

  "credentials"              InfCertificateCredentials*  : Read / Write / Construct
  "io"                       InfIo*                : Read / Write / Construct Only
  "sasl-context"             InfSaslContext*       : Read / Write / Construct
  "sasl-mechanisms"          gchar*                : Read / Write / Construct
  "security-policy"          InfXmppConnectionSecurityPolicy  : Read / Write
  "xmpp-manager"             InfXmppManager*       : Read / Write / Construct Only

Description

InfDiscoveryAvahi implements the InfDiscovery and InfLocalPublisher interfaces on top of avahi. It resolves services to client-side InfXmppConnections.

This class is only available if the macro LIBINFINITY_HAVE_AVAHI is defined.

Details

InfDiscoveryAvahi

typedef struct _InfDiscoveryAvahi InfDiscoveryAvahi;

InfDiscoveryAvahi is an opaque data type. You should only access it via the public API functions.


struct InfDiscoveryAvahiClass

struct InfDiscoveryAvahiClass {
};

This structure does not contain any public fields.


inf_discovery_avahi_new ()

InfDiscoveryAvahi * inf_discovery_avahi_new             (InfIo *io,
                                                         InfXmppManager *manager,
                                                         InfCertificateCredentials *creds,
                                                         InfSaslContext *sasl_context,
                                                         const gchar *sasl_mechanisms);

Created a new InfDiscoveryAvahi object which can be used to publish and discovery Infinote services on the local network. When resolving a InfDiscoveryInfo (which means obtaining a InfXmlConnection for the discovered service) a new InfXmppConnection needs to be created if there is not already one for the destination host in manager. Such connections are created with the creds and sasl_context parameters. These may be NULL in which case InfXmppConnection uses builtin credentials or a builtin context, respectively.

If this InfDiscoveryAvahi is not used to discover services but only to publish any, then creds, sasl_context and sasl_mechanisms are ignored and can safely set to be NULL.

sasl_mechanisms specifies allowed mechanisms used for authentication with the server. It can be NULL, in which case all available mechanisms are accepted.

io :

A InfIo object used for watching sockets and timeouts.

manager :

A InfXmppManager.

creds :

The certificate credentials used for GnuTLS encryption.

sasl_context :

A SASL context used for authentication.

sasl_mechanisms :

A whitespace-separated list of accepted SASL mechanisms, or NULL.

Returns :

A new InfDiscoveryAvahi.

inf_discovery_avahi_set_security_policy ()

void                inf_discovery_avahi_set_security_policy
                                                        (InfDiscoveryAvahi *discovery,
                                                         InfXmppConnectionSecurityPolicy plcy);

Sets the InfXmppConnectionSecurityPolicy for newly created InfXmppConnections. It does not affect already existing connections.

discovery :

A InfDiscoveryAvahi.

plcy :

The new security policy.

inf_discovery_avahi_get_security_policy ()

InfXmppConnectionSecurityPolicy inf_discovery_avahi_get_security_policy
                                                        (InfDiscoveryAvahi *discovery);

Returns the current security policy used for new InfXmppConnections.

discovery :

A InfDiscoveryAvahi.

Returns :

The current security policy.

Property Details

The "credentials" property

  "credentials"              InfCertificateCredentials*  : Read / Write / Construct

The GnuTLS certificate credentials used for encrypting XMPP streams.


The "io" property

  "io"                       InfIo*                : Read / Write / Construct Only

The IO object used for watching sockets and timeouts.


The "sasl-context" property

  "sasl-context"             InfSaslContext*       : Read / Write / Construct

The SASL context used for authentication.


The "sasl-mechanisms" property

  "sasl-mechanisms"          gchar*                : Read / Write / Construct

The accepted SASL mechanisms for authentication.

Default value: NULL


The "security-policy" property

  "security-policy"          InfXmppConnectionSecurityPolicy  : Read / Write

How to decide whether to use TLS.

Default value: INF_XMPP_CONNECTION_SECURITY_BOTH_PREFER_TLS


The "xmpp-manager" property

  "xmpp-manager"             InfXmppManager*       : Read / Write / Construct Only

The XMPP manager to register resolved XMPP connections.

libinfinity-0.5.5/docs/reference/libinfinity/html/InfcBrowserIter.html0000644000175000017500000001763312264766270023117 00000000000000 InfcBrowserIter

InfcBrowserIter

InfcBrowserIter — Iterating through browsed nodes

Stability Level

Unstable, unless otherwise indicated

Synopsis

#include <libinfinity/client/infc-browser-iter.h>

struct              InfcBrowserIter;
InfcBrowserIter *   infc_browser_iter_copy              (InfcBrowserIter *iter);
void                infc_browser_iter_free              (InfcBrowserIter *iter);

Object Hierarchy

  GBoxed
   +----InfcBrowserIter

Description

The InfcBrowserIter is used to iterate through the nodes of a InfcBrowser. Normally, InfcBrowserIter is allocated on the stack and initialized by a InfcBrowser API call, such as infc_browser_iter_get_root(). You can also safely copy the struct by value to create a copy. It is not necessary to free it.

Most operations are done via the InfcBrowser API. These methods could be useful to language bindings.

An initialized InfcBrowserIter always points to a node within the InfcBrowser. It stays valid as long as the node it points to is not removed from the browser (if it is, the "node-removed") signal is emitted.

Details

struct InfcBrowserIter

struct InfcBrowserIter {
  guint node_id;
  gpointer node;
};


infc_browser_iter_copy ()

InfcBrowserIter *   infc_browser_iter_copy              (InfcBrowserIter *iter);

Makes a dynamically allocated copy of iter. This should not be used by applications because you can copy the structs by value.

iter :

A InfcBrowserIter.

Returns :

A newly-allocated copy of iter.

infc_browser_iter_free ()

void                infc_browser_iter_free              (InfcBrowserIter *iter);

Frees a InfcBrowserIter allocated by infc_browser_iter_copy().

iter :

A InfcBrowserIter.

See Also

InfcBrowser
libinfinity-0.5.5/docs/reference/libinfinity/html/InfAdoptedAlgorithm.html0000644000175000017500000016766712264766270023751 00000000000000 InfAdoptedAlgorithm

InfAdoptedAlgorithm

InfAdoptedAlgorithm — adOPTed implementation

Stability Level

Unstable, unless otherwise indicated

Object Hierarchy

  GObject
   +----InfAdoptedAlgorithm

Properties

  "buffer"                   InfBuffer*            : Read / Write / Construct Only
  "buffer-modified-state"    InfAdoptedStateVector*  : Read
  "current-state"            InfAdoptedStateVector*  : Read
  "max-total-log-size"       guint                 : Read / Write / Construct Only
  "user-table"               InfUserTable*         : Read / Write / Construct Only

Description

InfAdoptedAlgorithm implements the adOPTed algorithm for concurrency control as described in the paper "An integrating, transformation-oriented approach to concurrency control and undo in group editors" by Matthias Ressel, Doris Nitsche-Ruhland and Rul Gunzenhäuser (http://portal.acm.org/citation.cfm?id=240305).

It is based on requests, represented by the InfAdoptedRequest class. If there is at least one local InfUser in the algorithm's user table, then you can create own reequests by the functions inf_adopted_algorithm_generate_request(), inf_adopted_algorithm_generate_request_noexec(), inf_adopted_algorithm_generate_undo() and inf_adopted_algorithm_generate_redo(). Remote requests can be applied via inf_adopted_algorithm_receive_request(). This class does not take care of transfering the generated requests to other users which is the scope of InfAdoptedSession.

The implementation is not tied to text editing. It can handle any operations implementing InfAdoptedOperation as long as they define sufficient transformation functions. The libinftext library provides operations for text editing, see InfTextInsertOperation and InfTextDeleteOperation.

Details

InfAdoptedAlgorithm

typedef struct _InfAdoptedAlgorithm InfAdoptedAlgorithm;

InfAdoptedAlgorithm is an opaque data type. You should only access it via the public API functions.


struct InfAdoptedAlgorithmClass

struct InfAdoptedAlgorithmClass {
  void(*can_undo_changed)(InfAdoptedAlgorithm* algorithm,
                          InfAdoptedUser* user,
                          gboolean can_undo);

  void(*can_redo_changed)(InfAdoptedAlgorithm* algorithm,
                          InfAdoptedUser* user,
                          gboolean can_redo);

  void(*execute_request)(InfAdoptedAlgorithm* algorithm,
                         InfAdoptedUser* user,
                         InfAdoptedRequest* request,
                         gboolean apply);

  void(*apply_request)(InfAdoptedAlgorithm* algorithm,
                       InfAdoptedUser* user,
                       InfAdoptedRequest* request);
};

Signals for the InfAdoptedAlgorithm class.

can_undo_changed ()

Default signal handler for the "can_undo_changed" signal.

can_redo_changed ()

Default signal handler for the "can_redo_changed" signal.

execute_request ()

Default signal handler for the "execute_request" signal.

apply_request ()

Default signal handler for the "apply_request" signal.

inf_adopted_algorithm_new ()

InfAdoptedAlgorithm * inf_adopted_algorithm_new         (InfUserTable *user_table,
                                                         InfBuffer *buffer);

Creates a InfAdoptedAlgorithm.

user_table :

The table of participating users.

buffer :

The buffer to apply operations to.

Returns :

A new InfAdoptedAlgorithm.

inf_adopted_algorithm_new_full ()

InfAdoptedAlgorithm * inf_adopted_algorithm_new_full    (InfUserTable *user_table,
                                                         InfBuffer *buffer,
                                                         guint max_total_log_size);

Note that it is possible that request logs need to grow a bit larger than max_total_log_size in high-latency situations or when a user does not send status updates frequently. However, when all requests have been processed by all users, the sum of all requests in the logs is guaranteed to be lower or equal to this value.

Set to G_MAXUINT to disable limitation. In theory, this would allow everyone to undo every operation up to the first one ever made. In practise, this issues a huge amount of data that needs to be synchronized on user join and is too expensive to compute anyway.

The default value is 2048.

user_table :

The table of participating users.

buffer :

The buffer to apply operations to.

max_total_log_size :

The maxmimum number of operations to keep in all user's request logs.

Returns :

A new InfAdoptedAlgorithm.

inf_adopted_algorithm_get_current ()

InfAdoptedStateVector * inf_adopted_algorithm_get_current
                                                        (InfAdoptedAlgorithm *algorithm);

Returns the current vector time of algorithm.

algorithm :

A InfAdoptedAlgorithm.

Returns :

A InfAdoptedStateVector owned by algorithm.

inf_adopted_algorithm_generate_request_noexec ()

InfAdoptedRequest * inf_adopted_algorithm_generate_request_noexec
                                                        (InfAdoptedAlgorithm *algorithm,
                                                         InfAdoptedUser *user,
                                                         InfAdoptedOperation *operation);

Creates a InfAdoptedRequest for the given operation, executed by user. The user needs to have the INF_USER_LOCAL flag set.

The operation is not applied to the buffer, so you are responsible that the operation is applied before the next request is processed or generated. This may be useful if you are applying multiple operations, but want to only make a single request out of them to save bandwidth.

algorithm :

A InfAdoptedAlgorithm.

user :

A local InfAdoptedUser.

operation :

A InfAdoptedOperation.

Returns :

A InfAdoptedRequest that needs to be transmitted to the other non-local users.

inf_adopted_algorithm_generate_request ()

InfAdoptedRequest * inf_adopted_algorithm_generate_request
                                                        (InfAdoptedAlgorithm *algorithm,
                                                         InfAdoptedUser *user,
                                                         InfAdoptedOperation *operation);

Creates a InfAdoptedRequest for the given operation, executed by user. The user needs to have the INF_USER_LOCAL flag set. operation is applied to the buffer (by user).

algorithm :

A InfAdoptedAlgorithm.

user :

A local InfAdoptedUser.

operation :

A InfAdoptedOperation.

Returns :

A InfAdoptedRequest that needs to be transmitted to the other non-local users.

inf_adopted_algorithm_generate_undo ()

InfAdoptedRequest * inf_adopted_algorithm_generate_undo (InfAdoptedAlgorithm *algorithm,
                                                         InfAdoptedUser *user);

Creates a request of type INF_ADOPTED_REQUEST_UNDO for the given user and with the current vector time. The user needs to have the INF_USER_LOCAL flag set. It also applies the effect of the operation to the buffer.

algorithm :

A InfAdoptedAlgorithm.

user :

A local InfAdoptedUser.

Returns :

A InfAdoptedRequest that needs to be transmitted to the other non-local users.

inf_adopted_algorithm_generate_redo ()

InfAdoptedRequest * inf_adopted_algorithm_generate_redo (InfAdoptedAlgorithm *algorithm,
                                                         InfAdoptedUser *user);

Creates a request of type INF_ADOPTED_REQUEST_REDO for the given user and with the current vector time. The user needs to have the INF_USER_LOCAL flag set. It also applies the effect of the operation to the buffer.

algorithm :

A InfAdoptedAlgorithm.

user :

A local InfAdoptedUser.

Returns :

A InfAdoptedRequest that needs to be transmitted to the other non-local users.

inf_adopted_algorithm_translate_request ()

InfAdoptedRequest * inf_adopted_algorithm_translate_request
                                                        (InfAdoptedAlgorithm *algorithm,
                                                         InfAdoptedRequest *request,
                                                         InfAdoptedStateVector *to);

Translates request so that it can be applied to the document at state to. request will not be modified but a new, translated request is returned instead.

There are several preconditions for this function to be called. to must be a reachable point in the state space. Also, requests can only be translated in forward direction, so request's vector time must be causally before (see inf_adopted_state_vector_causally_before()) to.

algorithm :

A InfAdoptedAlgorithm.

request :

A InfAdoptedRequest.

to :

The state vector to translate request to.

Returns :

A new or cached InfAdoptedRequest. Free with g_object_unref() when no longer needed.

inf_adopted_algorithm_receive_request ()

void                inf_adopted_algorithm_receive_request
                                                        (InfAdoptedAlgorithm *algorithm,
                                                         InfAdoptedRequest *request);

This function processes a request received from a non-local user and applies its operation to the buffer.

algorithm :

A InfAdoptedAlgorithm.

request :

A InfAdoptedRequest from a non-local user.

inf_adopted_algorithm_can_undo ()

gboolean            inf_adopted_algorithm_can_undo      (InfAdoptedAlgorithm *algorithm,
                                                         InfAdoptedUser *user);

Returns whether user can issue an undo request in the current state. Note that if user is non-local, then the result of this function does not depend on the current state but on the state that we know user is guaranteed to have reached. This is because user might still issue an Undo request even if the max-total-log-size is already exceeded if user does not know yet that it is exceeded.

algorithm :

A InfAdoptedAlgorithm.

user :

A local InfAdoptedUser.

Returns :

TRUE if Undo is possible, FALSE otherwise.

inf_adopted_algorithm_can_redo ()

gboolean            inf_adopted_algorithm_can_redo      (InfAdoptedAlgorithm *algorithm,
                                                         InfAdoptedUser *user);

Returns whether user can issue a redo request in the current state. Note that if user is non-local, then the result of this function does not depend on the current state but on the state that we know user is guaranteed to have reached. This is because user might still issue a Redo request even if the max-total-log-size is already exceeded if user does not know yet that it is exceeded.

algorithm :

A InfAdoptedAlgorithm.

user :

A local InfAdoptedUser.

Returns :

TRUE if Redo is possible, FALSE otherwise.

Property Details

The "buffer" property

  "buffer"                   InfBuffer*            : Read / Write / Construct Only

The buffer to apply operations to.


The "buffer-modified-state" property

  "buffer-modified-state"    InfAdoptedStateVector*  : Read

The state in which the buffer is considered not being modified.


The "current-state" property

  "current-state"            InfAdoptedStateVector*  : Read

The state vector describing the current document state.


The "max-total-log-size" property

  "max-total-log-size"       guint                 : Read / Write / Construct Only

The maximum number of requests to keep in all user's logs.

Default value: 2048


The "user-table" property

  "user-table"               InfUserTable*         : Read / Write / Construct Only

The user table.

Signal Details

The "apply-request" signal

void                user_function                      (InfAdoptedAlgorithm *algorithm,
                                                        InfAdoptedUser      *user,
                                                        InfAdoptedRequest   *request,
                                                        gpointer             user_data)      : Run Last

This signal is emitted every time the algorithm applies a request.

Note a call to inf_adopted_algorithm_generate_request(), inf_adopted_algorithm_generate_undo() or inf_adopted_algorithm_generate_redo() always applies the generated request. In contrast, inf_adopted_algorithm_receive_request() might not apply the given request (if requests it depends upon have not yet received) or might apply multiple request (if the provided request fulfills the dependencies of queued requests).

Note also that the signal is not emitted for every request processed by InfAdoptedAlgorithm since inf_adopted_algorithm_generate_request_noexec() generates a request but does not apply it.

algorithm :

The InfAdoptedAlgorithm applying a request.

user :

The InfAdoptedUser applying the request.

request :

The InfAdoptedRequest being applied.

user_data :

user data set when the signal handler was connected.

The "can-redo-changed" signal

void                user_function                      (InfAdoptedAlgorithm *algorithm,
                                                        InfAdoptedUser      *user,
                                                        gboolean             can_undo,
                                                        gpointer             user_data)      : Run Last

This signal is emitted every time the can-redo state of a local user in algorithm's user table changed. The can-redo state defines whether user can generate a redo request (via inf_adopted_algorithm_generate_redo()) in the current situation, see also inf_adopted_algorithm_can_redo().

algorithm :

The InfAdoptedAlgorithm for which a user's can-redo state changed.

user :

The InfAdoptedUser whose can-redo state has changed.

can_undo :

Whether user can issue a redo request in the current state or not.

user_data :

user data set when the signal handler was connected.

The "can-undo-changed" signal

void                user_function                      (InfAdoptedAlgorithm *algorithm,
                                                        InfAdoptedUser      *user,
                                                        gboolean             can_undo,
                                                        gpointer             user_data)      : Run Last

This signal is emitted every time the can-undo state of a local user in algorithm's user table changed. The can-undo state defines whether user can generate an undo request (via inf_adopted_algorithm_generate_undo()) in the current situation, see also inf_adopted_algorithm_can_undo().

algorithm :

The InfAdoptedAlgorithm for which a user's can-undo state changed.

user :

The InfAdoptedUser whose can-undo state has changed.

can_undo :

Whether user can issue an undo request in the current state or not.

user_data :

user data set when the signal handler was connected.

The "execute-request" signal

void                user_function                      (InfAdoptedAlgorithm *algorithm,
                                                        InfAdoptedUser      *user,
                                                        InfAdoptedRequest   *request,
                                                        gboolean             apply,
                                                        gpointer             user_data)      : Run Last

This signal is emitted every time the algorithm executes a request. request is the request that algorithm will execute. request can generally not be applied to the current state, and it might also be an undo or redo request. The default handler of this signal computes the operation that can be applied to the buffer, and applies it when apply is TRUE by emitting "apply-request".

algorithm :

The InfAdoptedAlgorithm executing a request.

user :

The InfAdoptedUser executing the request.

request :

The InfAdoptedRequest being executed.

apply :

Whether the request will be applied after execution.

user_data :

user data set when the signal handler was connected.
libinfinity-0.5.5/docs/reference/libinfinity/html/InfCommunicationHostedGroup.html0000644000175000017500000003343312264766270025472 00000000000000 InfCommunicationHostedGroup

InfCommunicationHostedGroup

InfCommunicationHostedGroup — Communication group opened by the local host

Stability Level

Unstable, unless otherwise indicated

Object Hierarchy

  GObject
   +----InfCommunicationGroup
         +----InfCommunicationHostedGroup

Description

InfCommunicationHostedGroup is a InfCommunicationHostedGroup opened on the local host. It allows adding other hosts to the group via inf_communication_hosted_group_add_member(), and to remove hosts via inf_communication_hosted_group_remove_member().

Details

InfCommunicationHostedGroup

typedef struct _InfCommunicationHostedGroup InfCommunicationHostedGroup;

InfCommunicationHostedGroup is an opaque data type. You should only access it via the public API functions.


struct InfCommunicationHostedGroupClass

struct InfCommunicationHostedGroupClass {
};

This structure does not contain any public fields.


inf_communication_hosted_group_add_method ()

void                inf_communication_hosted_group_add_method
                                                        (InfCommunicationHostedGroup *group,
                                                         const gchar *method);

Adds a method to the hosted group. When a connection from a given network is added to the group the first time, a InfCommunicationMethod is instantiated to handle messaging for the group within this network. The first method added will be tried first. If the communication manager does support it (meaning inf_communication_manager_get_factory_for() for the connection's network and the chosen method returns non-NULL), then it will be used, otherwise the next method will be tried, etc. If no method is supported, or no methods are added to the group, then the "central" method will be used as a fallback.

group :

A InfCommunicationHostedGroup.

method :

The method name to add.

inf_communication_hosted_group_add_member ()

void                inf_communication_hosted_group_add_member
                                                        (InfCommunicationHostedGroup *group,
                                                         InfXmlConnection *connection);

Adds connection as a member to group. On the remote site, a InfCommunicationJoinedGroup with the same name and method used for connection (see inf_communication_group_get_method_for_connection()) needs to be created for successful communication.

group :

A InfCommunicationGroup.

connection :

A InfXmlConnection to add to group.

inf_communication_hosted_group_remove_member ()

void                inf_communication_hosted_group_remove_member
                                                        (InfCommunicationHostedGroup *grp,
                                                         InfXmlConnection *connection);

Removes connection's membership from group. On the remote site, the corresponding InfCommunicationJoinedGroup needs to be freed.

grp :

A InfCommunicationGroup.

connection :

The InfXmlConnection to remove from the group.
libinfinity-0.5.5/docs/reference/libinfinity/html/InfDiscovery.html0000644000175000017500000011311412264766270022443 00000000000000 InfDiscovery

InfDiscovery

InfDiscovery — Discovery of remote services

Synopsis

#include <libinfinity/common/inf-discovery.h>

                    InfDiscovery;
struct              InfDiscoveryIface;
                    InfDiscoveryInfo;
void                (*InfDiscoveryResolvCompleteFunc)   (InfDiscoveryInfo *info,
                                                         InfXmlConnection *connection,
                                                         gpointer user_data);
void                (*InfDiscoveryResolvErrorFunc)      (InfDiscoveryInfo *info,
                                                         const GError *error,
                                                         gpointer user_data);
void                inf_discovery_discover              (InfDiscovery *discovery,
                                                         const gchar *type);
GSList *            inf_discovery_get_discovered        (InfDiscovery *discovery,
                                                         const gchar *type);
void                inf_discovery_resolve               (InfDiscovery *discovery,
                                                         InfDiscoveryInfo *info,
                                                         InfDiscoveryResolvCompleteFunc complete_func,
                                                         InfDiscoveryResolvErrorFunc error_func,
                                                         gpointer user_data);
gchar *             inf_discovery_info_get_service_name (InfDiscovery *discovery,
                                                         InfDiscoveryInfo *info);
const gchar *       inf_discovery_info_get_service_type (InfDiscovery *discovery,
                                                         InfDiscoveryInfo *info);
void                inf_discovery_discovered            (InfDiscovery *discovery,
                                                         InfDiscoveryInfo *info);
void                inf_discovery_undiscovered          (InfDiscovery *discovery,
                                                         InfDiscoveryInfo *info);

Object Hierarchy

  GInterface
   +----InfDiscovery

Prerequisites

InfDiscovery requires GObject.

Known Implementations

InfDiscovery is implemented by InfDiscoveryAvahi.

Description

InfDiscovery provides a common interface for the discovery of services. Discovered services are represented by InfDiscoveryInfo objects and can be used to query the name of the discovered service.

To create a connection to the host providing a discovered service, use inf_discovery_resolve().

Details

InfDiscovery

typedef struct _InfDiscovery InfDiscovery;

InfDiscovery is an opaque data type. You should only access it via the public API functions.


struct InfDiscoveryIface

struct InfDiscoveryIface {
  void (*discover)(InfDiscovery* discovery,
                   const gchar* type);

  GSList* (*get_discovered)(InfDiscovery* discovery,
                            const gchar* type);

  void (*resolve)(InfDiscovery* discovery,
                  InfDiscoveryInfo* info,
                  InfDiscoveryResolvCompleteFunc complete_func,
                  InfDiscoveryResolvErrorFunc error_func,
                  gpointer user_data);

  gchar*(*info_get_service_name)(InfDiscovery* discovery,
                                 InfDiscoveryInfo* info);

  const gchar*(*info_get_service_type)(InfDiscovery* discovery,
                                       InfDiscoveryInfo* info);

  /* Signals */
  void (*discovered)(InfDiscovery* discovery,
                     InfDiscoveryInfo* info);

  void (*undiscovered)(InfDiscovery* discovery,
                       InfDiscoveryInfo* info);
};

The virtual methods and default signal handlers of InfDiscovery. Implementing these allows discovering infinote servers.

discover ()

Virtual function to start discovery of services of the given type. If the discovery was already started ealier, then this function does nothing.

get_discovered ()

Virtual function to retrieve a list of InfDiscoveryInfos that represent discovered services. It needs to be freed by the caller via g_slist_free().

resolve ()

Virtual function that attempts to resolve the given discovery info. It guarantees to either call complete_func or error_func when the process has finished.

info_get_service_name ()

Returns the service name of the given InfDiscoveryInfo as a new string, to be freed by the caller with g_free().

info_get_service_type ()

Returns the type of the discovered service of the given InfDiscoveryInfo as a static string.

discovered ()

Default signal handler for the "discovered" signal.

undiscovered ()

Default signal handler for the "undiscovered" signal.

InfDiscoveryInfo

typedef struct _InfDiscoveryInfo InfDiscoveryInfo;

InfDiscoveryInfo is an opaque data type. You should only access it via the public API functions.


InfDiscoveryResolvCompleteFunc ()

void                (*InfDiscoveryResolvCompleteFunc)   (InfDiscoveryInfo *info,
                                                         InfXmlConnection *connection,
                                                         gpointer user_data);

This callback is called when a call to inf_discovery_resolve() finished successfully.

info :

The resolved InfDiscoveryInfo.

connection :

The resulting InfXmlConnection.

user_data :

The user_data passed to inf_discovery_resolve().

InfDiscoveryResolvErrorFunc ()

void                (*InfDiscoveryResolvErrorFunc)      (InfDiscoveryInfo *info,
                                                         const GError *error,
                                                         gpointer user_data);

This callback is called when a call to inf_discovery_resolve() failed.

info :

The resolved InfDiscoveryInfo.

error :

Reason for the failure.

user_data :

The user_data passed to inf_discovery_resolve().

inf_discovery_discover ()

void                inf_discovery_discover              (InfDiscovery *discovery,
                                                         const gchar *type);

Starts the discovery of the given service type. Whenever a service of this type is discovered, the "discovered" signal is emitted. If the service disappears, the "undiscovered" signal is emitted. This can be called more than once for the same type, but only the first call has an effect.

Note also that implementations of InfDiscovery might restrict the service types that can be discovered.

discovery :

A InfDiscovery.

type :

The service type to discover.

inf_discovery_get_discovered ()

GSList *            inf_discovery_get_discovered        (InfDiscovery *discovery,
                                                         const gchar *type);

Returns a list of discovered InfDiscoveryInfo for the given type.

discovery :

A InfDiscovery.

type :

The service type of which to get discovered infos for.

Returns :

A newly allocated list that needs to be freed with g_slist_free().

inf_discovery_resolve ()

void                inf_discovery_resolve               (InfDiscovery *discovery,
                                                         InfDiscoveryInfo *info,
                                                         InfDiscoveryResolvCompleteFunc complete_func,
                                                         InfDiscoveryResolvErrorFunc error_func,
                                                         gpointer user_data);

Attempts to resolve info. Resolving a InfDiscoveryInfo means creating a InfXmlConnection to the publisher. The connection might not be open when complete_func runs. This will call either complete_func or error_func, but not both.

discovery :

A InfDiscovery.

info :

A InfDiscoveryInfo discovered by discovery.

complete_func :

A callback that will be called when the resolving process has completed.

error_func :

A callback that will be called when an error has occured.

user_data :

Extra data to pass to complete_func and error_func.

inf_discovery_info_get_service_name ()

gchar *             inf_discovery_info_get_service_name (InfDiscovery *discovery,
                                                         InfDiscoveryInfo *info);

Returns the service name of the discovered info.

discovery :

A InfDiscovery.

info :

A InfDiscoveryInfo discovered by discovery.

Returns :

A string owned by discovery.

inf_discovery_info_get_service_type ()

const gchar *       inf_discovery_info_get_service_type (InfDiscovery *discovery,
                                                         InfDiscoveryInfo *info);

Returns the service type of the discovered info.

discovery :

A InfDiscovery.

info :

A InfDiscoveryInfo discovered by discovery.

Returns :

A string owned by discovery.

inf_discovery_discovered ()

void                inf_discovery_discovered            (InfDiscovery *discovery,
                                                         InfDiscoveryInfo *info);

Emits the "discovered" signal on discovery.

discovery :

A InfDiscovery.

info :

The discovered InfDiscoveryInfo.

inf_discovery_undiscovered ()

void                inf_discovery_undiscovered          (InfDiscovery *discovery,
                                                         InfDiscoveryInfo *info);

Emits the "undiscovered" signal on discovery.

discovery :

A InfDiscovery.

info :

The undiscovered InfDiscoveryInfo.

Signal Details

The "discovered" signal

void                user_function                      (InfDiscovery *discoverer,
                                                        gpointer      info,
                                                        gpointer      user_data)       : Has Details

This signal is detailed. The detail is the name of the service that has been discovered, so you can connect to "discovered::my-service-name" if you are only interested in a particular service.

discoverer :

The InfDiscovery object discovering something

info :

The InfDiscoveryInfo describing the discovered service

user_data :

user data set when the signal handler was connected.

The "undiscovered" signal

void                user_function                      (InfDiscovery *discoverer,
                                                        gpointer      info,
                                                        gpointer      user_data)       : Has Details

This signal is emitted if a previously discovered service is no longer available.

This signal is detailed. The detail is the name of the service that has been undiscovered, so you can connect to "undiscovered::my-service-name" if you are only interested in a particular service.

discoverer :

The InfDiscovery object undiscovering something

info :

The InfDiscoveryInfo describing the undiscovered service

user_data :

user data set when the signal handler was connected.
libinfinity-0.5.5/docs/reference/libinfinity/html/InfcNodeRequest.html0000644000175000017500000002105412264766270023076 00000000000000 InfcNodeRequest

InfcNodeRequest

InfcNodeRequest

Object Hierarchy

  GObject
   +----InfcRequest
         +----InfcNodeRequest

Properties

  "node-id"                  guint                 : Read / Write / Construct Only

Signals

  "finished"                                       : Run Last

Description

Details

InfcNodeRequest

typedef struct _InfcNodeRequest InfcNodeRequest;


struct InfcNodeRequestClass

struct InfcNodeRequestClass {
  InfcRequestClass parent_class;

  /* Signals */
  void (*finished)(InfcNodeRequest* node_request,
                   const InfcBrowserIter* iter);
};


infc_node_request_finished ()

void                infc_node_request_finished          (InfcNodeRequest *request,
                                                         const InfcBrowserIter *iter);

Emits the "finished" signal on request.

request :

A InfcNodeRequest.

iter :

A InfcBrowserIter pointing to a node affected by the request.

Property Details

The "node-id" property

  "node-id"                  guint                 : Read / Write / Construct Only

The ID of the node affected by the request.

Default value: 0

Signal Details

The "finished" signal

void                user_function                      (InfcNodeRequest *infcnoderequest,
                                                        InfcBrowserIter *arg1,
                                                        gpointer         user_data)            : Run Last

infcnoderequest :

the object which received the signal.

user_data :

user data set when the signal handler was connected.
libinfinity-0.5.5/docs/reference/libinfinity/html/InfBuffer.html0000644000175000017500000002547212264766270021716 00000000000000 InfBuffer

InfBuffer

InfBuffer — Abstract document interface

Synopsis

#include <libinfinity/common/inf-buffer.h>

                    InfBuffer;
struct              InfBufferIface;
gboolean            inf_buffer_get_modified             (InfBuffer *buffer);
void                inf_buffer_set_modified             (InfBuffer *buffer,
                                                         gboolean modified);

Object Hierarchy

  GInterface
   +----InfBuffer

Prerequisites

InfBuffer requires GObject.

Known Implementations

InfBuffer is implemented by InfChatBuffer.

Properties

  "modified"                 gboolean              : Read / Write

Description

InfBuffer represents a document containing a session's content. It does not cope with keeping its content in-sync with other participants but just offers an interface to modify the document.

The InfBuffer interface itself is probably not too useful, but actual documents implementing functionality (such as text editing or graphics editing) need to implement this interface to be passed to InfSession.

Details

InfBuffer

typedef struct _InfBuffer InfBuffer;

InfBuffer is an opaque data type. You should only access it via the public API functions.


struct InfBufferIface

struct InfBufferIface {
  gboolean (*get_modified)(InfBuffer* buffer);

  void (*set_modified)(InfBuffer* buffer,
                       gboolean modified);
};

The virtual methods of InfBuffer.

get_modified ()

Returns whether the buffer has been modified since the last call to set_modified set modified flag to FALSE.

set_modified ()

Set the current modified state of the buffer.

inf_buffer_get_modified ()

gboolean            inf_buffer_get_modified             (InfBuffer *buffer);

Indicates whether the buffer has been modified since the last call to inf_buffer_set_modified() set the modification flag to FALSE.

buffer :

A InfBuffer.

Returns :

Whether the buffer has been modified.

inf_buffer_set_modified ()

void                inf_buffer_set_modified             (InfBuffer *buffer,
                                                         gboolean modified);

Sets the modification flag of buffer to modified. You should normally set the flag to FALSE every time the document is saved onto disk. The buffer itself will set it to TRUE when it has been changed.

To get notified when the modification flag changes, connect to GObject::notify for the InfBuffer:modified property.

buffer :

A InfBuffer.

modified :

Whether the buffer is considered modified or not.

Property Details

The "modified" property

  "modified"                 gboolean              : Read / Write

Whether the buffer was modified since it has been saved.

Default value: FALSE

libinfinity-0.5.5/docs/reference/libinfinity/html/InfdXmppServer.html0000644000175000017500000005150612264766270022761 00000000000000 InfdXmppServer

InfdXmppServer

InfdXmppServer

Object Hierarchy

  GObject
   +----InfdXmppServer

Implemented Interfaces

InfdXmppServer implements InfdXmlServer.

Properties

  "credentials"              InfCertificateCredentials*  : Read / Write / Construct
  "local-hostname"           gchar*                : Read / Write / Construct Only
  "sasl-context"             InfSaslContext*       : Read / Write / Construct
  "sasl-mechanisms"          gchar*                : Read / Write / Construct
  "security-policy"          InfXmppConnectionSecurityPolicy  : Read / Write / Construct
  "tcp-server"               InfdTcpServer*        : Read / Write / Construct Only

Signals

  "error"                                          : Run Last

Description

Details

InfdXmppServer

typedef struct _InfdXmppServer InfdXmppServer;


struct InfdXmppServerClass

struct InfdXmppServerClass {
  GObjectClass parent_class;

  /* Signals */
  void (*error)(InfdXmppServer* server,
                GError* error);
};


infd_xmpp_server_new ()

InfdXmppServer *    infd_xmpp_server_new                (InfdTcpServer *tcp,
                                                         InfXmppConnectionSecurityPolicy policy,
                                                         InfCertificateCredentials *creds,
                                                         InfSaslContext *sasl_context,
                                                         const gchar *sasl_mechanisms);

Creates a new InfdXmppServer with tcp as underlaying TCP server object. No attempt is being made to open tcp, if it is not already open. When a new connection comes in, the XMPP server creates a XMPP connection that may be used to communicate with the client. Note however that the resulting connection will be in status OPENING until authentication has completed.

If policy is INF_XMPP_CONNECTION_SECURITY_ONLY_UNSECURED, then creds may be NULL. If creds is non-NULL nevertheless, then it is possible to change the security policy later using infd_xmpp_server_set_security_policy(). creds can also be changed later while the server is running. So just set valid credentials before changing policy to allow TLS.

If sasl_context is NULL, the server uses a built-in context that only supports ANONYMOUS authentication. If sasl_context is not NULL, then sasl_mechanisms specifies the mechanisms offered to clients. If sasl_mechanisms is NULL, then all available mechanims will be offered. If sasl_context is NULL, then this parameter is ignored.

tcp :

A InfdTcpServer.

policy :

The initial security policy.

creds :

Certificate credentials used to secure any communication.

sasl_context :

A SASL context used for authentication.

sasl_mechanisms :

A whitespace-sparated list of SASL mechanisms.

Returns :

A new InfdXmppServer.

infd_xmpp_server_set_security_policy ()

void                infd_xmpp_server_set_security_policy
                                                        (InfdXmppServer *server,
                                                         InfXmppConnectionSecurityPolicy policy);

Sets the security policy for newly accepted InfXmppConnections. Does not already established connections.

server :

A InfdXmppServer.

policy :

The new security policy.

infd_xmpp_server_get_security_policy ()

InfXmppConnectionSecurityPolicy infd_xmpp_server_get_security_policy
                                                        (InfdXmppServer *server);

Returns the current security policy for newly accepted InfXmppConnections.

server :

A InfdXmppServer.

Returns :

The current security policy.

Property Details

The "credentials" property

  "credentials"              InfCertificateCredentials*  : Read / Write / Construct

The certificate credentials for GnuTLS.


The "local-hostname" property

  "local-hostname"           gchar*                : Read / Write / Construct Only

Hostname of the server.

Default value: NULL


The "sasl-context" property

  "sasl-context"             InfSaslContext*       : Read / Write / Construct

The SASL context used for authentaction.


The "sasl-mechanisms" property

  "sasl-mechanisms"          gchar*                : Read / Write / Construct

The SASL mechanisms offered to the client for authentication.

Default value: NULL


The "security-policy" property

  "security-policy"          InfXmppConnectionSecurityPolicy  : Read / Write / Construct

Whether to offer or require TLS.

Default value: INF_XMPP_CONNECTION_SECURITY_ONLY_UNSECURED


The "tcp-server" property

  "tcp-server"               InfdTcpServer*        : Read / Write / Construct Only

Underlaying TCP server.

Signal Details

The "error" signal

void                user_function                      (InfdXmppServer *infdxmppserver,
                                                        gpointer        arg1,
                                                        gpointer        user_data)           : Run Last

infdxmppserver :

the object which received the signal.

user_data :

user data set when the signal handler was connected.
libinfinity-0.5.5/docs/reference/libinfinity/html/ch06.html0000644000175000017500000000677512264766270020615 00000000000000 Network abstraction

Network abstraction

InfCommunicationManager — Handling multiple communication sessions
InfCommunicationObject — Network message destinations
InfCommunicationGroup — Communication channel for mulitple connections
InfCommunicationHostedGroup — Communication group opened by the local host
InfCommunicationJoinedGroup — Communication group opened by a remote host
InfCommunicationFactory — Creation of communication methods
InfCommunicationMethod — Network communication method
InfCommunicationRegistry — Sharing connections between multiple groups
InfCommunicationCentralFactoryFactory for InfCommunicationCentralMethod methods
InfCommunicationCentralMethod — Relying group messages via the publisher
libinfinity-0.5.5/docs/reference/libinfinity/html/InfdDirectory.html0000644000175000017500000030151412264766270022607 00000000000000 InfdDirectory

InfdDirectory

InfdDirectory — Directory of published documents

Stability Level

Unstable, unless otherwise indicated

Synopsis

#include <libinfinity/server/infd-directory.h>

struct              InfdDirectoryIter;
                    InfdDirectory;
struct              InfdDirectoryClass;
void                (*InfdDirectoryForeachConnectionFunc)
                                                        (InfXmlConnection *Param1,
                                                         gpointer Param2);
InfdDirectoryIter * infd_directory_iter_copy            (InfdDirectoryIter *iter);
void                infd_directory_iter_free            (InfdDirectoryIter *iter);
InfdDirectory *     infd_directory_new                  (InfIo *io,
                                                         InfdStorage *storage,
                                                         InfCommunicationManager *comm_manager);
InfIo *             infd_directory_get_io               (InfdDirectory *directory);
InfdStorage *       infd_directory_get_storage          (InfdDirectory *directory);
InfCommunicationManager * infd_directory_get_communication_manager
                                                        (InfdDirectory *directory);
gboolean            infd_directory_add_plugin           (InfdDirectory *directory,
                                                         const InfdNotePlugin *plugin);
const InfdNotePlugin * infd_directory_lookup_plugin     (InfdDirectory *directory,
                                                         const gchar *note_type);
gboolean            infd_directory_add_connection       (InfdDirectory *directory,
                                                         InfXmlConnection *connection);
void                infd_directory_foreach_connection   (InfdDirectory *directory,
                                                         InfdDirectoryForeachConnectionFunc func,
                                                         gpointer user_data);
const gchar *       infd_directory_iter_get_name        (InfdDirectory *directory,
                                                         InfdDirectoryIter *iter);
gchar *             infd_directory_iter_get_path        (InfdDirectory *directory,
                                                         InfdDirectoryIter *iter);
void                infd_directory_iter_get_root        (InfdDirectory *directory,
                                                         InfdDirectoryIter *iter);
gboolean            infd_directory_iter_get_next        (InfdDirectory *directory,
                                                         InfdDirectoryIter *iter);
gboolean            infd_directory_iter_get_prev        (InfdDirectory *directory,
                                                         InfdDirectoryIter *iter);
gboolean            infd_directory_iter_get_parent      (InfdDirectory *directory,
                                                         InfdDirectoryIter *iter);
gboolean            infd_directory_iter_get_child       (InfdDirectory *directory,
                                                         InfdDirectoryIter *iter,
                                                         GError **error);
gboolean            infd_directory_iter_get_explored    (InfdDirectory *directory,
                                                         InfdDirectoryIter *iter);
gboolean            infd_directory_add_subdirectory     (InfdDirectory *directory,
                                                         InfdDirectoryIter *parent,
                                                         const gchar *name,
                                                         InfdDirectoryIter *iter,
                                                         GError **error);
gboolean            infd_directory_add_note             (InfdDirectory *directory,
                                                         InfdDirectoryIter *parent,
                                                         const gchar *name,
                                                         const InfdNotePlugin *plugin,
                                                         InfdDirectoryIter *iter,
                                                         GError **error);
gboolean            infd_directory_remove_node          (InfdDirectory *directory,
                                                         InfdDirectoryIter *iter,
                                                         GError **error);
InfdStorageNodeType infd_directory_iter_get_node_type   (InfdDirectory *directory,
                                                         InfdDirectoryIter *iter);
const InfdNotePlugin * infd_directory_iter_get_plugin   (InfdDirectory *directory,
                                                         InfdDirectoryIter *iter);
InfdSessionProxy *  infd_directory_iter_get_session     (InfdDirectory *directory,
                                                         InfdDirectoryIter *iter,
                                                         GError **error);
InfdSessionProxy *  infd_directory_iter_peek_session    (InfdDirectory *directory,
                                                         InfdDirectoryIter *iter);
gboolean            infd_directory_iter_save_session    (InfdDirectory *directory,
                                                         InfdDirectoryIter *iter,
                                                         GError **error);
void                infd_directory_enable_chat          (InfdDirectory *directory,
                                                         gboolean enable);
InfdSessionProxy *  infd_directory_get_chat_session     (InfdDirectory *directory);

Object Hierarchy

  GBoxed
   +----InfdDirectoryIter
  GObject
   +----InfdDirectory

Implemented Interfaces

InfdDirectory implements InfCommunicationObject.

Properties

  "chat-session"             InfdSessionProxy*     : Read
  "communication-manager"    InfCommunicationManager*  : Read / Write / Construct Only
  "io"                       InfIo*                : Read / Write / Construct Only
  "storage"                  InfdStorage*          : Read / Write / Construct

Description

The InfdDirectory manages a directory of documents. An item in the directory is also called "node". A node may either be a subdirectory or a document (also called "note"). Notes may be of different type - there may be plain text notes, rich text notes, graphics notes, etc.

InfdStorage defines where the directory structure and the notes are read from and how there are permanently stored.

Details

struct InfdDirectoryIter

struct InfdDirectoryIter {
  guint node_id;
  gpointer node;
};


InfdDirectory

typedef struct _InfdDirectory InfdDirectory;


struct InfdDirectoryClass

struct InfdDirectoryClass {
  GObjectClass parent_class;

  /* Signals */
  void (*node_added)(InfdDirectory* directory,
                     InfdDirectoryIter* iter);

  void (*node_removed)(InfdDirectory* directory,
                       InfdDirectoryIter* iter);

  void (*add_session)(InfdDirectory* directory,
                      InfdDirectoryIter* iter,
                      InfdSessionProxy* session);

  void (*remove_session)(InfdDirectory* directory,
                         InfdDirectoryIter* iter,
                         InfdSessionProxy* session);
};


InfdDirectoryForeachConnectionFunc ()

void                (*InfdDirectoryForeachConnectionFunc)
                                                        (InfXmlConnection *Param1,
                                                         gpointer Param2);


infd_directory_iter_copy ()

InfdDirectoryIter * infd_directory_iter_copy            (InfdDirectoryIter *iter);

Makes a dynamically-allocated copy of iter. This should not be used by applications because you can copy the structs by value.

iter :

A InfdDirectoryIter.

Returns :

A newly-allocated copy of iter.

infd_directory_iter_free ()

void                infd_directory_iter_free            (InfdDirectoryIter *iter);

Frees a InfdDirectoryIter allocated with infd_directory_iter_copy().

iter :

A InfdDirectoryIter.

infd_directory_new ()

InfdDirectory *     infd_directory_new                  (InfIo *io,
                                                         InfdStorage *storage,
                                                         InfCommunicationManager *comm_manager);

Creates a new InfdDirectory. If storage is NULL then the directory keeps all content in memory. This can make sense for ad-hoc sessions where no central document storage is required.

io :

IO object to watch connections and schedule timeouts.

storage :

Storage backend that is used to read/write notes from permanent memory into InfBuffer objects, or NULL.

comm_manager :

A InfCommunicationManager to register added connections to and which forwards incoming data to the directory or running sessions.

Returns :

A new InfdDirectory.

infd_directory_get_io ()

InfIo *             infd_directory_get_io               (InfdDirectory *directory);

Returns the IO object in use by the directory.

directory :

A InfdDirectory.

Returns :

A InfIo.

infd_directory_get_storage ()

InfdStorage *       infd_directory_get_storage          (InfdDirectory *directory);

Returns the storage backend in use by the directory.

directory :

A InfdDirectory:

Returns :

An InfdStorage.

infd_directory_get_communication_manager ()

InfCommunicationManager * infd_directory_get_communication_manager
                                                        (InfdDirectory *directory);

Returns the connection manager of the directory.

directory :

A InfdDirectory.

Returns :

An InfCommunicationManager.

infd_directory_add_plugin ()

gboolean            infd_directory_add_plugin           (InfdDirectory *directory,
                                                         const InfdNotePlugin *plugin);

Adds plugin to directory. This allows the directory to create sessions of the plugin's type. Only one plugin of each type can be added to the directory. The plugin's storage_type must match the storage of directory. If the directory's storage is NULL, then the plugin's storage type does not matter, and the plugin's session_read and session_write functions will not be used (and can therefore be NULL).

directory :

A InfdDirectory.

plugin :

A InfdNotePlugin.

Returns :

Whether the plugin was added successfully.

infd_directory_lookup_plugin ()

const InfdNotePlugin * infd_directory_lookup_plugin     (InfdDirectory *directory,
                                                         const gchar *note_type);

Returns the InfdNotePlugin that handles the given note type, or NULL in case no corresponding plugin was added.

directory :

A InfdDirectory.

note_type :

A note type for which to lookup the plugin.

Returns :

A InfdNotePlugin, or NULL.

infd_directory_add_connection ()

gboolean            infd_directory_add_connection       (InfdDirectory *directory,
                                                         InfXmlConnection *connection);

Adds connection to the connections of directory. The directory will then receive requests from connection. If the directory's method manager does not contain a "central" method for connection's network, then the connection will not be added and the function returns FALSE.

The connection is removed again automatically if it is closed.

directory :

A InfdDirectory.

connection :

A InfConnection.

Returns :

Whether the connection was added to the directory.

infd_directory_foreach_connection ()

void                infd_directory_foreach_connection   (InfdDirectory *directory,
                                                         InfdDirectoryForeachConnectionFunc func,
                                                         gpointer user_data);

Calls func for each connection in directory that has previously been added to the directory.

directory :

A InfdDirectory.

func :

The function to call for each connection in directory.

user_data :

Additional data to pass to the callback function.

infd_directory_iter_get_name ()

const gchar *       infd_directory_iter_get_name        (InfdDirectory *directory,
                                                         InfdDirectoryIter *iter);

Returns the name of the node iter points to.

directory :

A InfdDirectory.

iter :

A InfdDirectoryIter pointing to a node in directory.

Returns :

The node's name. The returned string must not be freed.

infd_directory_iter_get_path ()

gchar *             infd_directory_iter_get_path        (InfdDirectory *directory,
                                                         InfdDirectoryIter *iter);

Returns the complete path to the node iter points to. The path to a node is the name of the node and the name of all parent nodes separated by '/', as a filesystem path on Unix.

directory :

A InfdDirectory.

iter :

A InfdDirectoryIter pointing to a node in directory.

Returns :

The node's path. Free with g_free() when no longer in use.

infd_directory_iter_get_root ()

void                infd_directory_iter_get_root        (InfdDirectory *directory,
                                                         InfdDirectoryIter *iter);

Sets iter to point to the root node of the directory.

directory :

A InfdDirectory

iter :

An uninitalized InfdDirectoryIter.

infd_directory_iter_get_next ()

gboolean            infd_directory_iter_get_next        (InfdDirectory *directory,
                                                         InfdDirectoryIter *iter);

Sets iter to point to the next node within the same subdirectory. If there is no next node, iter is left untouched and the function returns FALSE.

directory :

A InfdDirectory.

iter :

A InfdDirectoryIter pointing to some node in directory.

Returns :

TRUE, if iter was set.

infd_directory_iter_get_prev ()

gboolean            infd_directory_iter_get_prev        (InfdDirectory *directory,
                                                         InfdDirectoryIter *iter);

Sets iter to point to the previous node within the same subdirectory. If there is no such node, iter is left untouched and the function returns FALSE.

directory :

A InfdDirectory.

iter :

A InfdDirectoryIter pointing to some node in directory.

Returns :

TRUE, if iter was set.

infd_directory_iter_get_parent ()

gboolean            infd_directory_iter_get_parent      (InfdDirectory *directory,
                                                         InfdDirectoryIter *iter);

Sets iter to point to the parent node of iter. This node is guaranteed to be a subdirectory node. If there is no such node (i.e. iter points to the root node), iter is left untouched and the function returns FALSE.

directory :

A InfdDirectory.

iter :

A InfdDirectoryIter pointing to some node in directory.

Returns :

TRUE, if iter was set.

infd_directory_iter_get_child ()

gboolean            infd_directory_iter_get_child       (InfdDirectory *directory,
                                                         InfdDirectoryIter *iter,
                                                         GError **error);

Sets iter to point to first child node of iter. This requires that iter points to a subdirectory node. If the subdirectory iter points to has no children, the function returns FALSE and iter is left untouched.

The function might fail if this node's children have not yet been read from the background storage and an error occurs while reading them. In this case, FALSE is returned and error is set.

The function guarantees not to set error if the node is already explored, i.e. infd_directory_iter_get_explored() returns TRUE for directory and iter.

directory :

A InfdDirectory.

iter :

A InfdDirectoryIter pointing to a subdirectory node in directory.

error :

Location to store error information.

Returns :

TRUE, if iter was set.

infd_directory_iter_get_explored ()

gboolean            infd_directory_iter_get_explored    (InfdDirectory *directory,
                                                         InfdDirectoryIter *iter);

Returns whether the subdirectory node pointed to by iter has already been read from the background storage. If not, then no connections can be subscribed to any child nodes.

directory :

A InfdDirectory.

iter :

A InfdDirectoryIter pointing to a subdirectory node in directory.

Returns :

Whether the node iter points to has been explored.

infd_directory_add_subdirectory ()

gboolean            infd_directory_add_subdirectory     (InfdDirectory *directory,
                                                         InfdDirectoryIter *parent,
                                                         const gchar *name,
                                                         InfdDirectoryIter *iter,
                                                         GError **error);

Adds a subdirectory to the directory tree. The new subdirectory will be a child the subdirectory parent points to. iter is modified to point to the new subdirectory. If creation fails, the function returns FALSE and error is set.

directory :

A InfdDirectory.

parent :

A InfdDirectoryIter pointing to a subdirectory node in directory.

name :

The name of the new node.

iter :

An uninitalized InfdDirectoryIter.

error :

Location to store error information.

Returns :

TRUE if the subdirectory was created successfully.

infd_directory_add_note ()

gboolean            infd_directory_add_note             (InfdDirectory *directory,
                                                         InfdDirectoryIter *parent,
                                                         const gchar *name,
                                                         const InfdNotePlugin *plugin,
                                                         InfdDirectoryIter *iter,
                                                         GError **error);

Creates a new note in directory. It will be child of the subdirectory node parent points to. iter is set to point to the new node. If an error occurs, the function returns FALSE and error is set.

directory :

A InfdDirectory.

parent :

A InfdDirectoryIter pointing to a subdirectory node in directory.

name :

The name of the new node.

plugin :

The plugin to use for the node. Must have been added with infd_directory_add_plugin().

iter :

An uninitialized InfdDirectoryIter.

error :

Location to store error information.

Returns :

TRUE on success.

infd_directory_remove_node ()

gboolean            infd_directory_remove_node          (InfdDirectory *directory,
                                                         InfdDirectoryIter *iter,
                                                         GError **error);

Removes the node iter points to. If it is a subdirectory node, every node it contains will also be removed. If the function fails, FALSE is returned and error is set.

directory :

A InfdDirectory

iter :

A InfdDirectoryIter pointing to some node in directory.

error :

Location to store error information.

Returns :

TRUE on success.

infd_directory_iter_get_node_type ()

InfdStorageNodeType infd_directory_iter_get_node_type   (InfdDirectory *directory,
                                                         InfdDirectoryIter *iter);

Returns the type of the node iter points to.

directory :

A InfdDirectory.

iter :

A InfdDirectoryIter pointing to some node in directory.

Returns :

A InfdStorageNodeType.

infd_directory_iter_get_plugin ()

const InfdNotePlugin * infd_directory_iter_get_plugin   (InfdDirectory *directory,
                                                         InfdDirectoryIter *iter);

Returns the plugin that is used to create a session for the note iter points to.

directory :

A InfdDirectory.

iter :

a InfdDirectoryIter pointing to a note in directory.

Returns :

The plugin for the note iter points to.

infd_directory_iter_get_session ()

InfdSessionProxy *  infd_directory_iter_get_session     (InfdDirectory *directory,
                                                         InfdDirectoryIter *iter,
                                                         GError **error);

Returns the running session in which the note iter points to is currently edited. If the session does not exist, it is created. However, this might fail if the loading from the background storage fails. In this case, NULL is returned and error is set.

directory :

A InfdDirectory.

iter :

A InfdDirectoryIter pointing to a note in directory.

error :

Location to store error information.

Returns :

A InfdSessionProxy for the note iter points to.

infd_directory_iter_peek_session ()

InfdSessionProxy *  infd_directory_iter_peek_session    (InfdDirectory *directory,
                                                         InfdDirectoryIter *iter);

Returns the running session in which the note iter points to is currently edited. If the session does not exist because nobody is editing it at the moment, the function returns NULL.

directory :

A InfdDirectory.

iter :

A InfdDirectoryIter pointing to a note in directory.

Returns :

A InfdSessionProxy for the note iter points to, or NULL.

infd_directory_iter_save_session ()

gboolean            infd_directory_iter_save_session    (InfdDirectory *directory,
                                                         InfdDirectoryIter *iter,
                                                         GError **error);

Attempts to store the session the node iter points to represents into the background storage.

directory :

A InfdDirectory.

iter :

A InfdDirectoryIter pointing to a note in directory.

error :

Location to store error information.

Returns :

TRUE if the operation succeeded, FALSE otherwise.

infd_directory_enable_chat ()

void                infd_directory_enable_chat          (InfdDirectory *directory,
                                                         gboolean enable);

If enable is TRUE, this enables the chat on the server. This allows clients subscribing to the chat via infc_browser_subscribe_chat(). If enable is FALSE the chat is disabled which means closing an existing chat session if any and no longer allowing subscription to the chat. The chat is initially disabled.

directory :

A InfdDirectory.

enable :

Whether to enable or disable the chat.

infd_directory_get_chat_session ()

InfdSessionProxy *  infd_directory_get_chat_session     (InfdDirectory *directory);

Returns a InfdSessionProxy for the chat session, if any. If the chat is enabled (see infd_directory_enable_chat()) this returns a InfdSessionProxy that can be used to join local users to the chat, or to get chat contents (by getting the InfChatBuffer from the proxy's InfChatSession). If the chat is disabled the function returns NULL.

directory :

A InfdDirectory.

Returns :

A InfdSessionProxy, or NULL if the chat is disabled.

Property Details

The "chat-session" property

  "chat-session"             InfdSessionProxy*     : Read

The server's chat session.


The "communication-manager" property

  "communication-manager"    InfCommunicationManager*  : Read / Write / Construct Only

The communication manager for the directory.


The "io" property

  "io"                       InfIo*                : Read / Write / Construct Only

IO object to watch sockets and schedule timeouts.


The "storage" property

  "storage"                  InfdStorage*          : Read / Write / Construct

The storage backend to use.

Signal Details

The "add-session" signal

void                user_function                      (InfdDirectory     *directory,
                                                        InfdDirectoryIter *iter,
                                                        InfdSessionProxy  *session,
                                                        gpointer           user_data)      : Run Last

This signal is emitted, when a session has been associated with a node. This happens when infd_directory_iter_get_session() is called on a node, when a remote client subscribes to a session or a new node was created.

When a session has been created for a node, the session is kept until it is idle for some time. Then, it is removed again after having been stored into the background storage.

directory :

The InfdDirectory emitting the signal.

iter :

A InfdDirectoryIter pointing to the affected node.

session :

The InfdSessionProxy proxying the added session.

user_data :

user data set when the signal handler was connected.

The "node-added" signal

void                user_function                      (InfdDirectory     *directory,
                                                        InfdDirectoryIter *iter,
                                                        gpointer           user_data)      : Run Last

This signal is emitted when a new node has been created. It can either be created by API calls such as infd_directory_add_note() and infd_directory_add_subdirectory() or by a client making a corresponding request.

directory :

The InfdDirectory emitting the signal.

iter :

A InfdDirectoryIter pointing to the added node.

user_data :

user data set when the signal handler was connected.

The "node-removed" signal

void                user_function                      (InfdDirectory     *directory,
                                                        InfdDirectoryIter *iter,
                                                        gpointer           user_data)      : Run Last

This signal is emitted when a node has been removed. If a subdirectory node is removed, all contained nodes are removed as well. Node removal can either happen through a call to infd_directory_remove_node(), or by a client making a corresponding request.

directory :

The InfdDirectory emitting the signal.

iter :

A InfdDirectoryIter pointing to the removed node.

user_data :

user data set when the signal handler was connected.

The "remove-session" signal

void                user_function                      (InfdDirectory     *directory,
                                                        InfdDirectoryIter *iter,
                                                        InfdSessionProxy  *session,
                                                        gpointer           user_data)      : Run Last

This signal is emitted when a previously added session was removed. This happens when a session is idle for some time, or when the corresponding node has been removed.

directory :

The InfdDirectory emitting the signal.

iter :

A InfdDirectoryIter pointing to the affected node.

session :

The InfdSessionProxy proxying the removed session.

user_data :

user data set when the signal handler was connected.
libinfinity-0.5.5/docs/reference/libinfinity/html/InfIo.html0000644000175000017500000011164112264766270021046 00000000000000 InfIo

InfIo

InfIo — Event loop abstraction

Stability Level

Unstable, unless otherwise indicated

Synopsis

#include <libinfinity/common/inf-io.h>

                    InfIo;
struct              InfIoIface;
typedef             InfNativeSocket;
enum                InfIoEvent;
                    InfIoWatch;
                    InfIoTimeout;
                    InfIoDispatch;
void                (*InfIoWatchFunc)                   (InfNativeSocket *socket,
                                                         InfIoEvent event,
                                                         gpointer user_data);
void                (*InfIoTimeoutFunc)                 (gpointer user_data);
void                (*InfIoDispatchFunc)                (gpointer user_data);
InfIoWatch *        inf_io_add_watch                    (InfIo *io,
                                                         InfNativeSocket *socket,
                                                         InfIoEvent events,
                                                         InfIoWatchFunc func,
                                                         gpointer user_data,
                                                         GDestroyNotify notify);
void                inf_io_update_watch                 (InfIo *io,
                                                         InfIoWatch *watch,
                                                         InfIoEvent events);
void                inf_io_remove_watch                 (InfIo *io,
                                                         InfIoWatch *watch);
InfIoTimeout *      inf_io_add_timeout                  (InfIo *io,
                                                         guint msecs,
                                                         InfIoTimeoutFunc func,
                                                         gpointer user_data,
                                                         GDestroyNotify notify);
void                inf_io_remove_timeout               (InfIo *io,
                                                         InfIoTimeout *timeout);
InfIoDispatch *     inf_io_add_dispatch                 (InfIo *io,
                                                         InfIoDispatchFunc func,
                                                         gpointer user_data,
                                                         GDestroyNotify notify);
void                inf_io_remove_dispatch              (InfIo *io,
                                                         InfIoDispatch *dispatch);

Object Hierarchy

  GInterface
   +----InfIo
  GFlags
   +----InfIoEvent

Prerequisites

InfIo requires GObject.

Known Implementations

InfIo is implemented by InfStandaloneIo.

Description

The InfIo interface is used to schedule timeouts and to watch sockets for events to occur. An actual implementation usually integrates this into the application main loop, such as GMainLoop. There is also a standalone implementation, InfStandaloneIo, that can directly be used as the application's main loop.

Every object in Libinfinity that needs to schedule timeouts or watches sockets uses a InfIo to do so. This allows to use libinfinity with different main event loops, not only Glib's one.

InfIo is guaranteed to be thread-safe. All functions can be called from any thread at any time. However, all callback functions are always called from the same thread (normally the one running the main loop).

Details

InfIo

typedef struct _InfIo InfIo;

InfIo is an opaque data type. You should only access it via the public API functions.


struct InfIoIface

struct InfIoIface {
  InfIoWatch* (*add_watch)(InfIo* io,
                           InfNativeSocket* socket,
                           InfIoEvent events,
                           InfIoWatchFunc func,
                           gpointer user_data,
                           GDestroyNotify notify);

  void (*update_watch)(InfIo* io,
                       InfIoWatch* watch,
                       InfIoEvent events);

  void (*remove_watch)(InfIo* io,
                       InfIoWatch* watch);

  InfIoTimeout* (*add_timeout)(InfIo* io,
                               guint msecs,
                               InfIoTimeoutFunc func,
                               gpointer user_data,
                               GDestroyNotify notify);

  void (*remove_timeout)(InfIo* io,
                         InfIoTimeout* timeout);

  InfIoDispatch* (*add_dispatch)(InfIo* io,
                                 InfIoDispatchFunc func,
                                 gpointer user_data,
                                 GDestroyNotify notify);

  void (*remove_dispatch)(InfIo* io,
                          InfIoDispatch* dispatch);
};

The virtual methods of InfIo. These allow to set up socket watches, timeouts and function dispatchers. All of these functions need to be thread-safe.

add_watch ()

Watches a socket for events to occur in which case func is called.

update_watch ()

Updates a watch on a socket so that a different set of events is watched for.

remove_watch ()

Removes a watch on a socket.

add_timeout ()

Schedules func to be called at least msecs milliseconds in the future.

remove_timeout ()

Removes a scheduled timeout again. The timeout is removed automatically when it has elapsed, so there is no need to call this function in that case.

add_dispatch ()

Schedules func to be called by the thread the InfIo runs in.

remove_dispatch ()

Removes a scheduled dispatch. This can be called as long as the scheduled function has not yet been called.

InfNativeSocket

typedef SOCKET InfNativeSocket;

Native socket type on the target platform. This typedef is a simple int on Unix and a SOCKET on Windows.


enum InfIoEvent

typedef enum {
  INF_IO_INCOMING = 1 << 0,
  INF_IO_OUTGOING = 1 << 1,
  INF_IO_ERROR    = 1 << 2
} InfIoEvent;

This enumeration specifies events that can be watched.

INF_IO_INCOMING

Data can be read from the socket without blocking, or the connection has been closed (which is the case when recv() returns 0).

INF_IO_OUTGOING

Data can be sent without blocking.

INF_IO_ERROR

An error with the socket occured, or the connection has been closed. Use getsockopt() to read the SO_ERROR option to find out what the problem is.

InfIoWatch

typedef struct _InfIoWatch InfIoWatch;


InfIoTimeout

typedef struct _InfIoTimeout InfIoTimeout;


InfIoDispatch

typedef struct _InfIoDispatch InfIoDispatch;


InfIoWatchFunc ()

void                (*InfIoWatchFunc)                   (InfNativeSocket *socket,
                                                         InfIoEvent event,
                                                         gpointer user_data);

Callback function that is called when an event occurs on a watched socket.

socket :

The socket on which an event occured.

event :

A bitmask of the events that occured.

user_data :

User-defined data specified in inf_io_add_watch().

InfIoTimeoutFunc ()

void                (*InfIoTimeoutFunc)                 (gpointer user_data);

Callback function that is called when a timeout has elapsed.

user_data :

User-defined data specified in inf_io_add_timeout().

InfIoDispatchFunc ()

void                (*InfIoDispatchFunc)                (gpointer user_data);

Callback function that is called when a dispatch is executed by the thread that runs InfIo.

user_data :

User-defined data specified in inf_io_add_dispatch().

inf_io_add_watch ()

InfIoWatch *        inf_io_add_watch                    (InfIo *io,
                                                         InfNativeSocket *socket,
                                                         InfIoEvent events,
                                                         InfIoWatchFunc func,
                                                         gpointer user_data,
                                                         GDestroyNotify notify);

Monitors the given socket for activity and calls func if one of the events specified in events occurs.

io :

A InfIo.

socket :

The socket to watch.

events :

Events to watch for.

func :

Function to be called when one of the events occurs.

user_data :

Extra data to pass to func.

notify :

A GDestroyNotify that is called when user_data is no longer needed, or NULL.

Returns :

A InfIoWatch that can be used to update or remove the watch.

inf_io_update_watch ()

void                inf_io_update_watch                 (InfIo *io,
                                                         InfIoWatch *watch,
                                                         InfIoEvent events);

Changes the events that the socket bound to watch is being watched for. The callback of watch will only be called if one of the newly watched for events occurs.

io :

A InfIo.

watch :

The watch to update, as returned by inf_io_add_watch().

events :

The new events to watch for.

inf_io_remove_watch ()

void                inf_io_remove_watch                 (InfIo *io,
                                                         InfIoWatch *watch);

Removes watch from io and releases all resources allocated for the watch. Events are no longer looked for on the socket.

io :

A InfIo.

watch :

The watch to remove, as returned by inf_io_add_watch().

inf_io_add_timeout ()

InfIoTimeout *      inf_io_add_timeout                  (InfIo *io,
                                                         guint msecs,
                                                         InfIoTimeoutFunc func,
                                                         gpointer user_data,
                                                         GDestroyNotify notify);

Calls func after at least msecs milliseconds have elapsed. The timeout is removed after it has elapsed.

io :

A InfIo.

msecs :

Number of milliseconds after which the timeout should be elapsed.

func :

Function to be called when the timeout elapsed.

user_data :

Extra data to pass to func.

notify :

A GDestroyNotify that is called when user_data is no longer needed, or NULL.

Returns :

A timeout handle that can be used to remove the timeout.

inf_io_remove_timeout ()

void                inf_io_remove_timeout               (InfIo *io,
                                                         InfIoTimeout *timeout);

Removes the given timeout.

io :

A InfIo.

timeout :

A timeout handle obtained from inf_io_add_timeout().

inf_io_add_dispatch ()

InfIoDispatch *     inf_io_add_dispatch                 (InfIo *io,
                                                         InfIoDispatchFunc func,
                                                         gpointer user_data,
                                                         GDestroyNotify notify);

Schedules func to be called by the thread io runs in. This function can be used from a different thread to communicate to io's thread.

io :

A InfIo.

func :

Function to be called when the function is dispatched.

user_data :

Extra data to pass to func.

notify :

A GDestroyNotify that is called when user_data is no longer needed, or NULL.

Returns :

A dispatch handle that can be used to stop the dispatched function from being called as long as it has not yet been called.

inf_io_remove_dispatch ()

void                inf_io_remove_dispatch              (InfIo *io,
                                                         InfIoDispatch *dispatch);

Removes the given dispatch from io so that it is not called.

io :

A InfIo.

dispatch :

A dispatch handle obtained from inf_io_add_dispatch().

See Also

InfStandaloneIo
libinfinity-0.5.5/docs/reference/libinfinity/html/InfdFilesystemStorage.html0000644000175000017500000003013012264766270024305 00000000000000 InfdFilesystemStorage

InfdFilesystemStorage

InfdFilesystemStorage

Synopsis

enum                InfdFilesystemStorageError;
                    InfdFilesystemStorage;
struct              InfdFilesystemStorageClass;
InfdFilesystemStorage * infd_filesystem_storage_new     (const gchar *root_directory);
FILE *              infd_filesystem_storage_open        (InfdFilesystemStorage *storage,
                                                         const gchar *identifier,
                                                         const gchar *path,
                                                         const gchar *mode,
                                                         GError **error);

Object Hierarchy

  GObject
   +----InfdFilesystemStorage

Implemented Interfaces

InfdFilesystemStorage implements InfdStorage.

Properties

  "root-directory"           gchar*                : Read / Write / Construct Only

Description

Details

enum InfdFilesystemStorageError

typedef enum {
  /* The path contains invalid characters */
  INFD_FILESYSTEM_STORAGE_ERROR_INVALID_PATH,
  /* Failed to remove files from disk */
  INFD_FILESYSTEM_STORAGE_ERROR_REMOVE_FILES,

  INFD_FILESYSTEM_STORAGE_ERROR_FAILED
} InfdFilesystemStorageError;

INFD_FILESYSTEM_STORAGE_ERROR_INVALID_PATH

INFD_FILESYSTEM_STORAGE_ERROR_REMOVE_FILES

INFD_FILESYSTEM_STORAGE_ERROR_FAILED


InfdFilesystemStorage

typedef struct _InfdFilesystemStorage InfdFilesystemStorage;


struct InfdFilesystemStorageClass

struct InfdFilesystemStorageClass {
  GObjectClass parent_class;
};


infd_filesystem_storage_new ()

InfdFilesystemStorage * infd_filesystem_storage_new     (const gchar *root_directory);

Creates a new InfdFilesystemStorage that stores its nodes in the given directory on the file system. The directory is created if it does not exist.

root_directory :

A directory name in UTF-8.

Returns :

A new InfdFilesystemStorage.

infd_filesystem_storage_open ()

FILE *              infd_filesystem_storage_open        (InfdFilesystemStorage *storage,
                                                         const gchar *identifier,
                                                         const gchar *path,
                                                         const gchar *mode,
                                                         GError **error);

Opens a file in the given path within the storage's root directory. If the file exists already, and mode is set to "w", the file is overwritten.

storage :

A InfdFilesystemStorage.

identifier :

The type of node to open.

path :

Tha path to open.

mode :

Either "r" for reading or "w" for writing.

error :

Location to store error information, if any.

Returns :

A stream for the open file. Close with fclose().

Property Details

The "root-directory" property

  "root-directory"           gchar*                : Read / Write / Construct Only

The directory in which the storage stores its content.

Default value: NULL

libinfinity-0.5.5/docs/reference/libinfinity/html/libinfinity-0.5-InfXmlUtil.html0000644000175000017500000021445112264766270024716 00000000000000 XML utility functions

XML utility functions

XML utility functions — Helper functions to read basic data types from XML

Stability Level

Unstable, unless otherwise indicated

Synopsis

#include <libinfinity/common/inf-xml-util.h>

void                inf_xml_util_add_child_text         (xmlNodePtr xml,
                                                         const gchar *text,
                                                         gsize bytes);
gchar *             inf_xml_util_get_child_text         (xmlNodePtr xml,
                                                         gsize *bytes,
                                                         guint *chars,
                                                         GError **error);
xmlChar *           inf_xml_util_get_attribute          (xmlNodePtr xml,
                                                         const gchar *attribute);
xmlChar *           inf_xml_util_get_attribute_required (xmlNodePtr xml,
                                                         const gchar *attribute,
                                                         GError **error);
gboolean            inf_xml_util_get_attribute_int      (xmlNodePtr xml,
                                                         const gchar *attribute,
                                                         gint *result,
                                                         GError **error);
gboolean            inf_xml_util_get_attribute_int_required
                                                        (xmlNodePtr xml,
                                                         const gchar *attribute,
                                                         gint *result,
                                                         GError **error);
gboolean            inf_xml_util_get_attribute_long     (xmlNodePtr xml,
                                                         const gchar *attribute,
                                                         glong *result,
                                                         GError **error);
gboolean            inf_xml_util_get_attribute_long_required
                                                        (xmlNodePtr xml,
                                                         const gchar *attribute,
                                                         glong *result,
                                                         GError **error);
gboolean            inf_xml_util_get_attribute_uint     (xmlNodePtr xml,
                                                         const gchar *attribute,
                                                         guint *result,
                                                         GError **error);
gboolean            inf_xml_util_get_attribute_uint_required
                                                        (xmlNodePtr xml,
                                                         const gchar *attribute,
                                                         guint *result,
                                                         GError **error);
gboolean            inf_xml_util_get_attribute_ulong    (xmlNodePtr xml,
                                                         const gchar *attribute,
                                                         gulong *result,
                                                         GError **error);
gboolean            inf_xml_util_get_attribute_ulong_required
                                                        (xmlNodePtr xml,
                                                         const gchar *attribute,
                                                         gulong *result,
                                                         GError **error);
gboolean            inf_xml_util_get_attribute_double   (xmlNodePtr xml,
                                                         const gchar *attribute,
                                                         gdouble *result,
                                                         GError **error);
gboolean            inf_xml_util_get_attribute_double_required
                                                        (xmlNodePtr xml,
                                                         const gchar *attribute,
                                                         gdouble *result,
                                                         GError **error);
void                inf_xml_util_set_attribute          (xmlNodePtr xml,
                                                         const gchar *attribute,
                                                         const gchar *value);
void                inf_xml_util_set_attribute_int      (xmlNodePtr xml,
                                                         const gchar *attribute,
                                                         gint value);
void                inf_xml_util_set_attribute_long     (xmlNodePtr xml,
                                                         const gchar *attribute,
                                                         glong value);
void                inf_xml_util_set_attribute_uint     (xmlNodePtr xml,
                                                         const gchar *attribute,
                                                         guint value);
void                inf_xml_util_set_attribute_ulong    (xmlNodePtr xml,
                                                         const gchar *attribute,
                                                         gulong value);
void                inf_xml_util_set_attribute_double   (xmlNodePtr xml,
                                                         const gchar *attribute,
                                                         gdouble value);
GError *            inf_xml_util_new_error_from_node    (xmlNodePtr xml);
xmlNodePtr          inf_xml_util_new_node_from_error    (GError *error,
                                                         xmlNsPtr name_space,
                                                         const gchar *name);

Description

In the infinote protocol XML attributes are often required to contain numbers. These function provide some convenience to set and retrieve them. They are mostly used in libinfinity itself but can also be useful when implementing new session types so they are public API.

Details

inf_xml_util_add_child_text ()

void                inf_xml_util_add_child_text         (xmlNodePtr xml,
                                                         const gchar *text,
                                                         gsize bytes);

Adds the given text as child text to xml in the same way xmlNodeAddContentLen() would do. The difference is that text is allowed to contain characters that are not valid in XML text, such as formfeed characters \f. In case one occurs in text, the function adds an <uchar /> element node instead to xml as specified in the infinote protocol.

xml :

A xmlNodePtr.

text :

The child text to add.

bytes :

The number of bytes of text.

inf_xml_util_get_child_text ()

gchar *             inf_xml_util_get_child_text         (xmlNodePtr xml,
                                                         gsize *bytes,
                                                         guint *chars,
                                                         GError **error);

Reads a node's child text. If there are <uchar /> child elements, as added by inf_xml_util_add_child_text() this function will convert them back to character codes. There should not be any other child elements in xml.

xml :

A xmlNodePtr

bytes :

Location to store number of bytes of child text, or NULL.

chars :

Location to store number of characters of child text, or NULL.

error :

Locatian to store error information if any, or NULL.

Returns :

The node's child text, or NULL on error. Free with g_free() when no longer needed.

inf_xml_util_get_attribute ()

xmlChar *           inf_xml_util_get_attribute          (xmlNodePtr xml,
                                                         const gchar *attribute);

Returns the value of the attribute called attribute in the XML element xml. This function is a thin wrapper around xmlGetProp() which exists mostly for consistency, and for not having to cast the attribute argument from char* to xmlChar*. The return value is a xmlChar*, though.

xml :

A xmlNodePtr.

attribute :

The name of the attribute to query.

Returns :

The value of the attribute, or NULL. Free with xmlFree() when no longer needed.

inf_xml_util_get_attribute_required ()

xmlChar *           inf_xml_util_get_attribute_required (xmlNodePtr xml,
                                                         const gchar *attribute,
                                                         GError **error);

Returns the value of the attribute called attribute in the XML element xml. If there is no such attribute then the function returns NULL and error is set.

xml :

A xmlNodePtr.

attribute :

The name of the attribute to query.

error :

Location to store error information, if any.

Returns :

The attribute's value, or NULL on error. Free with xmlFree() when no longer needed.

inf_xml_util_get_attribute_int ()

gboolean            inf_xml_util_get_attribute_int      (xmlNodePtr xml,
                                                         const gchar *attribute,
                                                         gint *result,
                                                         GError **error);

Reads the attribute named attribute from the XML element xml. The attribute value is expected to be a signed integral number. If it is the function converts the text to an integere and stores the result into result. In this case, TRUE is returned and error is left untouched.

If the value is not a signed integral number, then the function returns FALSE, error is set and result is left untouched.

If the attribute does not exist the function returns FALSE but error is not set.

xml :

A xmlNodePtr.

attribute :

The name of the attribute to query.

result :

Location to store the read value.

error :

Location to store error information, if any.

Returns :

Whether result was set.

inf_xml_util_get_attribute_int_required ()

gboolean            inf_xml_util_get_attribute_int_required
                                                        (xmlNodePtr xml,
                                                         const gchar *attribute,
                                                         gint *result,
                                                         GError **error);

Reads the attribute named attribute from the XML element xml. The attribute value is expected to be a signed integral number. If it is the function converts the text to an integere and stores the result into result. In this case, TRUE is returned and error is left untouched.

If the value is not a signed integral number or the attribute does not exist, then the function returns FALSE, error is set and result is left untouched.

xml :

A xmlNodePtr.

attribute :

The name of the attribute to query.

result :

Location to store the read value.

error :

Location to store error information, if any.

Returns :

Whether result was set.

inf_xml_util_get_attribute_long ()

gboolean            inf_xml_util_get_attribute_long     (xmlNodePtr xml,
                                                         const gchar *attribute,
                                                         glong *result,
                                                         GError **error);

Behaves exactly like inf_xml_util_get_attribute_int(). The only difference is that the function reads a signed long integral number.

xml :

A xmlNodePtr.

attribute :

The name of the attribute to query.

result :

Location to store the read value.

error :

Location to store error information, if any.

Returns :

Whether result was set.

inf_xml_util_get_attribute_long_required ()

gboolean            inf_xml_util_get_attribute_long_required
                                                        (xmlNodePtr xml,
                                                         const gchar *attribute,
                                                         glong *result,
                                                         GError **error);

Behaves exactly like inf_xml_util_get_attribute_int_required(). The only difference is that the function reads a signed long integral number.

xml :

A xmlNodePtr.

attribute :

The name of the attribute to query.

result :

Location to store the read value.

error :

Location to store error information, if any.

Returns :

Whether result was set.

inf_xml_util_get_attribute_uint ()

gboolean            inf_xml_util_get_attribute_uint     (xmlNodePtr xml,
                                                         const gchar *attribute,
                                                         guint *result,
                                                         GError **error);

Behaves exactly like inf_xml_util_get_attribute_int(). The only difference is that the function reads an unsigned integral number.

xml :

A xmlNodePtr.

attribute :

The name of the attribute to query.

result :

Location to store the read value.

error :

Location to store error information, if any.

Returns :

Whether result was set.

inf_xml_util_get_attribute_uint_required ()

gboolean            inf_xml_util_get_attribute_uint_required
                                                        (xmlNodePtr xml,
                                                         const gchar *attribute,
                                                         guint *result,
                                                         GError **error);

Behaves exactly like inf_xml_util_get_attribute_int_required(). The only difference is that the function reads an unsigned integral number.

xml :

A xmlNodePtr.

attribute :

The name of the attribute to query.

result :

Location to store the read value.

error :

Location to store error information, if any.

Returns :

Whether result was set.

inf_xml_util_get_attribute_ulong ()

gboolean            inf_xml_util_get_attribute_ulong    (xmlNodePtr xml,
                                                         const gchar *attribute,
                                                         gulong *result,
                                                         GError **error);

Behaves exactly like inf_xml_util_get_attribute_int(). The only difference is that the function reads an unsigned long integral number.

xml :

A xmlNodePtr.

attribute :

The name of the attribute to query.

result :

Location to store the read value.

error :

Location to store error information, if any.

Returns :

Whether result was set.

inf_xml_util_get_attribute_ulong_required ()

gboolean            inf_xml_util_get_attribute_ulong_required
                                                        (xmlNodePtr xml,
                                                         const gchar *attribute,
                                                         gulong *result,
                                                         GError **error);

Behaves exactly like inf_xml_util_get_attribute_int_required(). The only difference is that the function reads an unsigned long integral number.

xml :

A xmlNodePtr.

attribute :

The name of the attribute to query.

result :

Location to store the read value.

error :

Location to store error information, if any.

Returns :

Whether result was set.

inf_xml_util_get_attribute_double ()

gboolean            inf_xml_util_get_attribute_double   (xmlNodePtr xml,
                                                         const gchar *attribute,
                                                         gdouble *result,
                                                         GError **error);

Behaves exactly like inf_xml_util_get_attribute_int(). The only difference is that the function reads a double-precision floating point number.

xml :

A xmlNodePtr.

attribute :

The name of the attribute to query.

result :

Location to store the read value.

error :

Location to store error information, if any.

Returns :

Whether result was set.

inf_xml_util_get_attribute_double_required ()

gboolean            inf_xml_util_get_attribute_double_required
                                                        (xmlNodePtr xml,
                                                         const gchar *attribute,
                                                         gdouble *result,
                                                         GError **error);

Behaves exactly like inf_xml_util_get_attribute_int_required(). The only difference is that the function reads a double-precision floating point number.

xml :

A xmlNodePtr.

attribute :

The name of the attribute to query.

result :

Location to store the read value.

error :

Location to store error information, if any.

Returns :

Whether result was set.

inf_xml_util_set_attribute ()

void                inf_xml_util_set_attribute          (xmlNodePtr xml,
                                                         const gchar *attribute,
                                                         const gchar *value);

Sets the attribute named attribute to the given value of the XML element xml. This is a thin wrapper around xmlSetProp(), mainly provided for consistency and for not having to cast the arguments to xmlChar*.

xml :

A xmlNodePtr.

attribute :

The name of the attribute to set.

value :

The value to set.

inf_xml_util_set_attribute_int ()

void                inf_xml_util_set_attribute_int      (xmlNodePtr xml,
                                                         const gchar *attribute,
                                                         gint value);

Sets the attribute named attribute to the given signed integral value converted to text.

xml :

A xmlNodePtr.

attribute :

The name of the attribute to set.

value :

The value to set.

inf_xml_util_set_attribute_long ()

void                inf_xml_util_set_attribute_long     (xmlNodePtr xml,
                                                         const gchar *attribute,
                                                         glong value);

Sets the attribute named attribute to the given signed long integral value converted to text.

xml :

A xmlNodePtr.

attribute :

The name of the attribute to set.

value :

The value to set.

inf_xml_util_set_attribute_uint ()

void                inf_xml_util_set_attribute_uint     (xmlNodePtr xml,
                                                         const gchar *attribute,
                                                         guint value);

Sets the attribute named attribute to the given unsigned integral value converted to text.

xml :

A xmlNodePtr.

attribute :

The name of the attribute to set.

value :

The value to set.

inf_xml_util_set_attribute_ulong ()

void                inf_xml_util_set_attribute_ulong    (xmlNodePtr xml,
                                                         const gchar *attribute,
                                                         gulong value);

Sets the attribute named attribute to the given unsigned long integral value converted to text.

xml :

A xmlNodePtr.

attribute :

The name of the attribute to set.

value :

The value to set.

inf_xml_util_set_attribute_double ()

void                inf_xml_util_set_attribute_double   (xmlNodePtr xml,
                                                         const gchar *attribute,
                                                         gdouble value);

Sets the attribute named attribute to the given double-precision floating point number converted to text.

xml :

A xmlNodePtr.

attribute :

The name of the attribute to set.

value :

The value to set.

inf_xml_util_new_error_from_node ()

GError *            inf_xml_util_new_error_from_node    (xmlNodePtr xml);

Creates a new GError with the domain and erro code given in xml's attributes. The message is parsed from the child text as with inf_xml_util_get_child_text(). The element name and namespace are ignored. If xml does not have the attributes as expected, NULL is returned.

xml :

A xmlNodePtr as returned by inf_xml_util_new_node_from_error().

Returns :

A pointer to a new GError, or NULL on failure. It is the caller's responsibility to dispose the GError object using g_error_free().

inf_xml_util_new_node_from_error ()

xmlNodePtr          inf_xml_util_new_node_from_error    (GError *error,
                                                         xmlNsPtr name_space,
                                                         const gchar *name);

Creates a new xmlNode that encodes error. The element's name is optionally specified by name, or "error" by default, error's domain and code are set as attributes and its message is set as child text using inf_xml_util_add_child_text(). name_space is set as the element's namespace, if not NULL.

error :

The error object to represent in xml.

name_space :

The element's namespace, or NULL.

name :

An element name, or NULL.

Returns :

A new xmlNodePtr. It is the caller's responsibility to dispose it using xmlFreeNode().
libinfinity-0.5.5/docs/reference/libinfinity/html/up.png0000644000175000017500000000044212264766270020302 00000000000000‰PNG  IHDRàw=øéIDATxí•!‚@† Ä ‘H0ˆîÀô(4À6Œ£Á` l$n$ áùpæÍl]åáHðŸùʆï›yà ެ+$þ†ØGö턈)å꺭5E.™LEAUUY" yÿŒX"|¹5•3"n9#ÂÛ"|¹;²0’#7#eYRD!~/_"Ð4 ÉY!@)E‘„Îs‡¥i:( ÃÌi­Ÿ´mKO1(CnÌ€¹Ù¹>Ùóm•ý³ RBžç/)Š‚×1 éà½mÆþtÖÈÖAâýrt¾)_&›IEND®B`‚libinfinity-0.5.5/docs/reference/libinfinity/html/InfCertificateChain.html0000644000175000017500000004174312264766270023671 00000000000000 InfCertificateChain

InfCertificateChain

InfCertificateChain — X.509 certificate chains

Stability Level

Unstable, unless otherwise indicated

Object Hierarchy

  GBoxed
   +----InfCertificateChain

Description

InfCertificateChain is a reference-counted wrapper around an array of gnutls_x509_crt_t structures, representing a certificate chain.

Details

InfCertificateChain

typedef struct _InfCertificateChain InfCertificateChain;

InfCertificateChain is an opaque data type. You should only access it via the public API functions.


inf_certificate_chain_new ()

InfCertificateChain * inf_certificate_chain_new         (gnutls_x509_crt_t *certs,
                                                         guint n_certs);

Creates a new InfCertificateChain with the given certificates. The certs array needs to be allocated with g_malloc. This function takes ownership of certs.

certs :

Array of certificates.

n_certs :

Number of elements in certs.

Returns :

A new InfCertificateChain.

inf_certificate_chain_ref ()

InfCertificateChain * inf_certificate_chain_ref         (InfCertificateChain *chain);

Increases the reference count of chain by one.

chain :

A InfCertificateChain:

Returns :

The same chain.

inf_certificate_chain_unref ()

void                inf_certificate_chain_unref         (InfCertificateChain *chain);

Decreases the reference count of chain by one. If the reference count reaches zero, then chain is freed.

chain :

A InfCertificateChain.

inf_certificate_chain_get_raw ()

gnutls_x509_crt_t * inf_certificate_chain_get_raw       (const InfCertificateChain *chain);

Returns the raw array of certificates in the chain.

chain :

A InfCertificateChain.

Returns :

An array of certificates owned by the chain.

inf_certificate_chain_get_root_certificate ()

gnutls_x509_crt_t   inf_certificate_chain_get_root_certificate
                                                        (const InfCertificateChain *chain);

Returns the last certificate in the chain.

chain :

A InfCertificateChain.

Returns :

The last certificate in the chain.

inf_certificate_chain_get_own_certificate ()

gnutls_x509_crt_t   inf_certificate_chain_get_own_certificate
                                                        (const InfCertificateChain *chain);

TODO: Rename this function into something more appropriate.

Returns the first certificate in the chain.

chain :

A InfCertificateChain.

Returns :

The first certificate in the chain.

inf_certificate_chain_get_nth_certificate ()

gnutls_x509_crt_t   inf_certificate_chain_get_nth_certificate
                                                        (const InfCertificateChain *chain,
                                                         guint n);

Returns the nth certificate in the chain.

chain :

A InfCertificateChain.

n :

Index of the certificate to retrieve.

Returns :

The nth certificate in the chain.

inf_certificate_chain_get_n_certificates ()

guint               inf_certificate_chain_get_n_certificates
                                                        (const InfCertificateChain *chain);

libinfinity-0.5.5/docs/reference/libinfinity/html/InfAdoptedNoOperation.html0000644000175000017500000001537612264766270024245 00000000000000 InfAdoptedNoOperation

InfAdoptedNoOperation

InfAdoptedNoOperation — An operation not doing anything.

Stability Level

Unstable, unless otherwise indicated

Synopsis

#include <libinfinity/adopted/inf-adopted-no-operation.h>

                    InfAdoptedNoOperation;
struct              InfAdoptedNoOperationClass;
InfAdoptedNoOperation * inf_adopted_no_operation_new    (void);

Object Hierarchy

  GObject
   +----InfAdoptedNoOperation

Implemented Interfaces

InfAdoptedNoOperation implements InfAdoptedOperation.

Description

InfAdoptedNoOperation is an operation that does nothing when applied to the buffer. This might be the result of an operation transformation, for example if a request is received that is supposed to delete text that was already deleted by the local site. It is also used by InfAdoptedSession to send the current state to other users in case the user being idle, so that others keep knowing the current state of that user (this is especially required for cleanup of request logs and caches).

Details

InfAdoptedNoOperation

typedef struct _InfAdoptedNoOperation InfAdoptedNoOperation;

InfAdoptedNoOperation is an opaque data type. You should only access it via the public API functions.


struct InfAdoptedNoOperationClass

struct InfAdoptedNoOperationClass {
};

This structure does not contain any public fields.


inf_adopted_no_operation_new ()

InfAdoptedNoOperation * inf_adopted_no_operation_new    (void);

Creates a new InfAdoptedNoOperation. A no operation is an operation that does nothing, but might be the result of a transformation.

Returns :

A new InfAdoptedNoOperation.
libinfinity-0.5.5/docs/reference/libinfinity/html/InfAdoptedUser.html0000644000175000017500000003142312264766270022715 00000000000000 InfAdoptedUser

InfAdoptedUser

InfAdoptedUser

Object Hierarchy

  GObject
   +----InfUser
         +----InfAdoptedUser

Properties

  "request-log"              InfAdoptedRequestLog*  : Read / Write / Construct Only
  "vector"                   InfAdoptedStateVector*  : Read / Write

Description

Details

InfAdoptedUser

typedef struct _InfAdoptedUser InfAdoptedUser;

InfAdoptedUser is an opaque data type. You should only access it via the public API functions.


struct InfAdoptedUserClass

struct InfAdoptedUserClass {
};

This structure does not contain any public fields.


inf_adopted_user_get_component ()

guint               inf_adopted_user_get_component      (InfAdoptedUser *user,
                                                         guint id);

Returns the amount of requests user is guaranteed to have processed from the user with ID id.

user :

A InfAdoptedUser.

id :

The component to retrieve.

Returns :

The number of requests user has processed from id.

inf_adopted_user_get_vector ()

InfAdoptedStateVector * inf_adopted_user_get_vector     (InfAdoptedUser *user);

Returns the current vector time of user.

user :

A InfAdoptedUser.

Returns :

The current vector time of user.

inf_adopted_user_set_vector ()

void                inf_adopted_user_set_vector         (InfAdoptedUser *user,
                                                         InfAdoptedStateVector *vec);

Updates the state vector of user. This function takes ownership of vec.

user :

A InfAdoptedUser.

vec :

A InfAdoptedStateVector.

inf_adopted_user_get_request_log ()

InfAdoptedRequestLog * inf_adopted_user_get_request_log (InfAdoptedUser *user);

Returns the request log of user.

user :

A InfAdoptedUser.

Returns :

User's InfAdoptedRequestLog.

Property Details

The "request-log" property

  "request-log"              InfAdoptedRequestLog*  : Read / Write / Construct Only

Request log of this user.


The "vector" property

  "vector"                   InfAdoptedStateVector*  : Read / Write

The state this user is currently at.

libinfinity-0.5.5/docs/reference/libinfinity/html/ch03.html0000644000175000017500000000734012264766270020577 00000000000000 Libinfinity's adOPTed implementation

Libinfinity's adOPTed implementation

InfAdoptedSession — Session handling concurrency control via the adOPTed algorithm.
InfAdoptedSessionRecord — Create a record of a session
InfAdoptedSessionReplay — Replay a record of a session
InfAdoptedUndoGrouping — Grouping of requests to be undone simultaneously
InfAdoptedAlgorithm — adOPTed implementation
InfAdoptedRequestLog — History of requests
InfAdoptedRequestRequest processed by InfAdoptedAlgorithm.
InfAdoptedOperationOperation that can be processed by InfAdoptedAlgorithm.
InfAdoptedNoOperation — An operation not doing anything.
InfAdoptedSplitOperation — Operation wrapping two operations
InfAdoptedUser
InfAdoptedStateVector — Represents a state in the interaction model
libinfinity-0.5.5/docs/reference/libinfinity/html/InfSimulatedConnection.html0000644000175000017500000005337512264766270024457 00000000000000 InfSimulatedConnection

InfSimulatedConnection

InfSimulatedConnection — Simulated network connection

Stability Level

Unstable, unless otherwise indicated

Object Hierarchy

  GObject
   +----InfSimulatedConnection
  GEnum
   +----InfSimulatedConnectionMode

Implemented Interfaces

InfSimulatedConnection implements InfXmlConnection.

Properties

  "io"                       InfIo*                : Read / Write / Construct Only
  "mode"                     InfSimulatedConnectionMode  : Read / Write / Construct
  "target"                   InfSimulatedConnection*  : Read / Write

Description

InfSimulatedConnection simulates a connection and can be used everywhere where a InfXmlConnection is expected. Use inf_simulated_connection_connect() to connect two such connections so that data sent through one is received by the other.

Details

InfSimulatedConnection

typedef struct _InfSimulatedConnection InfSimulatedConnection;

InfSimulatedConnection is an opaque data type. You should only access it via the public API functions.


struct InfSimulatedConnectionClass

struct InfSimulatedConnectionClass {
};

This structure does not contain any public fields.


enum InfSimulatedConnectionMode

typedef enum {
  INF_SIMULATED_CONNECTION_IMMEDIATE,
  INF_SIMULATED_CONNECTION_DELAYED,
  INF_SIMULATED_CONNECTION_IO_CONTROLLED
} InfSimulatedConnectionMode;

The mode of a simulated connection defines when sent messages arrive at the target connection.

INF_SIMULATED_CONNECTION_IMMEDIATE

Messages are received directly by the target site when calling inf_xml_connection_send().

INF_SIMULATED_CONNECTION_DELAYED

Messages are queued, and delivered to the target site when inf_simulated_connection_flush() is called.

INF_SIMULATED_CONNECTION_IO_CONTROLLED

Messages are queued and delivered once the application main loop regains control. This requires the simulated connection to have been created with inf_simulated_connection_new_with_io().

inf_simulated_connection_new ()

InfSimulatedConnection * inf_simulated_connection_new   (void);

Creates a new InfSimulatedConnection. A connection created this way cannot be switched to INF_SIMULATED_CONNECTION_IO_CONTROLLED mode. Use inf_simulated_connection_new_with_io() instead if you intend to do that.

Returns :

A new InfSimulatedConnection.

inf_simulated_connection_new_with_io ()

InfSimulatedConnection * inf_simulated_connection_new_with_io
                                                        (InfIo *io);

Creates a new InfSimulatedConnection with the given InfIo. This connection can be used with INF_SIMULATED_CONNECTION_IO_CONTROLLED mode. If you don't intend to use that mode then using inf_simulated_connection_new() is also good enough since the InfIo object is not required in that case.

io :

The main loop to be used for INF_SIMULATED_CONNECTION_IO_CONTROLLED mode.

Returns :

A new InfSimulatedConnection.

inf_simulated_connection_connect ()

void                inf_simulated_connection_connect    (InfSimulatedConnection *connection,
                                                         InfSimulatedConnection *to);

Connects two simulated connections, so that data sent through one of them is received by the other one and vice versa. So one call to this function connects both InfSimulatedConnections to each other. There is no need to call this function once for each connection.

If one or both of the connections already have another target, then the simulated connection between those is closed first.

connection :

A InfSimulatedConnection.

to :

The target connection.

inf_simulated_connection_set_mode ()

void                inf_simulated_connection_set_mode   (InfSimulatedConnection *connection,
                                                         InfSimulatedConnectionMode mode);

Sets the mode of the simulated connection.

In INF_SIMULATED_CONNECTION_IMMEDIATE mode, messages sent through the connection are received by the target during the call to inf_xml_connection_send().

In INF_SIMULATED_CONNECTION_DELAYED mode, messages sent are queued and received by the target when inf_simulated_connection_flush() is called.

In INF_SIMULATED_CONNECTION_IO_CONTROLLED mode, messages are queued and received by the target as soon as a dispatch handler (see inf_io_add_dispatch()) installed on the main loop is called.

When changing the mode from INF_SIMULATED_CONNECTION_DELAYED or INF_SIMULATED_CONNECTION_IO_CONTROLLED to INF_SIMULATED_CONNECTION_IMMEDIATE, then the queue is flushed, too.

connection :

A InfSimulatedConnection.

mode :

The new mode to set.

inf_simulated_connection_flush ()

void                inf_simulated_connection_flush      (InfSimulatedConnection *connection);

When connection's mode is INF_SIMULATED_CONNECTION_DELAYED or INF_SIMULATED_CONNECTION_IO_CONTROLLED, then calling this function makes the target connection receive all the queued messages.

connection :

A InfSimulatedConnection.

Property Details

The "io" property

  "io"                       InfIo*                : Read / Write / Construct Only

The main loop to be used for IO_CONTROLLED mode.


The "mode" property

  "mode"                     InfSimulatedConnectionMode  : Read / Write / Construct

The mode of the simulated connection.

Default value: INF_SIMULATED_CONNECTION_IMMEDIATE


The "target" property

  "target"                   InfSimulatedConnection*  : Read / Write

The simulated connection receiving data sent through this connection.

libinfinity-0.5.5/docs/reference/libinfinity/Makefile.in0000644000175000017500000006613212264766065020263 00000000000000# Makefile.in generated by automake 1.13.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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@ # -*- mode: makefile -*- #################################### # Everything below here is generic # #################################### VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(top_srcdir)/gtk-doc.make $(srcdir)/Makefile.in \ $(srcdir)/Makefile.am $(top_srcdir)/mkinstalldirs subdir = docs/reference/libinfinity ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/libinfinity/inf-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBINFINITY_API_VERSION = @LIBINFINITY_API_VERSION@ LIBINFINITY_LIBTOOL_VERSION = @LIBINFINITY_LIBTOOL_VERSION@ LIBINFINITY_VERSION = @LIBINFINITY_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ avahi_CFLAGS = @avahi_CFLAGS@ avahi_LIBS = @avahi_LIBS@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gtk_requirement = @gtk_requirement@ gtk_version = @gtk_version@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infgtk_CFLAGS = @infgtk_CFLAGS@ infgtk_LIBS = @infgtk_LIBS@ infinity_CFLAGS = @infinity_CFLAGS@ infinity_LIBS = @infinity_LIBS@ infinoted_CFLAGS = @infinoted_CFLAGS@ infinoted_LIBS = @infinoted_LIBS@ infodir = @infodir@ inftext_CFLAGS = @inftext_CFLAGS@ inftext_LIBS = @inftext_LIBS@ inftextgtk_CFLAGS = @inftextgtk_CFLAGS@ inftextgtk_LIBS = @inftextgtk_LIBS@ install_sh = @install_sh@ libdaemon_CFLAGS = @libdaemon_CFLAGS@ libdaemon_LIBS = @libdaemon_LIBS@ 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@ # We require automake 1.6 at least. AUTOMAKE_OPTIONS = 1.6 # This is a blank Makefile.am for using gtk-doc. # Copy this to your project's API docs directory and modify the variables to # suit your project. See the GTK+ Makefiles in gtk+/docs/reference for examples # of using the various options. # The name of the module, e.g. 'glib'. DOC_MODULE = libinfinity-$(LIBINFINITY_API_VERSION) # The top-level SGML file. You can change this if you want to. DOC_MAIN_SGML_FILE = $(DOC_MODULE)-docs.sgml # The directory containing the source code. Relative to $(srcdir). # gtk-doc will search all .c & .h files beneath here for inline comments # documenting the functions and macros. # e.g. DOC_SOURCE_DIR=../../../gtk DOC_SOURCE_DIR = $(top_srcdir)/libinfinity # Extra options to pass to gtkdoc-scangobj. Not normally needed. SCANGOBJ_OPTIONS = @LIBINFINITY_HAVE_AVAHI_FALSE@IGNORE_HFILES = "inf-marshal.h inf-i18n.h inf-signals.h inf-config.h inf-discovery-avahi.h" # Header files to ignore when scanning. # e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h @LIBINFINITY_HAVE_AVAHI_TRUE@IGNORE_HFILES = "inf-marshal.h inf-i18n.h inf-signals.h inf-config.h" # Extra options to supply to gtkdoc-mkdb. # Extra options to supply to gtkdoc-scan. # e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED" SCAN_OPTIONS = --rebuild-types --ignore-headers=$(IGNORE_HFILES) # e.g. MKDB_OPTIONS=--sgml-mode --output-format=xml MKDB_OPTIONS = --sgml-mode --output-format=xml # Extra options to supply to gtkdoc-mktmpl # e.g. MKTMPL_OPTIONS=--only-section-tmpl MKTMPL_OPTIONS = # Extra options to supply to gtkdoc-fixref. Not normally needed. # e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html FIXXREF_OPTIONS = # Used for dependencies. The docs will be rebuilt if any of these change. # e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h # e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c HFILE_GLOB = \ $(top_srcdir)/libinfinity/communication/*.h \ $(top_srcdir)/libinfinity/common/*.h \ $(top_srcdir)/libinfinity/adopted/*.h \ $(top_srcdir)/libinfinity/client/*.h \ $(top_srcdir)/libinfinity/server/*.h CFILE_GLOB = \ $(top_srcdir)/libinfinity/communication/*.c \ $(top_srcdir)/libinfinity/common/*.c \ $(top_srcdir)/libinfinity/adopted/*.c \ $(top_srcdir)/libinfinity/client/*.c \ $(top_srcdir)/libinfinity/server/*.c # Images to copy into HTML directory. # e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png HTML_IMAGES = # Extra SGML files that are included by $(DOC_MAIN_SGML_FILE). # e.g. content_files=running.sgml building.sgml changes-2.0.sgml content_files = \ ../version.xml \ ../api_version.xml \ compiling.sgml # SGML files where gtk-doc abbrevations (#GtkWidget) are expanded # These files must be listed here *and* in content_files # e.g. expand_content_files=running.sgml expand_content_files = # CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library. # Only needed if you are using gtkdoc-scangobj to dynamically query widget # signals and properties. # e.g. INCLUDES=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS) # e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib) #INCLUDES=$(infinity_CFLAGS) AM_CPPFLAGS = $(infinity_CFLAGS) GTKDOC_LIBS = \ $(infinity_LIBS) \ $(top_builddir)/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la @GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_CC = $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_LD = $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) @GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) @GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_RUN = @GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_RUN = $(LIBTOOL) --mode=execute # We set GPATH here; this gives us semantics for GNU make # which are more like other make's VPATH, when it comes to # whether a source that is a target of one rule is then # searched for in VPATH/GPATH. # GPATH = $(srcdir) TARGET_DIR = $(HTML_DIR)/$(DOC_MODULE) SETUP_FILES = \ $(content_files) \ $(DOC_MAIN_SGML_FILE) \ $(DOC_MODULE)-sections.txt \ $(DOC_MODULE)-overrides.txt # This includes the standard gtk-doc make rules, copied by gtkdocize. # Other files to distribute # e.g. EXTRA_DIST += version.xml.in EXTRA_DIST = $(HTML_IMAGES) $(SETUP_FILES) DOC_STAMPS = setup-build.stamp scan-build.stamp tmpl-build.stamp sgml-build.stamp \ html-build.stamp pdf-build.stamp \ tmpl.stamp sgml.stamp html.stamp pdf.stamp SCANOBJ_FILES = \ $(DOC_MODULE).args \ $(DOC_MODULE).hierarchy \ $(DOC_MODULE).interfaces \ $(DOC_MODULE).prerequisites \ $(DOC_MODULE).signals REPORT_FILES = \ $(DOC_MODULE)-undocumented.txt \ $(DOC_MODULE)-undeclared.txt \ $(DOC_MODULE)-unused.txt CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) @ENABLE_GTK_DOC_TRUE@@GTK_DOC_BUILD_HTML_FALSE@HTML_BUILD_STAMP = @ENABLE_GTK_DOC_TRUE@@GTK_DOC_BUILD_HTML_TRUE@HTML_BUILD_STAMP = html-build.stamp @ENABLE_GTK_DOC_TRUE@@GTK_DOC_BUILD_PDF_FALSE@PDF_BUILD_STAMP = @ENABLE_GTK_DOC_TRUE@@GTK_DOC_BUILD_PDF_TRUE@PDF_BUILD_STAMP = pdf-build.stamp #### setup #### GTK_DOC_V_SETUP = $(GTK_DOC_V_SETUP_$(V)) GTK_DOC_V_SETUP_ = $(GTK_DOC_V_SETUP_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_SETUP_0 = @echo " DOC Preparing build"; #### scan #### GTK_DOC_V_SCAN = $(GTK_DOC_V_SCAN_$(V)) GTK_DOC_V_SCAN_ = $(GTK_DOC_V_SCAN_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_SCAN_0 = @echo " DOC Scanning header files"; GTK_DOC_V_INTROSPECT = $(GTK_DOC_V_INTROSPECT_$(V)) GTK_DOC_V_INTROSPECT_ = $(GTK_DOC_V_INTROSPECT_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_INTROSPECT_0 = @echo " DOC Introspecting gobjects"; #### templates #### GTK_DOC_V_TMPL = $(GTK_DOC_V_TMPL_$(V)) GTK_DOC_V_TMPL_ = $(GTK_DOC_V_TMPL_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_TMPL_0 = @echo " DOC Rebuilding template files"; #### xml #### GTK_DOC_V_XML = $(GTK_DOC_V_XML_$(V)) GTK_DOC_V_XML_ = $(GTK_DOC_V_XML_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_XML_0 = @echo " DOC Building XML"; #### html #### GTK_DOC_V_HTML = $(GTK_DOC_V_HTML_$(V)) GTK_DOC_V_HTML_ = $(GTK_DOC_V_HTML_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_HTML_0 = @echo " DOC Building HTML"; GTK_DOC_V_XREF = $(GTK_DOC_V_XREF_$(V)) GTK_DOC_V_XREF_ = $(GTK_DOC_V_XREF_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_XREF_0 = @echo " DOC Fixing cross-references"; #### pdf #### GTK_DOC_V_PDF = $(GTK_DOC_V_PDF_$(V)) GTK_DOC_V_PDF_ = $(GTK_DOC_V_PDF_$(AM_DEFAULT_VERBOSITY)) GTK_DOC_V_PDF_0 = @echo " DOC Building PDF"; # Files not to distribute # for --rebuild-types in $(SCAN_OPTIONS), e.g. $(DOC_MODULE).types # for --rebuild-sections in $(SCAN_OPTIONS) e.g. $(DOC_MODULE)-sections.txt DISTCLEANFILES = libinfinity-$(LIBINFINITY_API_VERSION).types version.xml api_version.xml all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/gtk-doc.make $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu docs/reference/libinfinity/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu docs/reference/libinfinity/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_srcdir)/gtk-doc.make: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook check-am: all-am check: check-am all-am: Makefile all-local installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -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) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-local mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-local dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-data-local install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic \ maintainer-clean-local mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-local .MAKE: install-am install-strip .PHONY: all all-am all-local check check-am clean clean-generic \ clean-libtool clean-local cscopelist-am ctags-am dist-hook \ distclean distclean-generic distclean-libtool distclean-local \ distdir dvi dvi-am html html-am info info-am install \ install-am install-data install-data-am install-data-local \ install-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ maintainer-clean-local mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-local @ENABLE_GTK_DOC_TRUE@all-local: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) @ENABLE_GTK_DOC_FALSE@all-local: docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) $(REPORT_FILES): sgml-build.stamp setup-build.stamp: -$(GTK_DOC_V_SETUP)if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ files=`echo $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types`; \ if test "x$$files" != "x" ; then \ for file in $$files ; do \ test -f $(abs_srcdir)/$$file && \ cp -pu $(abs_srcdir)/$$file $(abs_builddir)/$$file || true; \ done; \ fi; \ test -d $(abs_srcdir)/tmpl && \ { cp -rp $(abs_srcdir)/tmpl $(abs_builddir)/; \ chmod -R u+w $(abs_builddir)/tmpl; } \ fi $(AM_V_at)touch setup-build.stamp scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB) $(GTK_DOC_V_SCAN)_source_dir='' ; \ for i in $(DOC_SOURCE_DIR) ; do \ _source_dir="$${_source_dir} --source-dir=$$i" ; \ done ; \ gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES) $(GTK_DOC_V_INTROSPECT)if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null 2>&1 ; then \ scanobj_options=""; \ gtkdoc-scangobj 2>&1 --help | grep >/dev/null "\-\-verbose"; \ if test "$(?)" = "0"; then \ if test "x$(V)" = "x1"; then \ scanobj_options="--verbose"; \ fi; \ fi; \ CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \ gtkdoc-scangobj $(SCANGOBJ_OPTIONS) $$scanobj_options --module=$(DOC_MODULE); \ else \ for i in $(SCANOBJ_FILES) ; do \ test -f $$i || touch $$i ; \ done \ fi $(AM_V_at)touch scan-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp @true tmpl-build.stamp: setup-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt $(GTK_DOC_V_TMPL)gtkdoc-mktmpl --module=$(DOC_MODULE) $(MKTMPL_OPTIONS) $(AM_V_at)if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ if test -w $(abs_srcdir) ; then \ cp -rp $(abs_builddir)/tmpl $(abs_srcdir)/; \ fi \ fi $(AM_V_at)touch tmpl-build.stamp tmpl.stamp: tmpl-build.stamp @true $(srcdir)/tmpl/*.sgml: @true sgml-build.stamp: tmpl.stamp $(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml $(expand_content_files) $(GTK_DOC_V_XML)-chmod -R u+w $(srcdir) && _source_dir='' ; \ for i in $(DOC_SOURCE_DIR) ; do \ _source_dir="$${_source_dir} --source-dir=$$i" ; \ done ; \ gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $${_source_dir} $(MKDB_OPTIONS) $(AM_V_at)touch sgml-build.stamp sgml.stamp: sgml-build.stamp @true html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) $(GTK_DOC_V_HTML)rm -rf html && mkdir html && \ mkhtml_options=""; \ gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-verbose"; \ if test "$(?)" = "0"; then \ if test "x$(V)" = "x1"; then \ mkhtml_options="$$mkhtml_options --verbose"; \ fi; \ fi; \ gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \ if test "$(?)" = "0"; then \ mkhtml_options="$$mkhtml_options --path=\"$(abs_srcdir)\""; \ fi; \ cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) -@test "x$(HTML_IMAGES)" = "x" || \ for file in $(HTML_IMAGES) ; do \ if test -f $(abs_srcdir)/$$file ; then \ cp $(abs_srcdir)/$$file $(abs_builddir)/html; \ fi; \ if test -f $(abs_builddir)/$$file ; then \ cp $(abs_builddir)/$$file $(abs_builddir)/html; \ fi; \ done; $(GTK_DOC_V_XREF)gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) $(AM_V_at)touch html-build.stamp pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) $(GTK_DOC_V_PDF)rm -f $(DOC_MODULE).pdf && \ mkpdf_options=""; \ gtkdoc-mkpdf 2>&1 --help | grep >/dev/null "\-\-verbose"; \ if test "$(?)" = "0"; then \ if test "x$(V)" = "x1"; then \ mkpdf_options="$$mkpdf_options --verbose"; \ fi; \ fi; \ if test "x$(HTML_IMAGES)" != "x"; then \ for img in $(HTML_IMAGES); do \ part=`dirname $$img`; \ echo $$mkpdf_options | grep >/dev/null "\-\-imgdir=$$part "; \ if test $$? != 0; then \ mkpdf_options="$$mkpdf_options --imgdir=$$part"; \ fi; \ done; \ fi; \ gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_options $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS) $(AM_V_at)touch pdf-build.stamp ############## clean-local: @rm -f *~ *.bak @rm -rf .libs distclean-local: @rm -rf xml html $(REPORT_FILES) $(DOC_MODULE).pdf \ $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ rm -f $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types; \ rm -rf tmpl; \ fi maintainer-clean-local: @rm -rf xml html install-data-local: @installfiles=`echo $(builddir)/html/*`; \ if test "$$installfiles" = '$(builddir)/html/*'; \ then echo 1>&2 'Nothing to install' ; \ else \ if test -n "$(DOC_MODULE_VERSION)"; then \ installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ else \ installdir="$(DESTDIR)$(TARGET_DIR)"; \ fi; \ $(mkinstalldirs) $${installdir} ; \ for i in $$installfiles; do \ echo ' $(INSTALL_DATA) '$$i ; \ $(INSTALL_DATA) $$i $${installdir}; \ done; \ if test -n "$(DOC_MODULE_VERSION)"; then \ mv -f $${installdir}/$(DOC_MODULE).devhelp2 \ $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \ fi; \ $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir}; \ fi uninstall-local: @if test -n "$(DOC_MODULE_VERSION)"; then \ installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ else \ installdir="$(DESTDIR)$(TARGET_DIR)"; \ fi; \ rm -rf $${installdir} # # Require gtk-doc when making dist # @ENABLE_GTK_DOC_TRUE@dist-check-gtkdoc: docs @ENABLE_GTK_DOC_FALSE@dist-check-gtkdoc: @ENABLE_GTK_DOC_FALSE@ @echo "*** gtk-doc must be installed and enabled in order to make dist" @ENABLE_GTK_DOC_FALSE@ @false dist-hook: dist-check-gtkdoc dist-hook-local @mkdir $(distdir)/tmpl @mkdir $(distdir)/html @-cp ./tmpl/*.sgml $(distdir)/tmpl @cp ./html/* $(distdir)/html @-cp ./$(DOC_MODULE).pdf $(distdir)/ @-cp ./$(DOC_MODULE).types $(distdir)/ @-cp ./$(DOC_MODULE)-sections.txt $(distdir)/ @cd $(distdir) && rm -f $(DISTCLEANFILES) @$(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html .PHONY : dist-hook-local docs # Comment this out if you want your docs-status tested during 'make check' #TESTS = $(GTKDOC_CHECK) # 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: libinfinity-0.5.5/docs/reference/libinfinity/libinfinity-0.5-overrides.txt0000644000175000017500000000000012264763732023553 00000000000000libinfinity-0.5.5/docs/reference/libinfinity/tmpl/0000755000175000017500000000000012264766270017240 500000000000000libinfinity-0.5.5/docs/reference/libinfinity/tmpl/infd-xml-server.sgml0000644000175000017500000000177112264766270023074 00000000000000 InfdXmlServer @infdxmlserver: the object which received the signal. @arg1: @parent: @close: @new_connection: @INFD_XML_SERVER_CLOSED: @INFD_XML_SERVER_CLOSING: @INFD_XML_SERVER_OPEN: @INFD_XML_SERVER_OPENING: @server: @server: @connection: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-communication-object.sgml0000644000175000017500000000167612264766270024741 00000000000000 InfCommunicationObject @INF_COMMUNICATION_SCOPE_PTP: @INF_COMMUNICATION_SCOPE_GROUP: @received: @enqueued: @sent: @object: @conn: @node: @error: @Returns: @object: @conn: @node: @object: @conn: @node: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-communication-central-factory.sgml0000644000175000017500000000111712264766270026556 00000000000000 InfCommunicationCentralFactory @void: @Returns: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-adopted-session.sgml0000644000175000017500000000337512264766270023727 00000000000000 InfAdoptedSession @INF_ADOPTED_SESSION_ERROR_NO_SUCH_USER: @INF_ADOPTED_SESSION_ERROR_MISSING_OPERATION: @INF_ADOPTED_SESSION_ERROR_INVALID_REQUEST: @INF_ADOPTED_SESSION_ERROR_MISSING_STATE_VECTOR: @INF_ADOPTED_SESSION_ERROR_FAILED: @xml_to_request: @request_to_xml: @session: @Returns: @session: @Returns: @session: @request: @session: @user: @n: @session: @user: @n: @session: @xml: @diff_vec: @user: @time: @operation: @error: @Returns: @session: @request: @diff_vec: @xml: @operation: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/libinfinity-0.6-unused.sgml0000644000175000017500000007457212264766270024205 00000000000000 InfAclSheet InfAclTable InfAclUserListRequest InfBrowserRequest InfCentralMethod InfCommunicationCentralFactory InfConnectionManager InfKeepalive InfMethodManager InfNetObject InfUserListRequest @infacltable: the object which received the signal. @arg1: @arg2: @infacltable: the object which received the signal. @arg1: @user_added: @acl_changed: @infacluserlistrequest: the object which received the signal. @arg1: @finished: @infbrowser: the object which received the signal. @arg1: @infbrowser: the object which received the signal. @arg1: @arg2: @infbrowserrequest: the object which received the signal. @arg1: @finished: @infchatsession: the object which received the signal. @arg1: @infchatsession: the object which received the signal. @arg1: @type: @user: @text: @length: @time: @INF_CHAT_SESSION_MESSAGE_NORMAL: @INF_CHAT_SESSION_MESSAGE_EMOTE: @INF_CHAT_SESSION_MESSAGE_USERJOIN: @INF_CHAT_SESSION_MESSAGE_USERPART: @network: @name: @open: @join: @finalize: @receive_msg: @receive_ctrl: @add_connection: @remove_connection: @send_to_net: @INF_CONNECTION_MANAGER_POINT_TO_POINT: @INF_CONNECTION_MANAGER_NETWORK: @INF_CONNECTION_MANAGER_GROUP: @socket: @event: @user_data: @parent_class: @parent: @received: @enqueued: @sent: @user: @user_data: @INF_USER_JOIN_ERROR_NAME_IN_USE: @INF_USER_JOIN_ERROR_ID_PROVIDED: @INF_USER_JOIN_ERROR_NO_SUCH_USER: @INF_USER_JOIN_ERROR_STATUS_PROVIDED: @INF_USER_JOIN_ERROR_FAILED: @infuserlistrequest: the object which received the signal. @arg1: @finished: @INF_USER_STATUS_CHANGE_ERROR_NO_SUCH_USER: @INF_USER_STATUS_CHANGE_ERROR_NOT_JOINED: @INF_USER_STATUS_CHANGE_ERROR_INVALID_STATUS: @INF_USER_STATUS_CHANGE_ERROR_FAILED: @infcbrowser: the object which received the signal. @arg1: @arg2: @infcbrowser: the object which received the signal. @arg1: @arg2: @infcbrowser: the object which received the signal. @arg1: @infcbrowser: the object which received the signal. @arg1: @infcbrowser: the object which received the signal. @arg1: @infcbrowser: the object which received the signal. @arg1: @arg2: @INFC_BROWSER_NODE_SYNC: @INFC_BROWSER_NODE_DELETED: @INFC_BROWSER_NODE_ADDED: @INFC_BROWSER_NODE_MOVED: @INFC_BROWSER_NODE_COPIED: @INFC_BROWSER_NODE_INHERIT: @INFC_BROWSER_DISCONNECTED: @INFC_BROWSER_CONNECTING: @INFC_BROWSER_CONNECTED: @infcexplorerequest: the object which received the signal. @infcexplorerequest: the object which received the signal. @arg1: @infcexplorerequest: the object which received the signal. @arg1: @arg2: @infcnoderequest: the object which received the signal. @arg1: @infcrequest: the object which received the signal. @arg1: @parent_class: @failed: @unused1: @usused2: @infcuserrequest: the object which received the signal. @arg1: @infddirectory: the object which received the signal. @arg1: @arg2: @infddirectory: the object which received the signal. @arg1: @infddirectory: the object which received the signal. @arg1: @infddirectory: the object which received the signal. @arg1: @arg2: @table: @user: @active: @Returns: @table: @iter: @table: @iter: @Returns: @table: @Returns: @table: @iter: @user: @Returns: @table: @iter: @Returns: @table: @user_id: @Returns: @table: @n_users: @Returns: @table: @iter: @sheet: @table: @iter: @sheet_set: @void: @Returns: @table: @sheet: @xml: @error: @Returns: @table: @xml: @error: @Returns: @table: @sheet_set: @xml: @table: @sheet: @xml: @user: @Returns: @user: @xml: @error: @Returns: @request: @error: @user_id: @user_name: @Returns: @user: @xml: @include_times: @operation: @against: @Returns: @operation: @with: @buffer: @Returns: @request: @against: @Returns: @browser: @user: @browser: @Returns: @browser: @n_users: @Returns: @browser: @iter: @Returns: @browser: @iter: @Returns: @browser: @user_id: @Returns: @browser: @Returns: @request: @iter: @error: @instance: @connection: @instance: @dc: @group: @publisher_conn: @Returns: @dc: @group: @Returns: @instance: @connection: @xml: @instance: @scope: @can_forward: @connection: @xml: @inst: @connection: @instance: @except: @xml: @dest: @src: @Returns: @filename: @current: @error: @Returns: @certs: @n_certs: @file: @error: @Returns: @session: @n: @Returns: @session: @Returns: @message: @Returns: @message: @session: @user: @message: @session: @user: @message: @method: @connection: @group: @conn: @prnt: @Returns: @group: @connection: @g: @network: @Returns: @group: @Returns: @group: @Returns: @grp: @Returns: @group: @conn: @Returns: @grp: @network: @id: @Returns: @group: @grp: @conn: @g: @connection: @xml: @group: @except: @xml: @group: @object: @group: @manager: @group_name: @publisher_conn: @object: @meth: @Returns: @manager: @group_name: @publisher: @Returns: @manager: @group_name: @publisher_id: @Returns: @Returns: @manager: @group_name: @net_object: @methods: @Returns: @group: @connection: @parent: @group: @connection: @xml: @group: @connection: @scope: @xml: @group: @connection: @io: @socket: @events: @func: @user_data: @notify: @keepalive: @socket: @error: @Returns: @keepalive: @Returns: @keepalive: @void: @Returns: @use_keepalive: @keepalive_time: @keepalive_interval: @keepalive_probes: @Returns: @manager: @method: @Returns: @manager: @Returns: @manager: @name: @Returns: @manager: @network: @Returns: @manager: @network: @method_name: @Returns: @search_path: @Returns: @object: @conn: @node: @object: @conn: @node: @error: @Returns: @object: @conn: @node: @context: @mech: @session_data: @error: @Returns: @context: @mech: @session_data: @error: @Returns: @session: @Returns: @Returns: @code: @Returns: @request: @error: @Returns: @code: @Returns: @browser: @parent: @name: @plugin: @initial_subscribe: @Returns: @browser: @parent: @name: @plugin: @session: @initial_subscribe: @Returns: @browser: @parent: @name: @Returns: @browser: @Returns: @browser: @Returns: @iter: @Returns: @browser: @iter: @Returns: @iter: @browser: @request: @iter: @Returns: @browser: @request: @iter: @Returns: @browser: @iter: @Returns: @browser: @iter: @Returns: @browser: @iter: @Returns: @browser: @iter: @Returns: @browser: @iter: @Returns: @browser: @iter: @Returns: @browser: @iter: @Returns: @browser: @iter: @Returns: @browser: @iter: @Returns: @browser: @iter: @Returns: @browser: @iter: @browser: @iter: @Returns: @browser: @iter: @Returns: @browser: @iter: @Returns: @browser: @iter: @Returns: @browser: @iter: @Returns: @request: @error: @Returns: @request: @Returns: @request: @Returns: @request: @iter: @request: @error: @request: @Returns: @request: @Returns: @proxy: @Returns: @proxy: @params: @n_params: @error: @Returns: @proxy: @user: @error: @Returns: @proxy: @user: @status: @error: @Returns: @request: @user: @directory: @parent: @name: @plugin: @iter: @error: @Returns: @directory: @parent: @name: @iter: @error: @Returns: @directory: @connection: @Returns: @directory: @Returns: @iter: @Returns: @iter: @directory: @iter: @error: @Returns: @directory: @iter: @Returns: @directory: @iter: @Returns: @directory: @iter: @Returns: @directory: @iter: @Returns: @directory: @iter: @Returns: @directory: @iter: @Returns: @directory: @iter: @Returns: @directory: @iter: @Returns: @directory: @iter: @directory: @iter: @error: @Returns: @directory: @iter: @Returns: @directory: @iter: @error: @Returns: @proxy: @params: @n_params: @error: @Returns: @proxy: @Returns: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-keepalive.sgml0000644000175000017500000000151312264766270022563 00000000000000 InfKeepalive @use_keepalive: @keepalive_time: @keepalive_interval: @keepalive_probes: @Returns: @void: @Returns: @keepalive: @Returns: @keepalive: @keepalive: @socket: @error: @Returns: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-request.sgml0000644000175000017500000000074312264766270022312 00000000000000 InfRequest @fail: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-adopted-session-replay.sgml0000644000175000017500000000301412264766270025207 00000000000000 InfAdoptedSessionReplay @INF_ADOPTED_SESSION_REPLAY_ERROR_BAD_FILE: @INF_ADOPTED_SESSION_REPLAY_ERROR_BAD_XML: @INF_ADOPTED_SESSION_REPLAY_ERROR_BAD_DOCUMENT: @INF_ADOPTED_SESSION_REPLAY_ERROR_BAD_SESSION_TYPE: @INF_ADOPTED_SESSION_REPLAY_ERROR_BAD_FORMAT: @INF_ADOPTED_SESSION_REPLAY_ERROR_UNEXPECTED_EOF: @void: @Returns: @replay: @filename: @plugin: @error: @Returns: @replay: @Returns: @replay: @error: @Returns: @replay: @error: @Returns: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/infc-note-plugin.sgml0000644000175000017500000000062412264766270023224 00000000000000 InfcNotePlugin @user_data: @note_type: @session_new: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-xml-util.sgml0000644000175000017500000000566112264766270022401 00000000000000 InfXmlUtil @xml: @text: @bytes: @xml: @bytes: @chars: @error: @Returns: @xml: @attribute: @Returns: @xml: @attribute: @error: @Returns: @xml: @attribute: @result: @error: @Returns: @xml: @attribute: @result: @error: @Returns: @xml: @attribute: @result: @error: @Returns: @xml: @attribute: @result: @error: @Returns: @xml: @attribute: @result: @error: @Returns: @xml: @attribute: @result: @error: @Returns: @xml: @attribute: @result: @error: @Returns: @xml: @attribute: @result: @error: @Returns: @xml: @attribute: @result: @error: @Returns: @xml: @attribute: @result: @error: @Returns: @xml: @attribute: @value: @xml: @attribute: @value: @xml: @attribute: @value: @xml: @attribute: @value: @xml: @attribute: @value: @xml: @attribute: @value: @xml: @Returns: @error: @name_space: @name: @Returns: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-adopted-state-vector.sgml0000644000175000017500000000450512264766270024660 00000000000000 InfAdoptedStateVector @INF_ADOPTED_STATE_VECTOR_BAD_FORMAT: @INF_ADOPTED_STATE_VECTOR_FAILED: @id: @value: @user_data: @void: @Returns: @void: @Returns: @vec: @Returns: @vec: @vec: @id: @Returns: @vec: @id: @value: @vec: @id: @value: @vec: @func: @user_data: @first: @second: @Returns: @first: @second: @Returns: @first: @second: @inc_component: @Returns: @first: @second: @Returns: @vec: @Returns: @str: @error: @Returns: @vec: @orig: @Returns: @str: @orig: @error: @Returns: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-net-object.sgml0000644000175000017500000000134512264766270022653 00000000000000 InfNetObject @parent: @received: @enqueued: @sent: @object: @conn: @node: @error: @Returns: @object: @conn: @node: @object: @conn: @node: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-communication-group.sgml0000644000175000017500000000434712264766270024625 00000000000000 InfCommunicationGroup @infcommunicationgroup: the object which received the signal. @arg1: @infcommunicationgroup: the object which received the signal. @arg1: @member_added: @member_removed: @get_method: @get_publisher_id: @group: @Returns: @group: @Returns: @group: @target: @group: @connection: @Returns: @group: @connection: @xml: @group: @xml: @group: @connection: @group: @network: @Returns: @grp: @conn: @Returns: @group: @for_connection: @Returns: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-acl-sheet.sgml0000644000175000017500000000447112264766270022471 00000000000000 InfAclSheet @INF_ACL_CAN_SUBSCRIBE_SESSION: @INF_ACL_CAN_JOIN_USER: @INF_ACL_CAN_QUERY_USER_LIST: @INF_ACL_CAN_QUERY_ACL: @INF_ACL_CAN_SET_ACL: @sheets: @n_sheets: @user_id: @user_name: @Returns: @user: @Returns: @user: @xml: @error: @Returns: @user: @xml: @include_times: @sheet: @Returns: @sheet: @xml: @mask: @perms: @error: @Returns: @mask: @perms: @xml: @void: @Returns: @sheets: @n_sheets: @Returns: @sheet_set: @Returns: @sheet_set: @sheet_set: @user: @Returns: @sheet_set: @sheet: @sheet_set: @user: @Returns: @sheet_set: @user: @Returns: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-adopted-no-operation.sgml0000644000175000017500000000104312264766270024644 00000000000000 InfAdoptedNoOperation @void: @Returns: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-browser-iter.sgml0000644000175000017500000000102412264766270023237 00000000000000 InfBrowserIter @iter: @Returns: @iter: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-error.sgml0000644000175000017500000000613512264766270021754 00000000000000 InfError @INF_REQUEST_ERROR_UNKNOWN_DOMAIN: @INF_REQUEST_ERROR_REPLY_UNPROCESSED: @INF_REQUEST_ERROR_INVALID_SEQ: @INF_REQUEST_ERROR_NO_SUCH_ATTRIBUTE: @INF_REQUEST_ERROR_INVALID_NUMBER: @INF_REQUEST_ERROR_FAILED: @INF_USER_ERROR_NAME_IN_USE: @INF_USER_ERROR_ID_PROVIDED: @INF_USER_ERROR_NO_SUCH_USER: @INF_USER_ERROR_STATUS_UNAVAILABLE: @INF_USER_ERROR_NOT_JOINED: @INF_USER_ERROR_INVALID_STATUS: @INF_USER_ERROR_FAILED: @INF_DIRECTORY_ERROR_NO_WELCOME_MESSAGE: @INF_DIRECTORY_ERROR_VERSION_MISMATCH: @INF_DIRECTORY_ERROR_NODE_EXISTS: @INF_DIRECTORY_ERROR_INVALID_NAME: @INF_DIRECTORY_ERROR_NO_SUCH_NODE: @INF_DIRECTORY_ERROR_NO_SUCH_SUBSCRIPTION_REQUEST: @INF_DIRECTORY_ERROR_CHAT_DISABLED: @INF_DIRECTORY_ERROR_NOT_A_SUBDIRECTORY: @INF_DIRECTORY_ERROR_NOT_A_NOTE: @INF_DIRECTORY_ERROR_ROOT_NODE_REMOVE_ATTEMPT: @INF_DIRECTORY_ERROR_ALREADY_EXPLORED: @INF_DIRECTORY_ERROR_TOO_MUCH_CHILDREN: @INF_DIRECTORY_ERROR_TOO_FEW_CHILDREN: @INF_DIRECTORY_ERROR_TYPE_UNKNOWN: @INF_DIRECTORY_ERROR_ALREADY_SUBSCRIBED: @INF_DIRECTORY_ERROR_UNSUBSCRIBED: @INF_DIRECTORY_ERROR_NETWORK_UNSUPPORTED: @INF_DIRECTORY_ERROR_METHOD_UNSUPPORTED: @INF_DIRECTORY_ERROR_UNEXPECTED_SYNC_IN: @INF_DIRECTORY_ERROR_UNEXPECTED_MESSAGE: @INF_DIRECTORY_ERROR_NO_STORAGE: @INF_DIRECTORY_ERROR_FAILED: @INF_AUTHENTICATION_DETAIL_ERROR_AUTHENTICATION_FAILED: @INF_AUTHENTICATION_DETAIL_ERROR_USER_NOT_AUTHORIZED: @INF_AUTHENTICATION_DETAIL_ERROR_TRY_AGAIN: @INF_AUTHENTICATION_DETAIL_ERROR_SERVER_ERROR: @void: @Returns: @code: @Returns: @void: @Returns: @code: @Returns: @void: @Returns: @code: @Returns: @void: @Returns: @code: @Returns: @void: @Returns: @error: @error_code: @void: @Returns: @error: @error_code: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/infd-tcp-server.sgml0000644000175000017500000000260712264766270023061 00000000000000 InfdTcpServer @INFD_TCP_SERVER_CLOSED: @INFD_TCP_SERVER_BOUND: @INFD_TCP_SERVER_OPEN: @infdtcpserver: the object which received the signal. @arg1: @infdtcpserver: the object which received the signal. @arg1: @parent_class: @new_connection: @error: @server: @error: @Returns: @server: @error: @Returns: @server: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-communication-method.sgml0000644000175000017500000000355612264766270024752 00000000000000 InfCommunicationMethod @infcommunicationmethod: the object which received the signal. @arg1: @infcommunicationmethod: the object which received the signal. @arg1: @add_member: @remove_member: @is_member: @send_single: @send_all: @cancel_messages: @received: @enqueued: @sent: @method: @connection: @method: @connection: @method: @connection: @Returns: @method: @connection: @xml: @method: @xml: @method: @connection: @method: @connection: @xml: @Returns: @method: @connection: @xml: @method: @connection: @xml: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-simulated-connection.sgml0000644000175000017500000000250712264766270024746 00000000000000 InfSimulatedConnection @INF_SIMULATED_CONNECTION_IMMEDIATE: @INF_SIMULATED_CONNECTION_DELAYED: @INF_SIMULATED_CONNECTION_IO_CONTROLLED: @void: @Returns: @io: @Returns: @connection: @to: @connection: @mode: @connection: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-communication-factory.sgml0000644000175000017500000000142112264766270025126 00000000000000 InfCommunicationFactory @supports_method: @instantiate: @factory: @network: @method_name: @Returns: @factory: @network: @method_name: @registry: @group: @Returns: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-tcp-connection.sgml0000644000175000017500000000453512264766270023550 00000000000000 InfTcpConnection @INF_TCP_CONNECTION_CONNECTING: @INF_TCP_CONNECTION_CONNECTED: @INF_TCP_CONNECTION_CLOSED: @inftcpconnection: the object which received the signal. @arg1: @inftcpconnection: the object which received the signal. @arg1: @arg2: @inftcpconnection: the object which received the signal. @arg1: @arg2: @parent_class: @sent: @received: @error: @io: @remote_addr: @remote_port: @Returns: @io: @remote_addr: @remote_port: @error: @Returns: @connection: @error: @Returns: @connection: @connection: @data: @len: @connection: @Returns: @connection: @Returns: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/infd-acl-account-info.sgml0000644000175000017500000000257512264766270024115 00000000000000 InfdAclAccountInfo @id: @name: @Returns: @info: @Returns: @info: @info: @password: @error: @Returns: @info: @password: @Returns: @info: @fingerprint: @info: @fingerprint: @info: @xml: @error: @Returns: @info: @xml: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-discovery.sgml0000644000175000017500000000351612264766270022632 00000000000000 InfDiscovery @infdiscovery: the object which received the signal. @arg1: @infdiscovery: the object which received the signal. @arg1: @discover: @get_discovered: @resolve: @info_get_service_name: @info_get_service_type: @discovered: @undiscovered: @info: @connection: @user_data: @info: @error: @user_data: @discovery: @type: @discovery: @type: @Returns: @discovery: @info: @complete_func: @error_func: @user_data: @discovery: @info: @Returns: @discovery: @info: @Returns: @discovery: @info: @discovery: @info: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-user-list-request.sgml0000644000175000017500000000126712264766270024241 00000000000000 InfUserListRequest @infuserlistrequest: the object which received the signal. @arg1: @finished: @request: @error: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-acl.sgml0000644000175000017500000000457112264766270021364 00000000000000 InfAcl @INF_ACL_CAN_SUBSCRIBE_SESSION: @INF_ACL_CAN_JOIN_USER: @INF_ACL_CAN_QUERY_ACCOUNT_LIST: @INF_ACL_CAN_QUERY_ACL: @INF_ACL_CAN_SET_ACL: @sheets: @n_sheets: @id: @name: @Returns: @account: @Returns: @account: @xml: @error: @Returns: @account: @xml: @sheet: @Returns: @sheet: @xml: @mask: @perms: @error: @Returns: @mask: @perms: @xml: @void: @Returns: @sheets: @n_sheets: @Returns: @sheet_set: @Returns: @sheet_set: @sheet_set: @account: @Returns: @sheet_set: @sheet: @sheet_set: @account: @Returns: @sheet_set: @account: @Returns: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/libinfinity-0.3-unused.sgml0000644000175000017500000003005012264766270024161 00000000000000 InfCentralMethod InfChatSession InfCommunicationCentralFactory InfConnectionManager InfMethodManager InfNetObject @infchatsession: the object which received the signal. @arg1: @infchatsession: the object which received the signal. @arg1: @INF_CHAT_SESSION_ERROR_TYPE_INVALID: @INF_CHAT_SESSION_ERROR_NO_SUCH_USER: @INF_CHAT_SESSION_ERROR_FAILED: @type: @user: @text: @length: @time: @INF_CHAT_SESSION_MESSAGE_NORMAL: @INF_CHAT_SESSION_MESSAGE_EMOTE: @INF_CHAT_SESSION_MESSAGE_USERJOIN: @INF_CHAT_SESSION_MESSAGE_USERPART: @network: @name: @open: @join: @finalize: @receive_msg: @receive_ctrl: @add_connection: @remove_connection: @send_to_net: @INF_CONNECTION_MANAGER_POINT_TO_POINT: @INF_CONNECTION_MANAGER_NETWORK: @INF_CONNECTION_MANAGER_GROUP: @parent_class: @parent: @received: @enqueued: @sent: @user: @user_data: @INF_USER_JOIN_ERROR_NAME_IN_USE: @INF_USER_JOIN_ERROR_ID_PROVIDED: @INF_USER_JOIN_ERROR_NO_SUCH_USER: @INF_USER_JOIN_ERROR_STATUS_PROVIDED: @INF_USER_JOIN_ERROR_FAILED: @INF_USER_STATUS_CHANGE_ERROR_NO_SUCH_USER: @INF_USER_STATUS_CHANGE_ERROR_NOT_JOINED: @INF_USER_STATUS_CHANGE_ERROR_INVALID_STATUS: @INF_USER_STATUS_CHANGE_ERROR_FAILED: @instance: @connection: @instance: @dc: @group: @publisher_conn: @Returns: @dc: @group: @Returns: @instance: @connection: @xml: @instance: @scope: @can_forward: @connection: @xml: @inst: @connection: @instance: @except: @xml: @session: @n: @Returns: @session: @Returns: @message: @Returns: @message: @backlog_size: @Returns: @session: @user: @message: @session: @user: @message: @session: @log_file: @error: @Returns: @method: @connection: @group: @conn: @prnt: @Returns: @group: @connection: @g: @network: @Returns: @group: @Returns: @group: @Returns: @grp: @Returns: @group: @conn: @Returns: @grp: @network: @id: @Returns: @group: @grp: @conn: @g: @connection: @xml: @group: @except: @xml: @group: @object: @group: @manager: @group_name: @publisher_conn: @object: @meth: @Returns: @manager: @group_name: @publisher: @Returns: @manager: @group_name: @publisher_id: @Returns: @Returns: @manager: @group_name: @net_object: @methods: @Returns: @group: @connection: @parent: @group: @connection: @xml: @group: @connection: @scope: @xml: @group: @connection: @manager: @method: @Returns: @manager: @Returns: @manager: @name: @Returns: @manager: @network: @Returns: @manager: @network: @method_name: @Returns: @search_path: @Returns: @object: @conn: @node: @object: @conn: @node: @error: @Returns: @object: @conn: @node: @session: @Returns: @Returns: @code: @Returns: @Returns: @code: @Returns: @browser: @Returns: @proxy: @user: @error: @Returns: @proxy: @user: @status: @error: @Returns: @directory: @Returns: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-communication-manager.sgml0000644000175000017500000000207512264766270025077 00000000000000 InfCommunicationManager @void: @Returns: @manager: @group_name: @methods: @Returns: @manager: @group_name: @publisher_conn: @method: @Returns: @manager: @factory: @manager: @network: @method_name: @Returns: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-adopted-undo-grouping.sgml0000644000175000017500000000307112264766270025032 00000000000000 InfAdoptedUndoGrouping @infadoptedundogrouping: the object which received the signal. @arg1: @arg2: @Returns: @group_requests: @void: @Returns: @grouping: @Returns: @grouping: @algorithm: @user: @grouping: @allow_group_with_prev: @grouping: @allow_group_with_next: @grouping: @Returns: @grouping: @Returns: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-discovery-avahi.sgml0000644000175000017500000000232712264766270023717 00000000000000 InfDiscoveryAvahi @io: @manager: @creds: @sasl_context: @sasl_mechanisms: @Returns: @discovery: @plcy: @discovery: @Returns: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/infd-directory.sgml0000644000175000017500000001103312264766270022764 00000000000000 InfdDirectory @infddirectory: the object which received the signal. @arg1: @arg2: @infddirectory: the object which received the signal. @arg1: @infddirectory: the object which received the signal. @arg1: @infddirectory: the object which received the signal. @arg1: @arg2: @parent_class: @node_added: @node_removed: @add_session: @remove_session: @Param1: @Param2: @iter: @Returns: @iter: @io: @storage: @comm_manager: @Returns: @directory: @Returns: @directory: @Returns: @directory: @Returns: @directory: @plugin: @Returns: @directory: @note_type: @Returns: @directory: @connection: @Returns: @directory: @func: @user_data: @directory: @iter: @Returns: @directory: @iter: @Returns: @directory: @iter: @directory: @iter: @Returns: @directory: @iter: @Returns: @directory: @iter: @Returns: @directory: @iter: @error: @Returns: @directory: @iter: @Returns: @directory: @parent: @name: @iter: @error: @Returns: @directory: @parent: @name: @plugin: @iter: @error: @Returns: @directory: @iter: @error: @Returns: @directory: @iter: @Returns: @directory: @iter: @Returns: @directory: @iter: @error: @Returns: @directory: @iter: @Returns: @directory: @iter: @error: @Returns: @directory: @enable: @directory: @Returns: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/infd-user-request.sgml0000644000175000017500000000066012264766270023430 00000000000000 InfdUserRequest libinfinity-0.5.5/docs/reference/libinfinity/tmpl/infc-browser.sgml0000644000175000017500000001312412264766270022445 00000000000000 InfcBrowser @INFC_BROWSER_DISCONNECTED: @INFC_BROWSER_CONNECTING: @INFC_BROWSER_CONNECTED: @infcbrowser: the object which received the signal. @arg1: @arg2: @infcbrowser: the object which received the signal. @arg1: @arg2: @infcbrowser: the object which received the signal. @arg1: @infcbrowser: the object which received the signal. @arg1: @infcbrowser: the object which received the signal. @arg1: @infcbrowser: the object which received the signal. @arg1: @arg2: @error: @node_added: @node_removed: @subscribe_session: @begin_explore: @begin_subscribe: @io: @comm_manager: @connection: @Returns: @browser: @Returns: @browser: @Returns: @browser: @Returns: @browser: @plugin: @Returns: @browser: @note_type: @Returns: @browser: @iter: @browser: @iter: @Returns: @browser: @iter: @Returns: @browser: @iter: @Returns: @browser: @iter: @Returns: @browser: @iter: @Returns: @browser: @iter: @Returns: @browser: @iter: @Returns: @browser: @iter: @Returns: @browser: @iter: @Returns: @browser: @parent: @name: @Returns: @browser: @parent: @name: @plugin: @initial_subscribe: @Returns: @browser: @parent: @name: @plugin: @session: @initial_subscribe: @Returns: @browser: @iter: @Returns: @browser: @iter: @Returns: @browser: @iter: @Returns: @browser: @iter: @Returns: @browser: @iter: @Returns: @browser: @iter: @Returns: @browser: @iter: @Returns: @browser: @iter: @Returns: @browser: @iter: @Returns: @browser: @iter: @Returns: @browser: @request: @iter: @Returns: @browser: @request: @iter: @Returns: @browser: @iter: @Returns: @browser: @Returns: @browser: @Returns: @browser: @Returns: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/infc-acl-account-list-request.sgml0000644000175000017500000000141512264766270025612 00000000000000 InfcAclAccountListRequest @request: @total: @req: @Returns: @request: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-protocol.sgml0000644000175000017500000000114712264766270022462 00000000000000 InfProtocol @void: @Returns: @version: @major: @minor: @error: @Returns: @void: @Returns: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-cert-util.sgml0000644000175000017500000000252512264766270022532 00000000000000 InfCertUtil @filename: @current: @error: @Returns: @certs: @n_certs: @file: @error: @Returns: @dest: @src: @Returns: @cert: @oid: @index: @Returns: @crt: @oid: @index: @Returns: @cert: @Returns: @cert: @Returns: @cert: @Returns: @cert: @algo: @Returns: @cert: @Returns: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-adopted-algorithm.sgml0000644000175000017500000000547112264766270024231 00000000000000 InfAdoptedAlgorithm @infadoptedalgorithm: the object which received the signal. @arg1: @arg2: @infadoptedalgorithm: the object which received the signal. @arg1: @arg2: @infadoptedalgorithm: the object which received the signal. @arg1: @arg2: @infadoptedalgorithm: the object which received the signal. @arg1: @arg2: @arg3: @can_undo_changed: @can_redo_changed: @execute_request: @apply_request: @user_table: @buffer: @Returns: @user_table: @buffer: @max_total_log_size: @Returns: @algorithm: @Returns: @algorithm: @user: @operation: @Returns: @algorithm: @user: @operation: @Returns: @algorithm: @user: @Returns: @algorithm: @user: @Returns: @algorithm: @request: @to: @Returns: @algorithm: @request: @algorithm: @user: @Returns: @algorithm: @user: @Returns: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-acl-table.sgml0000644000175000017500000000436412264766270022451 00000000000000 InfAclTable @infacltable: the object which received the signal. @arg1: @arg2: @infacltable: the object which received the signal. @arg1: @user_added: @acl_changed: @void: @Returns: @table: @user: @active: @Returns: @table: @Returns: @table: @user_id: @Returns: @table: @n_users: @Returns: @table: @iter: @sheet: @table: @iter: @sheet_set: @table: @iter: @Returns: @table: @iter: @user: @Returns: @table: @iter: @Returns: @table: @iter: @table: @sheet: @xml: @table: @sheet: @xml: @error: @Returns: @table: @sheet_set: @xml: @table: @xml: @error: @Returns: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/infd-storage.sgml0000644000175000017500000000275412264766270022436 00000000000000 infd-storage @parent: @read_subdirectory: @create_subdirectory: @remove_node: @INFD_STORAGE_NODE_SUBDIRECTORY: @INFD_STORAGE_NODE_NOTE: @path: @Returns: @path: @identifier: @Returns: @node: @Returns: @node: @node_list: @storage: @path: @error: @Returns: @storage: @path: @error: @Returns: @storage: @identifier: @path: @error: @Returns: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/infd-filesystem-storage.sgml0000644000175000017500000000174112264766270024613 00000000000000 InfdFilesystemStorage @INFD_FILESYSTEM_STORAGE_ERROR_INVALID_PATH: @INFD_FILESYSTEM_STORAGE_ERROR_REMOVE_FILES: @INFD_FILESYSTEM_STORAGE_ERROR_FAILED: @parent_class: @root_directory: @Returns: @storage: @identifier: @path: @mode: @error: @Returns: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/infd-server-pool.sgml0000644000175000017500000000221312264766270023235 00000000000000 InfdServerPool @server: @user_data: @parent_class: @directory: @Returns: @server_pool: @server: @server_pool: @server: @publisher: @server_pool: @server: @server_pool: @func: @user_data: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-xmpp-manager.sgml0000644000175000017500000000244112264766270023213 00000000000000 InfXmppManager @infxmppmanager: the object which received the signal. @arg1: @infxmppmanager: the object which received the signal. @arg1: @add_connection: @remove_connection: @void: @Returns: @manager: @address: @port: @Returns: @manager: @connection: @Returns: @manager: @connection: @manager: @connection: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-adopted-request-log.sgml0000644000175000017500000000513612264766270024510 00000000000000 InfAdoptedRequestLog @infadoptedrequestlog: the object which received the signal. @arg1: @add_request: @user_id: @Returns: @log: @Returns: @log: @Returns: @log: @Returns: @log: @Returns: @log: @n: @log: @n: @Returns: @log: @request: @log: @up_to: @log: @request: @Returns: @log: @request: @Returns: @log: @request: @Returns: @log: @Returns: @log: @Returns: @log: @n: @Returns: @log: @n: @Returns: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-browser.sgml0000644000175000017500000001275212264766270022310 00000000000000 InfBrowser @infbrowser: the object which received the signal. @arg1: @infbrowser: the object which received the signal. @arg1: @arg2: @infbrowser: the object which received the signal. @arg1: @arg2: @infbrowser: the object which received the signal. @arg1: @infbrowser: the object which received the signal. @arg1: @infbrowser: the object which received the signal. @arg1: @infbrowser: the object which received the signal. @arg1: @arg2: @infbrowser: the object which received the signal. @arg1: @arg2: @error: @node_added: @node_removed: @subscribe_session: @unsubscribe_session: @begin_request: @acl_account_added: @acl_changed: @get_root: @get_next: @get_prev: @get_parent: @get_child: @explore: @get_explored: @is_subdirectory: @add_note: @add_subdirectory: @remove_node: @get_node_name: @get_node_type: @subscribe: @get_session: @list_pending_requests: @iter_from_request: @query_acl_account_list: @get_acl_account_list: @get_acl_local_account: @lookup_acl_account: @query_acl: @has_acl: @get_acl: @set_acl: @INF_BROWSER_CLOSED: @INF_BROWSER_OPENING: @INF_BROWSER_OPEN: @browser: @iter: @Returns: @browser: @iter: @Returns: @browser: @iter: @Returns: @browser: @iter: @Returns: @browser: @iter: @Returns: @browser: @ancestor: @iter: @Returns: @browser: @iter: @func: @user_data: @Returns: @browser: @iter: @Returns: @browser: @iter: @name: @type: @acl: @session: @initial_subscribe: @func: @user_data: @Returns: @browser: @iter: @name: @acl: @func: @user_data: @Returns: @browser: @iter: @func: @user_data: @Returns: @browser: @iter: @Returns: @browser: @iter: @Returns: @browser: @iter: @Returns: @browser: @iter: @func: @user_data: @Returns: @browser: @iter: @Returns: @browser: @iter: @request_type: @Returns: @browser: @request: @iter: @Returns: @browser: @iter: @request_type: @Returns: @browser: @iter: @func: @user_data: @Returns: @browser: @iter: @account: @Returns: @browser: @iter: @Returns: @browser: @iter: @sheet_set: @func: @user_data: @Returns: @browser: @iter: @account: @check_mask: @out_mask: @Returns: @browser: @error: @browser: @iter: @browser: @iter: @browser: @iter: @proxy: @browser: @iter: @request: @browser: @iter: @update: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-acl-user-list-request.sgml0000644000175000017500000000153012264766270024767 00000000000000 InfAclUserListRequest @infacluserlistrequest: the object which received the signal. @arg1: @finished: @request: @error: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-user.sgml0000644000175000017500000000323112264766270021573 00000000000000 InfUser @INF_USER_ACTIVE: @INF_USER_INACTIVE: @INF_USER_UNAVAILABLE: @INF_USER_LOCAL: @infuser: the object which received the signal. @arg1: @parent_class: @set_status: @user: @Returns: @user: @Returns: @user: @Returns: @user: @Returns: @user: @Returns: @status: @Returns: @string: @status: @error: @Returns: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/libinfinity-unused.sgml0000644000175000017500000003143712264766270023675 00000000000000 InfCentralMethod InfChatSession InfCommunicationCentralFactory InfConnectionManager InfMethodManager InfNetObject @infchatsession: the object which received the signal. @arg1: @infchatsession: the object which received the signal. @arg1: @INF_CHAT_SESSION_ERROR_TYPE_INVALID: @INF_CHAT_SESSION_ERROR_NO_SUCH_USER: @INF_CHAT_SESSION_ERROR_FAILED: @type: @user: @text: @length: @time: @INF_CHAT_SESSION_MESSAGE_NORMAL: @INF_CHAT_SESSION_MESSAGE_EMOTE: @INF_CHAT_SESSION_MESSAGE_USERJOIN: @INF_CHAT_SESSION_MESSAGE_USERPART: @network: @name: @open: @join: @finalize: @receive_msg: @receive_ctrl: @add_connection: @remove_connection: @send_to_net: @INF_CONNECTION_MANAGER_POINT_TO_POINT: @INF_CONNECTION_MANAGER_NETWORK: @INF_CONNECTION_MANAGER_GROUP: @parent_class: @parent: @received: @enqueued: @sent: @user: @user_data: @INF_USER_JOIN_ERROR_NAME_IN_USE: @INF_USER_JOIN_ERROR_ID_PROVIDED: @INF_USER_JOIN_ERROR_NO_SUCH_USER: @INF_USER_JOIN_ERROR_STATUS_PROVIDED: @INF_USER_JOIN_ERROR_FAILED: @INF_USER_STATUS_CHANGE_ERROR_NO_SUCH_USER: @INF_USER_STATUS_CHANGE_ERROR_NOT_JOINED: @INF_USER_STATUS_CHANGE_ERROR_INVALID_STATUS: @INF_USER_STATUS_CHANGE_ERROR_FAILED: @instance: @connection: @instance: @dc: @group: @publisher_conn: @Returns: @dc: @group: @Returns: @instance: @connection: @xml: @instance: @scope: @can_forward: @connection: @xml: @inst: @connection: @instance: @except: @xml: @session: @n: @Returns: @session: @Returns: @message: @Returns: @message: @backlog_size: @Returns: @session: @user: @message: @session: @user: @message: @session: @log_file: @error: @Returns: @method: @connection: @group: @conn: @prnt: @Returns: @group: @connection: @g: @network: @Returns: @group: @Returns: @group: @Returns: @grp: @Returns: @group: @conn: @Returns: @grp: @network: @id: @Returns: @group: @grp: @conn: @g: @connection: @xml: @group: @except: @xml: @group: @object: @group: @manager: @group_name: @publisher_conn: @object: @meth: @Returns: @manager: @group_name: @publisher: @Returns: @manager: @group_name: @publisher_id: @Returns: @Returns: @manager: @group_name: @net_object: @methods: @Returns: @group: @connection: @parent: @group: @connection: @xml: @group: @connection: @scope: @xml: @group: @connection: @manager: @method: @Returns: @manager: @Returns: @manager: @name: @Returns: @manager: @network: @Returns: @manager: @network: @method_name: @Returns: @search_path: @Returns: @object: @conn: @node: @object: @conn: @node: @error: @Returns: @object: @conn: @node: @session: @Returns: @Returns: @code: @Returns: @Returns: @code: @Returns: @xml: @attribute: @result: @error: @Returns: @xml: @attribute: @result: @error: @Returns: @xml: @attribute: @result: @error: @Returns: @xml: @attribute: @result: @error: @Returns: @xml: @attribute: @value: @xml: @attribute: @value: @browser: @Returns: @proxy: @user: @error: @Returns: @proxy: @user: @status: @error: @Returns: @directory: @Returns: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-local-publisher.sgml0000644000175000017500000000136312264766270023706 00000000000000 InfLocalPublisher @publish: @unpublish: @publisher: @type: @name: @port: @Returns: @publisher: @item: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/infc-user-request.sgml0000644000175000017500000000126312264766270023427 00000000000000 InfcUserRequest @infcuserrequest: the object which received the signal. @arg1: @parent_class: @finished: @request: @user: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-session.sgml0000644000175000017500000001123112264766270022277 00000000000000 InfSession @INF_SESSION_PRESYNC: @INF_SESSION_SYNCHRONIZING: @INF_SESSION_RUNNING: @INF_SESSION_CLOSED: @INF_SESSION_SYNC_NONE: @INF_SESSION_SYNC_IN_PROGRESS: @INF_SESSION_SYNC_AWAITING_ACK: @INF_SESSION_SYNC_ERROR_GOT_MESSAGE_IN_PRESYNC: @INF_SESSION_SYNC_ERROR_UNEXPECTED_NODE: @INF_SESSION_SYNC_ERROR_ID_NOT_PRESENT: @INF_SESSION_SYNC_ERROR_ID_IN_USE: @INF_SESSION_SYNC_ERROR_NAME_NOT_PRESENT: @INF_SESSION_SYNC_ERROR_NAME_IN_USE: @INF_SESSION_SYNC_ERROR_CONNECTION_CLOSED: @INF_SESSION_SYNC_ERROR_SENDER_CANCELLED: @INF_SESSION_SYNC_ERROR_RECEIVER_CANCELLED: @INF_SESSION_SYNC_ERROR_UNEXPECTED_BEGIN_OF_SYNC: @INF_SESSION_SYNC_ERROR_NUM_MESSAGES_MISSING: @INF_SESSION_SYNC_ERROR_UNEXPECTED_END_OF_SYNC: @INF_SESSION_SYNC_ERROR_EXPECTED_BEGIN_OF_SYNC: @INF_SESSION_SYNC_ERROR_EXPECTED_END_OF_SYNC: @INF_SESSION_SYNC_ERROR_FAILED: @infsession: the object which received the signal. @infsession: the object which received the signal. @arg1: @arg2: @infsession: the object which received the signal. @arg1: @infsession: the object which received the signal. @arg1: @arg2: @infsession: the object which received the signal. @arg1: @arg2: @to_xml_sync: @process_xml_sync: @process_xml_run: @get_xml_user_props: @set_xml_user_props: @validate_user_props: @user_new: @close: @synchronization_begin: @synchronization_progress: @synchronization_complete: @synchronization_failed: @params: @n_params: @name: @Returns: @array: @name: @Returns: @session: @user: @xml: @session: @session: @Returns: @session: @Returns: @session: @Returns: @session: @Returns: @session: @params: @n_params: @error: @Returns: @session: @user: @status: @session: @session: @group: @connection: @session: @connection: @Returns: @session: @connection: @Returns: @session: @Returns: @session: @Returns: @session: @group: @session: @xml: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/infd-xmpp-server.sgml0000644000175000017500000000252512264766270023256 00000000000000 InfdXmppServer @infdxmppserver: the object which received the signal. @arg1: @parent_class: @error: @tcp: @policy: @creds: @sasl_context: @sasl_mechanisms: @Returns: @server: @policy: @server: @Returns: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-communication-joined-group.sgml0000644000175000017500000000152212264766270026063 00000000000000 InfCommunicationJoinedGroup @grp: @connection: @g: @Returns: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-adopted-request.sgml0000644000175000017500000000471112264766270023727 00000000000000 InfAdoptedRequest @INF_ADOPTED_REQUEST_DO: @INF_ADOPTED_REQUEST_UNDO: @INF_ADOPTED_REQUEST_REDO: @vector: @user_id: @operation: @Returns: @vector: @user_id: @Returns: @vector: @user_id: @Returns: @request: @Returns: @request: @Returns: @request: @Returns: @request: @Returns: @request: @Returns: @request: @Returns: @request: @against: @Returns: @request: @against: @Returns: @request: @against: @concurrency_id: @Returns: @request: @by: @Returns: @request: @into: @by: @Returns: @request: @Returns: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-xml-connection.sgml0000644000175000017500000000362112264766270023555 00000000000000 InfXmlConnection @infxmlconnection: the object which received the signal. @arg1: @infxmlconnection: the object which received the signal. @arg1: @infxmlconnection: the object which received the signal. @arg1: @parent: @open: @close: @send: @sent: @received: @error: @INF_XML_CONNECTION_CLOSED: @INF_XML_CONNECTION_CLOSING: @INF_XML_CONNECTION_OPEN: @INF_XML_CONNECTION_OPENING: @connection: @error: @Returns: @connection: @connection: @xml: @connection: @xml: @connection: @xml: @connection: @error: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/infc-chat-request.sgml0000644000175000017500000000124412264766270023367 00000000000000 InfcChatRequest @infcchatrequest: the object which received the signal. @arg1: @finished: @request: @error: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-sasl-context.sgml0000644000175000017500000000476212264766270023253 00000000000000 InfSaslContext @session: @property: @session_data: @user_data: @session: @data: @needs_more: @error: @user_data: @error: @Returns: @context: @Returns: @context: @context: @callback: @user_data: @context: @io: @mech: @session_data: @error: @Returns: @context: @error: @Returns: @context: @mech: @Returns: @context: @mechanisms: @Returns: @context: @io: @mech: @session_data: @error: @Returns: @context: @error: @Returns: @context: @mech: @Returns: @context: @session: @session: @prop: @Returns: @session: @prop: @value: @session: @retval: @session: @data: @func: @user_data: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/infd-session-proxy.sgml0000644000175000017500000000322312264766270023624 00000000000000 InfdSessionProxy @infdsessionproxy: the object which received the signal. @arg1: @Param3: @infdsessionproxy: the object which received the signal. @arg1: @parent_class: @add_subscription: @remove_subscription: @proxy: @Returns: @proxy: @params: @n_params: @error: @Returns: @proxy: @connection: @seq_id: @synchronize: @proxy: @Returns: @proxy: @connection: @Returns: @proxy: @Returns: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-browser-request.sgml0000644000175000017500000000147612264766270023777 00000000000000 InfBrowserRequest @infbrowserrequest: the object which received the signal. @arg1: @finished: @request: @iter: @error: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-chat-session.sgml0000644000175000017500000000235112264766270023217 00000000000000 InfChatSession @infchatsession: the object which received the signal. @arg1: @infchatsession: the object which received the signal. @arg1: @receive_message: @send_message: @INF_CHAT_SESSION_ERROR_TYPE_INVALID: @INF_CHAT_SESSION_ERROR_NO_SUCH_USER: @INF_CHAT_SESSION_ERROR_FAILED: @manager: @backlog_size: @status: @sync_group: @sync_connection: @Returns: @session: @log_file: @error: @Returns: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/infd-note-plugin.sgml0000644000175000017500000000070512264766270023225 00000000000000 InfdNotePlugin @user_data: @storage_type: @note_type: @session_new: @session_read: @session_write: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-explore-request.sgml0000644000175000017500000000107412264766270023764 00000000000000 InfExploreRequest libinfinity-0.5.5/docs/reference/libinfinity/tmpl/infc-certificate-request.sgml0000644000175000017500000000133612264766270024734 00000000000000 InfcCertificateRequest @infccertificaterequest: the object which received the signal. @arg1: @arg2: @finished: @request: @cert: @error: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/infc-session-proxy.sgml0000644000175000017500000000234512264766270023627 00000000000000 InfcSessionProxy @parent_class: @translate_error: @proxy: @group: @connection: @seq_id: @proxy: @params: @n_params: @error: @Returns: @proxy: @Returns: @proxy: @Returns: @proxy: @Returns: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/infd-explore-request.sgml0000644000175000017500000000116712264766270024133 00000000000000 InfdExploreRequest @request: @total: @request: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-connection-manager.sgml0000644000175000017500000000713412264766270024372 00000000000000 InfConnectionManager @network: @name: @open: @join: @finalize: @receive_msg: @receive_ctrl: @add_connection: @remove_connection: @send_to_net: @INF_CONNECTION_MANAGER_POINT_TO_POINT: @INF_CONNECTION_MANAGER_NETWORK: @INF_CONNECTION_MANAGER_GROUP: @Returns: @manager: @group_name: @net_object: @methods: @Returns: @manager: @group_name: @publisher_conn: @object: @meth: @Returns: @manager: @group_name: @publisher: @Returns: @manager: @group_name: @publisher_id: @Returns: @group: @group: @g: @network: @Returns: @group: @object: @group: @Returns: @grp: @Returns: @group: @conn: @Returns: @group: @Returns: @group: @conn: @prnt: @Returns: @grp: @conn: @grp: @network: @id: @Returns: @g: @connection: @xml: @group: @except: @xml: @group: @connection: @group: @connection: @parent: @group: @connection: @group: @connection: @scope: @xml: @group: @connection: @xml: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/infc-request.sgml0000644000175000017500000000173112264766270022453 00000000000000 InfcRequest @infcrequest: the object which received the signal. @arg1: @parent_class: @failed: @unused1: @usused2: @request: @Returns: @request: @Returns: @request: @error: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-buffer.sgml0000644000175000017500000000127012264766270022067 00000000000000 InfBuffer @get_modified: @set_modified: @buffer: @Returns: @buffer: @modified: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-adopted-user.sgml0000644000175000017500000000167412264766270023222 00000000000000 InfAdoptedUser @user: @id: @Returns: @user: @Returns: @user: @vec: @user: @Returns: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-certificate-credentials.sgml0000644000175000017500000000141312264766270025372 00000000000000 InfCertificateCredentials @void: @Returns: @creds: @Returns: @creds: @creds: @Returns: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-adopted-operation.sgml0000644000175000017500000000356312264766270024243 00000000000000 InfAdoptedOperation @need_concurrency_id: @get_concurrency_id: @transform: @copy: @get_flags: @apply: @revert: @make_reversible: @INF_ADOPTED_OPERATION_AFFECTS_BUFFER: @INF_ADOPTED_OPERATION_REVERSIBLE: @INF_ADOPTED_CONCURRENCY_SELF: @INF_ADOPTED_CONCURRENCY_NONE: @INF_ADOPTED_CONCURRENCY_OTHER: @operation: @against: @Returns: @operation: @against: @Returns: @operation: @against: @concurrency_id: @Returns: @operation: @Returns: @operation: @Returns: @operation: @by: @buffer: @operation: @Returns: @operation: @Returns: @operation: @with: @buffer: @Returns: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/libinfinity-0.5-unused.sgml0000644000175000017500000013105312264766270024170 00000000000000 InfAclAccountListRequest InfAclSheet InfAclTable InfAclUserListRequest InfAcl InfBrowserIter InfBrowserRequest InfBrowser InfCentralMethod InfCommunicationCentralFactory InfConnectionManager InfExploreRequest InfKeepalive InfMethodManager InfNetObject InfNodeRequest InfRequest InfSessionProxy InfUserListRequest InfUserRequest InfcAclAccountListRequest InfcCertificateRequest InfcChatRequest InfdAclAccountInfo InfdExploreRequest InfdNodeRequest InfdUserRequest @infaclaccountlistrequest: the object which received the signal. @arg1: @finished: @INF_ACL_CAN_SUBSCRIBE_SESSION: @INF_ACL_CAN_JOIN_USER: @INF_ACL_CAN_QUERY_ACCOUNT_LIST: @INF_ACL_CAN_QUERY_ACL: @INF_ACL_CAN_SET_ACL: @sheets: @n_sheets: @infacltable: the object which received the signal. @arg1: @arg2: @infacltable: the object which received the signal. @arg1: @user_added: @acl_changed: @infacluserlistrequest: the object which received the signal. @arg1: @finished: @infbrowser: the object which received the signal. @arg1: @infbrowser: the object which received the signal. @arg1: @arg2: @infbrowser: the object which received the signal. @arg1: @infbrowser: the object which received the signal. @arg1: @arg2: @infbrowser: the object which received the signal. @arg1: @infbrowser: the object which received the signal. @arg1: @infbrowser: the object which received the signal. @arg1: @infbrowser: the object which received the signal. @arg1: @arg2: @infbrowser: the object which received the signal. @arg1: @arg2: @infbrowser: the object which received the signal. @arg1: @arg2: @error: @node_added: @node_removed: @subscribe_session: @unsubscribe_session: @begin_request: @acl_account_added: @acl_changed: @get_root: @get_next: @get_prev: @get_parent: @get_child: @explore: @get_explored: @is_subdirectory: @add_note: @add_subdirectory: @remove_node: @get_node_name: @get_node_type: @subscribe: @get_session: @list_pending_requests: @iter_from_request: @query_acl_account_list: @get_acl_account_list: @get_acl_local_account: @lookup_acl_account: @query_acl: @has_acl: @get_acl: @set_acl: @infbrowserrequest: the object which received the signal. @arg1: @finished: @INF_BROWSER_CLOSED: @INF_BROWSER_OPENING: @INF_BROWSER_OPEN: @infchatsession: the object which received the signal. @arg1: @infchatsession: the object which received the signal. @arg1: @type: @user: @text: @length: @time: @INF_CHAT_SESSION_MESSAGE_NORMAL: @INF_CHAT_SESSION_MESSAGE_EMOTE: @INF_CHAT_SESSION_MESSAGE_USERJOIN: @INF_CHAT_SESSION_MESSAGE_USERPART: @network: @name: @open: @join: @finalize: @receive_msg: @receive_ctrl: @add_connection: @remove_connection: @send_to_net: @INF_CONNECTION_MANAGER_POINT_TO_POINT: @INF_CONNECTION_MANAGER_NETWORK: @INF_CONNECTION_MANAGER_GROUP: @socket: @event: @user_data: @parent_class: @parent: @received: @enqueued: @sent: @infnoderequest: the object which received the signal. @arg1: @arg2: @finished: @fail: @infsession: the object which received the signal. @arg1: @arg2: @arg3: @user: @user_data: @join_user: @INF_USER_JOIN_ERROR_NAME_IN_USE: @INF_USER_JOIN_ERROR_ID_PROVIDED: @INF_USER_JOIN_ERROR_NO_SUCH_USER: @INF_USER_JOIN_ERROR_STATUS_PROVIDED: @INF_USER_JOIN_ERROR_FAILED: @infuserlistrequest: the object which received the signal. @arg1: @finished: @infuserrequest: the object which received the signal. @arg1: @arg2: @finished: @INF_USER_STATUS_CHANGE_ERROR_NO_SUCH_USER: @INF_USER_STATUS_CHANGE_ERROR_NOT_JOINED: @INF_USER_STATUS_CHANGE_ERROR_INVALID_STATUS: @INF_USER_STATUS_CHANGE_ERROR_FAILED: @INFC_BROWSER_NODE_SYNC: @INFC_BROWSER_NODE_DELETED: @INFC_BROWSER_NODE_ADDED: @INFC_BROWSER_NODE_MOVED: @INFC_BROWSER_NODE_COPIED: @INFC_BROWSER_NODE_INHERIT: @infccertificaterequest: the object which received the signal. @arg1: @arg2: @finished: @infcchatrequest: the object which received the signal. @arg1: @finished: @infddirectory: the object which received the signal. @arg1: @infddirectory: the object which received the signal. @arg1: @infdsessionproxy: the object which received the signal. @arg1: @arg2: @arg3: @Returns: @account: @Returns: @account: @xml: @error: @Returns: @request: @error: @id: @name: @Returns: @account: @xml: @sheet: @Returns: @sheet: @xml: @mask: @perms: @error: @Returns: @mask: @perms: @xml: @sheet_set: @account: @Returns: @sheet_set: @Returns: @sheet_set: @account: @Returns: @sheet_set: @account: @Returns: @sheet_set: @void: @Returns: @sheets: @n_sheets: @Returns: @sheet_set: @sheet: @table: @user: @active: @Returns: @table: @iter: @table: @iter: @Returns: @table: @Returns: @table: @iter: @user: @Returns: @table: @iter: @Returns: @table: @user_id: @Returns: @table: @n_users: @Returns: @table: @iter: @sheet: @table: @iter: @sheet_set: @void: @Returns: @table: @sheet: @xml: @error: @Returns: @table: @xml: @error: @Returns: @table: @sheet_set: @xml: @table: @sheet: @xml: @user: @Returns: @user: @xml: @error: @Returns: @request: @error: @user_id: @user_name: @Returns: @user: @xml: @include_times: @request: @Returns: @request: @Returns: @log: @request: @log: @vec: @Returns: @request: @time: @browser: @iter: @update: @browser: @user: @browser: @iter: @name: @type: @acl: @session: @initial_subscribe: @func: @user_data: @Returns: @browser: @iter: @name: @acl: @func: @user_data: @Returns: @browser: @iter: @request: @browser: @iter: @account: @check_mask: @out_mask: @Returns: @browser: @error: @browser: @iter: @func: @user_data: @Returns: @browser: @iter: @Returns: @browser: @Returns: @browser: @n_users: @Returns: @browser: @iter: @Returns: @browser: @iter: @Returns: @browser: @iter: @Returns: @browser: @iter: @Returns: @browser: @iter: @Returns: @browser: @iter: @Returns: @browser: @iter: @Returns: @browser: @iter: @Returns: @browser: @iter: @request_type: @Returns: @browser: @iter: @Returns: @browser: @iter: @Returns: @browser: @iter: @Returns: @browser: @iter: @Returns: @browser: @iter: @account: @Returns: @browser: @ancestor: @iter: @Returns: @iter: @Returns: @iter: @browser: @request: @iter: @Returns: @browser: @iter: @request_type: @Returns: @browser: @user_id: @Returns: @browser: @iter: @browser: @iter: @browser: @iter: @func: @user_data: @Returns: @browser: @Returns: @browser: @iter: @func: @user_data: @Returns: @request: @iter: @error: @browser: @iter: @sheet_set: @func: @user_data: @Returns: @browser: @iter: @func: @user_data: @Returns: @browser: @iter: @proxy: @instance: @connection: @instance: @dc: @group: @publisher_conn: @Returns: @dc: @group: @Returns: @instance: @connection: @xml: @instance: @scope: @can_forward: @connection: @xml: @inst: @connection: @instance: @except: @xml: @src: @error: @Returns: @error: @Returns: @algo: @bits: @error: @Returns: @key: @error: @Returns: @filename: @current: @error: @Returns: @filename: @error: @Returns: @filename: @error: @Returns: @certs: @n_certs: @filename: @error: @Returns: @params: @filename: @error: @Returns: @key: @filename: @error: @Returns: @session: @n: @Returns: @session: @Returns: @message: @Returns: @message: @session: @user: @message: @session: @user: @message: @method: @connection: @group: @conn: @prnt: @Returns: @group: @connection: @g: @network: @Returns: @group: @Returns: @group: @Returns: @grp: @Returns: @group: @conn: @Returns: @grp: @network: @id: @Returns: @group: @grp: @conn: @g: @connection: @xml: @group: @except: @xml: @group: @object: @group: @manager: @group_name: @publisher_conn: @object: @meth: @Returns: @manager: @group_name: @publisher: @Returns: @manager: @group_name: @publisher_id: @Returns: @Returns: @manager: @group_name: @net_object: @methods: @Returns: @group: @connection: @parent: @group: @connection: @xml: @group: @connection: @scope: @xml: @group: @connection: @io: @socket: @events: @func: @user_data: @notify: @keepalive: @socket: @error: @Returns: @keepalive: @Returns: @keepalive: @void: @Returns: @use_keepalive: @keepalive_time: @keepalive_interval: @keepalive_probes: @Returns: @manager: @method: @Returns: @manager: @Returns: @manager: @name: @Returns: @manager: @network: @Returns: @manager: @network: @method_name: @Returns: @search_path: @Returns: @object: @conn: @node: @object: @conn: @node: @error: @Returns: @object: @conn: @node: @request: @iter: @error: @context: @mech: @session_data: @error: @Returns: @context: @mech: @session_data: @error: @Returns: @session: @connection: @session: @Returns: @proxy: @n_params: @params: @func: @user_data: @Returns: @Returns: @code: @Returns: @request: @error: @request: @user: @error: @Returns: @code: @Returns: @xmpp: @Returns: @xmpp: @Returns: @req: @Returns: @request: @total: @request: @browser: @Returns: @browser: @crq: @extra_data: @func: @user_data: @error: @Returns: @request: @cert: @error: @request: @error: @proxy: @user: @error: @Returns: @proxy: @user: @status: @error: @Returns: @info: @fingerprint: @info: @password: @Returns: @info: @Returns: @info: @xml: @error: @Returns: @id: @name: @Returns: @info: @fingerprint: @info: @password: @error: @Returns: @info: @xml: @info: @directory: @connection: @Returns: @directory: @Returns: @directory: @key: @cert: @request: @total: @request: @proxy: @connection: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-central-method.sgml0000644000175000017500000000217512264766270023531 00000000000000 InfCentralMethod @dc: @group: @Returns: @dc: @group: @publisher_conn: @Returns: @instance: @instance: @scope: @can_forward: @connection: @xml: @instance: @connection: @xml: @instance: @connection: @inst: @connection: @instance: @except: @xml: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-ip-address.sgml0000644000175000017500000000275312264766270022660 00000000000000 InfIpAddress @INF_IP_ADDRESS_IPV4: @INF_IP_ADDRESS_IPV6: @address: @Returns: @void: @Returns: @address: @Returns: @void: @Returns: @str: @Returns: @address: @Returns: @address: @address: @Returns: @address: @Returns: @address: @Returns: @address1: @address2: @Returns: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-node-request.sgml0000644000175000017500000000125612264766270023235 00000000000000 InfNodeRequest @infnoderequest: the object which received the signal. @arg1: @arg2: @finished: @request: @iter: @error: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-standalone-io.sgml0000644000175000017500000000172512264766270023360 00000000000000 InfStandaloneIo @parent_class: @void: @Returns: @io: @io: @timeout: @io: @io: @io: @Returns: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-adopted-split-operation.sgml0000644000175000017500000000170312264766270025366 00000000000000 InfAdoptedSplitOperation @first: @second: @Returns: @operation: @Returns: @op: @other: @concurrency_id: @Returns: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/infc-explore-request.sgml0000644000175000017500000000353612264766270024134 00000000000000 InfcExploreRequest @infcexplorerequest: the object which received the signal. @infcexplorerequest: the object which received the signal. @arg1: @infcexplorerequest: the object which received the signal. @arg1: @arg2: @initiated: @progress: @finished: @request: @Returns: @request: @total: @request: @error: @Returns: @request: @error: @Returns: @request: @Returns: @request: @Returns: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/infd-node-request.sgml0000644000175000017500000000106612264766270023400 00000000000000 InfdNodeRequest libinfinity-0.5.5/docs/reference/libinfinity/tmpl/infc-browser-iter.sgml0000644000175000017500000000103012264766270023377 00000000000000 InfcBrowserIter @iter: @Returns: @iter: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-init.sgml0000644000175000017500000000067112264766270021565 00000000000000 InfInit @error: @Returns: @void: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-io.sgml0000644000175000017500000000351112264766270021225 00000000000000 InfIo @add_watch: @update_watch: @remove_watch: @add_timeout: @remove_timeout: @add_dispatch: @remove_dispatch: @INF_IO_INCOMING: @INF_IO_OUTGOING: @INF_IO_ERROR: @socket: @event: @user_data: @user_data: @user_data: @io: @socket: @events: @func: @user_data: @notify: @Returns: @io: @watch: @events: @io: @watch: @io: @msecs: @func: @user_data: @notify: @Returns: @io: @timeout: @io: @func: @user_data: @notify: @Returns: @io: @dispatch: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-certificate-chain.sgml0000644000175000017500000000227012264766270024161 00000000000000 InfCertificateChain @certs: @n_certs: @Returns: @chain: @Returns: @chain: @chain: @Returns: @chain: @Returns: @chain: @Returns: @chain: @n: @Returns: @chain: @Returns: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-communication-central-method.sgml0000644000175000017500000000117112264766270026367 00000000000000 InfCommunicationCentralMethod libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-communication-registry.sgml0000644000175000017500000000211112264766270025324 00000000000000 InfCommunicationRegistry @registry: @group: @method: @connection: @registry: @group: @connection: @registry: @group: @connection: @Returns: @registry: @group: @connection: @xml: @registry: @group: @connection: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-acl-account-list-request.sgml0000644000175000017500000000156012264766270025450 00000000000000 InfAclAccountListRequest @infaclaccountlistrequest: the object which received the signal. @arg1: @finished: @request: @error: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-user-table.sgml0000644000175000017500000000351612264766270022666 00000000000000 InfUserTable @user: @user_data: @infusertable: the object which received the signal. @arg1: @infusertable: the object which received the signal. @arg1: @infusertable: the object which received the signal. @arg1: @infusertable: the object which received the signal. @arg1: @add_user: @remove_user: @add_local_user: @remove_local_user: @void: @Returns: @user_table: @user: @user_table: @user: @user_table: @id: @Returns: @user_table: @name: @Returns: @user_table: @func: @user_data: @user_table: @func: @user_data: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-adopted-session-record.sgml0000644000175000017500000000174512264766270025202 00000000000000 InfAdoptedSessionRecord @session: @Returns: @record: @filename: @error: @Returns: @record: @error: @Returns: @record: @Returns: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-communication-method.sgml.sgml0000644000175000017500000000104412264766270025701 00000000000000 InfCommunicationCentralFactory @Returns: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/libinfinity-0.4-unused.sgml0000644000175000017500000003325212264766270024171 00000000000000 InfAdoptedSessionReplay InfCentralMethod InfCommunicationCentralFactory InfConnectionManager InfMethodManager InfNetObject @INF_ADOPTED_SESSION_REPLAY_ERROR_BAD_FILE: @INF_ADOPTED_SESSION_REPLAY_ERROR_BAD_XML: @INF_ADOPTED_SESSION_REPLAY_ERROR_BAD_DOCUMENT: @INF_ADOPTED_SESSION_REPLAY_ERROR_BAD_SESSION_TYPE: @INF_ADOPTED_SESSION_REPLAY_ERROR_BAD_FORMAT: @INF_ADOPTED_SESSION_REPLAY_ERROR_UNEXPECTED_EOF: @INF_CHAT_BUFFER_MESSAGE_BACKLOG: @infchatsession: the object which received the signal. @arg1: @infchatsession: the object which received the signal. @arg1: @type: @user: @text: @length: @time: @INF_CHAT_SESSION_MESSAGE_NORMAL: @INF_CHAT_SESSION_MESSAGE_EMOTE: @INF_CHAT_SESSION_MESSAGE_USERJOIN: @INF_CHAT_SESSION_MESSAGE_USERPART: @network: @name: @open: @join: @finalize: @receive_msg: @receive_ctrl: @add_connection: @remove_connection: @send_to_net: @INF_CONNECTION_MANAGER_POINT_TO_POINT: @INF_CONNECTION_MANAGER_NETWORK: @INF_CONNECTION_MANAGER_GROUP: @parent_class: @parent: @received: @enqueued: @sent: @user: @user_data: @INF_USER_JOIN_ERROR_NAME_IN_USE: @INF_USER_JOIN_ERROR_ID_PROVIDED: @INF_USER_JOIN_ERROR_NO_SUCH_USER: @INF_USER_JOIN_ERROR_STATUS_PROVIDED: @INF_USER_JOIN_ERROR_FAILED: @INF_USER_STATUS_CHANGE_ERROR_NO_SUCH_USER: @INF_USER_STATUS_CHANGE_ERROR_NOT_JOINED: @INF_USER_STATUS_CHANGE_ERROR_INVALID_STATUS: @INF_USER_STATUS_CHANGE_ERROR_FAILED: @replay: @Returns: @void: @Returns: @replay: @error: @Returns: @replay: @error: @Returns: @replay: @filename: @plugin: @error: @Returns: @instance: @connection: @instance: @dc: @group: @publisher_conn: @Returns: @dc: @group: @Returns: @instance: @connection: @xml: @instance: @scope: @can_forward: @connection: @xml: @inst: @connection: @instance: @except: @xml: @session: @n: @Returns: @session: @Returns: @message: @Returns: @message: @session: @user: @message: @session: @user: @message: @method: @connection: @group: @conn: @prnt: @Returns: @group: @connection: @g: @network: @Returns: @group: @Returns: @group: @Returns: @grp: @Returns: @group: @conn: @Returns: @grp: @network: @id: @Returns: @group: @grp: @conn: @g: @connection: @xml: @group: @except: @xml: @group: @object: @group: @manager: @group_name: @publisher_conn: @object: @meth: @Returns: @manager: @group_name: @publisher: @Returns: @manager: @group_name: @publisher_id: @Returns: @Returns: @manager: @group_name: @net_object: @methods: @Returns: @group: @connection: @parent: @group: @connection: @xml: @group: @connection: @scope: @xml: @group: @connection: @manager: @method: @Returns: @manager: @Returns: @manager: @name: @Returns: @manager: @network: @Returns: @manager: @network: @method_name: @Returns: @search_path: @Returns: @object: @conn: @node: @object: @conn: @node: @error: @Returns: @object: @conn: @node: @void: @Returns: @session: @Returns: @Returns: @code: @Returns: @Returns: @code: @Returns: @xmpp: @Returns: @xmpp: @new_context: @new_mechanisms: @xmpp: @error: @Returns: @xmpp: @error: @browser: @Returns: @browser: @iter: @Returns: @proxy: @user: @error: @Returns: @proxy: @user: @status: @error: @Returns: @directory: @func: @user_data: @directory: @Returns: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-user-request.sgml0000644000175000017500000000125612264766270023266 00000000000000 InfUserRequest @infuserrequest: the object which received the signal. @arg1: @arg2: @finished: @request: @user: @error: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-chat-buffer.sgml0000644000175000017500000000406712264766270023013 00000000000000 InfChatBuffer @INF_CHAT_BUFFER_MESSAGE_NORMAL: @INF_CHAT_BUFFER_MESSAGE_EMOTE: @INF_CHAT_BUFFER_MESSAGE_USERJOIN: @INF_CHAT_BUFFER_MESSAGE_USERPART: @INF_CHAT_BUFFER_MESSAGE_BACKLOG: @infchatbuffer: the object which received the signal. @arg1: @add_message: @message: @Returns: @message: @size: @Returns: @buffer: @by: @message: @length: @time: @flags: @buffer: @by: @message: @length: @time: @flags: @buffer: @user: @time: @flags: @buffer: @user: @time: @flags: @buffer: @n: @Returns: @buffer: @Returns: @buffer: @Returns: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-method-manager.sgml0000644000175000017500000000235312264766270023511 00000000000000 InfMethodManager @parent_class: @Returns: @search_path: @Returns: @manager: @method: @manager: @network: @method_name: @Returns: @manager: @name: @Returns: @manager: @network: @Returns: @manager: @Returns: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/infc-request-manager.sgml0000644000175000017500000000446112264766270024066 00000000000000 InfcRequestManager @Param1: @Param2: @infcrequestmanager: the object which received the signal. @arg1: @infcrequestmanager: the object which received the signal. @arg1: @parent_class: @request_add: @request_remove: @seq_id: @Returns: @manager: @request_type: @request_name: @first_property_name: @...: @Returns: @manager: @request_type: @request_name: @first_property_name: @arglist: @Returns: @manager: @request: @manager: @request: @error: @manager: @manager: @seq: @Returns: @manager: @name: @xml: @error: @Returns: @manager: @name: @xml: @error: @Returns: @manager: @func: @user_data: @manager: @name: @func: @user_data: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-session-proxy.sgml0000644000175000017500000000121312264766270023455 00000000000000 InfSessionProxy @join_user: @proxy: @n_params: @params: @func: @user_data: @Returns: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-xmpp-connection.sgml0000644000175000017500000001162512264766270023744 00000000000000 InfXmppConnection @xmpp: @chain: @user_data: @INF_XMPP_CONNECTION_SERVER: @INF_XMPP_CONNECTION_CLIENT: @INF_XMPP_CONNECTION_SECURITY_ONLY_UNSECURED: @INF_XMPP_CONNECTION_SECURITY_ONLY_TLS: @INF_XMPP_CONNECTION_SECURITY_BOTH_PREFER_UNSECURED: @INF_XMPP_CONNECTION_SECURITY_BOTH_PREFER_TLS: @INF_XMPP_CONNECTION_ERROR_TLS_UNSUPPORTED: @INF_XMPP_CONNECTION_ERROR_TLS_REQUIRED: @INF_XMPP_CONNECTION_ERROR_TLS_FAILURE: @INF_XMPP_CONNECTION_ERROR_NO_CERTIFICATE_PROVIDED: @INF_XMPP_CONNECTION_ERROR_CERTIFICATE_NOT_TRUSTED: @INF_XMPP_CONNECTION_ERROR_AUTHENTICATION_UNSUPPORTED: @INF_XMPP_CONNECTION_ERROR_NO_SUITABLE_MECHANISM: @INF_XMPP_CONNECTION_ERROR_FAILED: @INF_XMPP_CONNECTION_STREAM_ERROR_BAD_FORMAT: @INF_XMPP_CONNECTION_STREAM_ERROR_BAD_NAMESPACE_PREFIX: @INF_XMPP_CONNECTION_STREAM_ERROR_CONFLICT: @INF_XMPP_CONNECTION_STREAM_ERROR_CONNECTION_TIMEOUT: @INF_XMPP_CONNECTION_STREAM_ERROR_HOST_GONE: @INF_XMPP_CONNECTION_STREAM_ERROR_HOST_UNKNOWN: @INF_XMPP_CONNECTION_STREAM_ERROR_IMPROPER_ADDRESSING: @INF_XMPP_CONNECTION_STREAM_ERROR_INTERNAL_SERVER_ERROR: @INF_XMPP_CONNECTION_STREAM_ERROR_INVALID_FROM: @INF_XMPP_CONNECTION_STREAM_ERROR_INVALID_ID: @INF_XMPP_CONNECTION_STREAM_ERROR_INVALID_NAMESPACE: @INF_XMPP_CONNECTION_STREAM_ERROR_INVALID_XML: @INF_XMPP_CONNECTION_STREAM_ERROR_NOT_AUTHORIZED: @INF_XMPP_CONNECTION_STREAM_ERROR_POLICY_VIOLATION: @INF_XMPP_CONNECTION_STREAM_ERROR_REMOTE_CONNECTION_FAILED: @INF_XMPP_CONNECTION_STREAM_ERROR_RESOURCE_CONSTRAINT: @INF_XMPP_CONNECTION_STREAM_ERROR_RESTRICTED_XML: @INF_XMPP_CONNECTION_STREAM_ERROR_SEE_OTHER_HOST: @INF_XMPP_CONNECTION_STREAM_ERROR_SYSTEM_SHUTDOWN: @INF_XMPP_CONNECTION_STREAM_ERROR_UNDEFINED_CONDITION: @INF_XMPP_CONNECTION_STREAM_ERROR_UNSUPPORTED_ENCODING: @INF_XMPP_CONNECTION_STREAM_ERROR_UNSUPPORTED_STANZA_TYPE: @INF_XMPP_CONNECTION_STREAM_ERROR_UNSUPPORTED_VERSION: @INF_XMPP_CONNECTION_STREAM_ERROR_XML_NOT_WELL_FORMED: @INF_XMPP_CONNECTION_STREAM_ERROR_FAILED: @INF_XMPP_CONNECTION_AUTH_ERROR_ABORTED: @INF_XMPP_CONNECTION_AUTH_ERROR_INCORRECT_ENCODING: @INF_XMPP_CONNECTION_AUTH_ERROR_INVALID_AUTHZID: @INF_XMPP_CONNECTION_AUTH_ERROR_INVALID_MECHANISM: @INF_XMPP_CONNECTION_AUTH_ERROR_MECHANISM_TOO_WEAK: @INF_XMPP_CONNECTION_AUTH_ERROR_NOT_AUTHORIZED: @INF_XMPP_CONNECTION_AUTH_ERROR_TEMPORARY_AUTH_FAILURE: @INF_XMPP_CONNECTION_AUTH_ERROR_FAILED: @parent_class: @tcp: @site: @local_hostname: @remote_hostname: @security_policy: @creds: @sasl_context: @sasl_mechanisms: @Returns: @xmpp: @Returns: @xmpp: @cb: @user_data: @xmpp: @xmpp: @xmpp: @new_context: @new_mechanisms: @xmpp: @error: @Returns: @xmpp: @error: @xmpp: @Returns: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/inf-communication-hosted-group.sgml0000644000175000017500000000144712264766270026107 00000000000000 InfCommunicationHostedGroup @group: @method: @group: @connection: @grp: @connection: libinfinity-0.5.5/docs/reference/libinfinity/tmpl/infc-node-request.sgml0000644000175000017500000000136512264766270023401 00000000000000 InfcNodeRequest @infcnoderequest: the object which received the signal. @arg1: @parent_class: @finished: @request: @iter: libinfinity-0.5.5/docs/reference/version.xml.in.in0000644000175000017500000000002611204026376017070 00000000000000@LIBINFINITY_VERSION@ libinfinity-0.5.5/docs/Makefile.am0000644000175000017500000000002410762534324013750 00000000000000SUBDIRS = reference libinfinity-0.5.5/docs/Makefile.in0000644000175000017500000004632712264766065014011 00000000000000# Makefile.in generated by automake 1.13.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = docs DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/mkinstalldirs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/libinfinity/inf-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBINFINITY_API_VERSION = @LIBINFINITY_API_VERSION@ LIBINFINITY_LIBTOOL_VERSION = @LIBINFINITY_LIBTOOL_VERSION@ LIBINFINITY_VERSION = @LIBINFINITY_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ avahi_CFLAGS = @avahi_CFLAGS@ avahi_LIBS = @avahi_LIBS@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gtk_requirement = @gtk_requirement@ gtk_version = @gtk_version@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infgtk_CFLAGS = @infgtk_CFLAGS@ infgtk_LIBS = @infgtk_LIBS@ infinity_CFLAGS = @infinity_CFLAGS@ infinity_LIBS = @infinity_LIBS@ infinoted_CFLAGS = @infinoted_CFLAGS@ infinoted_LIBS = @infinoted_LIBS@ infodir = @infodir@ inftext_CFLAGS = @inftext_CFLAGS@ inftext_LIBS = @inftext_LIBS@ inftextgtk_CFLAGS = @inftextgtk_CFLAGS@ inftextgtk_LIBS = @inftextgtk_LIBS@ install_sh = @install_sh@ libdaemon_CFLAGS = @libdaemon_CFLAGS@ libdaemon_LIBS = @libdaemon_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = reference all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu docs/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu docs/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am # 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: libinfinity-0.5.5/configure.ac0000644000175000017500000002257012264766040013265 00000000000000m4_define([libinfinity_version], [0.5.5]) m4_define([libinfinity_api_version], [0.5]) m4_define([libinfinity_libtool_version], [0:0:0]) AC_PREREQ(2.60) AC_INIT([libinfinity], [libinfinity_version], [armin@arbur.net]) AM_INIT_AUTOMAKE([-Wall dist-bzip2 check-news]) m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES]) AM_MAINTAINER_MODE AC_CONFIG_SRCDIR([libinfinity/common/inf-init.c]) AC_CONFIG_HEADER([config.h libinfinity/inf-config.h]) LIBINFINITY_VERSION=libinfinity_version LIBINFINITY_API_VERSION=libinfinity_api_version LIBINFINITY_LIBTOOL_VERSION=libinfinity_libtool_version AC_SUBST(LIBINFINITY_VERSION) AC_SUBST(LIBINFINITY_API_VERSION) AC_SUBST(LIBINFINITY_LIBTOOL_VERSION) AC_CANONICAL_HOST # Remove -Wno-strict-prototypes for the feature tests has_strict_prototypes="" if (echo $CFLAGS | grep -- -Wstrict-prototype) then has_strict_prototypes="true" old_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -Wno-strict-prototypes" fi # Make GNU and POSIX extensions such as readdir_r, O_NOFOLLOW and # fdopendir available AC_USE_SYSTEM_EXTENSIONS AC_LANG(C) AC_PROG_CC AC_PROG_CPP AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET AM_PROG_AR AC_PROG_LIBTOOL # Seems to be required for building a binary from multiple source files # automake complains without it in infinoted/. AM_PROG_CC_C_O ################################### # Gtk-Doc ################################### AC_CONFIG_MACRO_DIR(m4) GTK_DOC_CHECK(1.4) ################################### # Platform checks ################################### case "$host_os" in *mingw*) platform='win32' ;; *) platform='unix' ;; esac # Check for MSG_NOSIGNAL AC_MSG_CHECKING(for MSG_NOSIGNAL) AC_TRY_COMPILE([#include ], [ int f = MSG_NOSIGNAL; ], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_MSG_NOSIGNAL, 1, [Define this symbol if you have MSG_NOSIGNAL]) ], [ AC_MSG_RESULT(no)] ) # Check for SO_REUSEADDR AC_MSG_CHECKING(for SO_REUSEADDR) AC_TRY_COMPILE([#include #include ], [ int f = SO_REUSEADDR; printf("%d\n", f); ], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_SO_REUSEADDR, 1, [Define this symbol if you have SO_REUSEADDR]) ], [ AC_MSG_RESULT(no)] ) # Check for dirent.d_type AC_MSG_CHECKING(for d_type) AC_TRY_COMPILE([#include #include ], [ struct dirent d; printf("%d\n", d.d_type); ], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_D_TYPE, 1, [Define this symbol if your struct dirent has the d_type field])], [ AC_MSG_RESULT(no)] ) ################################### # Check for regular dependencies ################################### infinity_libraries='glib-2.0 >= 2.16 gobject-2.0 >= 2.16 gmodule-2.0 >= 2.16 gthread-2.0 >= 2.16 libxml-2.0 gnutls >= 1.7.2 libgsasl >= 0.2.21' PKG_CHECK_MODULES([infinity], [$infinity_libraries]) PKG_CHECK_MODULES([inftext], [glib-2.0 >= 2.16 gobject-2.0 >= 2.16 libxml-2.0]) if test $platform = 'win32'; then infinity_LIBS="$infinity_LIBS -lws2_32" fi ################################### # Check for GTK+ 3 ################################### AC_ARG_WITH([gtk3], AS_HELP_STRING([--with-gtk3], [Builds libinfgtk and libinftextgtk against GTK+ 3 [[default=no]]]), [with_gtk3=$withval], [with_gtk3=no]) if test "x$with_gtk3" = "xyes" then gtk_requirement="gtk+-3.0 >= 2.90.6" gtk_version=3 else gtk_requirement="gtk+-2.0 >= 2.12" gtk_version=2 fi AC_SUBST(gtk_requirement) AC_SUBST(gtk_version) ################################### # libinftextgtk optional package ################################### AC_ARG_WITH([inftextgtk], AS_HELP_STRING([--with-inftextgtk], [Builds the libinftextgtk library [[default=auto]]]), [with_inftextgtk=$withval], [with_inftextgtk=auto]) if test "x$with_inftextgtk" = "xauto" then PKG_CHECK_MODULES([inftextgtk], [$gtk_requirement], [with_inftextgtk=yes], [with_inftextgtk=no]) elif test "x$with_inftextgtk" = "xyes" then PKG_CHECK_MODULES([inftextgtk], [$gtk_requirement]) fi if test "x$with_inftextgtk" = "xyes" then AC_CHECK_LIB([m], [atan2], [inftextgtk_LIBS="$inftextgtk_LIBS -lm"], AC_MSG_ERROR(libm not found)) fi AM_CONDITIONAL([WITH_INFTEXTGTK], test "x$with_inftextgtk" = "xyes") ############################### # libinfgtk optional package ############################### AC_ARG_WITH([infgtk], AS_HELP_STRING([--with-infgtk], [Builds the libinfgtk library [[default=auto]]]), [with_infgtk=$withval], [with_infgtk=auto]) if test "x$with_infgtk" = "xauto" then PKG_CHECK_MODULES([infgtk], [$gtk_requirement], [with_infgtk=yes], [with_infgtk=no]) elif test "x$with_infgtk" = "xyes" then PKG_CHECK_MODULES([infgtk], [$gtk_requirement]) fi AM_CONDITIONAL([WITH_INFGTK], test "x$with_infgtk" = "xyes") ############################### # infinoted optional package ############################### AC_ARG_WITH([infinoted], AS_HELP_STRING([--with-infinoted], [Build the infinote standalone server [[default=yes]]]), [with_infinoted=$withval], [with_infinoted=yes]) if test "x$with_infinoted" = "xyes" then PKG_CHECK_MODULES([infinoted], [glib-2.0 >= 2.16 gobject-2.0 >= 2.16 gmodule-2.0 >= 2.14 gnutls >= 1.7.2]) fi AM_CONDITIONAL([WITH_INFINOTED], test "x$with_infinoted" = "xyes") #################### # Check for avahi #################### AC_ARG_WITH([avahi], AS_HELP_STRING([--with-avahi], [Enables avahi support [[default=auto]]]), [use_avahi=$withval], [use_avahi=auto]) if test "x$use_avahi" = "xauto" then PKG_CHECK_MODULES([avahi], [avahi-client], [use_avahi=yes], [use_avahi=no]) elif test "x$use_avahi" = "xyes" then PKG_CHECK_MODULES([avahi], [avahi-client]) fi if test "x$use_avahi" = "xyes" then AC_DEFINE([LIBINFINITY_HAVE_AVAHI], 1, [Whether avahi support is enabled]) fi AM_CONDITIONAL([LIBINFINITY_HAVE_AVAHI], test "x$use_avahi" = "xyes") #################### # Check for libdaemon #################### AC_ARG_WITH([libdaemon], AS_HELP_STRING([--with-libdaemon], [Enables daemonizing support in infinoted [[default=auto]]]), [use_libdaemon=$withval], [use_libdaemon=auto]) if test "x$use_libdaemon" = "xauto" then PKG_CHECK_MODULES([libdaemon], [libdaemon], [use_libdaemon=yes], [use_libdaemon=no]) elif test "x$use_libdaemon" = "xyes" then PKG_CHECK_MODULES([libdaemon], [libdaemon]) fi if test "x$use_libdaemon" = "xyes" then AC_DEFINE([LIBINFINITY_HAVE_LIBDAEMON], 1, [Whether libdaemon support is enabled]) fi AM_CONDITIONAL([LIBINFINITY_HAVE_LIBDAEMON], test "x$use_libdaemon" = "xyes") ################# # Check for pam # ################# AC_MSG_CHECKING(for pam) AC_CHECK_LIB([ pam ], [ pam_start ], [ AC_MSG_RESULT(yes) AC_DEFINE(LIBINFINITY_HAVE_PAM, 1, [Define this symbol if you have pam]) use_pam=yes infinity_LIBS="$infinity_LIBS -lpam" ], [ AC_MSG_RESULT(no) use_pam=no ] ) # Check for PAM_FAIL_DELAY AC_MSG_CHECKING(for PAM_FAIL_DELAY) AC_TRY_COMPILE([#include #include ], [ int f = PAM_FAIL_DELAY; printf("%d\n", f); ], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_PAM_FAIL_DELAY, 1, [Define this symbol if your pam has PAM_FAIL_DELAY])], [ AC_MSG_RESULT(no)] ) ############ # gettext ############ GETTEXT_PACKAGE="libinfinity-libinfinity_api_version" AC_SUBST(GETTEXT_PACKAGE) AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], ["$GETTEXT_PACKAGE"], [The domain name to use with gettext.]) ALL_LINGUAS="`grep -v '^#' "$srcdir/po/LINGUAS" | tr '\n' ' '`" AM_GLIB_GNU_GETTEXT AM_GLIB_DEFINE_LOCALEDIR(INF_LOCALEDIR) ########### # Output ########### if test -n $has_strict_prototypes then CFLAGS=$old_CFLAGS fi AC_CONFIG_FILES([ Makefile libinfinity/Makefile libinfinity/communication/Makefile libinfinity/common/Makefile libinfinity/adopted/Makefile libinfinity/server/Makefile libinfinity/client/Makefile libinftext/Makefile libinfgtk/Makefile libinftextgtk/Makefile infinoted/Makefile infinoted/note-plugins/Makefile infinoted/note-plugins/text/Makefile pixmaps/Makefile pixmaps/16x16/Makefile pixmaps/22x22/Makefile pixmaps/scalable/Makefile test/Makefile test/util/Makefile test/session/Makefile test/cleanup/Makefile docs/Makefile docs/reference/Makefile docs/reference/version.xml.in docs/reference/api_version.xml.in docs/reference/libinfinity/Makefile docs/reference/libinftext/Makefile docs/reference/libinfgtk/Makefile docs/reference/libinftextgtk/Makefile po/Makefile.in ]) # These are separate for the macros to be expanded # (note no square brackets) AC_CONFIG_FILES( libinfinity-libinfinity_api_version.pc:libinfinity.pc.in libinftext-libinfinity_api_version.pc:libinftext.pc.in libinfgtk-libinfinity_api_version.pc:libinfgtk.pc.in libinftextgtk-libinfinity_api_version.pc:libinftextgtk.pc.in ) AC_OUTPUT echo " Build optional packages: libinfgtk: $with_infgtk libinftextgtk: $with_inftextgtk infinoted: $with_infinoted Enable support for: avahi: $use_avahi libdaemon: $use_libdaemon pam: $use_pam " # vim:set et: libinfinity-0.5.5/config.guess0000755000175000017500000012743212202130661013304 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011, 2012 Free Software Foundation, Inc. timestamp='2012-02-10' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, 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 Per Bothner. Please send patches (context # diff format) to and include a ChangeLog # entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-gnu else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-gnueabi else echo ${UNAME_MACHINE}-unknown-linux-gnueabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; hexagon:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:Linux:*:*) LIBC=gnu eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; padre:Linux:*:*) echo sparc-unknown-linux-gnu exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in i386) eval $set_cc_for_build if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then UNAME_PROCESSOR="x86_64" fi fi ;; unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: libinfinity-0.5.5/config.h.in0000644000175000017500000000717112264766064013030 00000000000000/* config.h.in. Generated from configure.ac by autoheader. */ /* always defined to indicate that i18n is enabled */ #undef ENABLE_NLS /* The domain name to use with gettext. */ #undef GETTEXT_PACKAGE /* Define to 1 if you have the `bind_textdomain_codeset' function. */ #undef HAVE_BIND_TEXTDOMAIN_CODESET /* Define to 1 if you have the `dcgettext' function. */ #undef HAVE_DCGETTEXT /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define this symbol if your struct dirent has the d_type field */ #undef HAVE_D_TYPE /* Define if the GNU gettext() function is already present or preinstalled. */ #undef HAVE_GETTEXT /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define if your file defines LC_MESSAGES. */ #undef HAVE_LC_MESSAGES /* Define to 1 if you have the header file. */ #undef HAVE_LOCALE_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define this symbol if you have MSG_NOSIGNAL */ #undef HAVE_MSG_NOSIGNAL /* Define this symbol if your pam has PAM_FAIL_DELAY */ #undef HAVE_PAM_FAIL_DELAY /* Define this symbol if you have SO_REUSEADDR */ #undef HAVE_SO_REUSEADDR /* 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 the location where the catalogs will be installed */ #undef INF_LOCALEDIR /* Whether avahi support is enabled */ #undef LIBINFINITY_HAVE_AVAHI /* Whether libdaemon support is enabled */ #undef LIBINFINITY_HAVE_LIBDAEMON /* Define this symbol if you have pam */ #undef LIBINFINITY_HAVE_PAM /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Define to 1 if your C compiler doesn't accept -c and -o together. */ #undef NO_MINUS_C_MINUS_O /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* 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 /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif /* Enable GNU extensions on systems that have them. */ #ifndef _GNU_SOURCE # undef _GNU_SOURCE #endif /* Enable threading extensions on Solaris. */ #ifndef _POSIX_PTHREAD_SEMANTICS # undef _POSIX_PTHREAD_SEMANTICS #endif /* Enable extensions on HP NonStop. */ #ifndef _TANDEM_SOURCE # undef _TANDEM_SOURCE #endif /* Enable general extensions on Solaris. */ #ifndef __EXTENSIONS__ # undef __EXTENSIONS__ #endif /* Version number of package */ #undef VERSION /* Define to 1 if on MINIX. */ #undef _MINIX /* Define to 2 if the system does not provide POSIX.1 features except with this defined. */ #undef _POSIX_1_SOURCE /* Define to 1 if you need to in order for `stat' and other things to work. */ #undef _POSIX_SOURCE libinfinity-0.5.5/test-driver0000755000175000017500000000761112254056256013174 00000000000000#! /bin/sh # test-driver - basic testsuite driver script. scriptversion=2012-06-27.10; # UTC # Copyright (C) 2011-2013 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. # This file is maintained in Automake, please report # bugs to or send patches to # . # Make unconditional expansion of undefined variables an error. This # helps a lot in preventing typo-related bugs. set -u usage_error () { echo "$0: $*" >&2 print_usage >&2 exit 2 } print_usage () { cat <$log_file 2>&1 estatus=$? if test $enable_hard_errors = no && test $estatus -eq 99; then estatus=1 fi case $estatus:$expect_failure in 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; 0:*) col=$grn res=PASS recheck=no gcopy=no;; 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;; *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;; *:*) col=$red res=FAIL recheck=yes gcopy=yes;; esac # Report outcome to console. echo "${col}${res}${std}: $test_name" # Register the test result, and other relevant metadata. echo ":test-result: $res" > $trs_file echo ":global-test-result: $res" >> $trs_file echo ":recheck: $recheck" >> $trs_file echo ":copy-in-global-log: $gcopy" >> $trs_file # 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: libinfinity-0.5.5/aclocal.m40000644000175000017500000017127712264766063012655 00000000000000# generated automatically by aclocal 1.13.3 -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # Copyright (C) 1995-2002 Free Software Foundation, Inc. # Copyright (C) 2001-2003,2004 Red Hat, Inc. # # This file is free software, distributed under the terms of the GNU # General Public License. As a special exception to the GNU General # Public License, this file may be distributed as part of a program # that contains a configuration script generated by Autoconf, under # the same distribution terms as the rest of that program. # # This file can be copied and used freely without restrictions. It can # be used in projects which are not available under the GNU Public License # but which still want to provide support for the GNU gettext functionality. # # Macro to add for using GNU gettext. # Ulrich Drepper , 1995, 1996 # # Modified to never use included libintl. # Owen Taylor , 12/15/1998 # # Major rework to remove unused code # Owen Taylor , 12/11/2002 # # Added better handling of ALL_LINGUAS from GNU gettext version # written by Bruno Haible, Owen Taylor 5/30/3002 # # Modified to require ngettext # Matthias Clasen 08/06/2004 # # We need this here as well, since someone might use autoconf-2.5x # to configure GLib then an older version to configure a package # using AM_GLIB_GNU_GETTEXT AC_PREREQ(2.53) dnl dnl We go to great lengths to make sure that aclocal won't dnl try to pull in the installed version of these macros dnl when running aclocal in the glib directory. dnl m4_copy([AC_DEFUN],[glib_DEFUN]) m4_copy([AC_REQUIRE],[glib_REQUIRE]) dnl dnl At the end, if we're not within glib, we'll define the public dnl definitions in terms of our private definitions. dnl # GLIB_LC_MESSAGES #-------------------- glib_DEFUN([GLIB_LC_MESSAGES], [AC_CHECK_HEADERS([locale.h]) if test $ac_cv_header_locale_h = yes; then AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, [AC_TRY_LINK([#include ], [return LC_MESSAGES], am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)]) if test $am_cv_val_LC_MESSAGES = yes; then AC_DEFINE(HAVE_LC_MESSAGES, 1, [Define if your file defines LC_MESSAGES.]) fi fi]) # GLIB_PATH_PROG_WITH_TEST #---------------------------- dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) glib_DEFUN([GLIB_PATH_PROG_WITH_TEST], [# Extract the first word of "$2", so it can be a program name with args. set dummy $2; ac_word=[$]2 AC_MSG_CHECKING([for $ac_word]) AC_CACHE_VAL(ac_cv_path_$1, [case "[$]$1" in /*) ac_cv_path_$1="[$]$1" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in ifelse([$5], , $PATH, [$5]); do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if [$3]; then ac_cv_path_$1="$ac_dir/$ac_word" break fi fi done IFS="$ac_save_ifs" dnl If no 4th arg is given, leave the cache variable unset, dnl so AC_PATH_PROGS will keep looking. ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" ])dnl ;; esac])dnl $1="$ac_cv_path_$1" if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then AC_MSG_RESULT([$]$1) else AC_MSG_RESULT(no) fi AC_SUBST($1)dnl ]) # GLIB_WITH_NLS #----------------- glib_DEFUN([GLIB_WITH_NLS], dnl NLS is obligatory [USE_NLS=yes AC_SUBST(USE_NLS) gt_cv_have_gettext=no CATOBJEXT=NONE XGETTEXT=: INTLLIBS= AC_CHECK_HEADER(libintl.h, [gt_cv_func_dgettext_libintl="no" libintl_extra_libs="" # # First check in libc # AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc, [AC_TRY_LINK([ #include ], [return !ngettext ("","", 1)], gt_cv_func_ngettext_libc=yes, gt_cv_func_ngettext_libc=no) ]) if test "$gt_cv_func_ngettext_libc" = "yes" ; then AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc, [AC_TRY_LINK([ #include ], [return !dgettext ("","")], gt_cv_func_dgettext_libc=yes, gt_cv_func_dgettext_libc=no) ]) fi if test "$gt_cv_func_ngettext_libc" = "yes" ; then AC_CHECK_FUNCS(bind_textdomain_codeset) fi # # If we don't have everything we want, check in libintl # if test "$gt_cv_func_dgettext_libc" != "yes" \ || test "$gt_cv_func_ngettext_libc" != "yes" \ || test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then AC_CHECK_LIB(intl, bindtextdomain, [AC_CHECK_LIB(intl, ngettext, [AC_CHECK_LIB(intl, dgettext, gt_cv_func_dgettext_libintl=yes)])]) if test "$gt_cv_func_dgettext_libintl" != "yes" ; then AC_MSG_CHECKING([if -liconv is needed to use gettext]) AC_MSG_RESULT([]) AC_CHECK_LIB(intl, ngettext, [AC_CHECK_LIB(intl, dcgettext, [gt_cv_func_dgettext_libintl=yes libintl_extra_libs=-liconv], :,-liconv)], :,-liconv) fi # # If we found libintl, then check in it for bind_textdomain_codeset(); # we'll prefer libc if neither have bind_textdomain_codeset(), # and both have dgettext and ngettext # if test "$gt_cv_func_dgettext_libintl" = "yes" ; then glib_save_LIBS="$LIBS" LIBS="$LIBS -lintl $libintl_extra_libs" unset ac_cv_func_bind_textdomain_codeset AC_CHECK_FUNCS(bind_textdomain_codeset) LIBS="$glib_save_LIBS" if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then gt_cv_func_dgettext_libc=no else if test "$gt_cv_func_dgettext_libc" = "yes" \ && test "$gt_cv_func_ngettext_libc" = "yes"; then gt_cv_func_dgettext_libintl=no fi fi fi fi if test "$gt_cv_func_dgettext_libc" = "yes" \ || test "$gt_cv_func_dgettext_libintl" = "yes"; then gt_cv_have_gettext=yes fi if test "$gt_cv_func_dgettext_libintl" = "yes"; then INTLLIBS="-lintl $libintl_extra_libs" fi if test "$gt_cv_have_gettext" = "yes"; then AC_DEFINE(HAVE_GETTEXT,1, [Define if the GNU gettext() function is already present or preinstalled.]) GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl if test "$MSGFMT" != "no"; then glib_save_LIBS="$LIBS" LIBS="$LIBS $INTLLIBS" AC_CHECK_FUNCS(dcgettext) MSGFMT_OPTS= AC_MSG_CHECKING([if msgfmt accepts -c]) GLIB_RUN_PROG([$MSGFMT -c -o /dev/null],[ msgid "" msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Project-Id-Version: test 1.0\n" "PO-Revision-Date: 2007-02-15 12:01+0100\n" "Last-Translator: test \n" "Language-Team: C \n" "MIME-Version: 1.0\n" "Content-Transfer-Encoding: 8bit\n" ], [MSGFMT_OPTS=-c; AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])]) AC_SUBST(MSGFMT_OPTS) AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) AC_TRY_LINK(, [extern int _nl_msg_cat_cntr; return _nl_msg_cat_cntr], [CATOBJEXT=.gmo DATADIRNAME=share], [case $host in *-*-solaris*) dnl On Solaris, if bind_textdomain_codeset is in libc, dnl GNU format message catalog is always supported, dnl since both are added to the libc all together. dnl Hence, we'd like to go with DATADIRNAME=share and dnl and CATOBJEXT=.gmo in this case. AC_CHECK_FUNC(bind_textdomain_codeset, [CATOBJEXT=.gmo DATADIRNAME=share], [CATOBJEXT=.mo DATADIRNAME=lib]) ;; *-*-openbsd*) CATOBJEXT=.mo DATADIRNAME=share ;; *) CATOBJEXT=.mo DATADIRNAME=lib ;; esac]) LIBS="$glib_save_LIBS" INSTOBJEXT=.mo else gt_cv_have_gettext=no fi fi ]) if test "$gt_cv_have_gettext" = "yes" ; then AC_DEFINE(ENABLE_NLS, 1, [always defined to indicate that i18n is enabled]) fi dnl Test whether we really found GNU xgettext. if test "$XGETTEXT" != ":"; then dnl If it is not GNU xgettext we define it as : so that the dnl Makefiles still can work. if $XGETTEXT --omit-header /dev/null 2> /dev/null; then : ; else AC_MSG_RESULT( [found xgettext program is not GNU xgettext; ignore it]) XGETTEXT=":" fi fi # We need to process the po/ directory. POSUB=po AC_OUTPUT_COMMANDS( [case "$CONFIG_FILES" in *po/Makefile.in*) sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile esac]) dnl These rules are solely for the distribution goal. While doing this dnl we only have to keep exactly one list of the available catalogs dnl in configure.ac. for lang in $ALL_LINGUAS; do GMOFILES="$GMOFILES $lang.gmo" POFILES="$POFILES $lang.po" done dnl Make all variables we use known to autoconf. AC_SUBST(CATALOGS) AC_SUBST(CATOBJEXT) AC_SUBST(DATADIRNAME) AC_SUBST(GMOFILES) AC_SUBST(INSTOBJEXT) AC_SUBST(INTLLIBS) AC_SUBST(PO_IN_DATADIR_TRUE) AC_SUBST(PO_IN_DATADIR_FALSE) AC_SUBST(POFILES) AC_SUBST(POSUB) ]) # AM_GLIB_GNU_GETTEXT # ------------------- # Do checks necessary for use of gettext. If a suitable implementation # of gettext is found in either in libintl or in the C library, # it will set INTLLIBS to the libraries needed for use of gettext # and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable # gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST() # on various variables needed by the Makefile.in.in installed by # glib-gettextize. dnl glib_DEFUN([GLIB_GNU_GETTEXT], [AC_REQUIRE([AC_PROG_CC])dnl GLIB_LC_MESSAGES GLIB_WITH_NLS if test "$gt_cv_have_gettext" = "yes"; then if test "x$ALL_LINGUAS" = "x"; then LINGUAS= else AC_MSG_CHECKING(for catalogs to be installed) NEW_LINGUAS= for presentlang in $ALL_LINGUAS; do useit=no if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then desiredlanguages="$LINGUAS" else desiredlanguages="$ALL_LINGUAS" fi for desiredlang in $desiredlanguages; do # Use the presentlang catalog if desiredlang is # a. equal to presentlang, or # b. a variant of presentlang (because in this case, # presentlang can be used as a fallback for messages # which are not translated in the desiredlang catalog). case "$desiredlang" in "$presentlang"*) useit=yes;; esac done if test $useit = yes; then NEW_LINGUAS="$NEW_LINGUAS $presentlang" fi done LINGUAS=$NEW_LINGUAS AC_MSG_RESULT($LINGUAS) fi dnl Construct list of names of catalog files to be constructed. if test -n "$LINGUAS"; then for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done fi fi dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly dnl find the mkinstalldirs script in another subdir but ($top_srcdir). dnl Try to locate is. MKINSTALLDIRS= if test -n "$ac_aux_dir"; then MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" fi if test -z "$MKINSTALLDIRS"; then MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" fi AC_SUBST(MKINSTALLDIRS) dnl Generate list of files to be processed by xgettext which will dnl be included in po/Makefile. test -d po || mkdir po if test "x$srcdir" != "x."; then if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then posrcprefix="$srcdir/" else posrcprefix="../$srcdir/" fi else posrcprefix="../" fi rm -f po/POTFILES sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ < $srcdir/po/POTFILES.in > po/POTFILES ]) # AM_GLIB_DEFINE_LOCALEDIR(VARIABLE) # ------------------------------- # Define VARIABLE to the location where catalog files will # be installed by po/Makefile. glib_DEFUN([GLIB_DEFINE_LOCALEDIR], [glib_REQUIRE([GLIB_GNU_GETTEXT])dnl glib_save_prefix="$prefix" glib_save_exec_prefix="$exec_prefix" glib_save_datarootdir="$datarootdir" test "x$prefix" = xNONE && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix=$prefix datarootdir=`eval echo "${datarootdir}"` if test "x$CATOBJEXT" = "x.mo" ; then localedir=`eval echo "${libdir}/locale"` else localedir=`eval echo "${datadir}/locale"` fi prefix="$glib_save_prefix" exec_prefix="$glib_save_exec_prefix" datarootdir="$glib_save_datarootdir" AC_DEFINE_UNQUOTED($1, "$localedir", [Define the location where the catalogs will be installed]) ]) dnl dnl Now the definitions that aclocal will find dnl ifdef(glib_configure_ac,[],[ AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)]) AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)]) ])dnl # GLIB_RUN_PROG(PROGRAM, TEST-FILE, [ACTION-IF-PASS], [ACTION-IF-FAIL]) # # Create a temporary file with TEST-FILE as its contents and pass the # file name to PROGRAM. Perform ACTION-IF-PASS if PROGRAM exits with # 0 and perform ACTION-IF-FAIL for any other exit status. AC_DEFUN([GLIB_RUN_PROG], [cat >conftest.foo <<_ACEOF $2 _ACEOF if AC_RUN_LOG([$1 conftest.foo]); then m4_ifval([$3], [$3], [:]) m4_ifvaln([$4], [else $4])dnl echo "$as_me: failed input was:" >&AS_MESSAGE_LOG_FD sed 's/^/| /' conftest.foo >&AS_MESSAGE_LOG_FD fi]) # 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|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])# 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` test "x$?" != "x0" && pkg_failed=yes ], [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 --cflags --libs "$2" 2>&1` else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD m4_default([$4], [AC_MSG_ERROR( [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT])[]dnl ]) elif test $pkg_failed = untried; then AC_MSG_RESULT([no]) m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT To get pkg-config, see .])[]dnl ]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) $3 fi[]dnl ])# PKG_CHECK_MODULES # Copyright (C) 2002-2013 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.13' 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.13.3], [], [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.13.3])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # Copyright (C) 2011-2013 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_AR([ACT-IF-FAIL]) # ------------------------- # Try to determine the archiver interface, and trigger the ar-lib wrapper # if it is needed. If the detection of archiver interface fails, run # ACT-IF-FAIL (default is to abort configure with a proper error message). AC_DEFUN([AM_PROG_AR], [AC_BEFORE([$0], [LT_INIT])dnl AC_BEFORE([$0], [AC_PROG_LIBTOOL])dnl AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([ar-lib])dnl AC_CHECK_TOOLS([AR], [ar lib "link -lib"], [false]) : ${AR=ar} AC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface], [am_cv_ar_interface=ar AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int some_variable = 0;]])], [am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([am_ar_try]) if test "$ac_status" -eq 0; then am_cv_ar_interface=ar else am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([am_ar_try]) if test "$ac_status" -eq 0; then am_cv_ar_interface=lib else am_cv_ar_interface=unknown fi fi rm -f conftest.lib libconftest.a ]) ]) case $am_cv_ar_interface in ar) ;; lib) # Microsoft lib, so override with the ar-lib wrapper script. # FIXME: It is wrong to rewrite AR. # 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__AR in this case, # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something # similar. AR="$am_aux_dir/ar-lib $AR" ;; unknown) m4_default([$1], [AC_MSG_ERROR([could not determine $AR interface])]) ;; esac AC_SUBST([AR])dnl ]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2013 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-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], [$1], [UPC], [depcc="$UPC" am_compiler_list=], [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each '.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl ]) 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-2013 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-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering # Copyright (C) 1996-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAINTAINER_MODE([DEFAULT-MODE]) # ---------------------------------- # Control maintainer-specific portions of Makefiles. # Default is to disable them, unless 'enable' is passed literally. # For symmetry, 'disable' may be passed as well. Anyway, the user # can override the default with the --enable/--disable switch. AC_DEFUN([AM_MAINTAINER_MODE], [m4_case(m4_default([$1], [disable]), [enable], [m4_define([am_maintainer_other], [disable])], [disable], [m4_define([am_maintainer_other], [enable])], [m4_define([am_maintainer_other], [enable]) m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode's default is 'disable' unless 'enable' is passed AC_ARG_ENABLE([maintainer-mode], [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode], am_maintainer_other[ make rules and dependencies not useful (and sometimes confusing) to the casual installer])], [USE_MAINTAINER_MODE=$enableval], [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST([MAINT])dnl ] ) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_CC_C_O # -------------- # Like AC_PROG_CC_C_O, but changed for automake. 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-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it is modern enough. # If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2013 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-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar # AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([m4/gtk-doc.m4]) m4_include([m4/libtool.m4]) m4_include([m4/ltoptions.m4]) m4_include([m4/ltsugar.m4]) m4_include([m4/ltversion.m4]) m4_include([m4/lt~obsolete.m4]) libinfinity-0.5.5/test/0000755000175000017500000000000012264766270012035 500000000000000libinfinity-0.5.5/test/inf-test-browser.c0000644000175000017500000002200112264763732015326 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include #include #include #include #include #include #include typedef struct _InfTestBrowser InfTestBrowser; struct _InfTestBrowser { InfStandaloneIo* io; InfXmppConnection* conn; InfcBrowser* browser; #ifndef G_OS_WIN32 int input_fd; #endif InfcBrowserIter cwd; }; typedef void(*InfTestBrowserCmdFunc)(InfTestBrowser*, const gchar*); typedef struct _InfTestBrowserCmd InfTestBrowserCmd; struct _InfTestBrowserCmd { const gchar* name; InfTestBrowserCmdFunc func; }; static gboolean inf_test_browser_find_node(InfTestBrowser* test, const gchar* name, InfcBrowserIter* result_iter) { InfcBrowserIter iter; gboolean result; if(infc_browser_iter_get_explored(test->browser, &test->cwd) == FALSE) { fprintf( stderr, "Directory '%s' not yet explored\n", infc_browser_iter_get_name(test->browser, &test->cwd) ); } else { iter = test->cwd; for(result = infc_browser_iter_get_child(test->browser, &iter); result == TRUE; result = infc_browser_iter_get_next(test->browser, &iter)) { if(strcmp(infc_browser_iter_get_name(test->browser, &iter), name) == 0) { *result_iter = iter; return TRUE; } } } return FALSE; } static void inf_test_browser_cmd_ls(InfTestBrowser* test, const gchar* param) { InfcBrowserIter iter; gboolean result; if(infc_browser_iter_get_explored(test->browser, &test->cwd) == FALSE) { fprintf( stderr, "Directory '%s' not yet explored\n", infc_browser_iter_get_name(test->browser, &test->cwd) ); } else { iter = test->cwd; for(result = infc_browser_iter_get_child(test->browser, &iter); result == TRUE; result = infc_browser_iter_get_next(test->browser, &iter)) { printf("%s\n", infc_browser_iter_get_name(test->browser, &iter)); } } } static void inf_test_browser_cmd_cd(InfTestBrowser* test, const gchar* param) { InfcBrowserIter iter; if(strcmp(param, "..") == 0) { iter = test->cwd; if(infc_browser_iter_get_parent(test->browser, &iter) == FALSE) { fprintf(stderr, "Already at the root directory\n"); } else { test->cwd = iter; } } else if(inf_test_browser_find_node(test, param, &iter) == FALSE) { fprintf( stderr, "Directory '%s' does not exist\n", param ); } else if(infc_browser_iter_get_explored(test->browser, &iter) == FALSE) { fprintf( stderr, "Directory '%s' not yet explored\n", infc_browser_iter_get_name(test->browser, &iter) ); } else { test->cwd = iter; } } static void inf_test_browser_cmd_explore(InfTestBrowser* test, const gchar* param) { InfcBrowserIter iter; if(inf_test_browser_find_node(test, param, &iter) == FALSE) { fprintf( stderr, "Directory '%s' does not exist\n", param ); } else if(infc_browser_iter_get_explored(test->browser, &iter) == TRUE) { fprintf( stderr, "Directory '%s' is already explored", infc_browser_iter_get_name(test->browser, &iter) ); } else { infc_browser_iter_explore(test->browser, &iter); } } static void inf_test_browser_cmd_create(InfTestBrowser* test, const gchar* param) { infc_browser_add_subdirectory(test->browser, &test->cwd, param); } static void inf_test_browser_cmd_remove(InfTestBrowser* test, const gchar* param) { InfcBrowserIter iter; if(inf_test_browser_find_node(test, param, &iter) == FALSE) { fprintf( stderr, "Directory '%s' does not exist\n", param ); } else { infc_browser_remove_node(test->browser, &iter); } } static const InfTestBrowserCmd inf_test_browser_commands[] = { { "ls", inf_test_browser_cmd_ls }, { "cd", inf_test_browser_cmd_cd }, { "explore", inf_test_browser_cmd_explore }, { "create", inf_test_browser_cmd_create }, { "remove", inf_test_browser_cmd_remove } }; static void inf_test_browser_input_cb(InfNativeSocket* fd, InfIoEvent io, gpointer user_data) { InfTestBrowser* test; char buffer[1024]; char* occ; guint i; test = (InfTestBrowser*)user_data; if(io & INF_IO_ERROR) { } if(io & INF_IO_INCOMING) { if(fgets(buffer, sizeof(buffer), stdin) == NULL) { inf_standalone_io_loop_quit(test->io); } else if(strlen(buffer) != sizeof(buffer) || buffer[sizeof(buffer)-2] == '\n') { buffer[strlen(buffer)-1] = '\0'; /* Read entire line */ occ = strchr(buffer, ' '); if(occ != NULL) { *occ = '\0'; ++ occ; } for(i = 0; i < G_N_ELEMENTS(inf_test_browser_commands); ++ i) { if(strcmp(inf_test_browser_commands[i].name, buffer) == 0) { inf_test_browser_commands[i].func(test, occ); break; } } if(i == G_N_ELEMENTS(inf_test_browser_commands)) { fprintf(stderr, "'%s': Command not found\n", buffer); } } } } static void inf_test_browser_error_cb(InfcBrowser* browser, GError* error, gpointer user_data) { fprintf(stderr, "Connection error: %s\n", error->message); } static void inf_test_browser_notify_status_cb(GObject* object, GParamSpec* pspec, gpointer user_data) { InfTestBrowser* test; test = (InfTestBrowser*)user_data; if(infc_browser_get_status(test->browser) == INFC_BROWSER_CONNECTED) { printf("Connection established\n"); #ifndef G_OS_WIN32 inf_io_add_watch( INF_IO(test->io), &test->input_fd, INF_IO_INCOMING | INF_IO_ERROR, inf_test_browser_input_cb, test, NULL ); #endif /* Explore root node */ infc_browser_iter_get_root(test->browser, &test->cwd); infc_browser_iter_explore(test->browser, &test->cwd); } if(infc_browser_get_status(test->browser) == INFC_BROWSER_DISCONNECTED) { if(inf_standalone_io_loop_running(test->io)) inf_standalone_io_loop_quit(test->io); } } int main(int argc, char* argv[]) { InfTestBrowser test; InfIpAddress* address; InfCommunicationManager* manager; InfTcpConnection* tcp_conn; GError* error; gnutls_global_init(); g_type_init(); test.io = inf_standalone_io_new(); #ifndef G_OS_WIN32 test.input_fd = STDIN_FILENO; #endif address = inf_ip_address_new_loopback4(); error = NULL; tcp_conn = inf_tcp_connection_new_and_open(INF_IO(test.io), address, inf_protocol_get_default_port(), &error); inf_ip_address_free(address); if(tcp_conn == NULL) { fprintf(stderr, "Could not open TCP connection: %s\n", error->message); g_error_free(error); } else { test.conn = inf_xmpp_connection_new( tcp_conn, INF_XMPP_CONNECTION_CLIENT, NULL, "localhost", INF_XMPP_CONNECTION_SECURITY_BOTH_PREFER_TLS, NULL, NULL, NULL ); g_object_unref(G_OBJECT(tcp_conn)); manager = inf_communication_manager_new(); test.browser = infc_browser_new( INF_IO(test.io), manager, INF_XML_CONNECTION(test.conn) ); g_signal_connect_after( G_OBJECT(test.browser), "notify::status", G_CALLBACK(inf_test_browser_notify_status_cb), &test ); g_signal_connect( G_OBJECT(test.browser), "error", G_CALLBACK(inf_test_browser_error_cb), &test ); inf_standalone_io_loop(test.io); g_object_unref(G_OBJECT(manager)); g_object_unref(G_OBJECT(test.browser)); /* TODO: Wait until the XMPP connection is in status closed */ g_object_unref(G_OBJECT(test.conn)); } g_object_unref(G_OBJECT(test.io)); return 0; } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/test/session/0000755000175000017500000000000012264766270013520 500000000000000libinfinity-0.5.5/test/session/test-49.xml0000644000175000017500000000121511072475776015376 00000000000000 c a c d c d a libinfinity-0.5.5/test/session/test-02.xml0000644000175000017500000000066611072475776015374 00000000000000 1 c 1 c libinfinity-0.5.5/test/session/test-25.xml0000644000175000017500000000173511072475776015377 00000000000000 abcd x x y acd libinfinity-0.5.5/test/session/test-32.xml0000644000175000017500000000104011072475776015362 00000000000000 ab ab libinfinity-0.5.5/test/session/test-46.xml0000644000175000017500000000111411072475776015371 00000000000000 abcdefg foo foo libinfinity-0.5.5/test/session/test-24.xml0000644000175000017500000000177711072475776015404 00000000000000 a x z a y y z libinfinity-0.5.5/test/session/Makefile.am0000644000175000017500000000143111313224527015457 00000000000000EXTRA_DIST = \ test-01.xml \ test-02.xml \ test-03.xml \ test-04.xml \ test-05.xml \ test-06.xml \ test-07.xml \ test-08.xml \ test-09.xml \ test-10.xml \ test-11.xml \ test-12.xml \ test-13.xml \ test-14.xml \ test-15.xml \ test-16.xml \ test-17.xml \ test-18.xml \ test-19.xml \ test-20.xml \ test-21.xml \ test-22.xml \ test-23.xml \ test-24.xml \ test-25.xml \ test-26.xml \ test-27.xml \ test-28.xml \ test-29.xml \ test-30.xml \ test-31.xml \ test-32.xml \ test-33.xml \ test-34.xml \ test-35.xml \ test-36.xml \ test-37.xml \ test-38.xml \ test-39.xml \ test-40.xml \ test-41.xml \ test-42.xml \ test-43.xml \ test-44.xml \ test-45.xml \ test-46.xml \ test-47.xml \ test-48.xml \ test-49.xml \ test-50.xml \ test-51.xml \ test-52.xml libinfinity-0.5.5/test/session/test-51.xml0000644000175000017500000000640211072476000015347 00000000000000 abcd x x z a y g tez tar tez a z c tary x libinfinity-0.5.5/test/session/test-26.xml0000644000175000017500000000171311072475776015374 00000000000000 a b c a c b libinfinity-0.5.5/test/session/test-39.xml0000644000175000017500000000100411072475776015371 00000000000000 a b libinfinity-0.5.5/test/session/test-48.xml0000644000175000017500000000153211072475776015377 00000000000000 abcd z y abc y libinfinity-0.5.5/test/session/test-20.xml0000644000175000017500000000135211072475776015365 00000000000000 ABCDE Y Z ABC libinfinity-0.5.5/test/session/test-52.xml0000644000175000017500000000071011313224527015347 00000000000000 b libinfinity-0.5.5/test/session/test-12.xml0000644000175000017500000000132211072475776015363 00000000000000 2 3 4 h h h hhh 432 libinfinity-0.5.5/test/session/test-04.xml0000644000175000017500000000127411072475776015372 00000000000000 1 b c d d b libinfinity-0.5.5/test/session/test-38.xml0000644000175000017500000000104611072475776015376 00000000000000 ab ab libinfinity-0.5.5/test/session/test-30.xml0000644000175000017500000000170111072475776015364 00000000000000 a b b a libinfinity-0.5.5/test/session/test-07.xml0000644000175000017500000000124511072475776015373 00000000000000 a b c a c libinfinity-0.5.5/test/session/test-33.xml0000644000175000017500000000102211072475776015363 00000000000000 M S A M A libinfinity-0.5.5/test/session/test-16.xml0000644000175000017500000000125211072475776015371 00000000000000 x a a libinfinity-0.5.5/test/session/test-34.xml0000644000175000017500000000105111072475776015366 00000000000000 ab ab libinfinity-0.5.5/test/session/Makefile.in0000644000175000017500000003341012264766066015511 00000000000000# Makefile.in generated by automake 1.13.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = test/session DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/mkinstalldirs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/libinfinity/inf-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBINFINITY_API_VERSION = @LIBINFINITY_API_VERSION@ LIBINFINITY_LIBTOOL_VERSION = @LIBINFINITY_LIBTOOL_VERSION@ LIBINFINITY_VERSION = @LIBINFINITY_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ avahi_CFLAGS = @avahi_CFLAGS@ avahi_LIBS = @avahi_LIBS@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gtk_requirement = @gtk_requirement@ gtk_version = @gtk_version@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infgtk_CFLAGS = @infgtk_CFLAGS@ infgtk_LIBS = @infgtk_LIBS@ infinity_CFLAGS = @infinity_CFLAGS@ infinity_LIBS = @infinity_LIBS@ infinoted_CFLAGS = @infinoted_CFLAGS@ infinoted_LIBS = @infinoted_LIBS@ infodir = @infodir@ inftext_CFLAGS = @inftext_CFLAGS@ inftext_LIBS = @inftext_LIBS@ inftextgtk_CFLAGS = @inftextgtk_CFLAGS@ inftextgtk_LIBS = @inftextgtk_LIBS@ install_sh = @install_sh@ libdaemon_CFLAGS = @libdaemon_CFLAGS@ libdaemon_LIBS = @libdaemon_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = \ test-01.xml \ test-02.xml \ test-03.xml \ test-04.xml \ test-05.xml \ test-06.xml \ test-07.xml \ test-08.xml \ test-09.xml \ test-10.xml \ test-11.xml \ test-12.xml \ test-13.xml \ test-14.xml \ test-15.xml \ test-16.xml \ test-17.xml \ test-18.xml \ test-19.xml \ test-20.xml \ test-21.xml \ test-22.xml \ test-23.xml \ test-24.xml \ test-25.xml \ test-26.xml \ test-27.xml \ test-28.xml \ test-29.xml \ test-30.xml \ test-31.xml \ test-32.xml \ test-33.xml \ test-34.xml \ test-35.xml \ test-36.xml \ test-37.xml \ test-38.xml \ test-39.xml \ test-40.xml \ test-41.xml \ test-42.xml \ test-43.xml \ test-44.xml \ test-45.xml \ test-46.xml \ test-47.xml \ test-48.xml \ test-49.xml \ test-50.xml \ test-51.xml \ test-52.xml all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu test/session/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu test/session/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am # 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: libinfinity-0.5.5/test/session/test-18.xml0000644000175000017500000000161211072475776015373 00000000000000 a b c a libinfinity-0.5.5/test/session/test-36.xml0000644000175000017500000000112411072475776015371 00000000000000 a b libinfinity-0.5.5/test/session/test-14.xml0000644000175000017500000000106011072475776015364 00000000000000 a b c b a libinfinity-0.5.5/test/session/test-44.xml0000644000175000017500000000103611072475776015372 00000000000000 a b c c b a libinfinity-0.5.5/test/session/test-35.xml0000644000175000017500000000104611072475776015373 00000000000000 ab 1 ab libinfinity-0.5.5/test/session/test-41.xml0000644000175000017500000000123611072475776015371 00000000000000 A B A libinfinity-0.5.5/test/session/test-23.xml0000644000175000017500000000126011072475776015366 00000000000000 x a a libinfinity-0.5.5/test/session/test-19.xml0000644000175000017500000000111011072475776015365 00000000000000 x a a libinfinity-0.5.5/test/session/test-45.xml0000644000175000017500000000120611072475776015372 00000000000000 a b c d d c b a libinfinity-0.5.5/test/session/test-31.xml0000644000175000017500000000073211072475776015370 00000000000000 a b libinfinity-0.5.5/test/session/test-01.xml0000644000175000017500000000111711072475776015363 00000000000000 abcdefghi ac bc ac bc fghi libinfinity-0.5.5/test/session/test-28.xml0000644000175000017500000000127211072475776015376 00000000000000 a b c c a libinfinity-0.5.5/test/session/test-13.xml0000644000175000017500000000132211072475776015364 00000000000000 2 3 4 h h h 432 hhh libinfinity-0.5.5/test/session/test-09.xml0000644000175000017500000000204311072475776015372 00000000000000 a b cd b c b d a libinfinity-0.5.5/test/session/test-43.xml0000644000175000017500000000066611072475776015401 00000000000000 a b b a libinfinity-0.5.5/test/session/test-40.xml0000644000175000017500000000105711072475776015371 00000000000000 AC B A B C libinfinity-0.5.5/test/session/test-11.xml0000644000175000017500000000132211072475776015362 00000000000000 2 3 4 h h h 234 hhh libinfinity-0.5.5/test/session/test-08.xml0000644000175000017500000000141111072475776015367 00000000000000 a c d a c libinfinity-0.5.5/test/session/test-42.xml0000644000175000017500000000074411072475776015375 00000000000000 ABCDE libinfinity-0.5.5/test/session/test-37.xml0000644000175000017500000000103611072475776015374 00000000000000 b b libinfinity-0.5.5/test/session/test-15.xml0000644000175000017500000000106011072475776015365 00000000000000 a b c a b libinfinity-0.5.5/test/session/test-27.xml0000644000175000017500000000111711072475776015373 00000000000000 a b c c libinfinity-0.5.5/test/session/test-17.xml0000644000175000017500000000160711072475776015376 00000000000000 a b c a libinfinity-0.5.5/test/session/test-10.xml0000644000175000017500000000132211072475776015361 00000000000000 2 3 4 h h h hhh 234 libinfinity-0.5.5/test/session/test-05.xml0000644000175000017500000000127411072475776015373 00000000000000 1 b c d b d libinfinity-0.5.5/test/session/test-47.xml0000644000175000017500000000121211072475776015371 00000000000000 abcd x x ac x x libinfinity-0.5.5/test/session/test-22.xml0000644000175000017500000000132411072475776015366 00000000000000 x a a a libinfinity-0.5.5/test/session/test-21.xml0000644000175000017500000000164211072475776015370 00000000000000 ABCDE Y Z DEG ABCDE libinfinity-0.5.5/test/session/test-06.xml0000644000175000017500000000124511072475776015372 00000000000000 a b c c a libinfinity-0.5.5/test/session/test-03.xml0000644000175000017500000000066611072475776015375 00000000000000 1 c c 1 libinfinity-0.5.5/test/session/test-50.xml0000644000175000017500000000424311072476000015347 00000000000000 a b c d e f g h i j a b c d e f g h i j abcdefghij libinfinity-0.5.5/test/session/test-29.xml0000644000175000017500000000106611072475776015400 00000000000000 a b b libinfinity-0.5.5/test/inf-test-xmpp-connection.c0000644000175000017500000000662212264763732016777 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include #include #include #include #include #include #include static void error_cb(InfTcpConnection* connection, GError* error, gpointer user_data) { fprintf(stderr, "Error occured: %s\n", error->message); /* if(inf_standalone_io_loop_running(INF_STANDALONE_IO(user_data))) inf_standalone_io_loop_quit(INF_STANDALONE_IO(user_data));*/ } static void notify_status_cb(InfXmppConnection* xmpp, const gchar* property, gpointer user_data) { InfXmlConnectionStatus status; g_object_get(G_OBJECT(xmpp), "status", &status,NULL); switch(status) { case INF_XML_CONNECTION_OPENING: printf("Opening\n"); break; case INF_XML_CONNECTION_OPEN: printf("Opened\n"); inf_xml_connection_close(INF_XML_CONNECTION(xmpp)); break; case INF_XML_CONNECTION_CLOSING: printf("Closing\n"); break; case INF_XML_CONNECTION_CLOSED: printf("Closed\n"); inf_standalone_io_loop_quit(INF_STANDALONE_IO(user_data)); break; default: g_assert_not_reached(); break; } } int main(int argc, char* argv[]) { InfIpAddress* addr; InfStandaloneIo* io; InfTcpConnection* connection; InfXmppConnection* xmpp; GError* error; gnutls_global_init(); g_type_init(); #if 0 addr = inf_ip_address_new_from_string("88.198.49.206"); /* This is jabber.0x539.de aka durotan.0x539.de */ #else addr = inf_ip_address_new_from_string("127.0.0.1"); /* This is localhost aka loopback */ #endif io = inf_standalone_io_new(); error = NULL; connection = inf_tcp_connection_new_and_open(INF_IO(io), addr, 5223, &error); inf_ip_address_free(addr); if(connection == NULL) { fprintf(stderr, "Could not open connection: %s\n", error->message); g_error_free(error); } else { xmpp = inf_xmpp_connection_new( connection, INF_XMPP_CONNECTION_CLIENT, NULL, "jabber.0x539.de", INF_XMPP_CONNECTION_SECURITY_BOTH_PREFER_TLS, NULL, NULL, NULL ); g_signal_connect(G_OBJECT(xmpp), "error", G_CALLBACK(error_cb), io); g_signal_connect(G_OBJECT(xmpp), "notify::status", G_CALLBACK(notify_status_cb), io); inf_standalone_io_loop(io); } g_object_unref(G_OBJECT(io)); if(connection) g_object_unref(G_OBJECT(connection)); gnutls_global_deinit(); return 0; } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/test/inf-test-state-vector.c0000644000175000017500000001113212264763732016266 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include static void cmp(const char* should_be, InfAdoptedStateVector* vec) { char* is; InfAdoptedStateVector* should_be_vec; is = inf_adopted_state_vector_to_string(vec); if (strcmp(should_be, is) != 0) { printf("should be: %s\n" "is: %s\n" "strcmp failed\n", should_be, is); g_assert_not_reached(); } should_be_vec = inf_adopted_state_vector_from_string(should_be, NULL); if (!should_be_vec || inf_adopted_state_vector_compare(vec, should_be_vec) != 0 || inf_adopted_state_vector_compare(should_be_vec, vec) != 0) { printf("should be: %s\n" "is: %s\n" "compare failed\n", should_be, is); g_assert_not_reached(); } g_free(is); inf_adopted_state_vector_free(should_be_vec); printf("ok!\n"); } #define apply(op, args) inf_adopted_state_vector_##op args static void l_test() { InfAdoptedStateVector* vec, * vec_; int i; char* str; vec = inf_adopted_state_vector_new(); apply(set, (vec, 10, 14)); cmp("10:14", vec); apply(set, (vec, 4, 5)); cmp("4:5;10:14", vec); apply(set, (vec, 4, 8)); cmp("4:8;10:14", vec); for (i = 0; i < 10; ++i) apply(set, (vec, i, i*10)); cmp("1:10;2:20;3:30;4:40;5:50;6:60;7:70;8:80;9:90;10:14", vec); apply(free, (vec)); vec = apply(from_string, ("1:10;2:5", NULL)); vec_ = apply(from_string, ("1:10;2:10;4:10", NULL)); g_assert(apply(causally_before, (vec, vec))); g_assert(apply(causally_before, (vec, vec_))); g_assert(apply(causally_before, (vec_, vec_))); apply(free, (vec)); apply(free, (vec_)); vec = apply(from_string, ("1:10;2:15", NULL)); vec_ = apply(from_string, ("1:10;2:10;4:10", NULL)); g_assert(!apply(causally_before, (vec, vec_))); g_assert( apply(causally_before, (vec, vec))); apply(free, (vec)); vec = apply(from_string, ("1:10;3:15", NULL)); g_assert(!apply(causally_before, (vec, vec_))); g_assert( apply(causally_before, (vec, vec))); apply(free, (vec_)); apply(free, (vec)); vec = apply(from_string, ("1:10", NULL)); vec_ = apply(from_string, ("1:7", NULL)); str = apply(to_string_diff, (vec, vec_)); g_assert(strcmp("1:3", str) == 0); apply(free, (vec_)); vec_ = apply(from_string_diff, (str, vec, NULL)); g_free(str); g_assert(vec_ != NULL); cmp("1:13", vec_); apply(free, (vec_)); for (i = 0; i < 100; ++i) { apply(set, (vec, rand(), i)); } str = apply(to_string, (vec)); /* printf("%s\n", str); */ g_free(str); apply(free, (vec)); vec = apply(from_string, ("1:0;5:0", NULL)); vec_ = apply(new, ()); g_assert(apply(compare, (vec, vec_)) == 0); apply(free, (vec)); apply(free, (vec_)); } int main(int argc, char* argv[]) { guint users[2]; InfAdoptedStateVector* vec; InfAdoptedStateVector* vec2; g_type_init(); users[0] = 1; users[1] = 2; /* Note we do not need to allocate users since the state vector does not * touch them. */ vec = inf_adopted_state_vector_new(); vec2 = inf_adopted_state_vector_new(); g_assert(inf_adopted_state_vector_causally_before_inc(vec, vec2, 1) == FALSE); inf_adopted_state_vector_free(vec2); inf_adopted_state_vector_set(vec, users[0], 2); g_assert(inf_adopted_state_vector_get(vec, users[0]) == 2); inf_adopted_state_vector_add(vec, users[0], 4); g_assert(inf_adopted_state_vector_get(vec, users[0]) == 6); inf_adopted_state_vector_add(vec, users[1], 3); g_assert(inf_adopted_state_vector_get(vec, users[1]) == 3); inf_adopted_state_vector_set(vec, users[1], 5); g_assert(inf_adopted_state_vector_get(vec, users[1]) == 5); inf_adopted_state_vector_free(vec); l_test(); return 0; } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/test/inf-test-daemon.c0000644000175000017500000000671212264763732015121 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include #include #include #include #include #include #include #include #ifdef LIBINFINITY_HAVE_AVAHI #include #endif int main(int argc, char* argv[]) { InfStandaloneIo* io; InfdTcpServer* server; InfdXmppServer* xmpp; InfCommunicationManager* manager; InfdServerPool* pool; InfdFilesystemStorage* storage; InfdDirectory* directory; gchar* root_directory; #ifdef LIBINFINITY_HAVE_AVAHI InfDiscoveryAvahi* avahi; InfXmppManager* xmpp_manager; #endif GError* error; gnutls_global_init(); g_type_init(); io = inf_standalone_io_new(); server = g_object_new( INFD_TYPE_TCP_SERVER, "io", io, "local-port", inf_protocol_get_default_port(), NULL ); error = NULL; if(infd_tcp_server_open(server, &error) == FALSE) { fprintf(stderr, "Could not open server: %s\n", error->message); g_error_free(error); } else { root_directory = g_build_filename(g_get_home_dir(), ".infinote", NULL); manager = inf_communication_manager_new(); storage = infd_filesystem_storage_new(root_directory); directory = infd_directory_new( INF_IO(io), INFD_STORAGE(storage), manager ); infd_directory_enable_chat(directory, TRUE); g_free(root_directory); g_object_unref(G_OBJECT(storage)); g_object_unref(G_OBJECT(manager)); pool = infd_server_pool_new(directory); g_object_unref(G_OBJECT(directory)); xmpp = infd_xmpp_server_new( server, INF_XMPP_CONNECTION_SECURITY_ONLY_UNSECURED, NULL, NULL, NULL ); g_object_unref(G_OBJECT(server)); infd_server_pool_add_server(pool, INFD_XML_SERVER(xmpp)); #ifdef LIBINFINITY_HAVE_AVAHI xmpp_manager = inf_xmpp_manager_new(); avahi = inf_discovery_avahi_new(INF_IO(io), xmpp_manager, NULL, NULL, NULL); g_object_unref(G_OBJECT(xmpp_manager)); infd_server_pool_add_local_publisher( pool, INFD_XMPP_SERVER(xmpp), INF_LOCAL_PUBLISHER(avahi) ); g_object_unref(G_OBJECT(avahi)); #endif g_object_unref(G_OBJECT(xmpp)); inf_standalone_io_loop(io); g_object_unref(G_OBJECT(pool)); } g_object_unref(G_OBJECT(io)); return 0; } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/test/Makefile.am0000644000175000017500000001076712264763732014024 00000000000000SUBDIRS = util session cleanup TESTS = inf-test-state-vector inf-test-chunk inf-test-text-session \ inf-test-text-cleanup AM_CPPFLAGS = \ -I${top_srcdir} \ ${infinity_CFLAGS} if WITH_INFGTK AM_CPPFLAGS += \ ${infgtk_CFLAGS} endif if WITH_INFTEXTGTK AM_CPPFLAGS += \ ${inftextgtk_CFLAGS} endif noinst_PROGRAMS = inf-test-tcp-connection inf-test-xmpp-connection \ inf-test-tcp-server inf-test-xmpp-server inf-test-daemon \ inf-test-browser inf-test-chat inf-test-state-vector inf-test-chunk \ inf-test-text-operations inf-test-text-session inf-test-text-cleanup \ inf-test-text-replay inf-test-reduce-replay inf-test-mass-join if WITH_INFTEXTGTK noinst_PROGRAMS += inf-test-gtk-browser endif inf_test_tcp_connection_SOURCES = \ inf-test-tcp-connection.c inf_test_tcp_connection_LDADD = \ ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ ${infinity_LIBS} inf_test_xmpp_connection_SOURCES = \ inf-test-xmpp-connection.c inf_test_xmpp_connection_LDADD = \ ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ ${infinity_LIBS} inf_test_tcp_server_SOURCES = \ inf-test-tcp-server.c inf_test_tcp_server_LDADD = \ ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ ${infinity_LIBS} inf_test_xmpp_server_SOURCES = \ inf-test-xmpp-server.c inf_test_xmpp_server_LDADD = \ ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ ${infinity_LIBS} inf_test_daemon_SOURCES = \ inf-test-daemon.c inf_test_daemon_LDADD = \ ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ ${infinity_LIBS} inf_test_browser_SOURCES = \ inf-test-browser.c inf_test_browser_LDADD = \ ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ ${infinity_LIBS} inf_test_chat_SOURCES = \ inf-test-chat.c inf_test_chat_LDADD = \ ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ ${infinity_LIBS} inf_test_state_vector_SOURCES = \ inf-test-state-vector.c inf_test_state_vector_LDADD = \ ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ ${infinity_LIBS} inf_test_chunk_SOURCES = \ inf-test-chunk.c inf_test_chunk_LDADD = \ ${top_builddir}/libinftext/libinftext-$(LIBINFINITY_API_VERSION).la \ ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ ${inftext_LIBS} ${infinity_LIBS} inf_test_text_operations_SOURCES = \ inf-test-text-operations.c inf_test_text_operations_LDADD = \ ${top_builddir}/libinftext/libinftext-$(LIBINFINITY_API_VERSION).la \ ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ ${inftext_LIBS} ${infinity_LIBS} inf_test_text_session_SOURCES = \ inf-test-text-session.c inf_test_text_session_LDADD = \ util/libinftestutil.a \ ${top_builddir}/libinftext/libinftext-$(LIBINFINITY_API_VERSION).la \ ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ ${inftext_LIBS} ${infinity_LIBS} inf_test_text_cleanup_SOURCES = \ inf-test-text-cleanup.c inf_test_text_cleanup_LDADD = \ util/libinftestutil.a \ ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ ${top_builddir}/libinftext/libinftext-$(LIBINFINITY_API_VERSION).la \ ${inftext_LIBS} ${infinity_LIBS} inf_test_text_replay_SOURCES = \ inf-test-text-replay.c inf_test_text_replay_LDADD = \ util/libinftestutil.a \ ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ ${top_builddir}/libinftext/libinftext-$(LIBINFINITY_API_VERSION).la \ ${inftext_LIBS} ${infinity_LIBS} inf_test_reduce_replay_SOURCES = \ inf-test-reduce-replay.c inf_test_reduce_replay_LDADD = \ util/libinftestutil.a \ ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ ${top_builddir}/libinftext/libinftext-$(LIBINFINITY_API_VERSION).la \ ${inftext_LIBS} ${infinity_LIBS} inf_test_mass_join_SOURCES = \ inf-test-mass-join.c inf_test_mass_join_LDADD = \ util/libinftestutil.a \ ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ ${top_builddir}/libinftext/libinftext-$(LIBINFINITY_API_VERSION).la \ ${inftext_LIBS} ${infinity_LIBS} if WITH_INFTEXTGTK inf_test_gtk_browser_SOURCES = \ inf-test-gtk-browser.c inf_test_gtk_browser_LDADD = \ ${top_builddir}/libinftextgtk/libinftextgtk-$(LIBINFINITY_API_VERSION).la \ ${top_builddir}/libinfgtk/libinfgtk-$(LIBINFINITY_API_VERSION).la \ ${top_builddir}/libinftext/libinftext-$(LIBINFINITY_API_VERSION).la \ ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ ${inftextgtk_LIBS} ${infgtk_LIBS} ${inftext_LIBS} ${infinity_LIBS} endif libinfinity-0.5.5/test/inf-test-reduce-replay.c0000644000175000017500000003270512264763732016420 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ /* Cuts away front and back of a replay, so that it still fails. It's very * primitive, and more sophisticated methods can still be implemented. */ /* TODO: Break as soon as either (stderr) output or exit status changes */ #include "util/inf-test-util.h" #include #include #include #include #include #include #include #ifndef G_OS_WIN32 # include #endif #include static const gchar REPLAY[] = ".libs/inf-test-text-replay"; static InfSession* inf_test_reduce_replay_session_new(InfIo* io, InfCommunicationManager* manager, InfSessionStatus status, InfCommunicationJoinedGroup* sync_group, InfXmlConnection* sync_connection, gpointer user_data) { InfTextDefaultBuffer* buffer; InfTextSession* session; buffer = inf_text_default_buffer_new("UTF-8"); session = inf_text_session_new( manager, INF_TEXT_BUFFER(buffer), io, status, INF_COMMUNICATION_GROUP(sync_group), sync_connection ); g_object_unref(buffer); return INF_SESSION(session); } /* TODO: This should maybe go to inf-test-util */ static const InfcNotePlugin INF_TEST_REDUCE_REPLAY_TEXT_PLUGIN = { NULL, "InfText", inf_test_reduce_replay_session_new }; static xmlNodePtr inf_test_reduce_replay_find_node(xmlNodePtr xml, const gchar* name) { xmlNodePtr child; for(child = xml->children; child != NULL; child = child->next) if(child->type == XML_ELEMENT_NODE) if(strcmp((const char*)child->name, name) == 0) return child; return NULL; } static xmlNodePtr inf_test_reduce_replay_next_node(xmlNodePtr xml) { do { xml = xml->next; } while(xml && xml->type != XML_ELEMENT_NODE); return xml; } static xmlNodePtr inf_test_reduce_replay_first_node(xmlNodePtr xml) { while(xml && xml->type != XML_ELEMENT_NODE) xml = xml->next; return xml; } static gboolean inf_test_reduce_replay_validate_test(xmlDocPtr doc) { GHashTable* table; xmlNodePtr root; xmlNodePtr cur; xmlNodePtr child; guint user_id; guint count; guint count_cur; guint count_max; root = xmlDocGetRootElement(doc); cur = inf_test_reduce_replay_find_node(root, "initial"); g_assert(cur); table = g_hash_table_new(NULL, NULL); while( (cur = inf_test_reduce_replay_next_node(cur)) != NULL) { if(strcmp((const char*)cur->name, "request") == 0) { child = cur->children; g_assert(child); if(child->type != XML_ELEMENT_NODE) child = inf_test_reduce_replay_next_node(child); if(!inf_xml_util_get_attribute_uint_required(cur, "user", &user_id, NULL)) { g_hash_table_unref(table); return FALSE; } count = GPOINTER_TO_UINT( g_hash_table_lookup(table, GUINT_TO_POINTER(user_id)) ); count_cur = (count ) & 0xffff; count_max = (count >> 16) & 0xffff; /* move and noop requests don't affect the buffer */ if(strcmp((const char*)child->name, "move") != 0 && strcmp((const char*)child->name, "no-op") != 0) { if(strcmp((const char*)child->name, "undo") == 0 || strcmp((const char*)child->name, "undo-caret") == 0) { if(count_cur == 0) { g_hash_table_unref(table); return FALSE; } --count_cur; } else if(strcmp((const char*)child->name, "redo") == 0 || strcmp((const char*)child->name, "redo-caret") == 0) { if(count_cur == count_max) { g_hash_table_unref(table); return FALSE; } ++count_cur; } else { /* do */ if(count_max >= 0xffff) { /* overflow */ g_hash_table_unref(table); return FALSE; } count_max = count_cur + 1; count_cur = count_max; } } g_hash_table_insert( table, GUINT_TO_POINTER(user_id), GUINT_TO_POINTER((count_max >> 16) | count_cur) ); } } g_hash_table_unref(table); return TRUE; } static gboolean inf_test_reduce_replay_run_test(xmlDocPtr doc) { GError* error; gchar* cmd; gchar* stdout_buf; gchar* stderr_buf; int ret; xmlSaveFile("test.xml", doc); /*cmd = g_strdup_printf("(%s %s 2>&1) > /dev/null", REPLAY, "test.xml");*/ cmd = g_strdup_printf("%s %s", REPLAY, "test.xml"); /* make it die on algorithm errors */ g_setenv("G_DEBUG", "fatal-warnings", TRUE); error = NULL; if(!g_spawn_command_line_sync(cmd, &stdout_buf, &stderr_buf, &ret, &error)) { g_unlink("test.xml"); g_free(cmd); fprintf(stderr, "Failed to run test: %s\n", error->message); g_error_free(error); return FALSE; } /* Reset, so that we don't die ourselves */ g_setenv("G_DEBUG", "", TRUE); /* These are just dummy variables to suppress the console output */ g_free(stdout_buf); g_free(stderr_buf); /*g_unlink("test.xml");*/ #ifndef G_OS_WIN32 if(WIFSIGNALED(ret) && (WTERMSIG(ret) == SIGABRT || WTERMSIG(ret) == SIGSEGV)) { return FALSE; } else if(WIFEXITED(ret)) { if(WEXITSTATUS(ret)) return FALSE; else return TRUE; } else #endif { /* what happen? */ g_assert_not_reached(); } } static void inf_test_reduce_replay_remove_sync_requests(xmlNodePtr initial) { xmlNodePtr child; xmlNodePtr next; xmlNodePtr prev; xmlNodePtr sync_begin; guint count; count = 0; for(child = inf_test_reduce_replay_first_node(initial->children); child != NULL; child = next) { next = inf_test_reduce_replay_next_node(child); if(strcmp((const char*)child->name, "sync-request") == 0) { while(child != next) { prev = child; child = child->next; xmlUnlinkNode(prev); xmlFreeNode(prev); } } else { if(strcmp((const char*)child->name, "sync-begin") == 0) sync_begin = child; else if(strcmp((const char*)child->name, "sync-end") != 0) ++count; } } g_assert(sync_begin != NULL); inf_xml_util_set_attribute_uint(sync_begin, "num-messages", count); } static gboolean inf_test_reduce_replay_reduce(xmlDocPtr doc, const char* filename) { InfAdoptedSessionReplay* local_replay; InfAdoptedSession* session; InfSessionClass* session_class; xmlDocPtr last_fail; xmlDocPtr back_doc; gboolean result; xmlNodePtr root; xmlNodePtr initial; xmlNodePtr next; xmlNodePtr request; xmlNodePtr sync_begin; GError* error; guint i; root = xmlDocGetRootElement(doc); if(inf_test_reduce_replay_run_test(doc) == TRUE) { fprintf(stderr, "Test does not initially fail\n"); return FALSE; } if(!inf_test_reduce_replay_validate_test(doc)) { fprintf(stderr, "Test does not initially validate\n"); return FALSE; } initial = inf_test_reduce_replay_find_node(root, "initial"); if(!initial) { fprintf(stderr, "Test has no initial\n"); return FALSE; } /* Remove all sync-requests. We require test to work without for now. */ inf_test_reduce_replay_remove_sync_requests(initial); root = xmlDocGetRootElement(doc); if(inf_test_reduce_replay_run_test(doc) == TRUE) { fprintf(stderr, "Test does not fail without sync-requests anymore\n"); return FALSE; } /* Initialize local replay */ error = NULL; local_replay = inf_adopted_session_replay_new(); inf_adopted_session_replay_set_record( local_replay, filename, &INF_TEST_REDUCE_REPLAY_TEXT_PLUGIN, &error ); session = inf_adopted_session_replay_get_session(local_replay); session_class = INF_SESSION_GET_CLASS(session); if(error) { fprintf(stderr, "Creating local replay failed: %s\n", error->message); g_error_free(error); return FALSE; } last_fail = xmlCopyDoc(doc, 1); request = inf_test_reduce_replay_next_node(initial); i = 0; for(;;) { /* Play next request */ if(inf_adopted_session_replay_play_next(local_replay, &error)) { ++i; fprintf(stderr, "%.6u... ", i); fflush(stderr); if(strcmp((const char*)request->name, "request") != 0 && strcmp((const char*)request->name, "user") != 0) { fprintf(stderr, "NOREQ <%s>\n", request->name); request = inf_test_reduce_replay_next_node(request); } else { fprintf(stderr, "REQ %8s ", request->name); fflush(stderr); /* Get rid of next request, and see if test still fails */ do { next = request->next; xmlUnlinkNode(request); xmlFreeNode(request); request = next; } while(next && next->type != XML_ELEMENT_NODE); /* Rewrite initial */ xmlFreeNodeList(initial->children); initial->children = NULL; sync_begin = xmlNewChild(initial, NULL, (const xmlChar*)"sync-begin", NULL); session_class->to_xml_sync(INF_SESSION(session), initial); xmlNewChild(initial, NULL, (const xmlChar*)"sync-end", NULL); /* this sets num-messages: */ inf_test_reduce_replay_remove_sync_requests(initial); if(inf_test_reduce_replay_validate_test(doc)) { if(inf_test_reduce_replay_run_test(doc)) { fprintf(stderr, "OK!\n"); result = TRUE; break; } else { fprintf(stderr, "FAIL\n"); xmlFreeDoc(last_fail); last_fail = xmlCopyDoc(doc, 1); } } else { /* Continue when test is invalid; we probably removed an undo's * associated request, so just wait until we remove the undo request * itself. */ fprintf(stderr, "INVALID\n"); } } } else { if(error) { fprintf(stderr, "Playing local replay failed: %s\n", error->message); g_error_free(error); result = FALSE; break; } else { fprintf(stderr, "Played all records and the error still occurs\n"); result = FALSE; break; } } } g_object_unref(local_replay); if(result) { /* Also reduce from back */ i = 0; back_doc = xmlCopyDoc(last_fail, 1); root = xmlDocGetRootElement(back_doc); initial = inf_test_reduce_replay_find_node(root, "initial"); g_assert(initial); next = initial; do { request = next; next = inf_test_reduce_replay_next_node(request); ++i; } while(next != NULL); for(;;) { g_assert(i > 1); --i; fprintf(stderr, "%.6u... ", i); fflush(stderr); do { next = request; request = request->prev; xmlUnlinkNode(next); xmlFreeNode(next); } while(request && request->type != XML_ELEMENT_NODE); if(inf_test_reduce_replay_validate_test(back_doc)) { if(inf_test_reduce_replay_run_test(back_doc)) { fprintf(stderr, "OK!\n"); result = TRUE; break; } else { fprintf(stderr, "FAIL\n"); xmlFreeDoc(last_fail); last_fail = xmlCopyDoc(back_doc, 1); } } else { fprintf(stderr, "INVALID\n"); result = FALSE; break; } } xmlFreeDoc(back_doc); } /* Save last failing record in each case */ xmlSaveFile("last_fail.record.xml", last_fail); printf("Last failing record in last_fail.record.xml\n"); xmlFreeDoc(last_fail); return result; } int main(int argc, char* argv[]) { GError* error = NULL; xmlDocPtr doc; gboolean ret; if(!inf_init(&error)) { fprintf(stderr, "%s\n", error->message); return -1; } if(!g_file_test(REPLAY, G_FILE_TEST_IS_EXECUTABLE)) { fprintf(stderr, "Replay tool not available. Run \"make\" first."); return -1; } if(argc < 2) { fprintf(stderr, "Usage: %s \n", argv[0]); return -1; } doc = xmlReadFile(argv[1], "UTF-8", XML_PARSE_NOERROR | XML_PARSE_NOWARNING); if(!doc || !xmlDocGetRootElement(doc)) { if(doc) xmlFreeDoc(doc); fprintf(stderr, "%s\n", xmlGetLastError()->message); return -1; } ret = inf_test_reduce_replay_reduce(doc, argv[1]); xmlFreeDoc(doc); return ret ? 0 : -1; } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/test/Makefile.in0000644000175000017500000015267312264766066014043 00000000000000# Makefile.in generated by automake 1.13.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ TESTS = inf-test-state-vector$(EXEEXT) inf-test-chunk$(EXEEXT) \ inf-test-text-session$(EXEEXT) inf-test-text-cleanup$(EXEEXT) @WITH_INFGTK_TRUE@am__append_1 = \ @WITH_INFGTK_TRUE@ ${infgtk_CFLAGS} @WITH_INFTEXTGTK_TRUE@am__append_2 = \ @WITH_INFTEXTGTK_TRUE@ ${inftextgtk_CFLAGS} noinst_PROGRAMS = inf-test-tcp-connection$(EXEEXT) \ inf-test-xmpp-connection$(EXEEXT) inf-test-tcp-server$(EXEEXT) \ inf-test-xmpp-server$(EXEEXT) inf-test-daemon$(EXEEXT) \ inf-test-browser$(EXEEXT) inf-test-chat$(EXEEXT) \ inf-test-state-vector$(EXEEXT) inf-test-chunk$(EXEEXT) \ inf-test-text-operations$(EXEEXT) \ inf-test-text-session$(EXEEXT) inf-test-text-cleanup$(EXEEXT) \ inf-test-text-replay$(EXEEXT) inf-test-reduce-replay$(EXEEXT) \ inf-test-mass-join$(EXEEXT) $(am__EXEEXT_1) @WITH_INFTEXTGTK_TRUE@am__append_3 = inf-test-gtk-browser subdir = test DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/mkinstalldirs $(top_srcdir)/depcomp \ $(top_srcdir)/test-driver README ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/libinfinity/inf-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @WITH_INFTEXTGTK_TRUE@am__EXEEXT_1 = inf-test-gtk-browser$(EXEEXT) PROGRAMS = $(noinst_PROGRAMS) am_inf_test_browser_OBJECTS = inf-test-browser.$(OBJEXT) inf_test_browser_OBJECTS = $(am_inf_test_browser_OBJECTS) am__DEPENDENCIES_1 = inf_test_browser_DEPENDENCIES = ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ $(am__DEPENDENCIES_1) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = am_inf_test_chat_OBJECTS = inf-test-chat.$(OBJEXT) inf_test_chat_OBJECTS = $(am_inf_test_chat_OBJECTS) inf_test_chat_DEPENDENCIES = ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ $(am__DEPENDENCIES_1) am_inf_test_chunk_OBJECTS = inf-test-chunk.$(OBJEXT) inf_test_chunk_OBJECTS = $(am_inf_test_chunk_OBJECTS) inf_test_chunk_DEPENDENCIES = ${top_builddir}/libinftext/libinftext-$(LIBINFINITY_API_VERSION).la \ ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_inf_test_daemon_OBJECTS = inf-test-daemon.$(OBJEXT) inf_test_daemon_OBJECTS = $(am_inf_test_daemon_OBJECTS) inf_test_daemon_DEPENDENCIES = ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ $(am__DEPENDENCIES_1) am__inf_test_gtk_browser_SOURCES_DIST = inf-test-gtk-browser.c @WITH_INFTEXTGTK_TRUE@am_inf_test_gtk_browser_OBJECTS = \ @WITH_INFTEXTGTK_TRUE@ inf-test-gtk-browser.$(OBJEXT) inf_test_gtk_browser_OBJECTS = $(am_inf_test_gtk_browser_OBJECTS) @WITH_INFTEXTGTK_TRUE@inf_test_gtk_browser_DEPENDENCIES = ${top_builddir}/libinftextgtk/libinftextgtk-$(LIBINFINITY_API_VERSION).la \ @WITH_INFTEXTGTK_TRUE@ ${top_builddir}/libinfgtk/libinfgtk-$(LIBINFINITY_API_VERSION).la \ @WITH_INFTEXTGTK_TRUE@ ${top_builddir}/libinftext/libinftext-$(LIBINFINITY_API_VERSION).la \ @WITH_INFTEXTGTK_TRUE@ ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ @WITH_INFTEXTGTK_TRUE@ $(am__DEPENDENCIES_1) \ @WITH_INFTEXTGTK_TRUE@ $(am__DEPENDENCIES_1) \ @WITH_INFTEXTGTK_TRUE@ $(am__DEPENDENCIES_1) \ @WITH_INFTEXTGTK_TRUE@ $(am__DEPENDENCIES_1) am_inf_test_mass_join_OBJECTS = inf-test-mass-join.$(OBJEXT) inf_test_mass_join_OBJECTS = $(am_inf_test_mass_join_OBJECTS) inf_test_mass_join_DEPENDENCIES = util/libinftestutil.a \ ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ ${top_builddir}/libinftext/libinftext-$(LIBINFINITY_API_VERSION).la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_inf_test_reduce_replay_OBJECTS = inf-test-reduce-replay.$(OBJEXT) inf_test_reduce_replay_OBJECTS = $(am_inf_test_reduce_replay_OBJECTS) inf_test_reduce_replay_DEPENDENCIES = util/libinftestutil.a \ ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ ${top_builddir}/libinftext/libinftext-$(LIBINFINITY_API_VERSION).la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_inf_test_state_vector_OBJECTS = inf-test-state-vector.$(OBJEXT) inf_test_state_vector_OBJECTS = $(am_inf_test_state_vector_OBJECTS) inf_test_state_vector_DEPENDENCIES = ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ $(am__DEPENDENCIES_1) am_inf_test_tcp_connection_OBJECTS = \ inf-test-tcp-connection.$(OBJEXT) inf_test_tcp_connection_OBJECTS = \ $(am_inf_test_tcp_connection_OBJECTS) inf_test_tcp_connection_DEPENDENCIES = ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ $(am__DEPENDENCIES_1) am_inf_test_tcp_server_OBJECTS = inf-test-tcp-server.$(OBJEXT) inf_test_tcp_server_OBJECTS = $(am_inf_test_tcp_server_OBJECTS) inf_test_tcp_server_DEPENDENCIES = ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ $(am__DEPENDENCIES_1) am_inf_test_text_cleanup_OBJECTS = inf-test-text-cleanup.$(OBJEXT) inf_test_text_cleanup_OBJECTS = $(am_inf_test_text_cleanup_OBJECTS) inf_test_text_cleanup_DEPENDENCIES = util/libinftestutil.a \ ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ ${top_builddir}/libinftext/libinftext-$(LIBINFINITY_API_VERSION).la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_inf_test_text_operations_OBJECTS = \ inf-test-text-operations.$(OBJEXT) inf_test_text_operations_OBJECTS = \ $(am_inf_test_text_operations_OBJECTS) inf_test_text_operations_DEPENDENCIES = ${top_builddir}/libinftext/libinftext-$(LIBINFINITY_API_VERSION).la \ ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_inf_test_text_replay_OBJECTS = inf-test-text-replay.$(OBJEXT) inf_test_text_replay_OBJECTS = $(am_inf_test_text_replay_OBJECTS) inf_test_text_replay_DEPENDENCIES = util/libinftestutil.a \ ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ ${top_builddir}/libinftext/libinftext-$(LIBINFINITY_API_VERSION).la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_inf_test_text_session_OBJECTS = inf-test-text-session.$(OBJEXT) inf_test_text_session_OBJECTS = $(am_inf_test_text_session_OBJECTS) inf_test_text_session_DEPENDENCIES = util/libinftestutil.a \ ${top_builddir}/libinftext/libinftext-$(LIBINFINITY_API_VERSION).la \ ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_inf_test_xmpp_connection_OBJECTS = \ inf-test-xmpp-connection.$(OBJEXT) inf_test_xmpp_connection_OBJECTS = \ $(am_inf_test_xmpp_connection_OBJECTS) inf_test_xmpp_connection_DEPENDENCIES = ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ $(am__DEPENDENCIES_1) am_inf_test_xmpp_server_OBJECTS = inf-test-xmpp-server.$(OBJEXT) inf_test_xmpp_server_OBJECTS = $(am_inf_test_xmpp_server_OBJECTS) inf_test_xmpp_server_DEPENDENCIES = ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ $(am__DEPENDENCIES_1) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -I$(top_builddir)/libinfinity 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) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(inf_test_browser_SOURCES) $(inf_test_chat_SOURCES) \ $(inf_test_chunk_SOURCES) $(inf_test_daemon_SOURCES) \ $(inf_test_gtk_browser_SOURCES) $(inf_test_mass_join_SOURCES) \ $(inf_test_reduce_replay_SOURCES) \ $(inf_test_state_vector_SOURCES) \ $(inf_test_tcp_connection_SOURCES) \ $(inf_test_tcp_server_SOURCES) \ $(inf_test_text_cleanup_SOURCES) \ $(inf_test_text_operations_SOURCES) \ $(inf_test_text_replay_SOURCES) \ $(inf_test_text_session_SOURCES) \ $(inf_test_xmpp_connection_SOURCES) \ $(inf_test_xmpp_server_SOURCES) DIST_SOURCES = $(inf_test_browser_SOURCES) $(inf_test_chat_SOURCES) \ $(inf_test_chunk_SOURCES) $(inf_test_daemon_SOURCES) \ $(am__inf_test_gtk_browser_SOURCES_DIST) \ $(inf_test_mass_join_SOURCES) \ $(inf_test_reduce_replay_SOURCES) \ $(inf_test_state_vector_SOURCES) \ $(inf_test_tcp_connection_SOURCES) \ $(inf_test_tcp_server_SOURCES) \ $(inf_test_text_cleanup_SOURCES) \ $(inf_test_text_operations_SOURCES) \ $(inf_test_text_replay_SOURCES) \ $(inf_test_text_session_SOURCES) \ $(inf_test_xmpp_connection_SOURCES) \ $(inf_test_xmpp_server_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ check recheck distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* # A command that, given a newline-separated list of test names on the # standard input, print the name of the tests that are to be re-run # upon "make recheck". am__list_recheck_tests = $(AWK) '{ \ recheck = 1; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ { \ if ((getline line2 < ($$0 ".log")) < 0) \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ { \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ { \ break; \ } \ }; \ if (recheck) \ print $$0; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # A command that, given a newline-separated list of test names on the # standard input, create the global log from their .trs and .log files. am__create_global_log = $(AWK) ' \ function fatal(msg) \ { \ print "fatal: making $@: " msg | "cat >&2"; \ exit 1; \ } \ function rst_section(header) \ { \ print header; \ len = length(header); \ for (i = 1; i <= len; i = i + 1) \ printf "="; \ printf "\n\n"; \ } \ { \ copy_in_global_log = 1; \ global_test_result = "RUN"; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".trs"); \ if (line ~ /$(am__global_test_result_rx)/) \ { \ sub("$(am__global_test_result_rx)", "", line); \ sub("[ ]*$$", "", line); \ global_test_result = line; \ } \ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ copy_in_global_log = 0; \ }; \ if (copy_in_global_log) \ { \ rst_section(global_test_result ": " $$0); \ while ((rc = (getline line < ($$0 ".log"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".log"); \ print line; \ }; \ printf "\n"; \ }; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # Restructured Text title. am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it # by disabling -e (using the XSI extension "set +e") if it's set. am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the # developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). am__check_pre = \ $(am__sh_e_setup); \ $(am__vpath_adj_setup) $(am__vpath_adj) \ $(am__tty_colors); \ srcdir=$(srcdir); export srcdir; \ case "$@" in \ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ *) am__odir=.;; \ esac; \ test "x$$am__odir" = x"." || test -d "$$am__odir" \ || $(MKDIR_P) "$$am__odir" || exit $$?; \ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ am__enable_hard_errors=yes; \ fi; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ am__expect_failure=yes;; \ *) \ am__expect_failure=no;; \ esac; \ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) # A shell command to get the names of the tests scripts with any registered # extension removed (i.e., equivalently, the names of the test logs, with # the '.log' extension removed). The result is saved in the shell variable # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", # since that might cause problem with VPATH rewrites for suffix-less tests. # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` RECHECK_LOGS = $(TEST_LOGS) TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ case '$*' in \ */*) b='$*';; \ *) b=`echo '$@' | sed 's/\.log$$//'`; \ esac;; \ *) \ b='$*';; \ esac am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) TEST_LOGS = $(am__test_logs2:.test.log=.log) TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBINFINITY_API_VERSION = @LIBINFINITY_API_VERSION@ LIBINFINITY_LIBTOOL_VERSION = @LIBINFINITY_LIBTOOL_VERSION@ LIBINFINITY_VERSION = @LIBINFINITY_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ avahi_CFLAGS = @avahi_CFLAGS@ avahi_LIBS = @avahi_LIBS@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gtk_requirement = @gtk_requirement@ gtk_version = @gtk_version@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infgtk_CFLAGS = @infgtk_CFLAGS@ infgtk_LIBS = @infgtk_LIBS@ infinity_CFLAGS = @infinity_CFLAGS@ infinity_LIBS = @infinity_LIBS@ infinoted_CFLAGS = @infinoted_CFLAGS@ infinoted_LIBS = @infinoted_LIBS@ infodir = @infodir@ inftext_CFLAGS = @inftext_CFLAGS@ inftext_LIBS = @inftext_LIBS@ inftextgtk_CFLAGS = @inftextgtk_CFLAGS@ inftextgtk_LIBS = @inftextgtk_LIBS@ install_sh = @install_sh@ libdaemon_CFLAGS = @libdaemon_CFLAGS@ libdaemon_LIBS = @libdaemon_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = util session cleanup AM_CPPFLAGS = -I${top_srcdir} ${infinity_CFLAGS} $(am__append_1) \ $(am__append_2) inf_test_tcp_connection_SOURCES = \ inf-test-tcp-connection.c inf_test_tcp_connection_LDADD = \ ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ ${infinity_LIBS} inf_test_xmpp_connection_SOURCES = \ inf-test-xmpp-connection.c inf_test_xmpp_connection_LDADD = \ ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ ${infinity_LIBS} inf_test_tcp_server_SOURCES = \ inf-test-tcp-server.c inf_test_tcp_server_LDADD = \ ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ ${infinity_LIBS} inf_test_xmpp_server_SOURCES = \ inf-test-xmpp-server.c inf_test_xmpp_server_LDADD = \ ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ ${infinity_LIBS} inf_test_daemon_SOURCES = \ inf-test-daemon.c inf_test_daemon_LDADD = \ ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ ${infinity_LIBS} inf_test_browser_SOURCES = \ inf-test-browser.c inf_test_browser_LDADD = \ ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ ${infinity_LIBS} inf_test_chat_SOURCES = \ inf-test-chat.c inf_test_chat_LDADD = \ ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ ${infinity_LIBS} inf_test_state_vector_SOURCES = \ inf-test-state-vector.c inf_test_state_vector_LDADD = \ ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ ${infinity_LIBS} inf_test_chunk_SOURCES = \ inf-test-chunk.c inf_test_chunk_LDADD = \ ${top_builddir}/libinftext/libinftext-$(LIBINFINITY_API_VERSION).la \ ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ ${inftext_LIBS} ${infinity_LIBS} inf_test_text_operations_SOURCES = \ inf-test-text-operations.c inf_test_text_operations_LDADD = \ ${top_builddir}/libinftext/libinftext-$(LIBINFINITY_API_VERSION).la \ ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ ${inftext_LIBS} ${infinity_LIBS} inf_test_text_session_SOURCES = \ inf-test-text-session.c inf_test_text_session_LDADD = \ util/libinftestutil.a \ ${top_builddir}/libinftext/libinftext-$(LIBINFINITY_API_VERSION).la \ ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ ${inftext_LIBS} ${infinity_LIBS} inf_test_text_cleanup_SOURCES = \ inf-test-text-cleanup.c inf_test_text_cleanup_LDADD = \ util/libinftestutil.a \ ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ ${top_builddir}/libinftext/libinftext-$(LIBINFINITY_API_VERSION).la \ ${inftext_LIBS} ${infinity_LIBS} inf_test_text_replay_SOURCES = \ inf-test-text-replay.c inf_test_text_replay_LDADD = \ util/libinftestutil.a \ ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ ${top_builddir}/libinftext/libinftext-$(LIBINFINITY_API_VERSION).la \ ${inftext_LIBS} ${infinity_LIBS} inf_test_reduce_replay_SOURCES = \ inf-test-reduce-replay.c inf_test_reduce_replay_LDADD = \ util/libinftestutil.a \ ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ ${top_builddir}/libinftext/libinftext-$(LIBINFINITY_API_VERSION).la \ ${inftext_LIBS} ${infinity_LIBS} inf_test_mass_join_SOURCES = \ inf-test-mass-join.c inf_test_mass_join_LDADD = \ util/libinftestutil.a \ ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ ${top_builddir}/libinftext/libinftext-$(LIBINFINITY_API_VERSION).la \ ${inftext_LIBS} ${infinity_LIBS} @WITH_INFTEXTGTK_TRUE@inf_test_gtk_browser_SOURCES = \ @WITH_INFTEXTGTK_TRUE@ inf-test-gtk-browser.c @WITH_INFTEXTGTK_TRUE@inf_test_gtk_browser_LDADD = \ @WITH_INFTEXTGTK_TRUE@ ${top_builddir}/libinftextgtk/libinftextgtk-$(LIBINFINITY_API_VERSION).la \ @WITH_INFTEXTGTK_TRUE@ ${top_builddir}/libinfgtk/libinfgtk-$(LIBINFINITY_API_VERSION).la \ @WITH_INFTEXTGTK_TRUE@ ${top_builddir}/libinftext/libinftext-$(LIBINFINITY_API_VERSION).la \ @WITH_INFTEXTGTK_TRUE@ ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ @WITH_INFTEXTGTK_TRUE@ ${inftextgtk_LIBS} ${infgtk_LIBS} ${inftext_LIBS} ${infinity_LIBS} all: all-recursive .SUFFIXES: .SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu test/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu test/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list inf-test-browser$(EXEEXT): $(inf_test_browser_OBJECTS) $(inf_test_browser_DEPENDENCIES) $(EXTRA_inf_test_browser_DEPENDENCIES) @rm -f inf-test-browser$(EXEEXT) $(AM_V_CCLD)$(LINK) $(inf_test_browser_OBJECTS) $(inf_test_browser_LDADD) $(LIBS) inf-test-chat$(EXEEXT): $(inf_test_chat_OBJECTS) $(inf_test_chat_DEPENDENCIES) $(EXTRA_inf_test_chat_DEPENDENCIES) @rm -f inf-test-chat$(EXEEXT) $(AM_V_CCLD)$(LINK) $(inf_test_chat_OBJECTS) $(inf_test_chat_LDADD) $(LIBS) inf-test-chunk$(EXEEXT): $(inf_test_chunk_OBJECTS) $(inf_test_chunk_DEPENDENCIES) $(EXTRA_inf_test_chunk_DEPENDENCIES) @rm -f inf-test-chunk$(EXEEXT) $(AM_V_CCLD)$(LINK) $(inf_test_chunk_OBJECTS) $(inf_test_chunk_LDADD) $(LIBS) inf-test-daemon$(EXEEXT): $(inf_test_daemon_OBJECTS) $(inf_test_daemon_DEPENDENCIES) $(EXTRA_inf_test_daemon_DEPENDENCIES) @rm -f inf-test-daemon$(EXEEXT) $(AM_V_CCLD)$(LINK) $(inf_test_daemon_OBJECTS) $(inf_test_daemon_LDADD) $(LIBS) inf-test-gtk-browser$(EXEEXT): $(inf_test_gtk_browser_OBJECTS) $(inf_test_gtk_browser_DEPENDENCIES) $(EXTRA_inf_test_gtk_browser_DEPENDENCIES) @rm -f inf-test-gtk-browser$(EXEEXT) $(AM_V_CCLD)$(LINK) $(inf_test_gtk_browser_OBJECTS) $(inf_test_gtk_browser_LDADD) $(LIBS) inf-test-mass-join$(EXEEXT): $(inf_test_mass_join_OBJECTS) $(inf_test_mass_join_DEPENDENCIES) $(EXTRA_inf_test_mass_join_DEPENDENCIES) @rm -f inf-test-mass-join$(EXEEXT) $(AM_V_CCLD)$(LINK) $(inf_test_mass_join_OBJECTS) $(inf_test_mass_join_LDADD) $(LIBS) inf-test-reduce-replay$(EXEEXT): $(inf_test_reduce_replay_OBJECTS) $(inf_test_reduce_replay_DEPENDENCIES) $(EXTRA_inf_test_reduce_replay_DEPENDENCIES) @rm -f inf-test-reduce-replay$(EXEEXT) $(AM_V_CCLD)$(LINK) $(inf_test_reduce_replay_OBJECTS) $(inf_test_reduce_replay_LDADD) $(LIBS) inf-test-state-vector$(EXEEXT): $(inf_test_state_vector_OBJECTS) $(inf_test_state_vector_DEPENDENCIES) $(EXTRA_inf_test_state_vector_DEPENDENCIES) @rm -f inf-test-state-vector$(EXEEXT) $(AM_V_CCLD)$(LINK) $(inf_test_state_vector_OBJECTS) $(inf_test_state_vector_LDADD) $(LIBS) inf-test-tcp-connection$(EXEEXT): $(inf_test_tcp_connection_OBJECTS) $(inf_test_tcp_connection_DEPENDENCIES) $(EXTRA_inf_test_tcp_connection_DEPENDENCIES) @rm -f inf-test-tcp-connection$(EXEEXT) $(AM_V_CCLD)$(LINK) $(inf_test_tcp_connection_OBJECTS) $(inf_test_tcp_connection_LDADD) $(LIBS) inf-test-tcp-server$(EXEEXT): $(inf_test_tcp_server_OBJECTS) $(inf_test_tcp_server_DEPENDENCIES) $(EXTRA_inf_test_tcp_server_DEPENDENCIES) @rm -f inf-test-tcp-server$(EXEEXT) $(AM_V_CCLD)$(LINK) $(inf_test_tcp_server_OBJECTS) $(inf_test_tcp_server_LDADD) $(LIBS) inf-test-text-cleanup$(EXEEXT): $(inf_test_text_cleanup_OBJECTS) $(inf_test_text_cleanup_DEPENDENCIES) $(EXTRA_inf_test_text_cleanup_DEPENDENCIES) @rm -f inf-test-text-cleanup$(EXEEXT) $(AM_V_CCLD)$(LINK) $(inf_test_text_cleanup_OBJECTS) $(inf_test_text_cleanup_LDADD) $(LIBS) inf-test-text-operations$(EXEEXT): $(inf_test_text_operations_OBJECTS) $(inf_test_text_operations_DEPENDENCIES) $(EXTRA_inf_test_text_operations_DEPENDENCIES) @rm -f inf-test-text-operations$(EXEEXT) $(AM_V_CCLD)$(LINK) $(inf_test_text_operations_OBJECTS) $(inf_test_text_operations_LDADD) $(LIBS) inf-test-text-replay$(EXEEXT): $(inf_test_text_replay_OBJECTS) $(inf_test_text_replay_DEPENDENCIES) $(EXTRA_inf_test_text_replay_DEPENDENCIES) @rm -f inf-test-text-replay$(EXEEXT) $(AM_V_CCLD)$(LINK) $(inf_test_text_replay_OBJECTS) $(inf_test_text_replay_LDADD) $(LIBS) inf-test-text-session$(EXEEXT): $(inf_test_text_session_OBJECTS) $(inf_test_text_session_DEPENDENCIES) $(EXTRA_inf_test_text_session_DEPENDENCIES) @rm -f inf-test-text-session$(EXEEXT) $(AM_V_CCLD)$(LINK) $(inf_test_text_session_OBJECTS) $(inf_test_text_session_LDADD) $(LIBS) inf-test-xmpp-connection$(EXEEXT): $(inf_test_xmpp_connection_OBJECTS) $(inf_test_xmpp_connection_DEPENDENCIES) $(EXTRA_inf_test_xmpp_connection_DEPENDENCIES) @rm -f inf-test-xmpp-connection$(EXEEXT) $(AM_V_CCLD)$(LINK) $(inf_test_xmpp_connection_OBJECTS) $(inf_test_xmpp_connection_LDADD) $(LIBS) inf-test-xmpp-server$(EXEEXT): $(inf_test_xmpp_server_OBJECTS) $(inf_test_xmpp_server_DEPENDENCIES) $(EXTRA_inf_test_xmpp_server_DEPENDENCIES) @rm -f inf-test-xmpp-server$(EXEEXT) $(AM_V_CCLD)$(LINK) $(inf_test_xmpp_server_OBJECTS) $(inf_test_xmpp_server_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inf-test-browser.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inf-test-chat.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inf-test-chunk.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inf-test-daemon.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inf-test-gtk-browser.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inf-test-mass-join.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inf-test-reduce-replay.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inf-test-state-vector.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inf-test-tcp-connection.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inf-test-tcp-server.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inf-test-text-cleanup.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inf-test-text-operations.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inf-test-text-replay.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inf-test-text-session.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inf-test-xmpp-connection.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inf-test-xmpp-server.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags # Recover from deleted '.trs' file; this should ensure that # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells # to avoid problems with "make -n". .log.trs: rm -f $< $@ $(MAKE) $(AM_MAKEFLAGS) $< # Leading 'am--fnord' is there to ensure the list of targets does not # expand to empty, as could happen e.g. with make check TESTS=''. am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ redo_bases=`for i in $$bases; do \ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ done`; \ if test -n "$$redo_bases"; then \ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ if $(am__make_dryrun); then :; else \ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ fi; \ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ else \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ st=0; \ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ for i in $$redo_bases; do \ test -f $$i.trs && test -r $$i.trs \ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ test -f $$i.log && test -r $$i.log \ || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ test $$st -eq 0 || exit 1; \ fi @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ ws='[ ]'; \ results=`for b in $$bases; do echo $$b.trs; done`; \ test -n "$$results" || results=/dev/null; \ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ if test `expr $$fail + $$xpass + $$error` -eq 0; then \ success=true; \ else \ success=false; \ fi; \ br='==================='; br=$$br$$br$$br$$br; \ result_count () \ { \ if test x"$$1" = x"--maybe-color"; then \ maybe_colorize=yes; \ elif test x"$$1" = x"--no-color"; then \ maybe_colorize=no; \ else \ echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ shift; \ desc=$$1 count=$$2; \ if test $$maybe_colorize = yes && test $$count -gt 0; then \ color_start=$$3 color_end=$$std; \ else \ color_start= color_end=; \ fi; \ echo "$${color_start}# $$desc $$count$${color_end}"; \ }; \ create_testsuite_report () \ { \ result_count $$1 "TOTAL:" $$all "$$brg"; \ result_count $$1 "PASS: " $$pass "$$grn"; \ result_count $$1 "SKIP: " $$skip "$$blu"; \ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ result_count $$1 "FAIL: " $$fail "$$red"; \ result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ for b in $$bases; do echo $$b; done \ | $(am__create_global_log); \ } >$(TEST_SUITE_LOG).tmp || exit 1; \ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ if $$success; then \ col="$$grn"; \ else \ col="$$red"; \ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ if test -n "$(PACKAGE_BUGREPORT)"; then \ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ trs_list=`for i in $$bases; do echo $$i.trs; done`; \ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? inf-test-state-vector.log: inf-test-state-vector$(EXEEXT) @p='inf-test-state-vector$(EXEEXT)'; \ b='inf-test-state-vector'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) inf-test-chunk.log: inf-test-chunk$(EXEEXT) @p='inf-test-chunk$(EXEEXT)'; \ b='inf-test-chunk'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) inf-test-text-session.log: inf-test-text-session$(EXEEXT) @p='inf-test-text-session$(EXEEXT)'; \ b='inf-test-text-session'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) inf-test-text-cleanup.log: inf-test-text-cleanup$(EXEEXT) @p='inf-test-text-cleanup$(EXEEXT)'; \ b='inf-test-text-cleanup'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) .test.log: @p='$<'; \ $(am__set_b); \ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) @am__EXEEXT_TRUE@.test$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ @am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-recursive all-am: Makefile $(PROGRAMS) installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) check-am install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-TESTS check-am clean clean-generic clean-libtool \ clean-noinstPROGRAMS cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-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-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am recheck tags tags-am \ uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libinfinity-0.5.5/test/inf-test-mass-join.c0000644000175000017500000003050512264763732015553 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include typedef struct _InfTestMassJoiner InfTestMassJoiner; struct _InfTestMassJoiner { InfCommunicationManager* communication_manager; InfcBrowser* browser; InfcSessionProxy* session; gchar* document; gchar* username; }; typedef struct _InfTestMassJoin InfTestMassJoin; struct _InfTestMassJoin { InfIo* io; GSList* joiners; }; static InfSession* inf_test_mass_join_session_new(InfIo* io, InfCommunicationManager* manager, InfSessionStatus status, InfCommunicationJoinedGroup* sync_group, InfXmlConnection* sync_connection, gpointer user_data) { InfTextDefaultBuffer* buffer; InfTextSession* session; buffer = inf_text_default_buffer_new("UTF-8"); session = inf_text_session_new( manager, INF_TEXT_BUFFER(buffer), io, status, INF_COMMUNICATION_GROUP(sync_group), sync_connection ); g_object_unref(buffer); return INF_SESSION(session); } static const InfcNotePlugin INF_TEST_MASS_JOIN_TEXT_PLUGIN = { NULL, "InfText", inf_test_mass_join_session_new }; static void inf_test_mass_join_user_join_failed_cb(InfcUserRequest* request, const GError* error, gpointer user_data) { InfTestMassJoiner* joiner; joiner = (InfTestMassJoiner*)user_data; fprintf( stderr, "Joiner %s: User join failed: %s\n", joiner->username, error->message ); inf_xml_connection_close(infc_browser_get_connection(joiner->browser)); } static void inf_test_mass_join_user_join_finished_cb(InfcUserRequest* request, InfUser* user, gpointer user_data) { InfTestMassJoiner* joiner; joiner = (InfTestMassJoiner*)user_data; fprintf(stdout, "Joiner %s: User joined!\n", joiner->username); } static void inf_test_mass_join_join_user(InfTestMassJoiner* joiner) { InfcUserRequest* request; InfAdoptedStateVector* v; GError* error; GParameter params[3] = { { "name", { 0 } }, { "vector", { 0 } }, { "caret-position", { 0 } } }; g_value_init(¶ms[0].value, G_TYPE_STRING); g_value_init(¶ms[1].value, INF_ADOPTED_TYPE_STATE_VECTOR); g_value_init(¶ms[2].value, G_TYPE_UINT); g_value_set_static_string(¶ms[0].value, joiner->username); v = inf_adopted_algorithm_get_current( inf_adopted_session_get_algorithm( INF_ADOPTED_SESSION(infc_session_proxy_get_session(joiner->session)) ) ); g_value_set_boxed(¶ms[1].value, v); g_value_set_uint(¶ms[2].value, 0u); error = NULL; request = infc_session_proxy_join_user(joiner->session, params, 3, &error); g_value_unset(¶ms[2].value); g_value_unset(¶ms[1].value); g_value_unset(¶ms[0].value); if(request == NULL) { fprintf( stderr, "Joiner %s: User join failed: %s\n", joiner->username, error->message ); g_error_free(error); inf_xml_connection_close(infc_browser_get_connection(joiner->browser)); } else { g_signal_connect( G_OBJECT(request), "failed", G_CALLBACK(inf_test_mass_join_user_join_failed_cb), joiner ); g_signal_connect_after( G_OBJECT(request), "finished", G_CALLBACK(inf_test_mass_join_user_join_finished_cb), joiner ); } } static void inf_test_mass_join_session_synchronization_failed_cb(InfSession* session, InfXmlConnection* connection, const GError* error, gpointer user_data) { InfTestMassJoiner* joiner; joiner = (InfTestMassJoiner*)user_data; fprintf( stderr, "Joiner %s: Session synchronization failed: %s\n", joiner->username, error->message ); inf_xml_connection_close(infc_browser_get_connection(joiner->browser)); } static void inf_test_mass_join_session_synchronization_complete_cb(InfSession* session, InfXmlConnection* connection, gpointer user_data) { InfTestMassJoiner* joiner; joiner = (InfTestMassJoiner*)user_data; inf_test_mass_join_join_user(joiner); } static void inf_test_mass_join_subscribe_finished_cb(InfcNodeRequest* request, const InfcBrowserIter* iter, gpointer user_data) { InfTestMassJoiner* joiner; InfSession* session; joiner = (InfTestMassJoiner*)user_data; joiner->session = infc_browser_iter_get_session(joiner->browser, iter); g_assert(joiner->session != NULL); session = infc_session_proxy_get_session(joiner->session); switch(inf_session_get_status(session)) { case INF_SESSION_PRESYNC: case INF_SESSION_SYNCHRONIZING: g_signal_connect_after( G_OBJECT(session), "synchronization-failed", G_CALLBACK(inf_test_mass_join_session_synchronization_failed_cb), joiner ); g_signal_connect_after( G_OBJECT(session), "synchronization-complete", G_CALLBACK(inf_test_mass_join_session_synchronization_complete_cb), joiner ); break; case INF_SESSION_RUNNING: inf_test_mass_join_join_user(joiner); break; case INF_SESSION_CLOSED: fprintf( stderr, "Joiner %s: Session closed after subscription\n", joiner->username ); inf_xml_connection_close(infc_browser_get_connection(joiner->browser)); break; } } static void inf_test_mass_join_explore_finished_cb(InfcExploreRequest* exp_request, gpointer user_data) { InfTestMassJoiner* joiner; InfcBrowserIter iter; const char* name; InfcNodeRequest* sub_request; joiner = (InfTestMassJoiner*)user_data; infc_browser_iter_get_root(joiner->browser, &iter); if(infc_browser_iter_get_child(joiner->browser, &iter) == FALSE) { fprintf( stderr, "Joiner %s: Document %s does not exist\n", joiner->username, joiner->document ); inf_xml_connection_close(infc_browser_get_connection(joiner->browser)); } sub_request = NULL; do { name = infc_browser_iter_get_name(joiner->browser, &iter); if(strcmp(name, joiner->document) == 0) { sub_request = infc_browser_iter_subscribe_session(joiner->browser, &iter); g_signal_connect( G_OBJECT(sub_request), "finished", G_CALLBACK(inf_test_mass_join_subscribe_finished_cb), joiner ); break; } } while(infc_browser_iter_get_next(joiner->browser, &iter) == TRUE); if(sub_request == NULL) { fprintf( stderr, "Joiner %s: Document %s does not exist\n", joiner->username, joiner->document ); inf_xml_connection_close(infc_browser_get_connection(joiner->browser)); } } static void inf_test_mass_join_browser_notify_status_cb(GObject* object, const GParamSpec* pspec, gpointer user_data) { InfcBrowser* browser; InfcBrowserIter iter; InfcExploreRequest* request; InfTestMassJoin* massjoin; InfTestMassJoiner* joiner; GSList* item; browser = INFC_BROWSER(object); massjoin = (InfTestMassJoin*)user_data; joiner = NULL; for(item = massjoin->joiners; item != NULL; item = item->next) { joiner = (InfTestMassJoiner*)item->data; if(joiner->browser == browser) break; } g_assert(joiner != NULL); switch(infc_browser_get_status(browser)) { case INFC_BROWSER_CONNECTING: /* nothing to do */ break; case INFC_BROWSER_CONNECTED: fprintf(stdout, "Joiner %s: Connected\n", joiner->username); infc_browser_iter_get_root(browser, &iter); request = infc_browser_iter_explore(browser, &iter); g_signal_connect( G_OBJECT(request), "finished", G_CALLBACK(inf_test_mass_join_explore_finished_cb), joiner ); break; case INFC_BROWSER_DISCONNECTED: fprintf(stdout, "Joiner %s: Disconnected\n", joiner->username); massjoin->joiners = g_slist_remove(massjoin->joiners, joiner); if(massjoin->joiners == NULL) inf_standalone_io_loop_quit(INF_STANDALONE_IO(massjoin->io)); break; default: g_assert_not_reached(); break; } } static void inf_test_mass_join_connect(InfTestMassJoin* massjoin, const char* hostname, guint port, const char* document, const char* username) { InfIpAddress* addr; InfTcpConnection* tcp; InfXmppConnection* xmpp; InfTestMassJoiner* joiner; InfXmlConnection* xml; GError* error; addr = inf_ip_address_new_from_string(hostname); tcp = inf_tcp_connection_new(massjoin->io, addr, port); xmpp = inf_xmpp_connection_new( tcp, INF_XMPP_CONNECTION_CLIENT, g_get_host_name(), hostname, INF_XMPP_CONNECTION_SECURITY_BOTH_PREFER_TLS, NULL, NULL, NULL ); joiner = g_slice_new(InfTestMassJoiner); joiner->communication_manager = inf_communication_manager_new(); joiner->browser = infc_browser_new( massjoin->io, joiner->communication_manager, INF_XML_CONNECTION(xmpp) ); joiner->session = NULL; joiner->document = g_strdup(document); joiner->username = g_strdup(username); g_object_unref(xmpp); g_object_unref(tcp); inf_ip_address_free(addr); massjoin->joiners = g_slist_prepend(massjoin->joiners, joiner); infc_browser_add_plugin(joiner->browser, &INF_TEST_MASS_JOIN_TEXT_PLUGIN); g_signal_connect( G_OBJECT(joiner->browser), "notify::status", G_CALLBACK(inf_test_mass_join_browser_notify_status_cb), massjoin ); error = NULL; xml = infc_browser_get_connection(joiner->browser); if(inf_xml_connection_open(xml, &error) == FALSE) { fprintf( stderr, "Joiner %s: Failed to connect to %s: %s\n", joiner->username, hostname, error->message ); g_error_free(error); massjoin->joiners = g_slist_remove(massjoin->joiners, joiner); if(massjoin->joiners == NULL) inf_standalone_io_loop_quit(INF_STANDALONE_IO(massjoin->io)); } } int main(int argc, char* argv[]) { InfTestMassJoin massjoin; GError* error; int i; gchar* name; error = NULL; if(!inf_init(&error)) { fprintf(stderr, "%s\n", error->message); return -1; } massjoin.io = INF_IO(inf_standalone_io_new()); massjoin.joiners = NULL; for(i = 0; i < 128; ++i) { name = g_strdup_printf("MassJoin%03d", i); inf_test_mass_join_connect( &massjoin, "127.0.0.1", inf_protocol_get_default_port(), "Test", name ); g_free(name); //g_usleep(100000); } inf_standalone_io_loop(INF_STANDALONE_IO(massjoin.io)); return 0; } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/test/util/0000755000175000017500000000000012264766270013012 500000000000000libinfinity-0.5.5/test/util/Makefile.am0000644000175000017500000000062311204026376014754 00000000000000noinst_LIBRARIES = libinftestutil.a libinftestutil_a_CPPFLAGS = \ -I${top_srcdir} \ -I${top_builddir} \ ${infinity_CFLAGS} \ ${inftext_CFLAGS} libinftestutil_a_SOURCES = \ inf-test-util.c noinst_HEADERS = \ inf-test-util.h libinftestutil_a_LIBADD = \ ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ ${top_builddir}/libinftext/libinftext-$(LIBINFINITY_API_VERSION).la libinfinity-0.5.5/test/util/Makefile.in0000644000175000017500000005212612264766066015010 00000000000000# Makefile.in generated by automake 1.13.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = test/util DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/mkinstalldirs $(top_srcdir)/depcomp \ $(noinst_HEADERS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/libinfinity/inf-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru AM_V_AR = $(am__v_AR_@AM_V@) am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) am__v_AR_0 = @echo " AR " $@; am__v_AR_1 = libinftestutil_a_AR = $(AR) $(ARFLAGS) libinftestutil_a_DEPENDENCIES = ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ ${top_builddir}/libinftext/libinftext-$(LIBINFINITY_API_VERSION).la am_libinftestutil_a_OBJECTS = \ libinftestutil_a-inf-test-util.$(OBJEXT) libinftestutil_a_OBJECTS = $(am_libinftestutil_a_OBJECTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -I$(top_builddir)/libinfinity depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libinftestutil_a_SOURCES) DIST_SOURCES = $(libinftestutil_a_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBINFINITY_API_VERSION = @LIBINFINITY_API_VERSION@ LIBINFINITY_LIBTOOL_VERSION = @LIBINFINITY_LIBTOOL_VERSION@ LIBINFINITY_VERSION = @LIBINFINITY_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ avahi_CFLAGS = @avahi_CFLAGS@ avahi_LIBS = @avahi_LIBS@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gtk_requirement = @gtk_requirement@ gtk_version = @gtk_version@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infgtk_CFLAGS = @infgtk_CFLAGS@ infgtk_LIBS = @infgtk_LIBS@ infinity_CFLAGS = @infinity_CFLAGS@ infinity_LIBS = @infinity_LIBS@ infinoted_CFLAGS = @infinoted_CFLAGS@ infinoted_LIBS = @infinoted_LIBS@ infodir = @infodir@ inftext_CFLAGS = @inftext_CFLAGS@ inftext_LIBS = @inftext_LIBS@ inftextgtk_CFLAGS = @inftextgtk_CFLAGS@ inftextgtk_LIBS = @inftextgtk_LIBS@ install_sh = @install_sh@ libdaemon_CFLAGS = @libdaemon_CFLAGS@ libdaemon_LIBS = @libdaemon_LIBS@ 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@ noinst_LIBRARIES = libinftestutil.a libinftestutil_a_CPPFLAGS = \ -I${top_srcdir} \ -I${top_builddir} \ ${infinity_CFLAGS} \ ${inftext_CFLAGS} libinftestutil_a_SOURCES = \ inf-test-util.c noinst_HEADERS = \ inf-test-util.h libinftestutil_a_LIBADD = \ ${top_builddir}/libinfinity/libinfinity-$(LIBINFINITY_API_VERSION).la \ ${top_builddir}/libinftext/libinftext-$(LIBINFINITY_API_VERSION).la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu test/util/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu test/util/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libinftestutil.a: $(libinftestutil_a_OBJECTS) $(libinftestutil_a_DEPENDENCIES) $(EXTRA_libinftestutil_a_DEPENDENCIES) $(AM_V_at)-rm -f libinftestutil.a $(AM_V_AR)$(libinftestutil_a_AR) libinftestutil.a $(libinftestutil_a_OBJECTS) $(libinftestutil_a_LIBADD) $(AM_V_at)$(RANLIB) libinftestutil.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinftestutil_a-inf-test-util.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< libinftestutil_a-inf-test-util.o: inf-test-util.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinftestutil_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinftestutil_a-inf-test-util.o -MD -MP -MF $(DEPDIR)/libinftestutil_a-inf-test-util.Tpo -c -o libinftestutil_a-inf-test-util.o `test -f 'inf-test-util.c' || echo '$(srcdir)/'`inf-test-util.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinftestutil_a-inf-test-util.Tpo $(DEPDIR)/libinftestutil_a-inf-test-util.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-test-util.c' object='libinftestutil_a-inf-test-util.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinftestutil_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinftestutil_a-inf-test-util.o `test -f 'inf-test-util.c' || echo '$(srcdir)/'`inf-test-util.c libinftestutil_a-inf-test-util.obj: inf-test-util.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinftestutil_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libinftestutil_a-inf-test-util.obj -MD -MP -MF $(DEPDIR)/libinftestutil_a-inf-test-util.Tpo -c -o libinftestutil_a-inf-test-util.obj `if test -f 'inf-test-util.c'; then $(CYGPATH_W) 'inf-test-util.c'; else $(CYGPATH_W) '$(srcdir)/inf-test-util.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libinftestutil_a-inf-test-util.Tpo $(DEPDIR)/libinftestutil_a-inf-test-util.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inf-test-util.c' object='libinftestutil_a-inf-test-util.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libinftestutil_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libinftestutil_a-inf-test-util.obj `if test -f 'inf-test-util.c'; then $(CYGPATH_W) 'inf-test-util.c'; else $(CYGPATH_W) '$(srcdir)/inf-test-util.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLIBRARIES cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am # 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: libinfinity-0.5.5/test/util/inf-test-util.h0000644000175000017500000000367512264763732015622 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2010 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #ifndef __INF_TEST_UTIL_H__ #define __INF_TEST_UTIL_H__ #include #include #include #include G_BEGIN_DECLS typedef enum { INF_TEST_UTIL_PARSE_ERROR_UNEXPECTED_NODE, INF_TEST_UTIL_PARSE_ERROR_USER_ALREADY_EXISTS } InfTestUtilParseError; GQuark inf_test_util_parse_error_quark(void); void inf_test_util_print_operation(InfAdoptedOperation* op); void inf_test_util_print_request(InfAdoptedRequest* request); void inf_test_util_print_buffer(InfTextBuffer* buffer); gboolean inf_test_util_dir_foreach(const char* dirname, void(*callback)(const char*, gpointer), gpointer user_data, GError** error); InfTextChunk* inf_test_util_parse_buffer(xmlNodePtr xml, GError** error); gboolean inf_test_util_parse_user(xmlNodePtr xml, GSList** users, GError** error); G_END_DECLS #endif /* __INF_TEST_UTIL_H__ */ libinfinity-0.5.5/test/util/inf-test-util.c0000644000175000017500000001465412264763732015614 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include "inf-test-util.h" #include #include #include #include #include static int inf_test_util_dir_foreach_sort_func(gconstpointer first, gconstpointer second) { return strcmp(first, second); } GQuark inf_test_util_parse_error_quark(void) { return g_quark_from_static_string("INF_TEST_UTIL_PARSE_ERROR"); } void inf_test_util_print_operation(InfAdoptedOperation* op) { InfAdoptedOperation* first; InfAdoptedOperation* second; gchar* chunk_text; gsize chunk_bytes; if(INF_TEXT_IS_DEFAULT_INSERT_OPERATION(op)) { chunk_text = inf_text_chunk_get_text( inf_text_default_insert_operation_get_chunk( INF_TEXT_DEFAULT_INSERT_OPERATION(op) ), &chunk_bytes ); printf( "insert(%u, %.*s)\n", inf_text_insert_operation_get_position(INF_TEXT_INSERT_OPERATION(op)), (int)chunk_bytes, chunk_text ); g_free(chunk_text); } else if(INF_TEXT_IS_DELETE_OPERATION(op)) { printf( "delete(%u/%u)\n", inf_text_delete_operation_get_position(INF_TEXT_DELETE_OPERATION(op)), inf_text_delete_operation_get_length(INF_TEXT_DELETE_OPERATION(op)) ); } else if(INF_ADOPTED_IS_SPLIT_OPERATION(op)) { g_object_get(G_OBJECT(op), "first", &first, "second", &second, NULL); printf("split(\n "); inf_test_util_print_operation(first); printf(" "); inf_test_util_print_operation(second); printf(")\n"); } else { g_assert_not_reached(); } } void inf_test_util_print_request(InfAdoptedRequest* request) { gchar* time; time = inf_adopted_state_vector_to_string( inf_adopted_request_get_vector(request) ); printf("%u [%s] ", inf_adopted_request_get_user_id(request), time); g_free(time); switch(inf_adopted_request_get_request_type(request)) { case INF_ADOPTED_REQUEST_DO: printf("DO {\n "); inf_test_util_print_operation(inf_adopted_request_get_operation(request)); printf("}\n"); break; case INF_ADOPTED_REQUEST_UNDO: printf("UNDO\n"); break; case INF_ADOPTED_REQUEST_REDO: printf("REDO\n"); break; } } void inf_test_util_print_buffer(InfTextBuffer* buffer) { InfTextChunk* chunk; gchar* text; gsize bytes; chunk = inf_text_buffer_get_slice( buffer, 0, inf_text_buffer_get_length(buffer) ); text = inf_text_chunk_get_text(chunk, &bytes); inf_text_chunk_free(chunk); printf("%.*s\n", (int)bytes, text); g_free(text); } gboolean inf_test_util_dir_foreach(const char* dirname, void(*callback)(const char*, gpointer), gpointer user_data, GError** error) { GDir* dir; const gchar* entry; gchar* path; GSList* items; GSList* item; gboolean result; dir = g_dir_open(dirname, 0, error); if(dir == NULL) return FALSE; items = NULL; for(entry = g_dir_read_name(dir); entry != NULL; entry = g_dir_read_name(dir)) { /* Ignore hidden files */ if(entry[0] == '.') continue; path = g_build_filename(dirname, entry, NULL); items = g_slist_prepend(items, path); } g_dir_close(dir); items = g_slist_sort(items, inf_test_util_dir_foreach_sort_func); result = TRUE; for(item = items; item != NULL; item = g_slist_next(item)) { path = (gchar*)item->data; if(g_file_test(path, G_FILE_TEST_IS_DIR)) { if(inf_test_util_dir_foreach(path, callback, user_data, error) == FALSE) { result = FALSE; } } else if(g_file_test(path, G_FILE_TEST_IS_REGULAR)) { callback(path, user_data); } g_free(path); } g_slist_free(items); return result; } InfTextChunk* inf_test_util_parse_buffer(xmlNodePtr xml, GError** error) { InfTextChunk* chunk; xmlNodePtr child; guint author; gchar* content; gsize bytes; guint chars; chunk = inf_text_chunk_new("UTF-8"); for(child = xml->children; child != NULL; child = child->next) { if(child->type != XML_ELEMENT_NODE) continue; if(strcmp((const char*)child->name, "segment") == 0) { if(!inf_xml_util_get_attribute_uint(child, "author", &author, error)) { inf_text_chunk_free(chunk); return NULL; } content = inf_xml_util_get_child_text(child, &bytes, &chars, error); if(!content) { inf_text_chunk_free(chunk); return NULL; } inf_text_chunk_insert_text( chunk, inf_text_chunk_get_length(chunk), content, bytes, chars, author ); g_free(content); } else { g_set_error( error, inf_test_util_parse_error_quark(), INF_TEST_UTIL_PARSE_ERROR_UNEXPECTED_NODE, "Node '%s' unexpected", (const gchar*)child->name ); inf_text_chunk_free(chunk); return NULL; } } return chunk; } gboolean inf_test_util_parse_user(xmlNodePtr xml, GSList** users, GError** error) { guint id; if(!inf_xml_util_get_attribute_uint_required(xml, "id", &id, error)) return FALSE; if(g_slist_find(*users, GUINT_TO_POINTER(id)) != NULL) { g_set_error( error, inf_test_util_parse_error_quark(), INF_TEST_UTIL_PARSE_ERROR_USER_ALREADY_EXISTS, "User with ID %u exists already", id ); return FALSE; } *users = g_slist_prepend(*users, GUINT_TO_POINTER(id)); return TRUE; } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/test/cleanup/0000755000175000017500000000000012264766270013464 500000000000000libinfinity-0.5.5/test/cleanup/Makefile.am0000644000175000017500000000003711034223354015421 00000000000000EXTRA_DIST = \ cleanup-01.xml libinfinity-0.5.5/test/cleanup/cleanup-01.xml0000644000175000017500000000041711034223354015756 00000000000000 c libinfinity-0.5.5/test/cleanup/Makefile.in0000644000175000017500000003201612264766066015456 00000000000000# Makefile.in generated by automake 1.13.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = test/cleanup DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/mkinstalldirs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/libinfinity/inf-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBINFINITY_API_VERSION = @LIBINFINITY_API_VERSION@ LIBINFINITY_LIBTOOL_VERSION = @LIBINFINITY_LIBTOOL_VERSION@ LIBINFINITY_VERSION = @LIBINFINITY_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ avahi_CFLAGS = @avahi_CFLAGS@ avahi_LIBS = @avahi_LIBS@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gtk_requirement = @gtk_requirement@ gtk_version = @gtk_version@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infgtk_CFLAGS = @infgtk_CFLAGS@ infgtk_LIBS = @infgtk_LIBS@ infinity_CFLAGS = @infinity_CFLAGS@ infinity_LIBS = @infinity_LIBS@ infinoted_CFLAGS = @infinoted_CFLAGS@ infinoted_LIBS = @infinoted_LIBS@ infodir = @infodir@ inftext_CFLAGS = @inftext_CFLAGS@ inftext_LIBS = @inftext_LIBS@ inftextgtk_CFLAGS = @inftextgtk_CFLAGS@ inftextgtk_LIBS = @inftextgtk_LIBS@ install_sh = @install_sh@ libdaemon_CFLAGS = @libdaemon_CFLAGS@ libdaemon_LIBS = @libdaemon_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = \ cleanup-01.xml all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu test/cleanup/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu test/cleanup/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am # 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: libinfinity-0.5.5/test/inf-test-text-operations.c0000644000175000017500000003256412264763732017027 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include typedef struct { guint total; guint passed; } test_result; typedef enum { OP_INS, OP_DEL } operation_type; typedef struct { operation_type type; guint offset; const gchar* text; } operation_def; static const operation_def OPERATIONS[] = { { OP_INS, 4, "a" }, { OP_INS, 4, "b" }, { OP_INS, 4, "c" }, { OP_INS, 4, "a" }, { OP_INS, 2, "ac" }, { OP_INS, 3, "bc" }, { OP_INS, 2, "gro" }, { OP_DEL, 0, GUINT_TO_POINTER(1) }, { OP_DEL, 0, GUINT_TO_POINTER(5) }, { OP_DEL, 2, GUINT_TO_POINTER(7) }, { OP_DEL, 1, GUINT_TO_POINTER(9) } }; static const gchar EXAMPLE_DOCUMENT[] = "abcdefghijklmnopqrstuvwxyz"; static InfAdoptedOperation* def_to_operation(const operation_def* def, InfTextChunk* document, guint user) { InfTextChunk* chunk; InfAdoptedOperation* operation; switch(def->type) { case OP_INS: chunk = inf_text_chunk_new("UTF-8"); inf_text_chunk_insert_text( chunk, 0, def->text, strlen(def->text), strlen(def->text), user ); operation = INF_ADOPTED_OPERATION( inf_text_default_insert_operation_new(def->offset, chunk) ); inf_text_chunk_free(chunk); break; case OP_DEL: chunk = inf_text_chunk_substring( document, def->offset, GPOINTER_TO_UINT(def->text) ); operation = INF_ADOPTED_OPERATION( inf_text_default_delete_operation_new(def->offset, chunk) ); inf_text_chunk_free(chunk); break; default: g_assert_not_reached(); break; } return operation; } static gboolean insert_operation_equal(InfTextDefaultInsertOperation* op1, InfAdoptedOperation* op2) { guint pos1; guint pos2; int result; if(INF_TEXT_IS_DEFAULT_INSERT_OPERATION(op2)) { pos1 = inf_text_insert_operation_get_position( INF_TEXT_INSERT_OPERATION(op1) ); pos2 = inf_text_insert_operation_get_position( INF_TEXT_INSERT_OPERATION(op2) ); if(pos1 != pos2) return FALSE; result = inf_text_chunk_equal( inf_text_default_insert_operation_get_chunk(op1), inf_text_default_insert_operation_get_chunk( INF_TEXT_DEFAULT_INSERT_OPERATION(op2) ) ); return result; } else { return FALSE; } } static gboolean delete_operation_equal(InfTextDefaultDeleteOperation* op1, InfAdoptedOperation* op2) { guint pos1; guint pos2; InfTextChunk* chunk1; InfTextChunk* chunk2; if(INF_TEXT_IS_DEFAULT_DELETE_OPERATION(op2)) { pos1 = inf_text_delete_operation_get_position( INF_TEXT_DELETE_OPERATION(op1) ); pos2 = inf_text_delete_operation_get_position( INF_TEXT_DELETE_OPERATION(op2) ); chunk1 = inf_text_default_delete_operation_get_chunk( INF_TEXT_DEFAULT_DELETE_OPERATION(op1) ); chunk2 = inf_text_default_delete_operation_get_chunk( INF_TEXT_DEFAULT_DELETE_OPERATION(op2) ); /* Both are no-op */ if(inf_text_chunk_get_length(chunk1) == 0 && inf_text_chunk_get_length(chunk2) == 0) { return TRUE; } if(pos1 != pos2) return FALSE; return inf_text_chunk_equal(chunk1, chunk2); } else { return FALSE; } } /* Required by split_operation_equal */ static gboolean operation_equal(InfAdoptedOperation* op1, InfAdoptedOperation* op2); static gboolean split_operation_equal(InfAdoptedSplitOperation* op1, InfAdoptedOperation* op2) { GSList* first_list; GSList* second_list; GSList* first_item; GSList* second_item; InfAdoptedOperation* first_op; InfAdoptedOperation* second_op; first_list = inf_adopted_split_operation_unsplit(op1); if(INF_ADOPTED_IS_SPLIT_OPERATION(op2)) { second_list = inf_adopted_split_operation_unsplit( INF_ADOPTED_SPLIT_OPERATION(op2) ); } else { second_list = g_slist_prepend(NULL, op2); } /* Order in split operations does not matter. */ for(first_item = first_list; first_item != NULL; first_item = g_slist_next(first_item)) { first_op = first_item->data; /* Ignore noop operations */ if(INF_TEXT_IS_DELETE_OPERATION(first_op)) if(inf_text_delete_operation_get_length(INF_TEXT_DELETE_OPERATION(first_op)) == 0) continue; if(INF_ADOPTED_IS_NO_OPERATION(first_op)) continue; for(second_item = second_list; second_item != NULL; second_item = g_slist_next(second_item)) { second_op = second_item->data; if(operation_equal(first_op, second_op) == TRUE) break; } if(second_item == NULL) { g_slist_free(first_list); g_slist_free(second_list); return FALSE; } } for(second_item = second_list; second_item != NULL; second_item = g_slist_next(second_item)) { second_op = second_item->data; /* Ignore noop operations */ if(INF_TEXT_IS_DELETE_OPERATION(second_op)) if(inf_text_delete_operation_get_length(INF_TEXT_DELETE_OPERATION(second_op)) == 0) continue; if(INF_ADOPTED_IS_NO_OPERATION(second_op)) continue; for(first_item = first_list; first_item != NULL; first_item = g_slist_next(first_item)) { first_op = first_item->data; if(operation_equal(first_op, second_op) == TRUE) break; } if(first_item == NULL) { g_slist_free(first_list); g_slist_free(second_list); return FALSE; } } g_slist_free(first_list); g_slist_free(second_list); return TRUE; } static gboolean operation_equal(InfAdoptedOperation* op1, InfAdoptedOperation* op2) { if(INF_ADOPTED_IS_SPLIT_OPERATION(op1)) return split_operation_equal(INF_ADOPTED_SPLIT_OPERATION(op1), op2); else if(INF_ADOPTED_IS_SPLIT_OPERATION(op2)) return split_operation_equal(INF_ADOPTED_SPLIT_OPERATION(op2), op1); else if(INF_TEXT_IS_DEFAULT_INSERT_OPERATION(op1)) return insert_operation_equal(INF_TEXT_DEFAULT_INSERT_OPERATION(op1), op2); else if(INF_TEXT_IS_DEFAULT_DELETE_OPERATION(op1)) return delete_operation_equal(INF_TEXT_DEFAULT_DELETE_OPERATION(op1), op2); else g_assert_not_reached(); } static gboolean test_c1(InfAdoptedOperation* op1, InfAdoptedOperation* op2, InfAdoptedUser* user1, InfAdoptedUser* user2, InfAdoptedConcurrencyId cid12) { InfTextDefaultBuffer* first; InfTextDefaultBuffer* second; InfTextChunk* first_chunk; InfTextChunk* second_chunk; InfAdoptedOperation* transformed; int result; first = inf_text_default_buffer_new("UTF-8"); inf_text_buffer_insert_text( INF_TEXT_BUFFER(first), 0, EXAMPLE_DOCUMENT, strlen(EXAMPLE_DOCUMENT), strlen(EXAMPLE_DOCUMENT), NULL ); second = inf_text_default_buffer_new("UTF-8"); inf_text_buffer_insert_text( INF_TEXT_BUFFER(second), 0, EXAMPLE_DOCUMENT, strlen(EXAMPLE_DOCUMENT), strlen(EXAMPLE_DOCUMENT), NULL ); inf_adopted_operation_apply(op1, user1, INF_BUFFER(first)); transformed = inf_adopted_operation_transform(op2, op1, -cid12); inf_adopted_operation_apply(transformed, user2, INF_BUFFER(first)); g_object_unref(G_OBJECT(transformed)); inf_adopted_operation_apply(op2, user2, INF_BUFFER(second)); transformed = inf_adopted_operation_transform(op1, op2, cid12); inf_adopted_operation_apply(transformed, user1, INF_BUFFER(second)); g_object_unref(G_OBJECT(transformed)); first_chunk = inf_text_buffer_get_slice( INF_TEXT_BUFFER(first), 0, inf_text_buffer_get_length(INF_TEXT_BUFFER(first)) ); second_chunk = inf_text_buffer_get_slice( INF_TEXT_BUFFER(second), 0, inf_text_buffer_get_length(INF_TEXT_BUFFER(second)) ); result = inf_text_chunk_equal(first_chunk, second_chunk); inf_text_chunk_free(first_chunk); inf_text_chunk_free(second_chunk); g_object_unref(G_OBJECT(first)); g_object_unref(G_OBJECT(second)); return result; } static gboolean test_c2(InfAdoptedOperation* op1, InfAdoptedOperation* op2, InfAdoptedOperation* op3, InfAdoptedConcurrencyId cid12, InfAdoptedConcurrencyId cid13, InfAdoptedConcurrencyId cid23) { InfAdoptedOperation* temp1; InfAdoptedOperation* temp2; InfAdoptedOperation* result1; InfAdoptedOperation* result2; InfAdoptedConcurrencyId cid; gboolean retval; temp1 = inf_adopted_operation_transform(op2, op1, -cid12); temp2 = inf_adopted_operation_transform(op3, op1, -cid13); cid = INF_ADOPTED_CONCURRENCY_NONE; if(inf_adopted_operation_need_concurrency_id(temp2, temp1)) cid = inf_adopted_operation_get_concurrency_id(op3, op2); if(cid == INF_ADOPTED_CONCURRENCY_NONE) cid = -cid23; result1 = inf_adopted_operation_transform(temp2, temp1, cid); g_object_unref(G_OBJECT(temp1)); g_object_unref(G_OBJECT(temp2)); temp1 = inf_adopted_operation_transform(op1, op2, cid12); temp2 = inf_adopted_operation_transform(op3, op2, -cid23); cid = INF_ADOPTED_CONCURRENCY_NONE; if(inf_adopted_operation_need_concurrency_id(temp2, temp1)) cid = inf_adopted_operation_get_concurrency_id(op3, op1); if(cid == INF_ADOPTED_CONCURRENCY_NONE) cid = -cid13; result2 = inf_adopted_operation_transform(temp2, temp1, cid); g_object_unref(G_OBJECT(temp1)); g_object_unref(G_OBJECT(temp2)); retval = operation_equal(result1, result2); g_object_unref(G_OBJECT(result1)); g_object_unref(G_OBJECT(result2)); return retval; } static InfAdoptedConcurrencyId cid(InfAdoptedOperation** first, InfAdoptedOperation** second) { if(first > second) return INF_ADOPTED_CONCURRENCY_SELF; else if(first < second) return INF_ADOPTED_CONCURRENCY_OTHER; else g_assert_not_reached(); } static void perform_c1(InfAdoptedOperation** begin, InfAdoptedOperation** end, InfAdoptedUser** users, test_result* result) { InfAdoptedOperation** _1; InfAdoptedOperation** _2; for(_1 = begin; _1 != end; ++ _1) { for(_2 = begin; _2 != end; ++ _2) { if(_1 != _2) { ++ result->total; if(test_c1(*_1, *_2, users[_1 - begin], users[_2 - begin], cid(_1, _2))) ++ result->passed; } } } } static void perform_c2(InfAdoptedOperation** begin, InfAdoptedOperation** end, test_result* result) { InfAdoptedOperation** _1; InfAdoptedOperation** _2; InfAdoptedOperation** _3; for(_1 = begin; _1 != end; ++ _1) { for(_2 = begin; _2 != end; ++ _2) { for(_3 = begin; _3 != end; ++ _3) { if(_1 != _2 && _1 != _3 && _2 != _3) { ++ result->total; if(test_c2(*_1, *_2, *_3, cid(_1, _2), cid(_1, _3), cid(_2, _3))) ++ result->passed; } } } } } int main() { InfAdoptedOperation** operations; InfAdoptedUser** users; InfTextChunk* document; test_result result; guint i; int retval; g_type_init(); retval = 0; operations = g_malloc( sizeof(InfAdoptedOperation*) * G_N_ELEMENTS(OPERATIONS) ); users = g_malloc(sizeof(InfAdoptedUser*) * G_N_ELEMENTS(OPERATIONS)); document = inf_text_chunk_new("UTF-8"); inf_text_chunk_insert_text( document, 0, EXAMPLE_DOCUMENT, strlen(EXAMPLE_DOCUMENT), strlen(EXAMPLE_DOCUMENT), 0 ); for(i = 0; i < G_N_ELEMENTS(OPERATIONS); ++ i) { operations[i] = def_to_operation(&OPERATIONS[i], document, i + 1); users[i] = INF_ADOPTED_USER( g_object_new(INF_TEXT_TYPE_USER, "id", i + 1, NULL) ); } inf_text_chunk_free(document); result.passed = 0; result.total = 0; perform_c1(operations, operations + G_N_ELEMENTS(OPERATIONS), users, &result); printf("C1: %u out of %u passed\n", result.passed, result.total); if(result.passed < result.total) retval = -1; result.passed = 0; result.total = 0; perform_c2(operations, operations + G_N_ELEMENTS(OPERATIONS), &result); printf("C2: %u out of %u passed\n", result.passed, result.total); if(result.passed < result.total) retval = -1; for(i = 0; i < G_N_ELEMENTS(OPERATIONS); ++ i) { g_object_unref(G_OBJECT(operations[i])); g_object_unref(G_OBJECT(users[i])); } g_free(operations); g_free(users); return retval; } libinfinity-0.5.5/test/inf-test-gtk-browser.c0000644000175000017500000006270012264763732016123 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include typedef struct _InfTestGtkBrowserWindow InfTestGtkBrowserWindow; struct _InfTestGtkBrowserWindow { GtkWidget* textview; GtkWidget* undo_button; GtkWidget* redo_button; InfTextGtkBuffer* buffer; InfTextGtkView* view; InfTextGtkViewport* viewport; InfcSessionProxy* proxy; InfUser* user; InfcUserRequest* request; }; typedef struct _InfTestGtkBrowserChatWindow InfTestGtkBrowserChatWindow; struct _InfTestGtkBrowserChatWindow { GtkWidget* chat; GtkWidget* status; InfChatBuffer* buffer; InfcSessionProxy* proxy; InfUser* user; InfcUserRequest* request; }; static InfSession* inf_test_gtk_browser_session_new(InfIo* io, InfCommunicationManager* manager, InfSessionStatus status, InfCommunicationJoinedGroup* sync_group, InfXmlConnection* sync_connection, gpointer user_data) { InfTextGtkBuffer* buffer; InfUserTable* user_table; GtkTextBuffer* textbuffer; InfTextSession* session; textbuffer = gtk_text_buffer_new(NULL); user_table = inf_user_table_new(); buffer = inf_text_gtk_buffer_new(textbuffer, user_table); session = inf_text_session_new_with_user_table( manager, INF_TEXT_BUFFER(buffer), io, user_table, status, INF_COMMUNICATION_GROUP(sync_group), sync_connection ); return INF_SESSION(session); } static const InfcNotePlugin INF_TEST_GTK_BROWSER_TEXT_PLUGIN = { NULL, "InfText", inf_test_gtk_browser_session_new }; static void set_error(InfTestGtkBrowserWindow* test, const gchar* prefix, const gchar* error_message) { GtkTextBuffer* new_buffer; GtkTextIter iter; /* Note we cannot just write in the current buffer of the textview because * it is coupled with the InfTextGtkBuffer which would then try to send * the text insertion to the subscription group (and fail doing so, * probably). */ new_buffer = gtk_text_buffer_new(NULL); gtk_text_buffer_get_start_iter(new_buffer, &iter); gtk_text_buffer_insert(new_buffer, &iter, prefix, -1); gtk_text_buffer_insert(new_buffer, &iter, ": ", 2); gtk_text_buffer_insert(new_buffer, &iter, error_message, -1); gtk_text_view_set_buffer(GTK_TEXT_VIEW(test->textview), new_buffer); g_object_unref(G_OBJECT(new_buffer)); } static void on_undo_button_clicked(GtkButton* button, gpointer user_data) { InfTestGtkBrowserWindow* test; InfAdoptedSession* session; test = (InfTestGtkBrowserWindow*)user_data; session = INF_ADOPTED_SESSION(infc_session_proxy_get_session(test->proxy)); inf_adopted_session_undo(session, INF_ADOPTED_USER(test->user), 1); } static void on_redo_button_clicked(GtkButton* button, gpointer user_data) { InfTestGtkBrowserWindow* test; InfAdoptedSession* session; test = (InfTestGtkBrowserWindow*)user_data; session = INF_ADOPTED_SESSION(infc_session_proxy_get_session(test->proxy)); inf_adopted_session_redo(session, INF_ADOPTED_USER(test->user), 1); } static void on_can_undo_changed(InfAdoptedAlgorithm* algorithm, InfAdoptedUser* user, gboolean can_undo, gpointer user_data) { InfTestGtkBrowserWindow* test; test = (InfTestGtkBrowserWindow*)user_data; gtk_widget_set_sensitive(test->undo_button, can_undo); } static void on_can_redo_changed(InfAdoptedAlgorithm* algorithm, InfAdoptedUser* user, gboolean can_redo, gpointer user_data) { InfTestGtkBrowserWindow* test; test = (InfTestGtkBrowserWindow*)user_data; gtk_widget_set_sensitive(test->redo_button, can_redo); } static void on_chat_join_finished(InfcUserRequest* request, InfUser* user, gpointer user_data) { InfTestGtkBrowserChatWindow* test; gchar* text; test = (InfTestGtkBrowserChatWindow*)user_data; inf_gtk_chat_set_active_user(INF_GTK_CHAT(test->chat), user); text = g_strdup_printf("Joined as %s", inf_user_get_name(user)); gtk_label_set_text(GTK_LABEL(test->status), text); g_free(text); test->user = user; g_object_ref(user); g_assert(test->request != NULL); g_object_unref(test->request); test->request = NULL; /* Unfortunately, gtk_widget_grab_focus(test->chat) + * gtk_container_set_focus_child() in inf_gtk_chat_set_active_user() does * not do the job which is why I added this crappy API. */ gtk_widget_grab_focus(inf_gtk_chat_get_entry(INF_GTK_CHAT(test->chat))); } static void on_join_finished(InfcUserRequest* request, InfUser* user, gpointer user_data) { InfTestGtkBrowserWindow* test; InfAdoptedSession* session; InfAdoptedAlgorithm* algorithm; gboolean undo; gboolean redo; test = (InfTestGtkBrowserWindow*)user_data; inf_text_gtk_buffer_set_active_user(test->buffer, INF_TEXT_USER(user)); inf_text_gtk_view_set_active_user(test->view, INF_TEXT_USER(user)); inf_text_gtk_viewport_set_active_user(test->viewport, INF_TEXT_USER(user)); gtk_text_view_set_editable(GTK_TEXT_VIEW(test->textview), TRUE); test->user = user; g_object_ref(user); g_assert(test->request != NULL); g_object_unref(test->request); test->request = NULL; session = INF_ADOPTED_SESSION(infc_session_proxy_get_session(test->proxy)); algorithm = inf_adopted_session_get_algorithm(session); undo = inf_adopted_algorithm_can_undo(algorithm, INF_ADOPTED_USER(user)); redo = inf_adopted_algorithm_can_redo(algorithm, INF_ADOPTED_USER(user)); gtk_widget_set_sensitive(test->undo_button, undo); gtk_widget_set_sensitive(test->redo_button, redo); } static void request_chat_join(InfTestGtkBrowserChatWindow* test, const gchar* user_name); static void on_chat_join_failed(InfcRequest* request, const GError* error, gpointer user_data) { InfTestGtkBrowserChatWindow* test; gchar* new_name; gchar* text; test = (InfTestGtkBrowserChatWindow*)user_data; g_assert(test->request != NULL); g_object_unref(test->request); test->request = NULL; if(error->domain == inf_user_error_quark() && error->code == INF_USER_ERROR_NAME_IN_USE) { new_name = g_strdup_printf("%s%d", g_get_user_name(), rand()); request_chat_join(test, new_name); g_free(new_name); } else { text = g_strdup_printf("User join failed: %s", error->message); gtk_label_set_text(GTK_LABEL(test->status), text); g_free(text); } } static void request_join(InfTestGtkBrowserWindow* test, const gchar* user_name); static void on_join_failed(InfcRequest* request, const GError* error, gpointer user_data) { InfTestGtkBrowserWindow* test; gchar* new_name; test = (InfTestGtkBrowserWindow*)user_data; g_assert(test->request != NULL); g_object_unref(test->request); test->request = NULL; if(error->domain == inf_user_error_quark() && error->code == INF_USER_ERROR_NAME_IN_USE) { new_name = g_strdup_printf("%s%d", g_get_user_name(), rand()); request_join(test, new_name); g_free(new_name); } else { set_error(test, "User join failed", error->message); } } static void request_chat_join(InfTestGtkBrowserChatWindow* test, const gchar* user_name) { InfcUserRequest* request; GError* error; gchar* text; GParameter params[1] = { { "name", { 0 } } }; g_value_init(¶ms[0].value, G_TYPE_STRING); g_value_set_static_string(¶ms[0].value, user_name); error = NULL; request = infc_session_proxy_join_user(test->proxy, params, 1, &error); g_value_unset(¶ms[0].value); if(request == NULL) { text = g_strdup_printf("User join failed: %s", error->message); g_error_free(error); gtk_label_set_text(GTK_LABEL(test->status), text); g_free(text); } else { text = g_strdup_printf("Requesting user join for %s", user_name); gtk_label_set_text(GTK_LABEL(test->status), text); g_free(text); g_signal_connect_after( G_OBJECT(request), "failed", G_CALLBACK(on_chat_join_failed), test ); g_signal_connect_after( G_OBJECT(request), "finished", G_CALLBACK(on_chat_join_finished), test ); g_assert(test->request == NULL); test->request = request; g_object_ref(test->request); } } static void request_join(InfTestGtkBrowserWindow* test, const gchar* user_name) { InfcUserRequest* request; InfAdoptedStateVector* v; GError* error; GtkTextBuffer* buffer; GtkTextMark* mark; GtkTextIter iter; GParameter params[3] = { { "name", { 0 } }, { "vector", { 0 } }, { "caret-position", { 0 } } }; g_value_init(¶ms[0].value, G_TYPE_STRING); g_value_init(¶ms[1].value, INF_ADOPTED_TYPE_STATE_VECTOR); g_value_init(¶ms[2].value, G_TYPE_UINT); g_value_set_static_string(¶ms[0].value, user_name); /* Use current state vector. Infinote should already do this. */ v = inf_adopted_state_vector_copy( inf_adopted_algorithm_get_current( inf_adopted_session_get_algorithm( INF_ADOPTED_SESSION(infc_session_proxy_get_session(test->proxy)) ) ) ); g_value_take_boxed(¶ms[1].value, v); buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(test->textview)); mark = gtk_text_buffer_get_insert(buffer); gtk_text_buffer_get_iter_at_mark(buffer, &iter, mark); g_value_set_uint(¶ms[2].value, gtk_text_iter_get_offset(&iter)); error = NULL; request = infc_session_proxy_join_user(test->proxy, params, 3, &error); /* TODO: Free GValues? */ if(request == NULL) { set_error(test, "Failed to request user join", error->message); } else { g_signal_connect_after( G_OBJECT(request), "failed", G_CALLBACK(on_join_failed), test ); g_signal_connect_after( G_OBJECT(request), "finished", G_CALLBACK(on_join_finished), test ); g_assert(test->request == NULL); test->request = request; g_object_ref(request); } } static void on_chat_synchronization_failed(InfSession* session, InfXmlConnection* connection, const GError* error, gpointer user_data) { InfTestGtkBrowserChatWindow* test; gchar* text; test = (InfTestGtkBrowserChatWindow*)user_data; text = g_strdup_printf("Synchronization failed: %s\n", error->message); gtk_label_set_text(GTK_LABEL(test->status), text); g_free(text); } static void on_chat_synchronization_complete(InfSession* session, InfXmlConnection* connection, gpointer user_data) { InfTestGtkBrowserChatWindow* test; test = (InfTestGtkBrowserChatWindow*)user_data; request_chat_join(test, g_get_user_name()); } static void on_synchronization_failed(InfSession* session, InfXmlConnection* connection, const GError* error, gpointer user_data) { InfTestGtkBrowserWindow* test; test = (InfTestGtkBrowserWindow*)user_data; set_error(test, "Synchronization failed", error->message); } static void on_synchronization_complete(InfSession* session, InfXmlConnection* connection, gpointer user_data) { InfTestGtkBrowserWindow* test; InfAdoptedAlgorithm* algorithm; test = (InfTestGtkBrowserWindow*)user_data; session = infc_session_proxy_get_session(test->proxy); algorithm = inf_adopted_session_get_algorithm(INF_ADOPTED_SESSION(session)); g_signal_connect( G_OBJECT(algorithm), "can-undo-changed", G_CALLBACK(on_can_undo_changed), test ); g_signal_connect( G_OBJECT(algorithm), "can-redo-changed", G_CALLBACK(on_can_redo_changed), test ); request_join(test, g_get_user_name()); } static void on_chat_window_destroy(GtkWindow* window, gpointer user_data) { InfTestGtkBrowserChatWindow* test; InfSession* session; test = (InfTestGtkBrowserChatWindow*)user_data; session = infc_session_proxy_get_session(test->proxy); inf_signal_handlers_disconnect_by_func( session, G_CALLBACK(on_chat_synchronization_complete), test ); inf_signal_handlers_disconnect_by_func( session, G_CALLBACK(on_chat_synchronization_failed), test ); if(test->request != NULL) { inf_signal_handlers_disconnect_by_func( test->request, G_CALLBACK(on_chat_join_finished), test ); inf_signal_handlers_disconnect_by_func( test->request, G_CALLBACK(on_chat_join_failed), test ); g_object_unref(test->request); } if(test->proxy != NULL) g_object_unref(test->proxy); if(test->user != NULL) g_object_unref(test->user); g_slice_free(InfTestGtkBrowserChatWindow, test); } static void on_text_window_destroy(GtkWindow* window, gpointer user_data) { InfTestGtkBrowserWindow* test; InfSession* session; test = (InfTestGtkBrowserWindow*)user_data; session = infc_session_proxy_get_session(test->proxy); inf_signal_handlers_disconnect_by_func( session, G_CALLBACK(on_synchronization_complete), test ); inf_signal_handlers_disconnect_by_func( session, G_CALLBACK(on_synchronization_failed), test ); if(test->request != NULL) { inf_signal_handlers_disconnect_by_func( test->request, G_CALLBACK(on_join_finished), test ); inf_signal_handlers_disconnect_by_func( test->request, G_CALLBACK(on_join_failed), test ); g_object_unref(test->request); } if(test->proxy != NULL) g_object_unref(test->proxy); /* TODO: Do we ever ref buffer? */ if(test->buffer != NULL) g_object_unref(test->buffer); if(test->user !=NULL) g_object_unref(test->user); g_slice_free(InfTestGtkBrowserWindow, test); } static void on_subscribe_chat_session(InfcBrowser* browser, InfcSessionProxy* proxy, gpointer user_data) { InfSession* session; InfChatBuffer* buffer; GtkWidget* chat; GtkWidget* status; GtkWidget* vbox; GtkWidget* window; InfTestGtkBrowserChatWindow* test; session = infc_session_proxy_get_session(proxy); buffer = INF_CHAT_BUFFER(inf_session_get_buffer(session)); chat = inf_gtk_chat_new(); inf_gtk_chat_set_session(INF_GTK_CHAT(chat), INF_CHAT_SESSION(session)); gtk_widget_show(chat); status = gtk_label_new("Synchronizing chat..."); gtk_widget_show(status); vbox = gtk_vbox_new(FALSE, 6); gtk_box_pack_start(GTK_BOX(vbox), chat, TRUE, TRUE, 0); gtk_box_pack_start(GTK_BOX(vbox), status, FALSE, TRUE, 0); gtk_widget_show(vbox); window = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_window_set_title(GTK_WINDOW(window), "Chat"); gtk_window_set_default_size(GTK_WINDOW(window), 400, 400); gtk_window_set_icon_name(GTK_WINDOW(window), "infinote"); gtk_container_set_border_width(GTK_CONTAINER(window), 6); gtk_container_add(GTK_CONTAINER(window), vbox); gtk_widget_show(window); test = g_slice_new(InfTestGtkBrowserChatWindow); test->chat = chat; test->status = status; test->buffer = buffer; test->proxy = proxy; test->user = NULL; test->request = NULL; g_object_ref(test->proxy); g_signal_connect_after( G_OBJECT(session), "synchronization-failed", G_CALLBACK(on_chat_synchronization_failed), test ); g_signal_connect_after( G_OBJECT(session), "synchronization-complete", G_CALLBACK(on_chat_synchronization_complete), test ); g_signal_connect( G_OBJECT(window), "destroy", G_CALLBACK(on_chat_window_destroy), test ); } static void on_subscribe_session(InfcBrowser* browser, InfcBrowserIter* iter, InfcSessionProxy* proxy, gpointer user_data) { GtkWidget* window; GtkWidget* scroll; GtkWidget* textview; GtkWidget* vbox; GtkWidget* hbox; GtkWidget* undo_button; GtkWidget* redo_button; InfSession* session; InfIo* io; InfUserTable* user_table; InfTextGtkBuffer* buffer; InfTextGtkView* view; InfTextGtkViewport* viewport; GtkTextBuffer* textbuffer; InfTestGtkBrowserWindow* test; if(iter == NULL) { on_subscribe_chat_session(browser, proxy, user_data); return; } session = infc_session_proxy_get_session(proxy); io = inf_adopted_session_get_io(INF_ADOPTED_SESSION(session)); user_table = inf_session_get_user_table(session); buffer = INF_TEXT_GTK_BUFFER(inf_session_get_buffer(session)); textbuffer = inf_text_gtk_buffer_get_text_buffer(buffer); textview = gtk_text_view_new_with_buffer(textbuffer); view = inf_text_gtk_view_new(io, GTK_TEXT_VIEW(textview), user_table); gtk_text_view_set_editable(GTK_TEXT_VIEW(textview), FALSE); gtk_widget_show(textview); scroll = gtk_scrolled_window_new(NULL, NULL); viewport = inf_text_gtk_viewport_new(GTK_SCROLLED_WINDOW(scroll), user_table); gtk_scrolled_window_set_shadow_type( GTK_SCROLLED_WINDOW(scroll), GTK_SHADOW_IN ); gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW(scroll), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC ); gtk_container_add(GTK_CONTAINER(scroll), textview); gtk_widget_show(scroll); undo_button = gtk_button_new_from_stock(GTK_STOCK_UNDO); redo_button = gtk_button_new_from_stock(GTK_STOCK_REDO); gtk_widget_set_sensitive(undo_button, FALSE); gtk_widget_set_sensitive(redo_button, FALSE); gtk_widget_show(undo_button); gtk_widget_show(redo_button); hbox = gtk_hbutton_box_new(); gtk_box_pack_start(GTK_BOX(hbox), undo_button, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(hbox), redo_button, FALSE, FALSE, 0); gtk_widget_show(hbox); vbox = gtk_vbox_new(FALSE, 6); gtk_box_pack_start(GTK_BOX(vbox), scroll, TRUE, TRUE, 0); gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); gtk_widget_show(vbox); window = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_window_set_title( GTK_WINDOW(window), infc_browser_iter_get_name(browser, iter) ); gtk_window_set_default_size(GTK_WINDOW(window), 400, 400); gtk_window_set_icon_name(GTK_WINDOW(window), "infinote"); gtk_container_set_border_width(GTK_CONTAINER(window), 6); gtk_container_add(GTK_CONTAINER(window), vbox); gtk_widget_show(window); test = g_slice_new(InfTestGtkBrowserWindow); test->textview = textview; test->undo_button = undo_button; test->redo_button = redo_button; test->buffer = buffer; test->view = view; test->viewport = viewport; test->proxy = proxy; test->user = NULL; test->request = NULL; g_object_ref(proxy); g_signal_connect_after( G_OBJECT(session), "synchronization-failed", G_CALLBACK(on_synchronization_failed), test ); g_signal_connect_after( G_OBJECT(session), "synchronization-complete", G_CALLBACK(on_synchronization_complete), test ); g_signal_connect( G_OBJECT(window), "destroy", G_CALLBACK(on_text_window_destroy), test ); g_signal_connect( G_OBJECT(undo_button), "clicked", G_CALLBACK(on_undo_button_clicked), test ); g_signal_connect( G_OBJECT(redo_button), "clicked", G_CALLBACK(on_redo_button_clicked), test ); } static void on_activate(InfGtkBrowserView* view, GtkTreeIter* iter, gpointer user_data) { InfcBrowser* browser; InfcBrowserIter* browser_iter; gtk_tree_model_get( GTK_TREE_MODEL(gtk_tree_view_get_model(GTK_TREE_VIEW(view))), iter, INF_GTK_BROWSER_MODEL_COL_BROWSER, &browser, INF_GTK_BROWSER_MODEL_COL_NODE, &browser_iter, -1 ); /* Subscribe, if possible and not already */ if(!infc_browser_iter_get_session(browser, browser_iter) && !infc_browser_iter_get_subscribe_request(browser, browser_iter) && infc_browser_iter_get_plugin(browser, browser_iter) != NULL) { infc_browser_iter_subscribe_session(browser, browser_iter); } infc_browser_iter_free(browser_iter); g_object_unref(browser); } static void on_browser_notify_status(GObject* object, const GParamSpec* pspec, gpointer user_data) { InfcBrowser* browser; browser = INFC_BROWSER(object); if(infc_browser_get_status(browser) == INFC_BROWSER_CONNECTED) infc_browser_subscribe_chat(browser); } static void on_set_browser(InfGtkBrowserModel* model, GtkTreePath* path, GtkTreeIter* iter, InfcBrowser* browser, gpointer user_data) { if(browser != NULL) { infc_browser_add_plugin(browser, &INF_TEST_GTK_BROWSER_TEXT_PLUGIN); g_signal_connect_after( G_OBJECT(browser), "subscribe-session", G_CALLBACK(on_subscribe_session), NULL ); if(infc_browser_get_status(browser) == INFC_BROWSER_CONNECTED) { infc_browser_subscribe_chat(browser); } else { g_signal_connect( G_OBJECT(browser), "notify::status", G_CALLBACK(on_browser_notify_status), browser ); } } } static void on_destroy(GtkWindow* window, gpointer user_data) { /* TODO: Destroy open text windows */ gtk_main_quit(); } int main(int argc, char* argv[]) { InfGtkIo* io; InfCommunicationManager* communication_manager; #ifdef LIBINFINITY_HAVE_AVAHI InfXmppManager* xmpp_manager; InfDiscoveryAvahi* avahi; #endif InfGtkBrowserStore* store; GtkWidget* view; GtkWidget* scroll; GtkWidget* window; GError* error; int i; InfTcpConnection* tcp; InfXmppConnection* xmpp; InfIpAddress* addr; gtk_init(&argc, &argv); error = NULL; if(!inf_init(&error)) { fprintf(stderr, "%s\n", error->message); return -1; } io = inf_gtk_io_new(); #ifdef LIBINFINITY_HAVE_AVAHI xmpp_manager = inf_xmpp_manager_new(); avahi = inf_discovery_avahi_new(INF_IO(io), xmpp_manager, NULL, NULL, NULL); g_object_unref(G_OBJECT(xmpp_manager)); #endif communication_manager = inf_communication_manager_new(); store = inf_gtk_browser_store_new(INF_IO(io), communication_manager); g_object_unref(communication_manager); g_signal_connect_after( G_OBJECT(store), "set-browser", G_CALLBACK(on_set_browser), NULL ); for(i = 1; i < argc; ++i) { addr = inf_ip_address_new_from_string(argv[i]); tcp = inf_tcp_connection_new( INF_IO(io), addr, inf_protocol_get_default_port() ); xmpp = inf_xmpp_connection_new( tcp, INF_XMPP_CONNECTION_CLIENT, g_get_host_name(), argv[i], INF_XMPP_CONNECTION_SECURITY_BOTH_PREFER_TLS, NULL, NULL, NULL ); inf_ip_address_free(addr); g_object_unref(tcp); #ifdef LIBINFINITY_HAVE_AVAHI inf_xmpp_manager_add_connection(xmpp_manager, xmpp); #endif inf_gtk_browser_store_add_connection( INF_GTK_BROWSER_STORE(store), INF_XML_CONNECTION(xmpp), argv[i] ); } g_object_unref(G_OBJECT(io)); #ifdef LIBINFINITY_HAVE_AVAHI inf_gtk_browser_store_add_discovery(store, INF_DISCOVERY(avahi)); g_object_unref(G_OBJECT(avahi)); #endif view = inf_gtk_browser_view_new_with_model(INF_GTK_BROWSER_MODEL(store)); g_object_unref(G_OBJECT(store)); gtk_widget_show(view); g_signal_connect( G_OBJECT(view), "activate", G_CALLBACK(on_activate), NULL ); scroll = gtk_scrolled_window_new(NULL, NULL); gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW(scroll), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC ); gtk_scrolled_window_set_shadow_type( GTK_SCROLLED_WINDOW(scroll), GTK_SHADOW_IN ); gtk_container_add(GTK_CONTAINER(scroll), view); gtk_widget_show(scroll); window = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_window_set_title(GTK_WINDOW(window),"Infinote Browser"); gtk_window_set_default_size(GTK_WINDOW(window), 400, 400); gtk_window_set_icon_name(GTK_WINDOW(window), "infinote"); gtk_container_set_border_width(GTK_CONTAINER(window), 6); gtk_container_add(GTK_CONTAINER(window), scroll); gtk_widget_show(window); g_signal_connect(G_OBJECT(window), "destroy", G_CALLBACK(on_destroy), NULL); gtk_main(); return 0; } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/test/inf-test-text-cleanup.c0000644000175000017500000002352512264763732016270 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include "util/inf-test-util.h" #include #include #include #include #include #include #include #include #include #include typedef struct { guint total; guint passed; } test_result; typedef enum { INF_TEST_TEXT_CLEANUP_USER_UNAVAILABLE, INF_TEST_TEXT_CLEANUP_UNSUPPORTED, INF_TEST_TEXT_CLEANUP_VERIFY_FAILED } InfTestTextCleanupError; static GQuark inf_test_text_cleanup_error_quark() { return g_quark_from_static_string("INF_TEST_TEXT_CLEANUP_ERROR"); } static gboolean perform_test(guint max_total_log_size, InfTextChunk* initial, GSList* users, GSList* requests, GError** error) { InfTextBuffer* buffer; InfCommunicationManager* manager; InfIo* io; InfTextSession* session; InfAdoptedAlgorithm* algorithm; InfUserTable* user_table; InfTextUser* user; gchar* user_name; GSList* item; xmlNodePtr request; gboolean result; GError* local_error; guint verify_user_id; InfAdoptedUser* verify_user; guint verify_log_size; gint verify_can_undo; gint verify_can_redo; InfAdoptedRequestLog* log; guint log_size; buffer = INF_TEXT_BUFFER(inf_text_default_buffer_new("UTF-8")); inf_text_buffer_insert_chunk(buffer, 0, initial, NULL); manager = inf_communication_manager_new(); io = INF_IO(inf_standalone_io_new()); user_table = inf_user_table_new(); local_error = NULL; for(item = users; item != NULL; item = g_slist_next(item)) { user_name = g_strdup_printf("User_%u", GPOINTER_TO_UINT(item->data)); user = INF_TEXT_USER( g_object_new( INF_TEXT_TYPE_USER, "id", GPOINTER_TO_UINT(item->data), "name", user_name, "status", INF_USER_ACTIVE, "flags", 0, NULL ) ); g_free(user_name); inf_user_table_add_user(user_table, INF_USER(user)); g_object_unref(user); } session = INF_TEXT_SESSION( g_object_new( INF_TEXT_TYPE_SESSION, "communication-manager", manager, "buffer", buffer, "io", io, "user_table", user_table, "max-total-log-size", max_total_log_size, NULL ) ); algorithm = inf_adopted_session_get_algorithm(INF_ADOPTED_SESSION(session)); g_object_unref(io); g_object_unref(manager); g_object_unref(user_table); g_object_unref(buffer); for(item = requests; item != NULL; item = item->next) { request = (xmlNodePtr)item->data; if(strcmp((const char*)request->name, "request") == 0) { /* Request */ result = inf_communication_object_received( INF_COMMUNICATION_OBJECT(session), NULL, request, &local_error ); if(local_error != NULL) goto fail; } else { /* TODO: Make an extra function out of this: */ /* Verify */ result = inf_xml_util_get_attribute_uint_required( request, "user", &verify_user_id, &local_error ); if(result == FALSE) goto fail; verify_user = INF_ADOPTED_USER( inf_user_table_lookup_user_by_id(user_table, verify_user_id) ); if(verify_user == NULL) { g_set_error( error, inf_test_text_cleanup_error_quark(), INF_TEST_TEXT_CLEANUP_USER_UNAVAILABLE, "User ID '%u' not available", verify_user_id ); goto fail; } result = inf_xml_util_get_attribute_uint( request, "log-size", &verify_log_size, &local_error ); if(local_error) goto fail; if(result) { log = inf_adopted_user_get_request_log(INF_ADOPTED_USER(verify_user)); log_size = inf_adopted_request_log_get_end(log) - inf_adopted_request_log_get_begin(log); if(verify_log_size != log_size) { g_set_error( error, inf_test_text_cleanup_error_quark(), INF_TEST_TEXT_CLEANUP_VERIFY_FAILED, "Log size does not match; got %u, but expected %u", log_size, verify_log_size ); goto fail; } } result = inf_xml_util_get_attribute_int( request, "can-undo", &verify_can_undo, &local_error ); if(local_error) goto fail; if(result) { result = inf_adopted_algorithm_can_undo(algorithm, verify_user); if(result != verify_can_undo) { g_set_error( error, inf_test_text_cleanup_error_quark(), INF_TEST_TEXT_CLEANUP_VERIFY_FAILED, "can-undo does not match; got %d, but expected %d", (guint)result, verify_can_undo ); goto fail; } } result = inf_xml_util_get_attribute_int( request, "can-redo", &verify_can_redo, &local_error ); if(local_error) goto fail; if(result) { result = inf_adopted_algorithm_can_redo(algorithm, verify_user); if(result != verify_can_redo) { g_set_error( error, inf_test_text_cleanup_error_quark(), INF_TEST_TEXT_CLEANUP_VERIFY_FAILED, "can-redo does not match; got %d, but expected %d", (guint)result, verify_can_redo ); goto fail; } } } } g_object_unref(session); return TRUE; fail: g_object_unref(session); if(local_error) g_propagate_error(error, local_error); return FALSE; } static void foreach_test_func(const gchar* testfile, gpointer user_data) { test_result* result; xmlDocPtr doc; xmlNodePtr root; xmlNodePtr child; GSList* requests; InfTextChunk* initial; GSList* users; guint max_total_log_size; GError* error; gboolean res; /* Only process XML files, not the Makefiles or other stuff */ if(!g_str_has_suffix(testfile, ".xml")) return; result = (test_result*)user_data; doc = xmlParseFile(testfile); requests = NULL; initial = NULL; users = NULL; max_total_log_size = 0; error = NULL; printf("%s... ", testfile); fflush(stdout); ++ result->total; if(doc != NULL) { root = xmlDocGetRootElement(doc); for(child = root->children; child != NULL; child = child->next) { if(child->type != XML_ELEMENT_NODE) continue; if(strcmp((const char*)child->name, "log") == 0) { res = inf_xml_util_get_attribute_uint_required( child, "size", &max_total_log_size, &error ); if(!res) break; } else if(strcmp((const char*)child->name, "initial-buffer") == 0) { if(initial != NULL) inf_text_chunk_free(initial); initial = inf_test_util_parse_buffer(child, &error); if(initial == NULL) break; } else if(strcmp((const char*)child->name, "user") == 0) { if(inf_test_util_parse_user(child, &users, &error) == FALSE) break; } else if(strcmp((const char*)child->name, "request") == 0 || strcmp((const char*)child->name, "verify") == 0) { requests = g_slist_prepend(requests, child); } else { g_set_error( &error, inf_test_util_parse_error_quark(), INF_TEST_UTIL_PARSE_ERROR_UNEXPECTED_NODE, "Node '%s' unexpected", (const gchar*)child->name ); break; } } if(error != NULL) { printf("Failed to parse: %s\n", error->message); g_error_free(error); xmlFreeDoc(doc); g_slist_free(requests); if(initial != NULL) inf_text_chunk_free(initial); g_slist_free(users); } else { g_assert(initial != NULL); requests = g_slist_reverse(requests); if(perform_test(max_total_log_size, initial, users, requests, &error) == TRUE) { ++ result->passed; printf("OK\n"); } else { printf("FAILED (%s)\n", error->message); g_error_free(error); } xmlFreeDoc(doc); g_slist_free(requests); inf_text_chunk_free(initial); g_slist_free(users); } } } int main(int argc, char* argv[]) { const char* dir; GError* error; test_result result; g_type_init(); if(argc > 1) dir = argv[1]; else dir = "cleanup"; result.total = 0; result.passed = 0; error = NULL; if(inf_test_util_dir_foreach(dir, foreach_test_func, &result, &error) == FALSE) { fprintf(stderr, "%s\n", error->message); g_error_free(error); return -1; } printf("%u out of %u tests passed\n", result.passed, result.total); if(result.passed < result.total) return -1; return 0; } libinfinity-0.5.5/test/inf-test-text-session.c0000644000175000017500000002520612264763732016322 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include "util/inf-test-util.h" #include #include #include #include #include #include #include #include #include #include #define NUM_PERMUTATIONS 100 typedef struct { GRand* rand; guint total; guint passed; gdouble time; } test_result; static gboolean perform_single_test(InfTextChunk* initial, InfTextChunk* final, GSList* users, GSList* requests, gdouble* time) { InfTextBuffer* buffer; InfCommunicationManager* manager; InfIo* io; InfTextSession* session; InfUserTable* user_table; InfTextUser* user; gchar* user_name; GSList* item; xmlNodePtr request; gboolean result; InfTextChunk* test_chunk; gchar* first; gchar* second; gsize first_bytes; gsize second_bytes; GTimer* timer; buffer = INF_TEXT_BUFFER(inf_text_default_buffer_new("UTF-8")); inf_text_buffer_insert_chunk(buffer, 0, initial, NULL); manager = inf_communication_manager_new(); io = INF_IO(inf_standalone_io_new()); user_table = inf_user_table_new(); for(item = users; item != NULL; item = g_slist_next(item)) { user_name = g_strdup_printf("User_%u", GPOINTER_TO_UINT(item->data)); user = INF_TEXT_USER( g_object_new( INF_TEXT_TYPE_USER, "id", GPOINTER_TO_UINT(item->data), "name", user_name, "status", INF_USER_ACTIVE, "flags", 0, NULL ) ); g_free(user_name); inf_user_table_add_user(user_table, INF_USER(user)); g_object_unref(user); } session = inf_text_session_new_with_user_table( manager, buffer, io, user_table, INF_SESSION_RUNNING, NULL, NULL ); g_object_unref(G_OBJECT(io)); g_object_unref(G_OBJECT(manager)); g_object_unref(G_OBJECT(user_table)); timer = g_timer_new(); for(item = requests; item != NULL; item = item->next) { request = (xmlNodePtr)item->data; /* TODO: Check error? */ inf_communication_object_received( INF_COMMUNICATION_OBJECT(session), NULL, request, NULL ); } *time = g_timer_elapsed(timer, NULL); g_timer_destroy(timer); test_chunk = inf_text_buffer_get_slice( buffer, 0, inf_text_buffer_get_length(buffer) ); g_object_unref(G_OBJECT(session)); result = inf_text_chunk_equal(test_chunk, final); if(result == FALSE) { first = inf_text_chunk_get_text(final, &first_bytes); second = inf_text_chunk_get_text(test_chunk, &second_bytes); printf("(%.*s vs. %.*s) ", (int)second_bytes, second, (int)first_bytes, first); g_free(second); g_free(first); } inf_text_chunk_free(test_chunk); g_object_unref(G_OBJECT(buffer)); return result; } static gboolean perform_test(InfTextChunk* initial, InfTextChunk* final, GSList* users, GSList* requests, GRand* rand, gdouble* time) { GSList* permutation; GSList* item; GSList* item2; GSList* dist_item; unsigned int i; unsigned int dist; unsigned int rval; gpointer temp; gboolean retval; gdouble local_time; guint user; guint user2; InfAdoptedStateVector* v; GError* error; g_assert(requests != NULL); permutation = g_slist_copy(requests); /* Mark per-user request order which must be kept when applying for the * state vector diffs to work. */ v = inf_adopted_state_vector_new(); error = NULL; for(item = permutation; item != NULL; item = g_slist_next(item)) { if(!inf_xml_util_get_attribute_uint(item->data, "user", &user, &error)) { printf("%s\n", error->message); inf_adopted_state_vector_free(v); g_slist_free(permutation); return FALSE; } ((xmlNodePtr)item->data)->_private = GUINT_TO_POINTER( inf_adopted_state_vector_get(v, user) ); inf_adopted_state_vector_add(v, user, 1); } inf_adopted_state_vector_free(v); *time = 0.0; for(i = 0; i < NUM_PERMUTATIONS; ++ i) { dist = 0; /* TODO: This can be optimized */ /* shuffle random */ for(item = permutation->next; item != NULL; item = g_slist_next(item)) { ++ dist; dist_item = g_slist_nth(permutation, g_rand_int(rand) % (dist + 1)); rval = g_rand_int(rand) % (dist + 1); temp = item->data; item->data = dist_item->data; dist_item->data = temp; } /* Resort according to per-user request order */ /* We could probably use g_slist_sort if it was stable, but the * documentation says nothing about it. So just do a primitive bubblesort * for now. */ for(item = permutation; item != NULL; item = g_slist_next(item)) { for(item2 = item->next; item2 != NULL; item2 = g_slist_next(item2)) { /* This can't fail anymore, otherwise it * would already have failed above. */ inf_xml_util_get_attribute_uint(item->data, "user", &user, NULL); inf_xml_util_get_attribute_uint(item2->data, "user", &user2, NULL); if(user == user2) { if(GPOINTER_TO_UINT( ((xmlNodePtr)item->data)->_private) > GPOINTER_TO_UINT( ((xmlNodePtr)item2->data)->_private) ) { temp = item->data; item->data = item2->data; item2->data = temp; } } } } if(i % (MAX(NUM_PERMUTATIONS/30, 1)) == 0) { printf("."); fflush(stdout); } retval = perform_single_test( initial, final, users, permutation, &local_time ); if(!retval) break; *time += local_time; } g_slist_free(permutation); return retval; } static void foreach_test_func(const gchar* testfile, gpointer user_data) { test_result* result; xmlDocPtr doc; xmlNodePtr root; xmlNodePtr child; GSList* requests; InfTextChunk* initial; InfTextChunk* final; GSList* users; GError* error; gboolean retval; gdouble local_time; /* Only process XML files, not the Makefiles or other stuff */ if(!g_str_has_suffix(testfile, ".xml")) return; result = (test_result*)user_data; doc = xmlParseFile(testfile); requests = NULL; initial = NULL; final = NULL; error = NULL; users = NULL; printf("%s... ", testfile); fflush(stdout); ++ result->total; if(doc != NULL) { root = xmlDocGetRootElement(doc); for(child = root->children; child != NULL; child = child->next) { if(child->type != XML_ELEMENT_NODE) continue; if(strcmp((const char*)child->name, "initial-buffer") == 0) { if(initial != NULL) inf_text_chunk_free(initial); initial = inf_test_util_parse_buffer(child, &error); if(initial == NULL) break; } else if(strcmp((const char*)child->name, "final-buffer") == 0) { if(final != NULL) inf_text_chunk_free(final); final = inf_test_util_parse_buffer(child, &error); if(final == NULL) break; } else if(strcmp((const char*)child->name, "user") == 0) { if(inf_test_util_parse_user(child, &users, &error) == FALSE) break; } else if(strcmp((const char*)child->name, "request") == 0) { requests = g_slist_prepend(requests, child); } else { g_set_error( &error, inf_test_util_parse_error_quark(), INF_TEST_UTIL_PARSE_ERROR_UNEXPECTED_NODE, "Node '%s' unexpected", (const gchar*)child->name ); break; } } if(error != NULL) { printf("Failed to parse: %s\n", error->message); g_error_free(error); xmlFreeDoc(doc); g_slist_free(requests); if(initial != NULL) inf_text_chunk_free(initial); if(final != NULL) inf_text_chunk_free(final); g_slist_free(users); } else { g_assert(initial != NULL); g_assert(final != NULL); requests = g_slist_reverse(requests); retval = perform_test( initial, final, users, requests, result->rand, &local_time ); if(retval == TRUE) { ++ result->passed; printf("OK (%g secs)\n", local_time); result->time += local_time; } else { printf("FAILED\n"); } xmlFreeDoc(doc); g_slist_free(requests); inf_text_chunk_free(initial); inf_text_chunk_free(final); g_slist_free(users); } } } int main(int argc, char* argv[]) { const char* dir; GError* error; test_result result; unsigned int rseed; int dirarg; gboolean retval; GTimer* timer; gdouble elapsed; dirarg = 1; if(argc > 1) { rseed = atoi(argv[1]); if(rseed > 0) dirarg = 2; else rseed = time(NULL); } else { rseed = time(NULL); } printf("Using random seed %u\n", rseed); g_type_init(); if(argc > dirarg) dir = argv[dirarg]; else dir = "session"; result.rand = g_rand_new_with_seed(rseed); result.total = 0; result.passed = 0; result.time = 0.0; error = NULL; timer = g_timer_new(); retval = inf_test_util_dir_foreach( dir, foreach_test_func, &result, &error ); g_timer_stop(timer); elapsed = g_timer_elapsed(timer, NULL); g_rand_free(result.rand); g_timer_destroy(timer); if(retval == FALSE) { fprintf(stderr, "%s\n", error->message); g_error_free(error); return -1; } printf( "%u out of %u tests passed (real %g secs, algo %g secs)\n", result.passed, result.total, elapsed, result.time ); if(result.passed < result.total) return -1; return 0; } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/test/inf-test-chunk.c0000644000175000017500000000252212264763732014761 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include int main() { InfTextChunk* chunk; InfTextChunk* chunk2; chunk2 = inf_text_chunk_new("UTF-8"); inf_text_chunk_insert_text(chunk2, 0, "a", 1, 1, 500); inf_text_chunk_insert_text(chunk2, 0, "b", 1, 1, 501); inf_text_chunk_insert_text(chunk2, 0, "c", 1, 1, 502); inf_text_chunk_insert_text(chunk2, 3, "ü", 2, 1, 503); chunk = inf_text_chunk_substring(chunk2, 0, 3); inf_text_chunk_free(chunk); inf_text_chunk_free(chunk2); return 0; } libinfinity-0.5.5/test/inf-test-xmpp-server.c0000644000175000017500000001043712264763732016145 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include #include #include #include #include #include static void conn_notify_status_cb(InfXmlConnection* connection, GParamSpec* spec, gpointer user_data) { InfXmlConnectionStatus status; g_object_get( G_OBJECT(connection), "status", &status, NULL ); switch(status) { case INF_XML_CONNECTION_CLOSED: fprintf(stderr, "Connection closed\n"); break; case INF_XML_CONNECTION_CLOSING: fprintf(stderr, "Connection closing\n"); break; case INF_XML_CONNECTION_OPENING: fprintf(stderr, "Connection opening\n"); break; case INF_XML_CONNECTION_OPEN: fprintf(stderr, "Connection open\n"); break; } } static void conn_error_cb(InfXmlConnection* connection, GError* error, gpointer user_data) { fprintf(stderr, "Connection error occured: %s\n", error->message); } static void new_connection_cb(InfdXmlServer* server, InfXmlConnection* connection, gpointer user_data) { fprintf(stderr, "New connection\n"); g_signal_connect( G_OBJECT(connection), "error", G_CALLBACK(conn_error_cb), NULL ); g_signal_connect( G_OBJECT(connection), "notify::status", G_CALLBACK(conn_notify_status_cb), NULL ); g_object_ref(G_OBJECT(connection)); } static void error_cb(InfdXmppServer* server, GError* error, gpointer user_data) { fprintf(stderr, "Server Error occured: %s\n", error->message); } static void notify_status_cb(InfdXmlServer* server, GParamSpec* pspec, gpointer user_data) { InfdXmlServerStatus status; g_object_get( G_OBJECT(server), "status", &status, NULL ); switch(status) { case INFD_XML_SERVER_CLOSED: printf("Server closed\n"); inf_standalone_io_loop_quit(INF_STANDALONE_IO(user_data)); break; case INFD_XML_SERVER_CLOSING: printf("Server closing\n"); break; case INFD_XML_SERVER_OPENING: printf("Server opening\n"); break; case INFD_XML_SERVER_OPEN: printf("Server open\n"); break; default: g_assert_not_reached(); break; } } int main(int argc, char* argv[]) { InfStandaloneIo* io; InfdTcpServer* server; InfdXmppServer* xmpp; GError* error; gnutls_global_init(); g_type_init(); io = inf_standalone_io_new(); error = NULL; server = g_object_new( INFD_TYPE_TCP_SERVER, "io", io, "local-port", 5223, NULL ); if(infd_tcp_server_open(server, &error) == FALSE) { fprintf(stderr, "Could not open server: %s\n", error->message); g_error_free(error); } else { xmpp = infd_xmpp_server_new( server, INF_XMPP_CONNECTION_SECURITY_ONLY_UNSECURED, NULL, NULL, NULL ); g_signal_connect( G_OBJECT(xmpp), "error", G_CALLBACK(error_cb), io ); g_signal_connect( G_OBJECT(xmpp), "new-connection", G_CALLBACK(new_connection_cb), io ); g_signal_connect( G_OBJECT(xmpp), "notify::status", G_CALLBACK(notify_status_cb), io ); inf_standalone_io_loop(io); } g_object_unref(G_OBJECT(io)); g_object_unref(G_OBJECT(server)); return 0; } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/test/inf-test-chat.c0000644000175000017500000002434612264763732014600 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include #include #include #include #include #include #include #include #include typedef struct _InfTestChat InfTestChat; struct _InfTestChat { InfStandaloneIo* io; InfXmppConnection* conn; InfcBrowser* browser; #ifndef G_OS_WIN32 int input_fd; #endif InfChatBuffer* buffer; InfUser* self; }; static void inf_test_chat_input_cb(InfNativeSocket* fd, InfIoEvent io, gpointer user_data) { InfTestChat* test; char buffer[1024]; test = (InfTestChat*)user_data; if(io & INF_IO_ERROR) { } if(io & INF_IO_INCOMING) { if(fgets(buffer, sizeof(buffer), stdin) == NULL) { inf_standalone_io_loop_quit(test->io); } else if(strlen(buffer) != sizeof(buffer) || buffer[sizeof(buffer)-2] == '\n') { buffer[strlen(buffer)-1] = '\0'; if(test->buffer != NULL && test->self != NULL) { inf_chat_buffer_add_message( test->buffer, test->self, buffer, strlen(buffer), time(NULL), 0 ); } } } } static void inf_chat_test_buffer_receive_message_cb(InfChatSession* session, InfChatBufferMessage* message, gpointer user_data) { switch(message->type) { case INF_CHAT_BUFFER_MESSAGE_NORMAL: printf("<%s> %s\n", inf_user_get_name(message->user), message->text); break; case INF_CHAT_BUFFER_MESSAGE_EMOTE: printf(" * %s %s\n", inf_user_get_name(message->user), message->text); break; case INF_CHAT_BUFFER_MESSAGE_USERJOIN: printf(" --> %s has joined\n", inf_user_get_name(message->user)); break; case INF_CHAT_BUFFER_MESSAGE_USERPART: printf(" <-- %s has left\n", inf_user_get_name(message->user)); break; } } static void inf_test_chat_userjoin_finished_cb(InfcRequest* request, InfUser* user, gpointer user_data) { InfTestChat* test; test = (InfTestChat*)user_data; printf("User join complete. Start chatting!\n"); #ifndef G_OS_WIN32 inf_io_add_watch( INF_IO(test->io), &test->input_fd, INF_IO_INCOMING | INF_IO_ERROR, inf_test_chat_input_cb, test, NULL ); #endif test->self = user; } static void inf_test_chat_userjoin_failed_cb(InfcRequest* request, const GError* error, gpointer user_data) { fprintf(stderr, "User join failed: %s\n", error->message); fprintf(stderr, "Chat will be read-only\n"); } static void inf_chat_test_session_synchronization_complete_cb(InfSession* session, InfXmlConnection* connection, gpointer user_data) { InfTestChat* test; InfcSessionProxy* proxy; InfcUserRequest* request; GParameter params[1] = { { "name", { 0 } } }; GError* error; printf("Synchronization complete, joining user...\n"); test = (InfTestChat*)user_data; proxy = infc_browser_get_chat_session(test->browser); g_value_init(¶ms[0].value, G_TYPE_STRING); g_value_set_string(¶ms[0].value, g_get_user_name()); error = NULL; request = infc_session_proxy_join_user( proxy, params, G_N_ELEMENTS(params), &error ); g_value_unset(¶ms[0].value); if(!request) { fprintf(stderr, "User join failed: %s\n", error->message); g_error_free(error); inf_standalone_io_loop_quit(test->io); } else { g_signal_connect_after( G_OBJECT(request), "failed", G_CALLBACK(inf_test_chat_userjoin_failed_cb), test ); g_signal_connect_after( G_OBJECT(request), "finished", G_CALLBACK(inf_test_chat_userjoin_finished_cb), test ); } } static void inf_chat_test_session_synchronization_failed_cb(InfSession* session, InfXmlConnection* connection, const GError* error, gpointer user_data) { InfTestChat* test; test = (InfTestChat*)user_data; fprintf(stderr, "Synchronization failed: %s\n", error->message); inf_standalone_io_loop_quit(test->io); } static void inf_chat_test_session_close_cb(InfSession* session, gpointer user_data) { InfTestChat* test; test = (InfTestChat*)user_data; printf("The server closed the chat session\n"); if(inf_standalone_io_loop_running(test->io)) inf_standalone_io_loop_quit(test->io); } static void inf_chat_test_subscribe_finished_cb(InfcNodeRequest* request, const InfcBrowserIter* iter, gpointer user_data) { InfTestChat* test; InfSession* session; test = (InfTestChat*)user_data; printf("Subscription successful, waiting for synchronization...\n"); session = infc_session_proxy_get_session( infc_browser_get_chat_session(test->browser)); test->buffer = INF_CHAT_BUFFER(inf_session_get_buffer(session)); /* TODO: Show backlog after during/after synchronization */ g_signal_connect_after( G_OBJECT(session), "receive-message", G_CALLBACK(inf_chat_test_buffer_receive_message_cb), test ); g_signal_connect_after( G_OBJECT(session), "synchronization-complete", G_CALLBACK(inf_chat_test_session_synchronization_complete_cb), test ); g_signal_connect_after( G_OBJECT(session), "synchronization-failed", G_CALLBACK(inf_chat_test_session_synchronization_failed_cb), test ); /* This can happen when the server disables the chat without being * shutdown. */ g_signal_connect_after( G_OBJECT(session), "close", G_CALLBACK(inf_chat_test_session_close_cb), test ); } static void inf_chat_test_subscribe_failed_cb(InfcRequest* request, const GError* error, gpointer user_data) { InfTestChat* test; test = (InfTestChat*)user_data; fprintf(stderr, "Subscription failed: %s\n", error->message); inf_standalone_io_loop_quit(test->io); } static void inf_test_chat_notify_status_cb(GObject* object, GParamSpec* pspec, gpointer user_data) { InfTestChat* test; InfcBrowserStatus status; InfcNodeRequest* request; test = (InfTestChat*)user_data; status = infc_browser_get_status(test->browser); if(status == INFC_BROWSER_CONNECTED) { printf("Connection established, subscribing to chat...\n"); /* Subscribe to chat */ request = infc_browser_subscribe_chat(test->browser); g_signal_connect_after( G_OBJECT(request), "failed", G_CALLBACK(inf_chat_test_subscribe_failed_cb), test ); g_signal_connect_after( G_OBJECT(request), "finished", G_CALLBACK(inf_chat_test_subscribe_finished_cb), test ); } if(status == INFC_BROWSER_DISCONNECTED) { printf("Connection closed\n"); if(inf_standalone_io_loop_running(test->io)) inf_standalone_io_loop_quit(test->io); } } static void inf_test_chat_error_cb(InfXmppConnection* xmpp, GError* error, gpointer user_data) { /* status notify will close conn: */ fprintf(stderr, "Connection error: %s\n", error->message); } int main(int argc, char* argv[]) { InfTestChat test; InfIpAddress* address; InfCommunicationManager* manager; InfTcpConnection* tcp_conn; GError* error; gnutls_global_init(); g_type_init(); test.io = inf_standalone_io_new(); #ifndef G_OS_WIN32 test.input_fd = STDIN_FILENO; #endif test.buffer = NULL; address = inf_ip_address_new_loopback4(); error = NULL; tcp_conn = inf_tcp_connection_new_and_open(INF_IO(test.io), address, inf_protocol_get_default_port(), &error); inf_ip_address_free(address); if(tcp_conn == NULL) { fprintf(stderr, "Could not open TCP connection: %s\n", error->message); g_error_free(error); } else { test.conn = inf_xmpp_connection_new( tcp_conn, INF_XMPP_CONNECTION_CLIENT, NULL, "localhost", INF_XMPP_CONNECTION_SECURITY_BOTH_PREFER_TLS, NULL, NULL, NULL ); g_object_unref(G_OBJECT(tcp_conn)); manager = inf_communication_manager_new(); test.browser = infc_browser_new( INF_IO(test.io), manager, INF_XML_CONNECTION(test.conn) ); g_signal_connect_after( G_OBJECT(test.browser), "notify::status", G_CALLBACK(inf_test_chat_notify_status_cb), &test ); g_signal_connect( G_OBJECT(test.browser), "error", G_CALLBACK(inf_test_chat_error_cb), &test ); inf_standalone_io_loop(test.io); g_object_unref(G_OBJECT(manager)); g_object_unref(G_OBJECT(test.browser)); /* TODO: Wait until the XMPP connection is in status closed */ g_object_unref(G_OBJECT(test.conn)); } g_object_unref(G_OBJECT(test.io)); return 0; } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/test/inf-test-tcp-connection.c0000644000175000017500000001015612264763732016576 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include #include #include #include #include static void received_cb(InfTcpConnection* connection, gconstpointer buffer, guint len, gpointer user_data) { printf("Received: \033[00;32m%.*s\033[00;00m", (int)len, (const char*)buffer); fflush(stdout); } static void sent_cb(InfTcpConnection* connection, gconstpointer buffer, guint len, gpointer user_data) { printf("Sent: \033[00;34m%.*s\033[00;00m", (int)len, (const char*)buffer); fflush(stdout); } static void error_cb(InfTcpConnection* connection, GError* error, gpointer user_data) { fprintf(stderr, "Error occured: %s\n", error->message); if(inf_standalone_io_loop_running(INF_STANDALONE_IO(user_data))) inf_standalone_io_loop_quit(INF_STANDALONE_IO(user_data)); } static void notify_status_cb(InfTcpConnection* connection, const gchar* property, gpointer user_data) { InfTcpConnectionStatus status; InfIpAddress* addr; guint port; gchar* addr_str; g_object_get( G_OBJECT(connection), "status", &status, "remote-address", &addr, "remote-port", &port, NULL ); addr_str = inf_ip_address_to_string(addr); inf_ip_address_free(addr); switch(status) { case INF_TCP_CONNECTION_CONNECTING: printf("Connecting to %s:%u\n", addr_str, port); break; case INF_TCP_CONNECTION_CONNECTED: printf("Connected to %s:%u\n", addr_str, port); g_object_get( G_OBJECT(connection), "local-address", &addr, "local-port", &port, NULL ); g_free(addr_str); addr_str = inf_ip_address_to_string(addr); inf_ip_address_free(addr); printf("Connected from %s:%u\n", addr_str, port); inf_tcp_connection_send(connection, "Hello, World!\n", 14); break; case INF_TCP_CONNECTION_CLOSED: printf("Connection to %s:%u closed\n", addr_str, port); if(inf_standalone_io_loop_running(INF_STANDALONE_IO(user_data))) inf_standalone_io_loop_quit(INF_STANDALONE_IO(user_data)); break; default: g_assert_not_reached(); break; } g_free(addr_str); } int main(int argc, char* argv[]) { InfIpAddress* addr; InfStandaloneIo* io; InfTcpConnection* connection; GError* error; g_type_init(); addr = inf_ip_address_new_loopback4(); io = inf_standalone_io_new(); error = NULL; connection = inf_tcp_connection_new(INF_IO(io), addr, 5223); inf_ip_address_free(addr); g_signal_connect( G_OBJECT(connection), "received", G_CALLBACK(received_cb), io ); g_signal_connect( G_OBJECT(connection), "sent", G_CALLBACK(sent_cb), io ); g_signal_connect( G_OBJECT(connection), "error", G_CALLBACK(error_cb), io ); g_signal_connect( G_OBJECT(connection), "notify::status", G_CALLBACK(notify_status_cb), io ); if(inf_tcp_connection_open(connection, &error) == FALSE) { fprintf(stderr, "Could not open connection: %s\n", error->message); g_error_free(error); } else { inf_standalone_io_loop(io); } g_object_unref(G_OBJECT(io)); g_object_unref(G_OBJECT(connection)); return 0; } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/test/README0000644000175000017500000000407711066002713012625 00000000000000These are various applications to test different aspects of the infinote API. They are different in nature and depend on each other (meaning that if inf-test-browser fails, inf-test-gtk-browser probably won't work either). Here is a rough overview of the tests: (NI=Non-Interactive, I=Interactive) NI inf-test-state-vector: Verifies that basic inf_adopted_state_vector functions work. I inf-test-tcp-connection: Connects to localhost on port 5223, sending "Hello World" and printing everything it receives to stdout. I inf-test-tcp-server: Listens on 5223, accepting every connection and printing anything it receives from all connections. I inf-test-browser: Connects to a infinote server at localhost on port 6523, providing a simple command line interface to list, explore, add and remove subdirectory nodes on the server. NI inf-test-chunk: Verifies that basic InfTextChunk operations do not cause a segfault. NI inf-test-text-session: Reads all test files in the session/ subdirectory and performs the tests. The test files contain a number of requests from different users, a beginning state and an end state of the text buffer. It applies all requests from all users in a random order to the beginning buffer and verifies that at the end the buffer matches the end state. NI inf-test-text-cleanup: Performs all test files in the cleanup/ subdirectory. This basically checks that cleaning up the request log works correctly in certain situations. Again, the test files contain a number of requests from different users. This time, however, they are always applied in order. In between the requests, there are tags that verify that the request log of the given user has a specified size or that the user can or can not issue Undo/Redo in the current situation. This is to ensure that the algorithm correctly shrinks the request log. NI inf-test-text-replay Replays a record as recorded with InfAdoptedSessionRecord. A few records that should play without problems are contained in the replay/ subdirectory. libinfinity-0.5.5/test/inf-test-tcp-server.c0000644000175000017500000001170112264763732015742 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include #include #include #include #include static void conn_notify_status_cb(InfTcpConnection* connection, GParamSpec* spec, gpointer user_data) { InfIpAddress* addr; InfTcpConnectionStatus status; gchar* str; g_object_get( G_OBJECT(connection), "remote-address", &addr, "status", &status, NULL ); str = inf_ip_address_to_string(addr); inf_ip_address_free(addr); if(status == INF_TCP_CONNECTION_CLOSED) printf("Connection close from %s\n", str); g_free(str); } static void conn_error_cb(InfTcpConnection* connection, GError* error, gpointer user_data) { InfIpAddress* addr; gchar* str; g_object_get(G_OBJECT(connection), "remote-address", &addr, NULL); str = inf_ip_address_to_string(addr); inf_ip_address_free(addr); printf("Error from %s: %s\n", str, error->message); g_free(str); g_object_unref(G_OBJECT(connection)); } static void conn_received_cb(InfTcpConnection* connection, gconstpointer data, guint len, gpointer user_data) { InfIpAddress* addr; gchar* str; g_object_get(G_OBJECT(connection), "remote-address", &addr, NULL); str = inf_ip_address_to_string(addr); inf_ip_address_free(addr); printf("Data from %s: %.*s\n", str, (int)len, (const char*)data); g_free(str); } static void new_connection_cb(InfdTcpServer* server, InfTcpConnection* connection, gpointer user_data) { InfIpAddress* addr; gchar* str; g_object_get(G_OBJECT(connection), "remote-address", &addr, NULL); str = inf_ip_address_to_string(addr); inf_ip_address_free(addr); printf("Connection from %s\n", str); g_free(str); g_signal_connect( G_OBJECT(connection), "received", G_CALLBACK(conn_received_cb), NULL ); g_signal_connect( G_OBJECT(connection), "error", G_CALLBACK(conn_error_cb), NULL ); g_signal_connect( G_OBJECT(connection), "notify::status", G_CALLBACK(conn_notify_status_cb), NULL ); g_object_ref(G_OBJECT(connection)); } static void error_cb(InfdTcpServer* server, GError* error, gpointer user_data) { fprintf(stderr, "Error occured: %s\n", error->message); if(inf_standalone_io_loop_running(INF_STANDALONE_IO(user_data))) inf_standalone_io_loop_quit(INF_STANDALONE_IO(user_data)); } static void notify_status_cb(InfdTcpServer* server, GParamSpec* pspec, gpointer user_data) { InfdTcpServerStatus status; InfIpAddress* addr; guint port; gchar* addr_str; g_object_get( G_OBJECT(server), "status", &status, "local-address", &addr, "local-port", &port, NULL ); addr_str = inf_ip_address_to_string(addr); inf_ip_address_free(addr); switch(status) { case INFD_TCP_SERVER_CLOSED: printf("Server closed\n"); break; case INFD_TCP_SERVER_OPEN: printf("Server listening on %s:%u\n", addr_str, port); break; default: g_assert_not_reached(); break; } g_free(addr_str); } int main(int argc, char* argv[]) { InfStandaloneIo* io; InfdTcpServer* server; GError* error; g_type_init(); io = inf_standalone_io_new(); error = NULL; server = g_object_new( INFD_TYPE_TCP_SERVER, "io", io, "local-port", 5223, NULL ); g_signal_connect( G_OBJECT(server), "error", G_CALLBACK(error_cb), io ); g_signal_connect( G_OBJECT(server), "new-connection", G_CALLBACK(new_connection_cb), io ); g_signal_connect( G_OBJECT(server), "notify::status", G_CALLBACK(notify_status_cb), io ); if(infd_tcp_server_open(server, &error) == FALSE) { fprintf(stderr, "Could not open server: %s\n", error->message); g_error_free(error); } else { inf_standalone_io_loop(io); } g_object_unref(G_OBJECT(io)); g_object_unref(G_OBJECT(server)); return 0; } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/test/inf-test-text-replay.c0000644000175000017500000002607112264763732016134 00000000000000/* libinfinity - a GObject-based infinote implementation * Copyright (C) 2007-2011 Armin Burgmeier * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include "util/inf-test-util.h" #include #include #include #include #include #include #include #include #include #include #include #include typedef struct _InfTestTextReplayUndoGroupingInfo InfTestTextReplayUndoGroupingInfo; struct _InfTestTextReplayUndoGroupingInfo { InfAdoptedAlgorithm* algorithm; GSList* undo_groupings; }; static InfSession* inf_test_text_replay_session_new(InfIo* io, InfCommunicationManager* manager, InfSessionStatus status, InfCommunicationJoinedGroup* sync_group, InfXmlConnection* sync_connection, gpointer user_data) { InfTextDefaultBuffer* buffer; InfTextSession* session; buffer = inf_text_default_buffer_new("UTF-8"); session = inf_text_session_new( manager, INF_TEXT_BUFFER(buffer), io, status, INF_COMMUNICATION_GROUP(sync_group), sync_connection ); g_object_unref(buffer); return INF_SESSION(session); } static const InfcNotePlugin INF_TEST_TEXT_REPLAY_TEXT_PLUGIN = { NULL, "InfText", inf_test_text_replay_session_new }; /* * String check */ /* These functions assume that buffer and chunks contain UTF-8 */ static GString* inf_test_text_replay_load_buffer(InfTextBuffer* buffer) { InfTextBufferIter* iter; GString* result; gchar* text; gsize bytes; result = g_string_sized_new(inf_text_buffer_get_length(buffer)); g_assert(strcmp(inf_text_buffer_get_encoding(buffer), "UTF-8") == 0); iter = inf_text_buffer_create_iter(buffer); if(iter != NULL) { do { text = inf_text_buffer_iter_get_text(buffer, iter); bytes = inf_text_buffer_iter_get_bytes(buffer, iter); g_string_append_len(result, text, bytes); g_free(text); } while(inf_text_buffer_iter_next(buffer, iter)); inf_text_buffer_destroy_iter(buffer, iter); } return result; } static void inf_test_text_replay_apply_operation_to_string(GString* string, InfAdoptedOperation* operation) { InfTextChunk* chunk; InfTextChunkIter iter; guint position; guint length; InfAdoptedOperation* first; InfAdoptedOperation* second; InfAdoptedOperation* new_second; if(INF_TEXT_IS_INSERT_OPERATION(operation)) { g_assert(INF_TEXT_IS_DEFAULT_INSERT_OPERATION(operation)); chunk = inf_text_default_insert_operation_get_chunk( INF_TEXT_DEFAULT_INSERT_OPERATION(operation) ); position = inf_text_insert_operation_get_position( INF_TEXT_INSERT_OPERATION(operation) ); g_assert(strcmp(inf_text_chunk_get_encoding(chunk), "UTF-8") == 0); if(inf_text_chunk_iter_init(chunk, &iter)) { /* Convert from pos to byte */ position = g_utf8_offset_to_pointer(string->str, position) - string->str; do { g_string_insert_len( string, position, inf_text_chunk_iter_get_text(&iter), inf_text_chunk_iter_get_bytes(&iter) ); position += inf_text_chunk_iter_get_bytes(&iter); } while(inf_text_chunk_iter_next(&iter)); } } else if(INF_TEXT_IS_DELETE_OPERATION(operation)) { position = inf_text_delete_operation_get_position( INF_TEXT_DELETE_OPERATION(operation) ); length = inf_text_delete_operation_get_length( INF_TEXT_DELETE_OPERATION(operation) ); length = g_utf8_offset_to_pointer(string->str, position+length) - string->str; position = g_utf8_offset_to_pointer(string->str, position) - string->str; length -= position; g_string_erase(string, position, length); } else if(INF_ADOPTED_IS_SPLIT_OPERATION(operation)) { g_object_get( G_OBJECT(operation), "first", &first, "second", &second, NULL ); new_second = inf_adopted_operation_transform( second, first, INF_ADOPTED_CONCURRENCY_NONE ); inf_test_text_replay_apply_operation_to_string(string, first); inf_test_text_replay_apply_operation_to_string(string, new_second); g_object_unref(first); g_object_unref(second); g_object_unref(new_second); } else if(INF_TEXT_IS_MOVE_OPERATION(operation) || INF_ADOPTED_IS_NO_OPERATION(operation)) { /* Nothing to do */ } else { g_error( "Operation type \"%s\" not supported", g_type_name(G_TYPE_FROM_INSTANCE(operation)) ); g_assert_not_reached(); } } static void inf_test_text_replay_apply_request_cb_before(InfAdoptedAlgorithm* algorithm, InfAdoptedUser* user, InfAdoptedRequest* request, gpointer user_data) { InfAdoptedOperation* operation; g_assert( inf_adopted_request_get_request_type(request) == INF_ADOPTED_REQUEST_DO ); operation = inf_adopted_request_get_operation(request); #if 0 /* This can be used to set a breakpoint if the operation meats special * conditions when debugging a specific problem. */ if(INF_TEXT_IS_INSERT_OPERATION(operation)) if(inf_text_insert_operation_get_position(INF_TEXT_INSERT_OPERATION(operation)) == 1730) printf("tada\n"); #endif } static void inf_test_text_replay_apply_request_cb_after(InfAdoptedAlgorithm* algorithm, InfAdoptedUser* user, InfAdoptedRequest* request, gpointer user_data) { InfTextBuffer* buffer; InfAdoptedOperation* operation; GString* own_content; GString* buffer_content; g_object_get(G_OBJECT(algorithm), "buffer", &buffer, NULL); own_content = (GString*)user_data; g_assert( inf_adopted_request_get_request_type(request) == INF_ADOPTED_REQUEST_DO ); operation = inf_adopted_request_get_operation(request); /* Apply operation to own string */ inf_test_text_replay_apply_operation_to_string(own_content, operation); /* Compare with buffer content */ buffer_content = inf_test_text_replay_load_buffer(buffer); g_object_unref(buffer); g_assert(strcmp(buffer_content->str, own_content->str) == 0); g_string_free(buffer_content, TRUE); } /* * Undo grouping */ static void inf_test_text_replay_add_undo_grouping(InfTestTextReplayUndoGroupingInfo* fo, InfAdoptedUser* user) { InfTextUndoGrouping* grouping; grouping = inf_text_undo_grouping_new(); inf_adopted_undo_grouping_set_algorithm(INF_ADOPTED_UNDO_GROUPING(grouping), fo->algorithm, user); fo->undo_groupings = g_slist_prepend(fo->undo_groupings, grouping); } static void inf_test_text_replay_add_user_cb(InfUserTable* user_table, InfUser* user, gpointer user_data) { inf_test_text_replay_add_undo_grouping(user_data, INF_ADOPTED_USER(user)); } static void inf_test_text_replay_play_user_table_foreach_func(InfUser* user, gpointer user_data) { inf_test_text_replay_add_undo_grouping(user_data, INF_ADOPTED_USER(user)); } /* * Entry point */ int main(int argc, char* argv[]) { InfAdoptedSessionReplay* replay; InfAdoptedSession* session; GError* error; int i; int ret; GString* content; InfBuffer* buffer; InfUserTable* user_table; InfTestTextReplayUndoGroupingInfo data; GSList* item; if(argc < 2) { fprintf(stderr, "Usage: %s ...\n", argv[0]); return -1; } error = NULL; if(!inf_init(&error)) { fprintf(stderr, "%s\n", error->message); g_error_free(error); return -1; } ret = 0; for(i = 1; i < argc; ++ i) { fprintf(stderr, "%s... ", argv[i]); fflush(stderr); replay = inf_adopted_session_replay_new(); inf_adopted_session_replay_set_record( replay, argv[i], &INF_TEST_TEXT_REPLAY_TEXT_PLUGIN, &error ); if(error != NULL) { fprintf(stderr, "%s\n", error->message); g_error_free(error); error = NULL; ret = -1; } else { session = inf_adopted_session_replay_get_session(replay); buffer = inf_session_get_buffer(INF_SESSION(session)); content = inf_test_text_replay_load_buffer(INF_TEXT_BUFFER(buffer)); user_table = inf_session_get_user_table(INF_SESSION(session)); data.algorithm = inf_adopted_session_get_algorithm(session); data.undo_groupings = NULL; g_signal_connect( data.algorithm, "apply-request", G_CALLBACK(inf_test_text_replay_apply_request_cb_before), content ); g_signal_connect_after( data.algorithm, "apply-request", G_CALLBACK(inf_test_text_replay_apply_request_cb_after), content ); /* Let an undo grouper group stuff, just as a consistency check * that it does not crash or behave otherwise badly. */ inf_user_table_foreach_user( user_table, inf_test_text_replay_play_user_table_foreach_func, &data ); g_signal_connect_after( user_table, "add-user", G_CALLBACK(inf_test_text_replay_add_user_cb), &data ); if(!inf_adopted_session_replay_play_to_end(replay, &error)) { fprintf(stderr, "%s\n", error->message); g_error_free(error); error = NULL; ret = -1; } else { fprintf(stderr, "\n"); /*inf_test_util_print_buffer(INF_TEXT_BUFFER(buffer));*/ } g_string_free(content, TRUE); for(item = data.undo_groupings; item != NULL; item = item->next) g_object_unref(item->data); g_slist_free(data.undo_groupings); } g_object_unref(replay); } return ret; } /* vim:set et sw=2 ts=2: */ libinfinity-0.5.5/COPYING0000644000175000017500000006364012264763732012042 00000000000000 GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, 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 and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! libinfinity-0.5.5/README0000644000175000017500000000254112041011626011635 00000000000000 1. Components infinote consists of the following parts: libinfinity: Library implementing the core infinote part infinoted: Simple stand-alone infinote server application libinfgtk: Provides glib main loop integration and GTK+ widgets related to libinfinity libinftext: Infinote plugin implementing real-time collaborative text editing libinftextgtk: Implements the InfTextBuffer interface with a GtkTextBuffer as backend 2. Requirements libinfinity requires: - glib-2.0 >= 2.16 - gobject-2.0 >= 2.16 - gthread-2.0 >= 2.16 - libxml-2.0 - gnutls >= 1.7.2 - gsasl >= 0.2.21 - avahi (optional) infinoted: - libinfinity - libdaemon (optional) libinfgtk: - libinfinity - gtk+-2.0 >= 2.12 libinftext: - libinfinity libinftextgtk: - libinftext - gtk+-2.0 >= 2.12 3. Development This library is developed by Armin Burgmeier . Artwork is done by Benjamin Herr . To get in contact with the developers, either use the mailing list obby-users@list.0x539.de (to which you can subscribe by sending mail to obby-users-subscribe@list.0x539.de) or drop by in our IRC channel #infinote on irc.freenode.org. To hack on the code, check out the libinfinity git repository using `git clone git://git.0x539.de/git/infinote.git'. Patches should be filed in our bug tracker on http://gobby.0x539.de/trac/newticket. libinfinity-0.5.5/pixmaps/0000755000175000017500000000000012264766267012545 500000000000000libinfinity-0.5.5/pixmaps/22x22/0000755000175000017500000000000012264766267013324 500000000000000libinfinity-0.5.5/pixmaps/22x22/Makefile.am0000644000175000017500000000014210762534324015261 00000000000000icondir = $(datadir)/icons/hicolor/22x22/apps icon_DATA = infinote.png EXTRA_DIST = $(icon_DATA) libinfinity-0.5.5/pixmaps/22x22/Makefile.in0000644000175000017500000003633012264766066015313 00000000000000# Makefile.in generated by automake 1.13.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = pixmaps/22x22 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/mkinstalldirs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/libinfinity/inf-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(icondir)" DATA = $(icon_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBINFINITY_API_VERSION = @LIBINFINITY_API_VERSION@ LIBINFINITY_LIBTOOL_VERSION = @LIBINFINITY_LIBTOOL_VERSION@ LIBINFINITY_VERSION = @LIBINFINITY_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ avahi_CFLAGS = @avahi_CFLAGS@ avahi_LIBS = @avahi_LIBS@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gtk_requirement = @gtk_requirement@ gtk_version = @gtk_version@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infgtk_CFLAGS = @infgtk_CFLAGS@ infgtk_LIBS = @infgtk_LIBS@ infinity_CFLAGS = @infinity_CFLAGS@ infinity_LIBS = @infinity_LIBS@ infinoted_CFLAGS = @infinoted_CFLAGS@ infinoted_LIBS = @infinoted_LIBS@ infodir = @infodir@ inftext_CFLAGS = @inftext_CFLAGS@ inftext_LIBS = @inftext_LIBS@ inftextgtk_CFLAGS = @inftextgtk_CFLAGS@ inftextgtk_LIBS = @inftextgtk_LIBS@ install_sh = @install_sh@ libdaemon_CFLAGS = @libdaemon_CFLAGS@ libdaemon_LIBS = @libdaemon_LIBS@ 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@ icondir = $(datadir)/icons/hicolor/22x22/apps icon_DATA = infinote.png EXTRA_DIST = $(icon_DATA) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu pixmaps/22x22/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu pixmaps/22x22/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-iconDATA: $(icon_DATA) @$(NORMAL_INSTALL) @list='$(icon_DATA)'; test -n "$(icondir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(icondir)'"; \ $(MKDIR_P) "$(DESTDIR)$(icondir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(icondir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(icondir)" || exit $$?; \ done uninstall-iconDATA: @$(NORMAL_UNINSTALL) @list='$(icon_DATA)'; test -n "$(icondir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(icondir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(icondir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-iconDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-iconDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-iconDATA install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags-am uninstall uninstall-am uninstall-iconDATA # 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: libinfinity-0.5.5/pixmaps/22x22/infinote.png0000644000175000017500000000261310762534324015553 00000000000000‰PNG  IHDRÄ´l;sBIT|dˆ pHYs--+Ü ôtEXtSoftwarewww.inkscape.org›î<IDAT8­•]lTdžŸ™9sŽÏzÝõîz1nä¥@@¸MdA[¥IY#Y)Qš‚“È¥æ¢J{*~ÔFŠ*¥ªb!U⢮Ԫå¢U*EJ©ÊEÒÉìE@Â&¶@ÿ@`ÿÛ»^Û볜³Ó‹h-C“^e¤Ñ\}ϼó|£qèå×~¿êGŸüÜÏœíû_ÐŽ®éߓǚ‡g_}ýÀ ?;ŸÉdÂ_X¼¸ÿ—o<ólWau—ø|eCߊm]PÓŸWdŒ±<Ïk.•J'ÏŸ?á3ÁÆ|çÇo,¬>ùóñ…n’͉~žyzŒ]ߨþ?áp˜ÞÞ^ºººÌ… ÌÜÜֺܼAÜ39??ÿÝl6û¡¨Ê|ÇOÄÅ“›‹Æf÷ò—>Çßÿ6Èòò2¾ïãû>Æ._¾LGG===âĉ²¥¥%±gÏž»wïvúúúZ“Éä_d&“©s]wG"ÙÈ¡C[yá›o­û’×Ê»C?á½þPJ¡µ&‹qéÒ%öíÛGoo/wïÞeaak×®ÑÝÝM2™¤½½=–Édž’@ssssP,xfïcüðÅë|9þ6M”Ø¿3`äæÐZ …ð<ÁÁAnß¾ÍÀÀ©TŠ©©)†††8zô(étºÑuÝ]ЋŴïû(¥PJÑöÕ/±i³Çø?0ºàsùêûlÙÞ†ëºH)Éår!XZZbÛ¶mT*®\¹‚RŠ[·n‡³€!˲ÖÀJ)¢Q›]Ow ¥dÇSRJ´Öh­ñ}ÿÓÎ A{{;[¶la``­5žç¡”JKÇqZ‰„«”²¬¦Ö˲p]Çq˜œœ$šJ¥R»v$“I:;;ñ<˲BA‹‡·F"j‰×'—R"¥D‚;wîJ¥X]]]ƒ,..ây ùqü†G ´ cLT*¥Ò‘Hä §¯)˜˜˜ •Jqÿþ}´ÖØ¶ÍØëœ9ô¯]½A§½„Y˜Ã²,mc®ëR.—?3µRj-ñÊÊ ±X 皦r4 üƒù–oNRyâQ¤”Òr¥R Û¶‘R~®!6l ŸÏ‹jµJSnŒ®FÙ¼T¦,Úú( × áß›¸oyž7V,I¥Rk‡á5pkk+ƒß7mã7Å÷‡?¡ÎÆÂ.C{;ù`~™M‘(¾ïS­VËrqqq¤P(ø5Àúu½k­5¦8˳WÅ+ݦÎÎmLð¯½Â¾×…ã8X–E(¥¦,àÞììì²"R»7²æyäúEzŠ%ÊBðæö4Ÿl‚Ñ$'OžÄ¶m”RApGù™™™ÕZqíØ§>óÖŸ ‹Eú¾µƒß|ýqŠ™ocl‡‘‘†‡‡‰Çã šššð&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = pixmaps/16x16 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/mkinstalldirs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/libinfinity/inf-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(icondir)" DATA = $(icon_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBINFINITY_API_VERSION = @LIBINFINITY_API_VERSION@ LIBINFINITY_LIBTOOL_VERSION = @LIBINFINITY_LIBTOOL_VERSION@ LIBINFINITY_VERSION = @LIBINFINITY_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ avahi_CFLAGS = @avahi_CFLAGS@ avahi_LIBS = @avahi_LIBS@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gtk_requirement = @gtk_requirement@ gtk_version = @gtk_version@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infgtk_CFLAGS = @infgtk_CFLAGS@ infgtk_LIBS = @infgtk_LIBS@ infinity_CFLAGS = @infinity_CFLAGS@ infinity_LIBS = @infinity_LIBS@ infinoted_CFLAGS = @infinoted_CFLAGS@ infinoted_LIBS = @infinoted_LIBS@ infodir = @infodir@ inftext_CFLAGS = @inftext_CFLAGS@ inftext_LIBS = @inftext_LIBS@ inftextgtk_CFLAGS = @inftextgtk_CFLAGS@ inftextgtk_LIBS = @inftextgtk_LIBS@ install_sh = @install_sh@ libdaemon_CFLAGS = @libdaemon_CFLAGS@ libdaemon_LIBS = @libdaemon_LIBS@ 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@ icondir = $(datadir)/icons/hicolor/16x16/apps icon_DATA = infinote.png EXTRA_DIST = $(icon_DATA) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu pixmaps/16x16/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu pixmaps/16x16/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-iconDATA: $(icon_DATA) @$(NORMAL_INSTALL) @list='$(icon_DATA)'; test -n "$(icondir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(icondir)'"; \ $(MKDIR_P) "$(DESTDIR)$(icondir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(icondir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(icondir)" || exit $$?; \ done uninstall-iconDATA: @$(NORMAL_UNINSTALL) @list='$(icon_DATA)'; test -n "$(icondir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(icondir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(icondir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-iconDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-iconDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-iconDATA install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags-am uninstall uninstall-am uninstall-iconDATA # 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: libinfinity-0.5.5/pixmaps/16x16/infinote.png0000644000175000017500000000156110762534324015562 00000000000000‰PNG  IHDRísO/sBIT|dˆ pHYs × ×B(›xtEXtSoftwarewww.inkscape.org›î<îIDAT(‘•ÓÏOiðgÞyßwÞ:ý¡¶)ÕMÝ©©’E”z {`³$v/ê`âE/þDﻫL4Æ`Òƒò#ÞôbHÌÙÀn¶± ¤KØÅ,v¦3Ö±ÑË>çïóI¾‡Gº:rýñÚN²ƒãÕùÇÓ?/âFúáþ?YíÒ‘ˆÿ­ÛL?³Ýåɯ–Ëå@©Tº3;;k7===ä›CCú_çXÕ&ô·=ÁÀ€Š}ªÀ9ÇÌÌL½£££>77gƒÁ5MÓx™Ïç‡äx<žLýÔ=ÒÖò¯òþ?óùa¬ç7Ñ{ÀH$‚ÕÕU©··WŠÇã,›Í†R©ïììü6›Ínp8|&úšîǵ+6Ú!°Ï/¼¥[[[hjjÂÄÄt]G.—ƒã8ÒÒÒ’âóù†©"!„€mÛ‚ââEŒÝÖÿ>|Ø„ëÖà8 ÃÀöö6ººº°°°€r¹ Çã%²,G)¥`ŒsÎ9‘C8ÓÝxü4M«rÎŽã`ll ¦iÂu]pÎýDá¯V«`Œ5 œs(Š]×]B(¥p]o^<Ç©?3…÷ „(cL°0Æ@)…,Ë „À4MH’EQ þñü÷îâ\¹‚õ`†Ô²¬’ªª°m» ”‚‚@ sóúÞ,âûåu,‡ö#}²Fì8P*I¥RÙQ²,ï?!ZÙåƒO§1¸²g'šQûåv¢- „ÀuÝ©ÕjyÓ4!ËòH¹dàÈAS’< ΞÆêà0nþzªªB˲ R,s†a€BHòû« ì£Ý˜<÷#Þ†¢ˆÅb( èëëC2™„eY[r(Úöz½©D"ø¼ÌCëwmH´¶crj ãããÈd2Ð4 ¦iÖlÛþ8??Yª×뽉D.!hÃP$ õz®¬¬„=¤ëúR±XÌ)ŠrÀëõ>L§Ó>|I&sûâ…IEND®B`‚libinfinity-0.5.5/pixmaps/Makefile.in0000644000175000017500000004746312264766066014545 00000000000000# Makefile.in generated by automake 1.13.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = pixmaps DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/mkinstalldirs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/libinfinity/inf-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBINFINITY_API_VERSION = @LIBINFINITY_API_VERSION@ LIBINFINITY_LIBTOOL_VERSION = @LIBINFINITY_LIBTOOL_VERSION@ LIBINFINITY_VERSION = @LIBINFINITY_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ avahi_CFLAGS = @avahi_CFLAGS@ avahi_LIBS = @avahi_LIBS@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gtk_requirement = @gtk_requirement@ gtk_version = @gtk_version@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infgtk_CFLAGS = @infgtk_CFLAGS@ infgtk_LIBS = @infgtk_LIBS@ infinity_CFLAGS = @infinity_CFLAGS@ infinity_LIBS = @infinity_LIBS@ infinoted_CFLAGS = @infinoted_CFLAGS@ infinoted_LIBS = @infinoted_LIBS@ infodir = @infodir@ inftext_CFLAGS = @inftext_CFLAGS@ inftext_LIBS = @inftext_LIBS@ inftextgtk_CFLAGS = @inftextgtk_CFLAGS@ inftextgtk_LIBS = @inftextgtk_LIBS@ install_sh = @install_sh@ libdaemon_CFLAGS = @libdaemon_CFLAGS@ libdaemon_LIBS = @libdaemon_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = 16x16 22x22 scalable gtk_update_icon_cache = gtk-update-icon-cache -f -t $(datadir)/icons/hicolor all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu pixmaps/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu pixmaps/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook .MAKE: $(am__recursive_targets) install-am install-data-am \ install-strip uninstall-am .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-data-hook install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-hook install-data-hook: update-icon-cache uninstall-hook: update-icon-cache update-icon-cache: @-if test -z "$(DESTDIR)"; then \ echo "Updating Gtk icon cache."; \ $(gtk_update_icon_cache); \ else \ echo "*** Icon cache not updated. After (un)install, run this:"; \ echo "*** $(gtk_update_icon_cache)"; \ fi # 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: libinfinity-0.5.5/pixmaps/scalable/0000755000175000017500000000000012264766270014305 500000000000000libinfinity-0.5.5/pixmaps/scalable/Makefile.am0000644000175000017500000000014510762534324016253 00000000000000icondir = $(datadir)/icons/hicolor/scalable/apps icon_DATA = infinote.svg EXTRA_DIST = $(icon_DATA) libinfinity-0.5.5/pixmaps/scalable/Makefile.in0000644000175000017500000003634412264766066016307 00000000000000# Makefile.in generated by automake 1.13.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = pixmaps/scalable DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/mkinstalldirs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h \ $(top_builddir)/libinfinity/inf-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(icondir)" DATA = $(icon_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBINFINITY_API_VERSION = @LIBINFINITY_API_VERSION@ LIBINFINITY_LIBTOOL_VERSION = @LIBINFINITY_LIBTOOL_VERSION@ LIBINFINITY_VERSION = @LIBINFINITY_VERSION@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ avahi_CFLAGS = @avahi_CFLAGS@ avahi_LIBS = @avahi_LIBS@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gtk_requirement = @gtk_requirement@ gtk_version = @gtk_version@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infgtk_CFLAGS = @infgtk_CFLAGS@ infgtk_LIBS = @infgtk_LIBS@ infinity_CFLAGS = @infinity_CFLAGS@ infinity_LIBS = @infinity_LIBS@ infinoted_CFLAGS = @infinoted_CFLAGS@ infinoted_LIBS = @infinoted_LIBS@ infodir = @infodir@ inftext_CFLAGS = @inftext_CFLAGS@ inftext_LIBS = @inftext_LIBS@ inftextgtk_CFLAGS = @inftextgtk_CFLAGS@ inftextgtk_LIBS = @inftextgtk_LIBS@ install_sh = @install_sh@ libdaemon_CFLAGS = @libdaemon_CFLAGS@ libdaemon_LIBS = @libdaemon_LIBS@ 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@ icondir = $(datadir)/icons/hicolor/scalable/apps icon_DATA = infinote.svg EXTRA_DIST = $(icon_DATA) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu pixmaps/scalable/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu pixmaps/scalable/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-iconDATA: $(icon_DATA) @$(NORMAL_INSTALL) @list='$(icon_DATA)'; test -n "$(icondir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(icondir)'"; \ $(MKDIR_P) "$(DESTDIR)$(icondir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(icondir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(icondir)" || exit $$?; \ done uninstall-iconDATA: @$(NORMAL_UNINSTALL) @list='$(icon_DATA)'; test -n "$(icondir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(icondir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(icondir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-iconDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-iconDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-iconDATA install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags-am uninstall uninstall-am uninstall-iconDATA # 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: libinfinity-0.5.5/pixmaps/scalable/infinote.svg0000644000175000017500000011526310762534324016563 00000000000000 image/svg+xml